Make sure dracut gets the rd_CCW parameter on s390x if the rootfs is on a network device.
Patch intended for master and rhel6-branch.
The dracutSetupString() method in the Network class needed to write out the rd_CCW parameter, which is necessary for network devices on s390x. The format is described in the dracut(8) man page. The required information has always been written to the ifcfg-DEVICE file, so we just need to make sure it gets to dracut as well. --- network.py | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/network.py b/network.py index 2fabff1..233ea50 100644 --- a/network.py +++ b/network.py @@ -823,4 +823,17 @@ class Network:
netargs += "ifname=%s:%s" % (nic, hwaddr.lower())
+ nettype = dev.get("NETTYPE") + subchannels = dev.get("SUBCHANNELS") + if iutil.isS390() and nettype and subchannels: + if netargs != "": + netargs += " " + + netargs += "rd_CCW=%s,%s" % (nettype, subchannels) + + options = dev.get("OPTIONS") + if options: + options = filter(lambda x: x != '', options.split(' ')) + netargs += ",%s" % (','.join(options)) + return netargs
Ack.
And thanks for taking care of this. Could you review my 577193 patch, that will be needed as well to resolve 577193 (or maybe we should clone the bug?): https://www.redhat.com/archives/anaconda-devel-list/2010-March/msg00464.html
Regards,
Hans
On 03/30/2010 11:09 PM, David Cantrell wrote:
The dracutSetupString() method in the Network class needed to write out the rd_CCW parameter, which is necessary for network devices on s390x. The format is described in the dracut(8) man page. The required information has always been written to the ifcfg-DEVICE file, so we just need to make sure it gets to dracut as well.
network.py | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/network.py b/network.py index 2fabff1..233ea50 100644 --- a/network.py +++ b/network.py @@ -823,4 +823,17 @@ class Network:
netargs += "ifname=%s:%s" % (nic, hwaddr.lower())
nettype = dev.get("NETTYPE")
subchannels = dev.get("SUBCHANNELS")
if iutil.isS390() and nettype and subchannels:
if netargs != "":
netargs += " "
netargs += "rd_CCW=%s,%s" % (nettype, subchannels)
options = dev.get("OPTIONS")
if options:
options = filter(lambda x: x != '', options.split(' '))
netargs += ",%s" % (','.join(options))
return netargs
On 03/30/2010 11:09 PM, David Cantrell wrote:
The dracutSetupString() method in the Network class needed to write out the rd_CCW parameter, which is necessary for network devices on s390x. The format is described in the dracut(8) man page. The required information has always been written to the ifcfg-DEVICE file, so we just need to make sure it gets to dracut as well.
network.py | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/network.py b/network.py index 2fabff1..233ea50 100644 --- a/network.py +++ b/network.py @@ -823,4 +823,17 @@ class Network:
netargs += "ifname=%s:%s" % (nic, hwaddr.lower())
nettype = dev.get("NETTYPE")
subchannels = dev.get("SUBCHANNELS")
if iutil.isS390() and nettype and subchannels:
if netargs != "":
netargs += " "
netargs += "rd_CCW=%s,%s" % (nettype, subchannels)
options = dev.get("OPTIONS")
if options:
options = filter(lambda x: x != '', options.split(' '))
netargs += ",%s" % (','.join(options))
Does this work with quoted arguments of OPTIONS, which we need because of the whitespace separated suboptions (anaconda does remove double quotes on parsing ifcfg which is why linuxrc writes single quotes here)
OPTIONS='layer2=1 portno=0'
and we get (assuming NETTYPE=qeth and SUBCHANNELS=0.0.0a00,0.0.0a01,0.0.0a02)
rd_CCW=qeth,0.0.0a00,0.0.0a01,0.0.0a02,layer2=1,portno=0
or do we get the non-functional following instead since you only split the options at spaces
rd_CCW=qeth,0.0.0a00,0.0.0a01,0.0.0a02,'layer2=1,portno=0'
?
return netargs
Steffen
Linux on System z Development
IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Martin Jetter Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294
On 04/01/2010 02:45 AM, Steffen Maier wrote:
On 03/30/2010 11:09 PM, David Cantrell wrote:
The dracutSetupString() method in the Network class needed to write out the rd_CCW parameter, which is necessary for network devices on s390x. The format is described in the dracut(8) man page. The required information has always been written to the ifcfg-DEVICE file, so we just need to make sure it gets to dracut as well.
network.py | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/network.py b/network.py index 2fabff1..233ea50 100644 --- a/network.py +++ b/network.py @@ -823,4 +823,17 @@ class Network:
netargs += "ifname=%s:%s" % (nic, hwaddr.lower())
nettype = dev.get("NETTYPE")
subchannels = dev.get("SUBCHANNELS")
if iutil.isS390() and nettype and subchannels:
if netargs != "":
netargs += " "
netargs += "rd_CCW=%s,%s" % (nettype, subchannels)
options = dev.get("OPTIONS")
Meanwhile I realized that NETTYPE, SUBCHANNELS, and OPTIONS are not sufficient since there can also be PORTNAME and CTCPROT. Please see http://fedorapeople.org/gitweb?p=sharkcz/public_git/utils.git;a=blob;f=ccw_i... near the comment "# translate variables from the interface config files to OPTIONS" for how to handle PORTNAME and CTCPROT correctly depending on the NETTYPE and transform it into the corresponding sysfs attribute names which dracut uses consistently.
if options:
options = filter(lambda x: x != '', options.split(' '))
netargs += ",%s" % (','.join(options))
Does this work with quoted arguments of OPTIONS, which we need because of the whitespace separated suboptions (anaconda does remove double quotes on parsing ifcfg which is why linuxrc writes single quotes here)
OPTIONS='layer2=1 portno=0'
and we get (assuming NETTYPE=qeth and SUBCHANNELS=0.0.0a00,0.0.0a01,0.0.0a02)
rd_CCW=qeth,0.0.0a00,0.0.0a01,0.0.0a02,layer2=1,portno=0
or do we get the non-functional following instead since you only split the options at spaces
rd_CCW=qeth,0.0.0a00,0.0.0a01,0.0.0a02,'layer2=1,portno=0'
?
return netargs
Steffen
Linux on System z Development
IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Martin Jetter Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294
anaconda-devel@lists.stg.fedoraproject.org