# 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
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
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
# 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