Write BOOTPROTO=ibft for ip=ibft to ifcfg files
authorRadek Vykydal <rvykydal@redhat.com>
Thu, 14 Mar 2013 08:51:07 +0000 (09:51 +0100)
committerHarald Hoyer <harald@redhat.com>
Thu, 14 Mar 2013 09:54:28 +0000 (10:54 +0100)
modules.d/40network/net-lib.sh
modules.d/45ifcfg/write-ifcfg.sh

index 4a4d7e7..f9b461b 100644 (file)
@@ -159,6 +159,7 @@ ibft_to_cmdline() {
                 hostname=$(read a < ${iface}/hostname; echo $a)
                 echo "ip=$ip::$gw:$mask:$hostname:$dev:none"
             fi
+            echo $mac > /tmp/net.${dev}.has_ibft_config
         done
     ) >> /etc/cmdline.d/40-ibft.conf
     # reread cmdline
index 79c1987..773dc51 100755 (executable)
@@ -106,7 +106,11 @@ for netif in $IFACES ; do
         [ -n "$mtu" ] && echo "MTU=$mtu"
         if [ -f /tmp/net.$netif.lease ]; then
             strstr "$ip" '*:*:*' && echo "IPV6INIT=yes"
-            echo "BOOTPROTO=dhcp"
+            if [ -f /tmp/net.$netif.has_ibft_config ]; then
+                echo "BOOTPROTO=ibft"
+            else
+                echo "BOOTPROTO=dhcp"
+            fi
             cp /tmp/net.$netif.lease /tmp/ifcfg-leases/dhclient-$uuid-$netif.lease
         else
             # If we've booted with static ip= lines, the override file is there
@@ -116,12 +120,16 @@ for netif in $IFACES ; do
                 echo "IPV6_AUTOCONF=no"
                 echo "IPV6ADDR=$ip/$mask"
             else
-                echo "BOOTPROTO=none"
-                echo "IPADDR=$ip"
-                if strstr "$mask" "."; then
-                    echo "NETMASK=$mask"
+                if [-f /tmp/net.$netif.has_ibft_config ]; then
+                    echo "BOOTPROTO=ibft"
                 else
-                    echo "PREFIX=$mask"
+                    echo "BOOTPROTO=none"
+                    echo "IPADDR=$ip"
+                    if strstr "$mask" "."; then
+                        echo "NETMASK=$mask"
+                    else
+                        echo "PREFIX=$mask"
+                    fi
                 fi
             fi
             if strstr "$gw" '*:*:*'; then