X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Fboot%2F9990-select-eth-device.sh;fp=scripts%2Fboot%2F9990-select-eth-device.sh;h=14fa4ef9c8b2546376010776008219a91d899749;hb=e3b11d9a5aa8df89c435118c12d92f9c4201ad85;hp=5a769cee8cc99285ad2b1a584e2158e9b821782d;hpb=bba6bf638e638ba6556ef335d34ec03433b86a9d;p=live-boot-grml.git diff --git a/scripts/boot/9990-select-eth-device.sh b/scripts/boot/9990-select-eth-device.sh index 5a769ce..14fa4ef 100755 --- a/scripts/boot/9990-select-eth-device.sh +++ b/scripts/boot/9990-select-eth-device.sh @@ -26,31 +26,40 @@ Select_eth_device () # Available Ethernet interfaces ? 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 ] + # See if we can derive the boot device + Device_from_bootif + + if [ -z "$DEVICE" ] then - # only one interface : no choice - echo "DEVICE=$l_interfaces" >> /conf/param.conf - return - fi + 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 user force to use specific device, write it - for ARGUMENT in ${_CMDLINE} - do - case "${ARGUMENT}" in - live-netdev=*) + if [ $(echo $l_interfaces | wc -w) -lt 2 ] + then + # only one interface : no choice + echo "DEVICE=$l_interfaces" >> /conf/param.conf + return + fi + + # If user force to use specific device, write it + for ARGUMENT in ${_CMDLINE} + do + case "${ARGUMENT}" in + live-netdev=*) NETDEV="${ARGUMENT#live-netdev=}" echo "DEVICE=$NETDEV" >> /conf/param.conf echo "Found live-netdev parameter, forcing to to use network device $NETDEV." return ;; - esac - done + esac + done + else + l_interfaces="$DEVICE" + fi found_eth_dev="" while true