]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
network/ifup: do DHCP for BOOTDEV
authorHarald Hoyer <harald@redhat.com>
Tue, 1 Sep 2015 17:05:37 +0000 (19:05 +0200)
committerHarald Hoyer <harald@redhat.com>
Tue, 1 Sep 2015 17:05:37 +0000 (19:05 +0200)
modules.d/40network/ifup.sh

index db9fb08526d33a714fc4acb0debb454ae340f997..0471c425110309087d1f0ed00a492520aca54120 100755 (executable)
@@ -430,11 +430,20 @@ fi
 
 # no ip option directed at our interface?
 if [ ! -e /tmp/net.${netif}.up ]; then
-    if getargs 'ip=dhcp6'; then
-        load_ipv6
-        do_dhcp -6
-    elif getargs 'ip=dhcp'; then
-        do_dhcp -4
+    if [ -e /tmp/net.bootdev ]; then
+        BOOTDEV=$(cat /tmp/net.bootdev)
+        if [ "$netif" = "$BOOTDEV" ] || [ "$BOOTDEV" = "$(cat /sys/class/net/${netif}/address)" ]; then
+            load_ipv6
+            do_dhcp
+        fi
+    else
+        if getargs 'ip=dhcp6'; then
+            load_ipv6
+            do_dhcp -6
+        fi
+        if getargs 'ip=dhcp'; then
+            do_dhcp -4
+        fi
     fi
 fi