[PATCH] Generate correct ifcfg file for ip=ibft with vlan set up in iBFT.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Instead of ifcfg for vlan device (eg ibft0.171) create ifcfg for parent
device (eg ibft0) with BOOTPROTO=ibft that NM can overtake.
---
 modules.d/45ifcfg/write-ifcfg.sh | 29 +++++++++++++++++++++++------
 1 file changed, 23 insertions(+), 6 deletions(-)

diff --git a/modules.d/45ifcfg/write-ifcfg.sh b/modules.d/45ifcfg/write-ifcfg.sh
index dcb2aef..ee15aa9 100755
--- a/modules.d/45ifcfg/write-ifcfg.sh
+++ b/modules.d/45ifcfg/write-ifcfg.sh
@@ -110,6 +110,7 @@ for netup in /tmp/net.*.did-setup ; do
     if [ "$netif" = "$vlanname" ]; then
         vlan=yes
     fi
+
     cat /sys/class/net/$netif/address > /tmp/net.$netif.hwaddr
     {
         echo "# Generated by dracut initrd"
@@ -172,12 +173,28 @@ for netup in /tmp/net.*.did-setup ; do
     fi
 
     if [ -n "$vlan" ] ; then
-        {
-            echo "TYPE=Vlan"
-            echo "NAME=\"$netif\""
-            echo "VLAN=yes"
-            echo "PHYSDEV=\"$phydevice\""
-        } >> /tmp/ifcfg/ifcfg-$netif
+        if [ -f /tmp/net.$phydevice.has_ibft_config ]; then
+            rm /tmp/ifcfg/ifcfg-$netif
+            netif=$phydevice
+            {
+                echo "# Generated by dracut initrd"
+                echo "DEVICE=\"$phydevice\""
+                echo "ONBOOT=yes"
+                echo "NETBOOT=yes"
+                echo "UUID=\"$uuid\""
+                echo "TYPE=Ethernet"
+                echo "HWADDR=\"$(cat /sys/class/net/$phydevice/address)\""
+                echo "BOOTPROTO=ibft"
+                [ -n "$mtu" ] && echo "MTU=\"$mtu\""
+            } >> /tmp/ifcfg/ifcfg-$netif
+        else
+            {
+                echo "TYPE=Vlan"
+                echo "NAME=\"$netif\""
+                echo "VLAN=yes"
+                echo "PHYSDEV=\"$phydevice\""
+            } >> /tmp/ifcfg/ifcfg-$netif
+        fi
     fi
 
     if [ -n "$bond" ] ; then
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux