[PATCH] Write LAYER2 and PORTNO correctly as parts of OPTIONS to ifcfg for s390x

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

 



On s390x, linuxrc.s390 brings up the network completely and
writes an NM compliant /etc/sysconfig/network-scripts/ifcfg-<DEVICE>.
Apparently, loader never hits STEP_IP or writeEnabledNetworkInfo().
The latter would convert LAYER2= and PORTNO= into OPTIONS="".
Since it does not seem to be called, linuxrc.s390 now writes OPTIONS="".
Fixed readIfcfgContents() to not swallow OPTIONS which contains '='.
With this in place, network.py writes a correct ifcfg to /mnt/sysimage.

This patch completes ifcfg production on s390x of the following commits:
25f58fe7c701c453d39d2a9c5c0850eefce07f76
9249e40f42ffbbdcf42cd1caad72e3d622c7a75b
5f0fcf6688d08f83826c2892bb9fc97d6b4d7dd0
81163960a6137d39a5f2082e9f8d9f0a7b2ada57

This patch is intended for both devel and F-12.
---
 loader/linuxrc.s390 |   15 ++++++++++-----
 network.py          |    2 +-
 2 files changed, 11 insertions(+), 6 deletions(-)
 mode change 100644 => 100755 loader/linuxrc.s390

diff --git a/loader/linuxrc.s390 b/loader/linuxrc.s390
old mode 100644
new mode 100755
index baec1e3..3b2a8d4
--- a/loader/linuxrc.s390
+++ b/loader/linuxrc.s390
@@ -3110,12 +3110,17 @@ fi
 [ "$PEERID" != "" ] && echo "PEERID=$PEERID" >> $IFCFGFILE
 [ "$PORTNAME" != "" ] && echo "PORTNAME=$PORTNAME" >> $IFCFGFILE
 [ "$CTCPROT" != "" ] && echo "CTCPROT=$CTCPROT" >> $IFCFGFILE
-[ "$LAYER2" != "" ] && echo "LAYER2=$LAYER2" >> $IFCFGFILE
 [ "$MACADDR" != "" ] && echo "MACADDR=$MACADDR" >> $IFCFGFILE
-[ "$PORTNO" != "" ] && echo "PORTNO=$PORTNO" >> $IFCFGFILE
-# also needs support in stage2 (loader.c,(net.c)) to make PORTNO persistent,
-# i.e. OPTION="portno=1" in /etc/sysconfig/network-scripts/ifcfg-<netdevname>
-# (see loader of RHEL 5.3)
+optstr=""
+for option in LAYER2 PORTNO; do
+    [ -z "${!option}" ] && continue
+    [ -n "$optstr" ] && optstr=${optstr}" "
+    optstr=${optstr}$(echo ${option} | tr [[:upper:]] [[:lower:]])"="${!option}
+done
+# write single quotes since network.py removes double quotes but we need quotes
+echo "OPTIONS='$optstr'" >> $IFCFGFILE
+unset option
+unset optstr
 
 if [ -z "$testing" ]; then
 
diff --git a/network.py b/network.py
index e9f6ad8..3a0e721 100644
--- a/network.py
+++ b/network.py
@@ -366,7 +366,7 @@ class Network:
                 if line.startswith('#') or line == '':
                     continue
 
-                var = string.splitfields(line, '=')
+                var = string.splitfields(line, '=', 1)
                 if len(var) == 2:
                     var[1] = var[1].replace('"', '')
                     contents[var[0]] = string.strip(var[1])
-- 
1.6.4.4


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux