X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Finit-premount%2Fselect_eth_device;h=4258fbae7ba9faeb7c451e30b96ca3a3b50c9740;hb=916bfc9fa4b28c67a8f29310cf9928a7e6995738;hp=48033148e4f3a1fb8f571d8cd3215ceb7ca21c73;hpb=cae2693a5c6bc93bf8c0fb5ede1941dc5d871485;p=live-boot-grml.git diff --git a/scripts/init-premount/select_eth_device b/scripts/init-premount/select_eth_device index 4803314..4258fba 100755 --- a/scripts/init-premount/select_eth_device +++ b/scripts/init-premount/select_eth_device @@ -30,9 +30,14 @@ for ARGUMENT in $(cat /proc/cmdline); do esac done -if [ "$bootconf" != "BOOT=nfs" ] && [ "$NETBOOT" = "" ]; then - # Not a net boot : nothing to do - exit 0 +if [ "$bootconf" != "BOOT=nfs" ] && + [ "$NETBOOT" = "" ] && + [ "$FETCH" = "" ] && + [ "$FTPFS" = "" ] && + [ "$HTTPFS" = "" ] +then + # Not a net boot : nothing to do + exit 0 fi # be sure this has been run (*should* be done by scripts/init-premount/udev) @@ -43,7 +48,11 @@ udevadm settle modprobe -q af_packet # Available Ethernet interfaces ? -l_interfaces=$(cd /sys/class/net/ && ls -d eth* 2>/dev/null) +l_interfaces="" +echo "Waiting for ethernet card(s) up... If this fails, maybe the ethernet card is not supported by the kernel `uname -r`?" +while [ -z "$l_interfaces" ]; do + l_interfaces="$(cd /sys/class/net/ && ls -d eth* 2>/dev/null)" +done if [ $(echo $l_interfaces | wc -w) -lt 2 ]; then # only one interface : no choice @@ -51,6 +60,18 @@ if [ $(echo $l_interfaces | wc -w) -lt 2 ]; then exit 0 fi +# If user force to use specific device, write it +for ARGUMENT in $(cat /proc/cmdline); do + case "${ARGUMENT}" in + live-netdev=*) + NETDEV="${ARGUMENT#live-netdev=}" + echo "DEVICE=$NETDEV" >> /conf/param.conf + echo "Found live-netdev parameter in /proc/cmdline. Force to use network device $NETDEV." + exit 0 + ;; + esac +done + while true; do echo -n "Looking for a connected Ethernet interface ..."