Skip to content

Commit ab27ef7

Browse files
Merge pull request #342 from aafeijoo-suse/059-consolidate-s390-tools
Consolidated s390 device configuration
2 parents 8870645 + 0ce3a10 commit ab27ef7

21 files changed

+191
-574
lines changed

.github/labeler.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -382,10 +382,6 @@ dasd_mod:
382382
- changed-files:
383383
- any-glob-to-any-file: 'modules.d/95dasd_mod/*'
384384

385-
dasd_rules:
386-
- changed-files:
387-
- any-glob-to-any-file: 'modules.d/95dasd_rules/*'
388-
389385
dcssblk:
390386
- changed-files:
391387
- any-glob-to-any-file: 'modules.d/95dcssblk/*'
@@ -426,10 +422,6 @@ nvmf:
426422
- changed-files:
427423
- any-glob-to-any-file: 'modules.d/95nvmf/*'
428424

429-
qeth_rules:
430-
- changed-files:
431-
- any-glob-to-any-file: 'modules.d/95qeth_rules/*'
432-
433425
resume:
434426
- changed-files:
435427
- any-glob-to-any-file: 'modules.d/95resume/*'
@@ -462,10 +454,6 @@ zfcp:
462454
- changed-files:
463455
- any-glob-to-any-file: 'modules.d/95zfcp/*'
464456

465-
zfcp_rules:
466-
- changed-files:
467-
- any-glob-to-any-file: 'modules.d/95zfcp_rules/*'
468-
469457
znet:
470458
- changed-files:
471459
- any-glob-to-any-file: 'modules.d/95znet/*'

man/dracut.cmdline.7.asc

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -972,19 +972,38 @@ root=virtiofs:host rw
972972
DASD
973973
~~~~
974974
**rd.dasd=**....::
975-
same syntax as the kernel module parameter (s390 only)
975+
same syntax as the kernel module parameter (s390 only).
976+
For more details on the syntax see the IBM book
977+
"Linux on IBM Z and IBM LinuxONE - Device Drivers, Features, and Commands"
978+
https://www.ibm.com/docs/en/linux-on-systems?topic=overview-device-drivers-features-commands.
979+
This parameter can be specified multiple times.
980+
+
981+
NOTE:
982+
This parameter is no longer handled by dracut itself but with the exact
983+
same syntax by
984+
https://github.com/ibm-s390-linux/s390-tools/tree/master/zdev/dracut/95zdev.
976985
977986
ZFCP
978987
~~~~
979988
**rd.zfcp=**__<zfcp adaptor device bus ID>__,__<WWPN>__,__<FCPLUN>__::
980989
rd.zfcp can be specified multiple times on the kernel command
981990
line.
991+
+
992+
NOTE:
993+
This parameter is no longer handled by dracut itself but with the exact
994+
same syntax by
995+
https://github.com/ibm-s390-linux/s390-tools/tree/master/zdev/dracut/95zdev.
982996
983997
**rd.zfcp=**__<zfcp adaptor device bus ID>__::
984998
If NPIV is enabled and the 'allow_lun_scan' parameter to the zfcp
985-
module is set to 'Y' then the zfcp adaptor will be initiating a
999+
module is set to 'Y' then the zfcp driver will be initiating a
9861000
scan internally and the <WWPN> and <FCPLUN> parameters can be omitted.
9871001
+
1002+
NOTE:
1003+
This parameter is no longer handled by dracut itself but with the exact
1004+
same syntax by
1005+
https://github.com/ibm-s390-linux/s390-tools/tree/master/zdev/dracut/95zdev.
1006+
+
9881007
[listing]
9891008
.Example
9901009
--
@@ -998,9 +1017,12 @@ rd.zfcp=0.0.4000
9981017
ZNET
9991018
~~~~
10001019
**rd.znet=**__<nettype>__,__<subchannels>__,__<options>__::
1001-
The whole parameter is appended to /etc/ccw.conf, which is used on
1002-
RHEL/Fedora with ccw_init, which is called from udev for certain
1003-
devices on z-series.
1020+
Activates a channel-attached network interface on s390 architecture.
1021+
<nettype> is one of: qeth, lcs, ctc.
1022+
<subchannels> is a comma-separated list of ccw device bus-IDs.
1023+
The list consists of 3 entries with nettype qeth, and 2 for other nettype.
1024+
<options> is a comma-separated list of <name>=<value> pairs,
1025+
where <name> refers to a device sysfs attribute to which <value> gets written.
10041026
rd.znet can be specified multiple times on the kernel command line.
10051027
10061028
**rd.znet_ifname=**__<ifname>__:__<subchannels>__::

