Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consolidated s390 device configuration - step 2: cleanup #2632

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
3111316
refactor(cms): use zdev to simplify handling CMSDASD=... boot option
steffen-maier May 24, 2023
cdd4cce
refactor(cms): use consolidated zfcp config with zdev from s390-tools
steffen-maier Jan 28, 2023
9d0ae68
refactor(cms): use consolidated dasd config with zdev from s390-tools
steffen-maier May 24, 2023
680b7f5
refactor(cms): use consolidated network config with zdev from s390-tools
steffen-maier Jul 26, 2023
d71591f
refactor(cms): remove now unnecessary inclusion of full s390utils-base
steffen-maier Feb 8, 2024
5fe5c7e
feat(zfcp_rules): remove zfcp handling consolidated in s390-tools
steffen-maier Jan 20, 2023
f084b0b
feat(zfcp): minimize zfcp handling consolidated in s390-tools
steffen-maier Jan 31, 2023
9b4ef02
feat(dasd_rules): remove dasd handling consolidated in s390-tools
steffen-maier Mar 23, 2023
0868601
feat(dasd_mod): minimize dasd handling consolidated in s390-tools
steffen-maier Mar 23, 2023
660dbfb
feat(dasd): minimize dasd handling consolidated in s390-tools
steffen-maier Mar 23, 2023
fdddfdd
feat(znet): use zdev for consolidated device configuration
steffen-maier Jul 25, 2023
2ba3d44
docs(dracut.cmdline): generalize description of rd.znet
steffen-maier May 26, 2023
4fed82c
feat(qeth_rules): remove qeth handling consolidated in 95znet
steffen-maier May 26, 2023
b0197bc
fix(znet): append to udev rules so each rd.znet_ifname is effective
steffen-maier May 26, 2023
71688c1
refactor(ifcfg): delete code duplication using iface_get_subchannels()
steffen-maier Jul 26, 2023
b2f3373
feat(ifcfg): minimize s390-specific network configuration aspects
steffen-maier Jul 26, 2023
0d37551
feat(zfcp): finally remove zfcp handling consolidated in s390-tools
steffen-maier Mar 23, 2023
7b93814
feat(dasd): finally remove dasd handling consolidated in s390-tools
steffen-maier May 12, 2023
22e0a2b
feat(dasd_mod): finally remove dasd handling consolidated in s390-tools
steffen-maier Feb 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -374,18 +374,6 @@ cifs:
- changed-files:
- any-glob-to-any-file: 'modules.d/95cifs/*'

dasd:
- changed-files:
- any-glob-to-any-file: 'modules.d/95dasd/*'

dasd_mod:
- changed-files:
- any-glob-to-any-file: 'modules.d/95dasd_mod/*'

dasd_rules:
- changed-files:
- any-glob-to-any-file: 'modules.d/95dasd_rules/*'

dcssblk:
- changed-files:
- any-glob-to-any-file: 'modules.d/95dcssblk/*'
Expand Down Expand Up @@ -426,10 +414,6 @@ nvmf:
- changed-files:
- any-glob-to-any-file: 'modules.d/95nvmf/*'

qeth_rules:
- changed-files:
- any-glob-to-any-file: 'modules.d/95qeth_rules/*'

resume:
- changed-files:
- any-glob-to-any-file: 'modules.d/95resume/*'
Expand Down Expand Up @@ -458,14 +442,6 @@ virtiofs:
- changed-files:
- any-glob-to-any-file: 'modules.d/95virtiofs/*'

zfcp:
- changed-files:
- any-glob-to-any-file: 'modules.d/95zfcp/*'

zfcp_rules:
- changed-files:
- any-glob-to-any-file: 'modules.d/95zfcp_rules/*'

znet:
- changed-files:
- any-glob-to-any-file: 'modules.d/95znet/*'
Expand Down
38 changes: 32 additions & 6 deletions man/dracut.cmdline.7.asc
Original file line number Diff line number Diff line change
Expand Up @@ -972,19 +972,38 @@ root=virtiofs:host rw
DASD
~~~~
**rd.dasd=**....::
same syntax as the kernel module parameter (s390 only)
same syntax as the kernel module parameter (s390 only).
For more details on the syntax see the IBM book
"Linux on IBM Z and IBM LinuxONE - Device Drivers, Features, and Commands"
https://www.ibm.com/docs/en/linux-on-systems?topic=overview-device-drivers-features-commands.
This parameter can be specified multiple times.
+
NOTE:
This parameter is no longer handled by dracut itself but with the exact
same syntax by
https://github.com/ibm-s390-linux/s390-tools/tree/master/zdev/dracut/95zdev.

ZFCP
~~~~
**rd.zfcp=**__<zfcp adaptor device bus ID>__,__<WWPN>__,__<FCPLUN>__::
rd.zfcp can be specified multiple times on the kernel command
line.
+
NOTE:
This parameter is no longer handled by dracut itself but with the exact
same syntax by
https://github.com/ibm-s390-linux/s390-tools/tree/master/zdev/dracut/95zdev.

