heads/initrd/bin/network-init-recovery
Francis Lam d0294b1142
Add all supported network modules to network-init-recovery
also fix verbiage in comments
2018-04-20 09:29:57 -07:00

29 lines
675 B
Bash
Executable File

#!/bin/ash
# bring up the ethernet; maybe should do DHCP?
ifconfig lo 127.0.0.1
network_modules="e1000 e1000e igb sfc mdio mlx4_core mlx4_en"
for module in `echo $network_modules`; do
if [ -f /lib/modules/$module.ko ]; then
insmod /lib/modules/$module.ko
fi
done
if [ -e /sys/class/net/eth0 ]; then
# Set up static IP
if [ ! -z "$CONFIG_BOOT_STATIC_IP" ]; then
ifconfig eth0 $CONFIG_BOOT_STATIC_IP
fi
# TODO: Set up DHCP if available
ifconfig eth0 > /dev/ttyprintk
# Set up the ssh server, allow root logins and log to stderr
if [ ! -d /etc/dropbear ]; then
mkdir /etc/dropbear
fi
dropbear -B -R 2>/dev/ttyprintk
ifconfig eth0 | head -1 > /dev/tty0
fi