summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Maier <maier@linux.vnet.ibm.com>2009-10-05 00:10:59 +0200
committerDavid Cantrell <dcantrell@redhat.com>2009-10-15 11:06:20 -1000
commitc4a6109facee7007c6453a6f816ff6725633ccf0 (patch)
treecbec80deba5c9b294ee621291bf1d8cf6887113f
parentf44c11b561efc565c1d729644bce289ddfab697f (diff)
downloadanaconda-c4a6109facee7007c6453a6f816ff6725633ccf0.tar.gz
anaconda-c4a6109facee7007c6453a6f816ff6725633ccf0.tar.xz
anaconda-c4a6109facee7007c6453a6f816ff6725633ccf0.zip
Write LAYER2 and PORTNO correctly as parts of OPTIONS to ifcfg for s390x
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.
-rw-r--r--loader/linuxrc.s39015
-rw-r--r--network.py2
2 files changed, 11 insertions, 6 deletions
diff --git a/loader/linuxrc.s390 b/loader/linuxrc.s390
index baec1e37c..3b2a8d4cb 100644
--- 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 a79d584a5..e35539837 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])