[rhinstaller/anaconda/pulls/207 rhel7-branch] network: add s390 options to default ifcfg files (#1074570)

bcl installerbot-noreply at redhat.com
Wed Jul 15 23:11:52 UTC 2015


> @@ -547,6 +560,38 @@ def add_connection_for_ksdata(networkdata, devname):
>      added_connections.insert(0, (con_uuid, dev_spec))
>      return added_connections
>  
> +# We duplicate this in dracut/parse-kickstart
> +def _get_s390_settings(devname):
> +    cfg = {
> +        'SUBCHANNELS': '',
> +        'NETTYPE': '',
> +        'OPTIONS': ''
> +        }
> +
> +    subchannels = []
> +    for symlink in sorted(glob.glob("/sys/class/net/%s/device/cdev[0-9]*" % devname)):
> +        subchannels.append(os.path.basename(os.readlink(symlink)))
> +    if not subchannels:
> +        return cfg
> +    cfg['SUBCHANNELS'] = ','.join(subchannels)
> +
> +    ## cat /etc/ccw.conf
> +    #qeth,0.0.0900,0.0.0901,0.0.0902,layer2=0,portname=FOOBAR,portno=0
> +    #
> +    #SUBCHANNELS="0.0.0900,0.0.0901,0.0.0902"
> +    #NETTYPE="qeth"
> +    #OPTIONS="layer2=1 portname=FOOBAR portno=0"
> +    with open('/run/install/ccw.conf') as f:

Should probably add a check for the file's existance, even though on non-s390 the subchannel check above will return the default dict and skip this.

-- 
To view this pull request on github, visit https://github.com/rhinstaller/anaconda/pull/207#discussion_r34740547


More information about the anaconda-patches mailing list