]> 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>
Wed, 11 Nov 2015 15:19:43 +0000 (16:19 +0100)
(cherry picked from commit 7316d68353cfd6e08f007d10ea3e32fa4d083487)

modules.d/40network/ifup.sh

index 9246da73c4030d91be3df092bddfda92c69d4fde..366744f0ff3f590b044814ad8201059c2742a3c7 100755 (executable)
@@ -407,11 +407,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