From: Harald Hoyer Date: Thu, 13 Jun 2013 12:45:18 +0000 (+0200) Subject: network: refix BOOTIF logic X-Git-Tag: 029~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b819f519cb9d622632cea8aa64fa6d9cac1c402b;p=thirdparty%2Fdracut.git network: refix BOOTIF logic --- diff --git a/modules.d/40network/net-genrules.sh b/modules.d/40network/net-genrules.sh index 43aa9e391..f6b7d9a59 100755 --- a/modules.d/40network/net-genrules.sh +++ b/modules.d/40network/net-genrules.sh @@ -82,7 +82,7 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh # Default: We don't know the interface to use, handle all # Fixme: waiting for the interface as well. else - cond='ACTION=="add|change", SUBSYSTEM=="net"' + cond='ACTION=="add", SUBSYSTEM=="net"' # if you change the name of "91-default-net.rules", also change modules.d/80cms/cmssetup.sh echo "$cond, $runcmd" > /etc/udev/rules.d/91-default-net.rules fi diff --git a/modules.d/40network/netroot.sh b/modules.d/40network/netroot.sh index 9c481a8f9..1dcae51a4 100755 --- a/modules.d/40network/netroot.sh +++ b/modules.d/40network/netroot.sh @@ -20,6 +20,18 @@ command -v setup_net >/dev/null || . /lib/net-lib.sh netif=$1 [ -e "/tmp/net.bootdev" ] && read netif < /tmp/net.bootdev +case "$netif" in + ??:??:??:??:??:??) # MAC address + for i in /sys/class/net/*/address; do + mac=$(cat $i) + if [ "$mac" = "$netif" ]; then + i=${i%/address} + netif=${i##*/} + break + fi + done +esac + # Figure out the handler for root=dhcp by recalling all netroot cmdline # handlers when this is not called from manually network bringing up. if [ -z "$2" ]; then diff --git a/modules.d/40network/parse-ip-opts.sh b/modules.d/40network/parse-ip-opts.sh index bdd71db79..4ca509804 100755 --- a/modules.d/40network/parse-ip-opts.sh +++ b/modules.d/40network/parse-ip-opts.sh @@ -17,7 +17,7 @@ command -v getarg >/dev/null || . /lib/dracut-lib.sh command -v ibft_to_cmdline >/dev/null || . /lib/net-lib.sh -if [ -n "$netroot" ] && [ -z "$(getarg ip=)" ] ; then +if [ -n "$netroot" ] && [ -z "$(getarg ip=)" ] && [ -z "$(getarg BOOTIF=)" ]; then # No ip= argument(s) for netroot provided, defaulting to DHCP return; fi @@ -113,7 +113,8 @@ done # put BOOTIF in IFACES to make sure it comes up if BOOTIF="$(getarg BOOTIF=)"; then - IFACES="$IFACES $(fix_bootif $BOOTIF)" + BOOTDEV=$(fix_bootif $BOOTIF) + IFACES="$BOOTDEV $IFACES" fi # This ensures that BOOTDEV is always first in IFACES