]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
nfsroot follow ifcfg settings for boot protocol
authorThomas Blume <thomas.blume@suse.com>
Wed, 19 Jun 2019 13:15:57 +0000 (15:15 +0200)
committerDaniel Molkentin <daniel@molkentin.de>
Thu, 18 Jul 2019 22:23:34 +0000 (00:23 +0200)
modules.d/95nfs/module-setup.sh

index 2ca75d0741c4c595edadb3cc3e59f16153e5b289..dce457f4198a99f34359f10e1f1ff9ccdbf34a98 100755 (executable)
@@ -65,7 +65,12 @@ cmdline() {
         printf 'ifname=%s:%s ' ${ifname} ${ifmac}
     fi
 
-    printf 'ip=%s:static\n' ${ifname}
+    bootproto=$(sed -n "/BOOTPROTO/s/BOOTPROTO='\([[:alpha:]]*6\?\)4\?'/\1/p" /etc/sysconfig/network/ifcfg-$ifname)
+    if [ $bootproto ]; then
+        printf 'ip=%s:%s ' ${ifname} ${bootproto}
+    else
+        printf 'ip=%s:static ' ${ifname}
+    fi
 }
 
 # called by dracut