modules.d/45ifcfg/write-ifcfg.sh

Lines changed: 2 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -10,68 +10,21 @@ mkdir -m 0755 -p /tmp/ifcfg/
1010
# shellcheck disable=SC2174
1111
mkdir -m 0755 -p /tmp/ifcfg-leases/
1212

13-
get_config_line_by_subchannel() {
14-
local CHANNELS
15-
local line
16-
17-
CHANNELS="$1"
18-
while read -r line || [ -n "$line" ]; do
19-
if strstr "$line" "$CHANNELS"; then
20-
echo "$line"
21-
return 0
22-
fi
23-
done < /etc/ccw.conf
24-
return 1
25-
}
26-
2713
print_s390() {
2814
local _netif
2915
local SUBCHANNELS
30-
local OPTIONS
31-
local NETTYPE
32-
local CONFIG_LINE
3316
local i
34-
local channel
35-
local OLD_IFS
3617

3718
_netif="$1"
3819
# if we find ccw channel, then use those, instead of
3920
# of the MAC
40-
SUBCHANNELS=$({
41-
for i in /sys/class/net/"$_netif"/device/cdev[0-9]*; do
42-
[ -e "$i" ] || continue
43-
channel=$(readlink -f "$i")
44-
printf '%s' "${channel##*/},"
45-
done
46-
})
21+
# [iface_get_subchannels() from /lib/net-lib.sh sourced at top of this file]
22+
SUBCHANNELS=$(iface_get_subchannels "$_netif")
4723
[ -n "$SUBCHANNELS" ] || return 1
4824

4925
SUBCHANNELS=${SUBCHANNELS%,}
5026
echo "SUBCHANNELS=\"${SUBCHANNELS}\""
5127

52-
CONFIG_LINE=$(get_config_line_by_subchannel "$SUBCHANNELS")
53-
# shellcheck disable=SC2181
54-
[ $? -ne 0 -o -z "$CONFIG_LINE" ] && return 0
55-
56-
OLD_IFS=$IFS
57-
IFS=","
58-
# shellcheck disable=SC2086
59-
set -- $CONFIG_LINE
60-
IFS=$OLD_IFS
61-
NETTYPE=$1
62-
shift
63-
SUBCHANNELS="$1"
64-
OPTIONS=""
65-
shift
66-
while [ $# -gt 0 ]; do
67-
case $1 in
68-
*=*) OPTIONS="$OPTIONS $1" ;;
69-
esac
70-
shift
71-
done
72-
OPTIONS=${OPTIONS## }
73-
echo "NETTYPE=\"${NETTYPE}\""
74-
echo "OPTIONS=\"${OPTIONS}\""
7528
return 0
7629
}
7730

modules.d/80cms/cms-write-ifcfg.sh

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -81,21 +81,8 @@ EOF
8181
fi
8282
# colons in SEARCHDNS already replaced with spaces above for /etc/resolv.conf
8383
[[ $SEARCHDNS ]] && echo "DOMAIN=\"$SEARCHDNS\"" >> "$IFCFGFILE"
84-
[[ $NETTYPE ]] && echo "NETTYPE=$NETTYPE" >> "$IFCFGFILE"
8584
[[ $PEERID ]] && echo "PEERID=$PEERID" >> "$IFCFGFILE"
86-
[[ $PORTNAME ]] && echo "PORTNAME=$PORTNAME" >> "$IFCFGFILE"
87-
[[ $CTCPROT ]] && echo "CTCPROT=$CTCPROT" >> "$IFCFGFILE"
8885
[[ $MACADDR ]] && echo "MACADDR=$MACADDR" >> "$IFCFGFILE"
89-
optstr=""
90-
for option in LAYER2 PORTNO; do
91-
[ -z "${!option}" ] && continue
92-
[ -n "$optstr" ] && optstr=${optstr}" "
93-
optstr=${optstr}$(echo ${option} | sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/')"="${!option}
94-
done
95-
# write single quotes since network.py removes double quotes but we need quotes
96-
echo "OPTIONS='$optstr'" >> "$IFCFGFILE"
97-
unset option
98-
unset optstr
9986
unset DNS1
10087
unset DNS2
10188
echo "files /etc/sysconfig/network-scripts" >> /run/initramfs/rwtab

0 commit comments

Comments
 (0)