diff options
author | Harald Hoyer <harald@redhat.com> | 2013-06-13 14:45:18 +0200 |
---|---|---|
committer | Harald Hoyer <harald@redhat.com> | 2013-06-13 15:15:19 +0200 |
commit | b819f519cb9d622632cea8aa64fa6d9cac1c402b (patch) | |
tree | 13f28a2f68de47bbb2a07db0509db59b470d0239 /modules.d | |
parent | 44d832c5adc45b720cd090c97d224983f82ad620 (diff) | |
download | dracut-b819f519cb9d622632cea8aa64fa6d9cac1c402b.tar.gz dracut-b819f519cb9d622632cea8aa64fa6d9cac1c402b.tar.bz2 dracut-b819f519cb9d622632cea8aa64fa6d9cac1c402b.zip |
network: refix BOOTIF logic
Diffstat (limited to 'modules.d')
-rwxr-xr-x | modules.d/40network/net-genrules.sh | 2 | ||||
-rwxr-xr-x | modules.d/40network/netroot.sh | 12 | ||||
-rwxr-xr-x | modules.d/40network/parse-ip-opts.sh | 5 |
3 files changed, 16 insertions, 3 deletions
diff --git a/modules.d/40network/net-genrules.sh b/modules.d/40network/net-genrules.sh index 43aa9e39..f6b7d9a5 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 9c481a8f..1dcae51a 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 bdd71db7..4ca50980 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 |