**rd.zfcp=**__<zfcp adaptor device bus ID>__::
If NPIV is enabled and the 'allow_lun_scan' parameter to the zfcp
module is set to 'Y' then the zfcp adaptor will be initiating a
module is set to 'Y' then the zfcp driver will be initiating a
scan internally and the <WWPN> and <FCPLUN> parameters can be omitted.
+
NOTE:
This parameter is no longer handled by dracut itself but with the exact
same syntax by
https://github.com/ibm-s390-linux/s390-tools/tree/master/zdev/dracut/95zdev.
+
[listing]
.Example
--
Expand All @@ -993,14 +1012,21 @@ rd.zfcp=0.0.4000
--

**rd.zfcp.conf=0**::
ignore zfcp.conf included in the initramfs
ignore zfcp.conf included in the initramfs.
+
NOTE:
This parameter no longer has any effect and is ignored.
The file /etc/zfcp.conf no longer gets included in the initramfs.

ZNET
~~~~
**rd.znet=**__<nettype>__,__<subchannels>__,__<options>__::
The whole parameter is appended to /etc/ccw.conf, which is used on
RHEL/Fedora with ccw_init, which is called from udev for certain
devices on z-series.
Activates a channel-attached network interface on s390 architecture.
<nettype> is one of: qeth, lcs, ctc.
<subchannels> is a comma-separated list of ccw device bus-IDs.
The list consists of 3 entries with nettype qeth, and 2 for other nettype.
<options> is a comma-separated list of <name>=<value> pairs,
where <name> refers to a device sysfs attribute to which <value> gets written.
rd.znet can be specified multiple times on the kernel command line.

**rd.znet_ifname=**__<ifname>__:__<subchannels>__::
Expand Down
51 changes: 2 additions & 49 deletions modules.d/45ifcfg/write-ifcfg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,68 +10,21 @@ mkdir -m 0755 -p /tmp/ifcfg/
# shellcheck disable=SC2174
mkdir -m 0755 -p /tmp/ifcfg-leases/

get_config_line_by_subchannel() {
local CHANNELS
local line

CHANNELS="$1"
while read -r line || [ -n "$line" ]; do
if strstr "$line" "$CHANNELS"; then
echo "$line"
return 0
fi
done < /etc/ccw.conf
return 1
}

print_s390() {
local _netif
local SUBCHANNELS
local OPTIONS
local NETTYPE
local CONFIG_LINE
local i
local channel
local OLD_IFS

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

SUBCHANNELS=${SUBCHANNELS%,}
echo "SUBCHANNELS=\"${SUBCHANNELS}\""

CONFIG_LINE=$(get_config_line_by_subchannel "$SUBCHANNELS")
# shellcheck disable=SC2181
[ $? -ne 0 -o -z "$CONFIG_LINE" ] && return 0

OLD_IFS=$IFS
IFS=","
# shellcheck disable=SC2086
set -- $CONFIG_LINE
IFS=$OLD_IFS
NETTYPE=$1
shift
SUBCHANNELS="$1"
OPTIONS=""
shift
while [ $# -gt 0 ]; do
case $1 in
*=*) OPTIONS="$OPTIONS $1" ;;
esac
shift
done
OPTIONS=${OPTIONS## }
echo "NETTYPE=\"${NETTYPE}\""
echo "OPTIONS=\"${OPTIONS}\""
return 0
}

Expand Down
13 changes: 0 additions & 13 deletions modules.d/80cms/cms-write-ifcfg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,8 @@ EOF
fi
# colons in SEARCHDNS already replaced with spaces above for /etc/resolv.conf
[[ $SEARCHDNS ]] && echo "DOMAIN=\"$SEARCHDNS\"" >> "$IFCFGFILE"
[[ $NETTYPE ]] && echo "NETTYPE=$NETTYPE" >> "$IFCFGFILE"
[[ $PEERID ]] && echo "PEERID=$PEERID" >> "$IFCFGFILE"
[[ $PORTNAME ]] && echo "PORTNAME=$PORTNAME" >> "$IFCFGFILE"
[[ $CTCPROT ]] && echo "CTCPROT=$CTCPROT" >> "$IFCFGFILE"
[[ $MACADDR ]] && echo "MACADDR=$MACADDR" >> "$IFCFGFILE"
optstr=""
for option in LAYER2 PORTNO; do
[ -z "${!option}" ] && continue
[ -n "$optstr" ] && optstr=${optstr}" "
optstr=${optstr}$(echo ${option} | sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/')"="${!option}
done
# write single quotes since network.py removes double quotes but we need quotes
echo "OPTIONS='$optstr'" >> "$IFCFGFILE"
unset option
unset optstr
unset DNS1
unset DNS2
echo "files /etc/sysconfig/network-scripts" >> /run/initramfs/rwtab
Expand Down
Loading
Loading