Browse Source

network: refix BOOTIF logic

master
Harald Hoyer 12 years ago
parent
commit
b819f519cb
  1. 2
      modules.d/40network/net-genrules.sh
  2. 12
      modules.d/40network/netroot.sh
  3. 5
      modules.d/40network/parse-ip-opts.sh

2
modules.d/40network/net-genrules.sh

@ -82,7 +82,7 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.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

12
modules.d/40network/netroot.sh

@ -20,6 +20,18 @@ command -v setup_net >/dev/null || . /lib/net-lib.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

5
modules.d/40network/parse-ip-opts.sh

@ -17,7 +17,7 @@ @@ -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 @@ -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

Loading…
Cancel
Save