From 218d2d421e90359dde75ff84ae0cb7f68f6da324 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: May 16 2024 15:32:01 +0000 Subject: Update to dracut 101 From-source-git-commit: a24e1272faba2875f9b78fcf42109028af0869bc * switch to dracut-ng upstream fork The original dracut repository is no longer maintained, new initiative was started: https://github.com/dracut-ng/dracut-ng/ * applied additional fixes 9df3cb58a19f38157a615c311356cfd6ae55d2d7 fix(rngd): install system service file 0b65ac224d831cc96da940cce510523c7276a5ec feat(hwdb): add hwdb module to install hwdb.bin on demand 10b86edba3ffe0ce13c5f43ff0193cdf04661358 fix(nvmf): move /etc/nvme/host{nqn,id} requirement to hostonly bad2bc80cdcfac8915374497cc47ce9d5670d015 fix(systemd): explicitly install some libs that will not be statically included 55a56c546bde71fb42c99aadd96e98fca2199823 fix(dracut): move hooks directory from /usr/lib to /var/lib 110fec3e41faf47277447f1c56635c5a876c1f96 feat(ifcfg): minimize s390-specific network configuration aspects b6913f66b6c9e9ea81fd0832405c170876bc993a refactor(ifcfg): delete code duplication using iface_get_subchannels() cbc5eece88b8f6d0e69fdfbb8f34eabb45425c86 fix(znet): append to udev rules so each rd.znet_ifname is effective 7ad6fef8fe110093939c422b5c3b381ebe47e4e9 feat(qeth_rules): remove qeth handling consolidated in 95znet addb383b375fd0db07eacf8a9f5d9b4e23343855 docs(dracut.cmdline): generalize description of rd.znet 86b6e2979999cf5ecce8c76c6230d1f085b3a333 feat(znet): use zdev for consolidated device configuration 1ff6be8aef787513b8143df444a1dd2d696b0944 feat(dasd): minimize dasd handling consolidated in s390-tools a82045ef34bc8c913502eba37b6b9c60709d6997 feat(dasd_mod): minimize dasd handling consolidated in s390-tools 7294e45b5204e47bb8ee2108e2c38c5843e64fac feat(dasd_rules): remove dasd handling consolidated in s390-tools 8d6098969aa9dc34edfd1bc96e6aa0384ae2fb99 feat(zfcp): minimize zfcp handling consolidated in s390-tools 71876ea8c73090741bdf26abb89c28fb260ed575 feat(zfcp_rules): remove zfcp handling consolidated in s390-tools a2c1fc530d8bcbdeaf1806f4a22019052715fc98 refactor(cms): remove now unnecessary inclusion of full s390utils-base cc14fe218861f2855ca88ad03220ecb78d4aa31a refactor(cms): use consolidated network config with zdev from s390-tools 74edb9758da26ef063e4686a595f1d34f07f86f7 refactor(cms): use consolidated dasd config with zdev from s390-tools 3a9b9a5cf507a868f8b3ec33cf686b3a552286c2 refactor(cms): use consolidated zfcp config with zdev from s390-tools 38412977daad049b12273966300d07211674834e refactor(cms): use zdev to simplify handling CMSDASD=... boot option * remove tests/ Tests should be in the tests/* namespace instead: https://src.fedoraproject.org/tests/dracut/ --- diff --git a/0001-fix-dracut-move-hooks-directory-from-usr-lib-to-var-.patch b/0001-fix-dracut-move-hooks-directory-from-usr-lib-to-var-.patch deleted file mode 100644 index 53b2580..0000000 --- a/0001-fix-dracut-move-hooks-directory-from-usr-lib-to-var-.patch +++ /dev/null @@ -1,86 +0,0 @@ -From a45048b80c27ee5a45a380052a6d29ab1925f7f9 Mon Sep 17 00:00:00 2001 -From: Laszlo Gombos -Date: Fri, 5 Apr 2024 15:50:20 +0200 -Subject: [PATCH] fix(dracut): move hooks directory from /usr/lib to /var/lib - -Since https://github.com/systemd/systemd/commit/ffc1ec73, /usr is mounted as -read-only in the initramfs by default. - -Fixes #2588 - -Co-authored-by: Antonio Alvarez Feijoo ---- - dracut-init.sh | 2 +- - dracut.sh | 6 +++++- - modules.d/99base/module-setup.sh | 5 ++++- - modules.d/99shutdown/module-setup.sh | 8 +++++--- - 4 files changed, 15 insertions(+), 6 deletions(-) - -diff --git a/dracut-init.sh b/dracut-init.sh -index 7ce3d1dd..863df0cb 100755 ---- a/dracut-init.sh -+++ b/dracut-init.sh -@@ -633,7 +633,7 @@ inst_hook() { - dfatal "No such hook type $1. Aborting initrd creation." - exit 1 - fi -- hook="/lib/dracut/hooks/${1}/${2}-${3##*/}" -+ hook="/var/lib/dracut/hooks/${1}/${2}-${3##*/}" - inst_simple "$3" "$hook" - chmod u+x "$initdir/$hook" - } -diff --git a/dracut.sh b/dracut.sh -index 3914d7c5..148ef8b0 100755 ---- a/dracut.sh -+++ b/dracut.sh -@@ -1884,7 +1884,11 @@ mkdir -p "${initdir}"/lib/dracut - - if [[ $kernel_only != yes ]]; then - mkdir -p "${initdir}/etc/cmdline.d" -- mkdir -m 0755 "${initdir}"/lib/dracut/hooks -+ mkdir -m 0755 -p "${initdir}"/var/lib/dracut/hooks -+ -+ # symlink to old hooks location for compatibility -+ ln_r /var/lib/dracut/hooks /lib/dracut/hooks -+ - for _d in $hookdirs; do - # shellcheck disable=SC2174 - mkdir -m 0755 -p "${initdir}/lib/dracut/hooks/$_d" -diff --git a/modules.d/99base/module-setup.sh b/modules.d/99base/module-setup.sh -index 54b0deb9..bfdc51d4 100755 ---- a/modules.d/99base/module-setup.sh -+++ b/modules.d/99base/module-setup.sh -@@ -45,7 +45,10 @@ install() { - - [ -e "${initdir}/lib" ] || mkdir -m 0755 -p "${initdir}"/lib - mkdir -m 0755 -p "${initdir}"/lib/dracut -- mkdir -m 0755 -p "${initdir}"/lib/dracut/hooks -+ mkdir -m 0755 -p "${initdir}"/var/lib/dracut/hooks -+ -+ # symlink to old hooks location for compatibility -+ ln_r /var/lib/dracut/hooks /lib/dracut/hooks - - mkdir -p "${initdir}"/tmp - -diff --git a/modules.d/99shutdown/module-setup.sh b/modules.d/99shutdown/module-setup.sh -index 2b999024..f53017ff 100755 ---- a/modules.d/99shutdown/module-setup.sh -+++ b/modules.d/99shutdown/module-setup.sh -@@ -17,9 +17,11 @@ install() { - inst_multiple umount poweroff reboot halt losetup stat sleep timeout - inst_multiple -o kexec - inst "$moddir/shutdown.sh" "$prefix/shutdown" -- [ -e "${initdir}/lib" ] || mkdir -m 0755 -p "${initdir}"/lib -- mkdir -m 0755 -p "${initdir}"/lib/dracut -- mkdir -m 0755 -p "${initdir}"/lib/dracut/hooks -+ mkdir -m 0755 -p "${initdir}"/var/lib/dracut/hooks -+ -+ # symlink to old hooks location for compatibility -+ ln_r /var/lib/dracut/hooks /lib/dracut/hooks -+ - for _d in $hookdirs shutdown shutdown-emergency; do - mkdir -m 0755 -p "${initdir}"/lib/dracut/hooks/"$_d" - done --- -2.44.0 - diff --git a/0001-fix-systemd-explicitly-install-some-libs-that-will-n.patch b/0001-fix-systemd-explicitly-install-some-libs-that-will-n.patch deleted file mode 100644 index 7524401..0000000 --- a/0001-fix-systemd-explicitly-install-some-libs-that-will-n.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 04b362d713235459cff1f370efb4cd5e36e4a358 Mon Sep 17 00:00:00 2001 -From: Antonio Alvarez Feijoo -Date: Thu, 4 Apr 2024 13:49:26 +0200 -Subject: [PATCH] fix(systemd): explicitly install some libs that will not be - statically included - -Some required libraries that used to be statically included are in the process -to be opened via `dlopen()`. - -References: -- https://github.com/systemd/systemd/pull/31131 -- https://github.com/systemd/systemd/pull/31550 -- https://github.com/systemd/systemd/pull/32019 - -Closes #2642 ---- - modules.d/00systemd/module-setup.sh | 2 ++ - modules.d/01systemd-coredump/module-setup.sh | 7 +++++++ - modules.d/01systemd-journald/module-setup.sh | 5 +++-- - 3 files changed, 12 insertions(+), 2 deletions(-) - -diff --git a/modules.d/00systemd/module-setup.sh b/modules.d/00systemd/module-setup.sh -index 66e08ea6..72341746 100755 ---- a/modules.d/00systemd/module-setup.sh -+++ b/modules.d/00systemd/module-setup.sh -@@ -260,6 +260,8 @@ EOF - # Install library file(s) - _arch=${DRACUT_ARCH:-$(uname -m)} - inst_libdir_file \ -+ {"tls/$_arch/",tls/,"$_arch/",}"libgcrypt.so*" \ -+ {"tls/$_arch/",tls/,"$_arch/",}"libkmod.so*" \ - {"tls/$_arch/",tls/,"$_arch/",}"libnss_*" - - } -diff --git a/modules.d/01systemd-coredump/module-setup.sh b/modules.d/01systemd-coredump/module-setup.sh -index 69ec9668..47666b6c 100755 ---- a/modules.d/01systemd-coredump/module-setup.sh -+++ b/modules.d/01systemd-coredump/module-setup.sh -@@ -40,6 +40,13 @@ install() { - "$sysusers"/systemd-coredump.conf \ - coredumpctl - -+ # Install library file(s) -+ _arch=${DRACUT_ARCH:-$(uname -m)} -+ inst_libdir_file \ -+ {"tls/$_arch/",tls/,"$_arch/",}"liblz4.so.*" \ -+ {"tls/$_arch/",tls/,"$_arch/",}"liblzma.so.*" \ -+ {"tls/$_arch/",tls/,"$_arch/",}"libzstd.so.*" -+ - # Install the hosts local user configurations if enabled. - if [[ $hostonly ]]; then - inst_multiple -H -o \ -diff --git a/modules.d/01systemd-journald/module-setup.sh b/modules.d/01systemd-journald/module-setup.sh -index 3cf2a1a1..276e7528 100755 ---- a/modules.d/01systemd-journald/module-setup.sh -+++ b/modules.d/01systemd-journald/module-setup.sh -@@ -53,9 +53,10 @@ install() { - # Install library file(s) - _arch=${DRACUT_ARCH:-$(uname -m)} - inst_libdir_file \ -+ {"tls/$_arch/",tls/,"$_arch/",}"libgcrypt.so*" \ - {"tls/$_arch/",tls/,"$_arch/",}"liblz4.so.*" \ -- {"tls/$_arch/",tls/,"$_arch/",}"libzstd.so.*" \ -- {"tls/$_arch/",tls/,"$_arch/",}"liblzma.so.*" -+ {"tls/$_arch/",tls/,"$_arch/",}"liblzma.so.*" \ -+ {"tls/$_arch/",tls/,"$_arch/",}"libzstd.so.*" - - # Install the hosts local user configurations if enabled. - if [[ $hostonly ]]; then --- -2.44.0 - diff --git a/0002-fix-kernel-install-do-not-generate-an-initrd-when-on.patch b/0002-fix-kernel-install-do-not-generate-an-initrd-when-on.patch new file mode 100644 index 0000000..858ec33 --- /dev/null +++ b/0002-fix-kernel-install-do-not-generate-an-initrd-when-on.patch @@ -0,0 +1,39 @@ +From 9f979fc9486af3c7c924d3f9f837f06616c61829 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= +Date: Tue, 18 Jan 2022 18:58:58 +0100 +Subject: [PATCH 02/23] fix(kernel-install): do not generate an initrd when one + was specified + +According to the synopsis, kernel-install can be called with an +already-prepared initrd. In that case, no initrd should be generated by dracut. + +(Cherry-picked commit 0b72cf5c4eca0e0db76e3e210cfdc48e6b49bb74 from PR#1825) +--- + install.d/50-dracut.install | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/install.d/50-dracut.install b/install.d/50-dracut.install +index efb184cd..3907e303 100755 +--- a/install.d/50-dracut.install ++++ b/install.d/50-dracut.install +@@ -4,6 +4,7 @@ COMMAND="$1" + KERNEL_VERSION="$2" + BOOT_DIR_ABS="$3" + KERNEL_IMAGE="$4" ++INITRD_OPTIONS_SHIFT=4 + + # If KERNEL_INSTALL_MACHINE_ID is defined but empty, BOOT_DIR_ABS is a fake directory. + # In this case, do not create the initrd. +@@ -34,6 +35,9 @@ ret=0 + + case "$COMMAND" in + add) ++ # If the initrd was provided on the kernel command line, we shouldn't generate our own. ++ [ "$#" -gt "$INITRD_OPTIONS_SHIFT" ] && exit 0 ++ + if [[ $IMAGE == "uki.efi" ]]; then + IMAGE_PREGENERATED=${KERNEL_IMAGE%/*}/uki.efi + else +-- +2.42.0 + diff --git a/0002-fix-systemd-pcrphase-rename-systemd-pcrphase-binary-.patch b/0002-fix-systemd-pcrphase-rename-systemd-pcrphase-binary-.patch deleted file mode 100644 index fd998ae..0000000 --- a/0002-fix-systemd-pcrphase-rename-systemd-pcrphase-binary-.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 12f3824a30300154928c3482b02b6e1e63ce8be8 Mon Sep 17 00:00:00 2001 -From: Antonio Alvarez Feijoo -Date: Tue, 26 Sep 2023 08:12:23 +0200 -Subject: [PATCH 02/10] fix(systemd-pcrphase): rename systemd-pcrphase binary - to systemd-pcrextend - -The `systemd-pcrphase` binary has been renamed to `systemd-pcrextend` since -https://github.com/systemd/systemd/commit/32295fa0 - -(Cherry-picked 8d9b558939ebdbbbeefbb1cbcd6d6825efc901fb from PR#2526) ---- - modules.d/01systemd-pcrphase/module-setup.sh | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/modules.d/01systemd-pcrphase/module-setup.sh b/modules.d/01systemd-pcrphase/module-setup.sh -index fa960a42..77f05eb7 100755 ---- a/modules.d/01systemd-pcrphase/module-setup.sh -+++ b/modules.d/01systemd-pcrphase/module-setup.sh -@@ -6,7 +6,7 @@ - check() { - - # If the binary(s) requirements are not fulfilled the module can't be installed. -- require_binaries "$systemdutildir"/systemd-pcrphase || return 1 -+ require_binaries "$systemdutildir"/systemd-pcrextend || return 1 - - # Return 255 to only include the module, if another module requires it. - return 255 -@@ -27,7 +27,7 @@ depends() { - install() { - - inst_multiple -o \ -- "$systemdutildir"/systemd-pcrphase \ -+ "$systemdutildir"/systemd-pcrextend \ - "$systemdsystemunitdir"/systemd-pcrphase-initrd.service \ - "$systemdsystemunitdir/systemd-pcrphase-initrd.service.d/*.conf" \ - "$systemdsystemunitdir"/initrd.target.wants/systemd-pcrphase-initrd.service --- -2.42.0 - diff --git a/0003-fix-resume-add-new-systemd-hibernate-resume.service.patch b/0003-fix-resume-add-new-systemd-hibernate-resume.service.patch deleted file mode 100644 index 6945dc0..0000000 --- a/0003-fix-resume-add-new-systemd-hibernate-resume.service.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 28ecd1f24f82a90852b65f57c1caa98838d25c97 Mon Sep 17 00:00:00 2001 -From: Antonio Alvarez Feijoo -Date: Tue, 26 Sep 2023 09:43:37 +0200 -Subject: [PATCH 03/10] fix(resume): add new systemd-hibernate-resume.service - -Since https://github.com/systemd/systemd/commit/a628d933, the generator only -does the initial validation of the system info and then enables the new -`systemd-hibernate-resume.service`. - -Fixes #2513 - -(Cherry-picked a2fe89116db4b286fbf515f26bd1773b5e6ee8ad from PR#2557) ---- - modules.d/95resume/module-setup.sh | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/modules.d/95resume/module-setup.sh b/modules.d/95resume/module-setup.sh -index d2551033..9204f9cb 100755 ---- a/modules.d/95resume/module-setup.sh -+++ b/modules.d/95resume/module-setup.sh -@@ -44,6 +44,7 @@ install() { - if dracut_module_included "systemd" && [[ -x $dracutsysrootdir$systemdutildir/systemd-hibernate-resume ]]; then - inst_multiple -o \ - "$systemdutildir"/system-generators/systemd-hibernate-resume-generator \ -+ "$systemdsystemunitdir"/systemd-hibernate-resume.service \ - "$systemdsystemunitdir"/systemd-hibernate-resume@.service \ - "$systemdutildir"/systemd-hibernate-resume - return 0 --- -2.42.0 - diff --git a/0003-refactor-cms-use-zdev-to-simplify-handling-CMSDASD-..patch b/0003-refactor-cms-use-zdev-to-simplify-handling-CMSDASD-..patch new file mode 100644 index 0000000..f71e2b0 --- /dev/null +++ b/0003-refactor-cms-use-zdev-to-simplify-handling-CMSDASD-..patch @@ -0,0 +1,198 @@ +From 38412977daad049b12273966300d07211674834e Mon Sep 17 00:00:00 2001 +From: Steffen Maier +Date: Wed, 24 May 2023 19:02:09 +0200 +Subject: [PATCH 03/23] refactor(cms): use zdev to simplify handling + CMSDASD=... boot option + +This is just internal to initrd, so we can already migrate the code to +consolidated dasd device configuration with zdev +https://github.com/ibm-s390-linux/s390-tools/tree/master/zdev/. +The code change is transparent to users after dracut switch root. + +Signed-off-by: Steffen Maier +--- + modules.d/80cms/cmssetup.sh | 108 ++++++-------------------------- + modules.d/80cms/module-setup.sh | 3 +- + 2 files changed, 21 insertions(+), 90 deletions(-) + +diff --git a/modules.d/80cms/cmssetup.sh b/modules.d/80cms/cmssetup.sh +index 68e45632..23e81ca9 100755 +--- a/modules.d/80cms/cmssetup.sh ++++ b/modules.d/80cms/cmssetup.sh +@@ -2,34 +2,16 @@ + + type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh + +-function sysecho() { +- file="$1" +- shift +- local i=1 +- while [ $i -le 10 ]; do +- if [ ! -f "$file" ]; then +- sleep 1 +- i=$((i + 1)) +- else +- break +- fi +- done +- local status +- read -r status < "$file" +- if [[ $status != "$*" ]]; then +- [ -f "$file" ] && echo "$*" > "$file" +- fi +-} +- + function dasd_settle() { +- local dasd_status=/sys/bus/ccw/devices/$1/status ++ local dasd_status ++ dasd_status=$(lszdev dasd "$1" --columns ATTRPATH:status --no-headings --active) + if [ ! -f "$dasd_status" ]; then + return 1 + fi + local i=1 + while [ $i -le 60 ]; do + local status +- read -r status < "$dasd_status" ++ status=$(lszdev dasd "$1" --columns ATTR:status --no-headings --active) + case $status in + online | unformatted) + return 0 +@@ -43,77 +25,23 @@ function dasd_settle() { + return 1 + } + +-function dasd_settle_all() { +- for dasdccw in $(while read -r line || [ -n "$line" ]; do echo "${line%%(*}"; done < /proc/dasd/devices); do +- if ! dasd_settle "$dasdccw"; then +- echo $"Could not access DASD $dasdccw in time" +- return 1 +- fi +- done +- return 0 +-} +- +-# prints a canonocalized device bus ID for a given devno of any format +-function canonicalize_devno() { +- case ${#1} in +- 3) echo "0.0.0${1}" ;; +- 4) echo "0.0.${1}" ;; +- *) echo "${1}" ;; +- esac +- return 0 +-} +- + # read file from CMS and write it to /tmp + function readcmsfile() { # $1=dasdport $2=filename + local dev +- local numcpus + local devname + local ret=0 + if [ $# -ne 2 ]; then return; fi +- # precondition: udevd created dasda block device node +- if ! dasd_cio_free -d "$1"; then +- echo $"DASD $1 could not be cleared from device blacklist" +- return 1 +- fi +- +- modprobe dasd_mod dasd="$CMSDASD" +- modprobe dasd_eckd_mod +- udevadm settle +- +- # precondition: dasd_eckd_mod driver incl. dependencies loaded, +- # dasd_mod must be loaded without setting any DASD online +- dev=$(canonicalize_devno "$1") +- numcpus=$( +- while read -r line || [ -n "$line" ]; do +- if strstr "$line" "# processors"; then +- echo "${line##*:}" +- break +- fi +- done < /proc/cpuinfo +- ) ++ # precondition: udevd created block device node + +- if [ "${numcpus}" -eq 1 ]; then +- echo 1 > /sys/bus/ccw/devices/"$dev"/online +- else +- if ! sysecho /sys/bus/ccw/devices/"$dev"/online 1; then +- echo $"DASD $dev could not be set online" +- return 1 +- fi +- udevadm settle +- if ! dasd_settle "$dev"; then +- echo $"Could not access DASD $dev in time" +- return 1 +- fi ++ dev="$1" ++ chzdev --enable --active --yes --quiet --no-root-update --force dasd "$dev" || return 1 ++ if ! dasd_settle "$dev"; then ++ echo $"Could not access DASD $dev in time" ++ return 1 + fi + +- udevadm settle +- +- devname=$( +- cd /sys/bus/ccw/devices/"$dev"/block || exit +- set -- * +- [ -b /dev/"$1" ] && echo "$1" +- ) +- devname=${devname:-dasda} ++ devname=$(lszdev dasd "$dev" --columns NAMES --no-headings --active) ++ [[ -n $devname ]] || return 1 + + [[ -d /mnt ]] || mkdir -p /mnt + if cmsfs-fuse --to=UTF-8 -a /dev/"$devname" /mnt; then +@@ -125,20 +53,22 @@ function readcmsfile() { # $1=dasdport $2=filename + ret=1 + fi + +- if ! sysecho /sys/bus/ccw/devices/"$dev"/online 0; then +- echo $"DASD $dev could not be set offline again" +- #return 1 +- fi +- udevadm settle ++ chzdev --disable --active --yes --quiet --no-root-update --force dasd "$dev" + + # unbind all dasds to unload the dasd modules for a clean start + ( + cd /sys/bus/ccw/drivers/dasd-eckd || exit +- for i in *.*; do echo "$i" > unbind; done ++ for i in *.*; do echo "$i" > unbind 2> /dev/null; done ++ ) ++ ( ++ cd /sys/bus/ccw/drivers/dasd-fba || exit ++ for i in *.*; do echo "$i" > unbind 2> /dev/null; done + ) + udevadm settle + modprobe -r dasd_eckd_mod + udevadm settle ++ modprobe -r dasd_fba_mod ++ udevadm settle + modprobe -r dasd_diag_mod + udevadm settle + modprobe -r dasd_mod +diff --git a/modules.d/80cms/module-setup.sh b/modules.d/80cms/module-setup.sh +index 2b280e0f..4872734b 100755 +--- a/modules.d/80cms/module-setup.sh ++++ b/modules.d/80cms/module-setup.sh +@@ -4,6 +4,7 @@ + check() { + arch=${DRACUT_ARCH:-$(uname -m)} + [ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1 ++ require_binaries chzdev lszdev || return 1 + return 255 + } + +@@ -28,7 +29,7 @@ install() { + # shellcheck disable=SC2046 + inst_multiple /etc/cmsfs-fuse/filetypes.conf /etc/udev/rules.d/99-fuse.rules /etc/fuse.conf \ + cmsfs-fuse fusermount bash insmod rmmod cat normalize_dasd_arg sed \ +- $(rpm -ql s390utils-base) awk getopt ++ $(rpm -ql s390utils-base) awk getopt chzdev lszdev + + inst_libdir_file "gconv/*" + #inst /usr/lib/locale/locale-archive +-- +2.42.0 + diff --git a/0004-fix-wait-12-hours-before-halt-on-media-check-fail.patch b/0004-fix-wait-12-hours-before-halt-on-media-check-fail.patch deleted file mode 100644 index 4c6afe4..0000000 --- a/0004-fix-wait-12-hours-before-halt-on-media-check-fail.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 5beddfca4192a28898904610a54d1cbc58d5856b Mon Sep 17 00:00:00 2001 -From: Adam Williamson -Date: Sun, 29 Oct 2023 21:19:36 -0700 -Subject: [PATCH 04/10] fix: wait 12 hours before halt on media check fail - -If a modesetting driver has been loaded by the time the media -check happens, halting the system (as we currently do immediately -if the check fails) blanks the screen, which is confusing for -the user. This adds a warning message and a 12-hour wait before -the system is eventually halted, so the user can see the media -check failure and (presumably) reboot and fix the medium. - -It also tweaks the text of the failure message not to call it a -"CD check", since it's not 1998 any more. - -https://bugzilla.redhat.com/show_bug.cgi?id=2246410 - -Signed-off-by: Adam Williamson - -(Cherry-picked a1b346121da44908b2685d8ef1b5e68b57829b2b from PR#2545) ---- - modules.d/90dmsquash-live/dmsquash-live-root.sh | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/modules.d/90dmsquash-live/dmsquash-live-root.sh b/modules.d/90dmsquash-live/dmsquash-live-root.sh -index e8083394..3fccda5f 100755 ---- a/modules.d/90dmsquash-live/dmsquash-live-root.sh -+++ b/modules.d/90dmsquash-live/dmsquash-live-root.sh -@@ -76,7 +76,9 @@ if [ -n "$check" ]; then - checkisomd5 --verbose "$check_dev" - fi - if [ $? -eq 1 ]; then -- die "CD check failed!" -+ warn "Media check failed! We do not recommend using this medium. System will halt in 12 hours" -+ sleep 43200 -+ die "Media check failed!" - exit 1 - fi - type plymouth > /dev/null 2>&1 && plymouth --show-splash --- -2.42.0 - diff --git a/0004-refactor-cms-use-consolidated-zfcp-config-with-zdev-.patch b/0004-refactor-cms-use-consolidated-zfcp-config-with-zdev-.patch new file mode 100644 index 0000000..0a35c9b --- /dev/null +++ b/0004-refactor-cms-use-consolidated-zfcp-config-with-zdev-.patch @@ -0,0 +1,77 @@ +From 3a9b9a5cf507a868f8b3ec33cf686b3a552286c2 Mon Sep 17 00:00:00 2001 +From: Steffen Maier +Date: Sat, 28 Jan 2023 01:58:29 +0100 +Subject: [PATCH 04/23] refactor(cms): use consolidated zfcp config with zdev + from s390-tools + +This is just internal to initrd, so we can already migrate the code to +consolidated zfcp device configuration with zdev +https://github.com/ibm-s390-linux/s390-tools/tree/master/zdev/. +The code change is transparent to users after dracut switch root. + +The generated persistent config of chzdev are pure udev rules so it has no +dependency on other dracut modules such as zdev, or zfcp. + +Signed-off-by: Steffen Maier +--- + modules.d/80cms/cmssetup.sh | 21 ++++++++++++++++----- + modules.d/80cms/module-setup.sh | 2 +- + 2 files changed, 17 insertions(+), 6 deletions(-) + +diff --git a/modules.d/80cms/cmssetup.sh b/modules.d/80cms/cmssetup.sh +index 23e81ca9..da42ec0f 100755 +--- a/modules.d/80cms/cmssetup.sh ++++ b/modules.d/80cms/cmssetup.sh +@@ -117,7 +117,6 @@ processcmsfile() { + dasd_cio_free + fi + +- unset _do_zfcp + for i in ${!FCP_*}; do + echo "${!i}" | while read -r port rest || [ -n "$port" ]; do + case $port in +@@ -130,12 +129,24 @@ processcmsfile() { + port="0.0.$port" + ;; + esac +- echo "$port" "$rest" >> /etc/zfcp.conf ++ # shellcheck disable=SC2086 ++ set -- $rest ++ SAVED_IFS="$IFS" ++ IFS=":" ++ # Intentionally do not dynamically activate now, but only generate udev ++ # rules, which activate the device later during udev coldplug. ++ if [[ -z $rest ]]; then ++ chzdev --enable --persistent \ ++ --no-settle --yes --quiet --no-root-update --force \ ++ zfcp-host "$port" 2>&1 | vinfo ++ else ++ chzdev --enable --persistent \ ++ --no-settle --yes --quiet --no-root-update --force \ ++ zfcp-lun "$port:$*" 2>&1 | vinfo ++ fi ++ IFS="$SAVED_IFS" + done +- _do_zfcp=1 + done +- [[ $_do_zfcp ]] && zfcp_cio_free +- unset _do_zfcp + } + + [[ $CMSDASD ]] || CMSDASD=$(getarg "CMSDASD=") +diff --git a/modules.d/80cms/module-setup.sh b/modules.d/80cms/module-setup.sh +index 4872734b..0dd86b80 100755 +--- a/modules.d/80cms/module-setup.sh ++++ b/modules.d/80cms/module-setup.sh +@@ -12,7 +12,7 @@ check() { + depends() { + arch=${DRACUT_ARCH:-$(uname -m)} + [ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1 +- echo znet zfcp dasd dasd_mod bash ++ echo znet dasd dasd_mod bash + return 0 + } + +-- +2.42.0 + diff --git a/0005-feat-network-include-98-default-mac-none.link-if-it-.patch b/0005-feat-network-include-98-default-mac-none.link-if-it-.patch deleted file mode 100644 index 7d4fb0c..0000000 --- a/0005-feat-network-include-98-default-mac-none.link-if-it-.patch +++ /dev/null @@ -1,70 +0,0 @@ -From aa45d7d857b39e0f2824b94902aa9197bee9a479 Mon Sep 17 00:00:00 2001 -From: Dusty Mabe -Date: Tue, 21 Feb 2023 22:21:35 -0500 -Subject: [PATCH 05/10] feat(network): include 98-default-mac-none.link if it - exists - -In Fedora Linux there was a new 98-default-mac-none.link file added -to set the MACAddressPolicy=none for bond/bridge/team devices. We'd -like for this policy to apply in the initramfs as well. See - -- https://fedoraproject.org/wiki/Changes/MAC_Address_Policy_none -- https://src.fedoraproject.org/rpms/systemd/pull-request/100# - -(Cherry-picked commit f6810b69ae722096184eaaf282e12a2caa6928b9 from PR#2224) ---- - modules.d/01systemd-networkd/module-setup.sh | 1 + - modules.d/35network-legacy/module-setup.sh | 6 ++++-- - modules.d/35network-manager/module-setup.sh | 6 ++++-- - 3 files changed, 9 insertions(+), 4 deletions(-) - -diff --git a/modules.d/01systemd-networkd/module-setup.sh b/modules.d/01systemd-networkd/module-setup.sh -index 7bbf83c0..f82aa933 100755 ---- a/modules.d/01systemd-networkd/module-setup.sh -+++ b/modules.d/01systemd-networkd/module-setup.sh -@@ -47,6 +47,7 @@ install() { - "$systemdnetwork"/80-container-vz.network \ - "$systemdnetwork"/80-vm-vt.network \ - "$systemdnetwork"/80-wifi-adhoc.network \ -+ "$systemdnetwork"/98-default-mac-none.link \ - "$systemdnetwork"/99-default.link \ - "$systemdsystemunitdir"/systemd-networkd.service \ - "$systemdsystemunitdir"/systemd-networkd.socket \ -diff --git a/modules.d/35network-legacy/module-setup.sh b/modules.d/35network-legacy/module-setup.sh -index 868ea8fc..a42f5797 100755 ---- a/modules.d/35network-legacy/module-setup.sh -+++ b/modules.d/35network-legacy/module-setup.sh -@@ -23,9 +23,11 @@ installkernel() { - install() { - local _arch - -- #Adding default link -+ # Adding default link and (if exists) 98-default-mac-none.link - if dracut_module_included "systemd"; then -- inst_multiple -o "${systemdnetwork}/99-default.link" -+ inst_multiple -o \ -+ "${systemdnetwork}/99-default.link" \ -+ "${systemdnetwork}/98-default-mac-none.link" - [[ $hostonly ]] && inst_multiple -H -o "${systemdnetworkconfdir}/*.link" - fi - -diff --git a/modules.d/35network-manager/module-setup.sh b/modules.d/35network-manager/module-setup.sh -index d9a244a3..1e3010a3 100755 ---- a/modules.d/35network-manager/module-setup.sh -+++ b/modules.d/35network-manager/module-setup.sh -@@ -51,8 +51,10 @@ install() { - inst_simple "$moddir"/nm-initrd.service "$systemdsystemunitdir"/nm-initrd.service - inst_simple "$moddir"/nm-wait-online-initrd.service "$systemdsystemunitdir"/nm-wait-online-initrd.service - -- # Adding default link -- inst_multiple -o "${systemdnetwork}/99-default.link" -+ # Adding default link and (if exists) 98-default-mac-none.link -+ inst_multiple -o \ -+ "${systemdnetwork}/99-default.link" \ -+ "${systemdnetwork}/98-default-mac-none.link" - [[ $hostonly ]] && inst_multiple -H -o "${systemdnetworkconfdir}/*.link" - - $SYSTEMCTL -q --root "$initdir" enable nm-initrd.service --- -2.42.0 - diff --git a/0005-refactor-cms-use-consolidated-dasd-config-with-zdev-.patch b/0005-refactor-cms-use-consolidated-dasd-config-with-zdev-.patch new file mode 100644 index 0000000..01f78c9 --- /dev/null +++ b/0005-refactor-cms-use-consolidated-dasd-config-with-zdev-.patch @@ -0,0 +1,81 @@ +From 74edb9758da26ef063e4686a595f1d34f07f86f7 Mon Sep 17 00:00:00 2001 +From: Steffen Maier +Date: Wed, 24 May 2023 19:04:48 +0200 +Subject: [PATCH 05/23] refactor(cms): use consolidated dasd config with zdev + from s390-tools + +Depends on https://github.com/ibm-s390-linux/s390-tools commit +9b2fb1d4d2e2 ("zdev: add helper to convert from dasd_mod.dasd to zdev +config"). + +This is just internal to initrd, so it's possible to migrate the code to +consolidated dasd device configuration with zdev +https://github.com/ibm-s390-linux/s390-tools/tree/master/zdev/. +The code change is transparent to users after dracut switch root. + +The generated persistent config of chzdev are pure udev rules so it has no +dependency on other dracut modules such as zdev, dasd, or dasd_mod. +Instead now install the corresponding kernel device drivers here directly. + +Signed-off-by: Steffen Maier +--- + modules.d/80cms/cmssetup.sh | 6 +++--- + modules.d/80cms/module-setup.sh | 6 +++--- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/modules.d/80cms/cmssetup.sh b/modules.d/80cms/cmssetup.sh +index da42ec0f..01cfd303 100755 +--- a/modules.d/80cms/cmssetup.sh ++++ b/modules.d/80cms/cmssetup.sh +@@ -1,6 +1,7 @@ + #!/bin/bash + + type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh ++type zdev_parse_dasd_list > /dev/null 2>&1 || . /lib/s390-tools/zdev-from-dasd_mod.dasd + + function dasd_settle() { + local dasd_status +@@ -112,9 +113,8 @@ processcmsfile() { + fi + + if [[ $DASD ]] && [[ $DASD != "none" ]]; then +- echo "$DASD" | normalize_dasd_arg > /etc/dasd.conf +- echo "options dasd_mod dasd=$DASD" > /etc/modprobe.d/dasd_mod.conf +- dasd_cio_free ++ echo "$DASD" | zdev_parse_dasd_list globals 2>&1 | vinfo ++ echo "$DASD" | zdev_parse_dasd_list ranges 2>&1 | vinfo + fi + + for i in ${!FCP_*}; do +diff --git a/modules.d/80cms/module-setup.sh b/modules.d/80cms/module-setup.sh +index 0dd86b80..05b049da 100755 +--- a/modules.d/80cms/module-setup.sh ++++ b/modules.d/80cms/module-setup.sh +@@ -12,13 +12,13 @@ check() { + depends() { + arch=${DRACUT_ARCH:-$(uname -m)} + [ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1 +- echo znet dasd dasd_mod bash ++ echo znet bash + return 0 + } + + # called by dracut + installkernel() { +- instmods zfcp ++ instmods zfcp dasd_mod dasd_eckd_mod dasd_fba_mod dasd_diag_mod + } + + # called by dracut +@@ -28,7 +28,7 @@ install() { + inst_script "$moddir/cmsifup.sh" /sbin/cmsifup + # shellcheck disable=SC2046 + inst_multiple /etc/cmsfs-fuse/filetypes.conf /etc/udev/rules.d/99-fuse.rules /etc/fuse.conf \ +- cmsfs-fuse fusermount bash insmod rmmod cat normalize_dasd_arg sed \ ++ cmsfs-fuse fusermount bash insmod rmmod cat /lib/s390-tools/zdev-from-dasd_mod.dasd sed \ + $(rpm -ql s390utils-base) awk getopt chzdev lszdev + + inst_libdir_file "gconv/*" +-- +2.42.0 + diff --git a/0006-feat-kernel-modules-add-Qualcomm-IPC-router-to-enabl.patch b/0006-feat-kernel-modules-add-Qualcomm-IPC-router-to-enabl.patch deleted file mode 100644 index 1cc4a7a..0000000 --- a/0006-feat-kernel-modules-add-Qualcomm-IPC-router-to-enabl.patch +++ /dev/null @@ -1,52 +0,0 @@ -From f38de6b6ad07edf5c534ae7a38b3fa48f5ef6153 Mon Sep 17 00:00:00 2001 -From: Jeremy Linton -Date: Fri, 6 Oct 2023 10:33:22 -0500 -Subject: [PATCH 06/10] feat(kernel-modules): add Qualcomm IPC router to enable - USB - -The x13s, and possibly other Qualcomm based devices need the QC -IPC router driver in order to enable USB. Without it, its not -possible to boot from USB-C attached disks. - -IPC in this case is Inter _Processor_ Communication and forms -the message bus used to communicate between differing processing -elements in a given system/SoC running and managing various -hardware devices. This means that while it appears this driver -should be in the dracut network modules that is incorrect -because its not for enabling host networking in the initrd, -but rather for communicating with other hardware blocks. - -Those other blocks aren't limited to modems, but any SMD (shared -memory device), which on QC based machines includes the audio DSPs, -RPM (resource power manager) and of course the application -processor cores linux is running on. - -References: -https://osmocom.org/projects/quectel-modems/wiki/Qualcomm_Linux_SMD -https://android.googlesource.com/kernel/msm/+/android-7.1.0_r0.2/Documentation/arm/msm/msm_ipc_router.txt -https://github.com/dracutdevs/dracut/pull/2531 - -Signed-off-by: Jeremy Linton - -(Cherry-picked commit a8015f7dfc682100434e3ee051bf9472a8e6cad4 from PR#2531) ---- - modules.d/90kernel-modules/module-setup.sh | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh -index e2175125..75afecc8 100755 ---- a/modules.d/90kernel-modules/module-setup.sh -+++ b/modules.d/90kernel-modules/module-setup.sh -@@ -95,7 +95,8 @@ installkernel() { - "=drivers/usb/misc" \ - "=drivers/usb/musb" \ - "=drivers/usb/phy" \ -- "=drivers/scsi/hisi_sas" -+ "=drivers/scsi/hisi_sas" \ -+ "=net/qrtr" - fi - - awk -F: '/^\// {print $1}' "$srcmods/modules.dep" 2> /dev/null | instmods --- -2.42.0 - diff --git a/0006-refactor-cms-use-consolidated-network-config-with-zd.patch b/0006-refactor-cms-use-consolidated-network-config-with-zd.patch new file mode 100644 index 0000000..74f3d4c --- /dev/null +++ b/0006-refactor-cms-use-consolidated-network-config-with-zd.patch @@ -0,0 +1,109 @@ +From cc14fe218861f2855ca88ad03220ecb78d4aa31a Mon Sep 17 00:00:00 2001 +From: Steffen Maier +Date: Wed, 26 Jul 2023 13:50:03 +0200 +Subject: [PATCH 06/23] refactor(cms): use consolidated network config with + zdev from s390-tools + +This is just internal to initrd, so we can already migrate the code to +consolidated network device configuration with zdev +https://github.com/ibm-s390-linux/s390-tools/tree/master/zdev/. +The code change is transparent to users after dracut switch root. + +The generated persistent config of chzdev are pure udev rules so it has no +dependency on the zdev dracut module. + +Keep the dependency on dracut module znet to at least pull in the required +kernel device drivers. + +Since consolidated s390 network device configuration with zdev is used, +it takes care of all s390-specific settings. +None of the s390-specific ifcfg variables should be used anymore. +NETTYPE, OPTIONS, PORTNAME, and CTCPROT can be removed entirely. +SUBCHANNELS is kept because there are some dependency chains +(probably around the key identifiying an interface which is not HWADDR): + +modules.d/35network-legacy/module-setup.sh +parses (sources) each of /etc/sysconfig/network-scripts/ifcfg-* +and if that contains SUBCHANNELS, create a symlink from the ifcfg file to +/etc/sysconfig/network-scripts/ccw-${SUBCHANNELS}.conf + +modules.d/35network-legacy/ifup.sh installed as /sbin/ifup +checks during team setup if a slave interface is an s390 channel-attached +network interface and then parses (sources) +/etc/sysconfig/network-scripts/ccw-${SUBCHANNELS}.conf +from above, if that file exists + +Signed-off-by: Steffen Maier +--- + modules.d/80cms/cms-write-ifcfg.sh | 13 ------------- + modules.d/80cms/cmssetup.sh | 21 +++++++++++++-------- + 2 files changed, 13 insertions(+), 21 deletions(-) + +diff --git a/modules.d/80cms/cms-write-ifcfg.sh b/modules.d/80cms/cms-write-ifcfg.sh +index ecfd53ef..91263092 100755 +--- a/modules.d/80cms/cms-write-ifcfg.sh ++++ b/modules.d/80cms/cms-write-ifcfg.sh +@@ -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 +diff --git a/modules.d/80cms/cmssetup.sh b/modules.d/80cms/cmssetup.sh +index 01cfd303..5e5b9267 100755 +--- a/modules.d/80cms/cmssetup.sh ++++ b/modules.d/80cms/cmssetup.sh +@@ -82,13 +82,19 @@ processcmsfile() { + SUBCHANNELS="$(echo "$SUBCHANNELS" | sed 'y/ABCDEF/abcdef/')" + + if [[ $NETTYPE ]]; then +- ( +- echo -n "$NETTYPE","$SUBCHANNELS" +- [[ $PORTNAME ]] && echo -n ",portname=$PORTNAME" +- [[ $LAYER2 ]] && echo -n ",layer2=$LAYER2" +- [[ $NETTYPE == "ctc" ]] && [[ $CTCPROT ]] && echo -n ",protocol=$CTCPROT" +- echo +- ) >> /etc/ccw.conf ++ _cms_attrs="" ++ if [[ $PORTNAME ]]; then ++ if [[ $NETTYPE == lcs ]]; then ++ _cms_attrs="$_cms_attrs portno=$PORTNAME" ++ else ++ _cms_attrs="$_cms_attrs portname=$PORTNAME" ++ fi ++ fi ++ [[ $LAYER2 ]] && _cms_attrs="$_cms_attrs layer2=$LAYER2" ++ [[ $CTCPROT ]] && _cms_attrs="$_cms_attrs protocol=$CTCPROT" ++ # shellcheck disable=SC2086 ++ chzdev --enable --persistent --yes --no-root-update --force \ ++ "$NETTYPE" "$SUBCHANNELS" $_cms_attrs 2>&1 | vinfo + + OLDIFS=$IFS + IFS=, +@@ -109,7 +115,6 @@ processcmsfile() { + [[ -f /etc/udev/rules.d/90-net.rules ]] \ + || printf 'SUBSYSTEM=="net", ACTION=="online", RUN+="/sbin/initqueue --onetime --env netif=$name source_hook initqueue/online"\n' >> /etc/udev/rules.d/99-cms.rules + udevadm control --reload +- znet_cio_free + fi + + if [[ $DASD ]] && [[ $DASD != "none" ]]; then +-- +2.42.0 + diff --git a/0007-fix-kernel-install-do-not-generate-an-initrd-when-on.patch b/0007-fix-kernel-install-do-not-generate-an-initrd-when-on.patch deleted file mode 100644 index 38e59cb..0000000 --- a/0007-fix-kernel-install-do-not-generate-an-initrd-when-on.patch +++ /dev/null @@ -1,39 +0,0 @@ -From ee0c17d24940f08a41179edce58f688f807d1d75 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= -Date: Tue, 18 Jan 2022 18:58:58 +0100 -Subject: [PATCH 07/10] fix(kernel-install): do not generate an initrd when one - was specified - -According to the synopsis, kernel-install can be called with an -already-prepared initrd. In that case, no initrd should be generated by dracut. - -(Cherry-picked commit 0b72cf5c4eca0e0db76e3e210cfdc48e6b49bb74 from PR#1825) ---- - install.d/50-dracut.install | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/install.d/50-dracut.install b/install.d/50-dracut.install -index efb184cd..3907e303 100755 ---- a/install.d/50-dracut.install -+++ b/install.d/50-dracut.install -@@ -4,6 +4,7 @@ COMMAND="$1" - KERNEL_VERSION="$2" - BOOT_DIR_ABS="$3" - KERNEL_IMAGE="$4" -+INITRD_OPTIONS_SHIFT=4 - - # If KERNEL_INSTALL_MACHINE_ID is defined but empty, BOOT_DIR_ABS is a fake directory. - # In this case, do not create the initrd. -@@ -34,6 +35,9 @@ ret=0 - - case "$COMMAND" in - add) -+ # If the initrd was provided on the kernel command line, we shouldn't generate our own. -+ [ "$#" -gt "$INITRD_OPTIONS_SHIFT" ] && exit 0 -+ - if [[ $IMAGE == "uki.efi" ]]; then - IMAGE_PREGENERATED=${KERNEL_IMAGE%/*}/uki.efi - else --- -2.42.0 - diff --git a/0007-refactor-cms-remove-now-unnecessary-inclusion-of-ful.patch b/0007-refactor-cms-remove-now-unnecessary-inclusion-of-ful.patch new file mode 100644 index 0000000..ff067a0 --- /dev/null +++ b/0007-refactor-cms-remove-now-unnecessary-inclusion-of-ful.patch @@ -0,0 +1,27 @@ +From a2c1fc530d8bcbdeaf1806f4a22019052715fc98 Mon Sep 17 00:00:00 2001 +From: Steffen Maier +Date: Thu, 8 Feb 2024 18:38:48 +0100 +Subject: [PATCH 07/23] refactor(cms): remove now unnecessary inclusion of full + s390utils-base + +Signed-off-by: Steffen Maier +--- + modules.d/80cms/module-setup.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/80cms/module-setup.sh b/modules.d/80cms/module-setup.sh +index 05b049da..5b33cd18 100755 +--- a/modules.d/80cms/module-setup.sh ++++ b/modules.d/80cms/module-setup.sh +@@ -29,7 +29,7 @@ install() { + # shellcheck disable=SC2046 + inst_multiple /etc/cmsfs-fuse/filetypes.conf /etc/udev/rules.d/99-fuse.rules /etc/fuse.conf \ + cmsfs-fuse fusermount bash insmod rmmod cat /lib/s390-tools/zdev-from-dasd_mod.dasd sed \ +- $(rpm -ql s390utils-base) awk getopt chzdev lszdev ++ awk getopt chzdev lszdev + + inst_libdir_file "gconv/*" + #inst /usr/lib/locale/locale-archive +-- +2.42.0 + diff --git a/0008-feat-zfcp_rules-remove-zfcp-handling-consolidated-in.patch b/0008-feat-zfcp_rules-remove-zfcp-handling-consolidated-in.patch new file mode 100644 index 0000000..b831225 --- /dev/null +++ b/0008-feat-zfcp_rules-remove-zfcp-handling-consolidated-in.patch @@ -0,0 +1,222 @@ +From 71876ea8c73090741bdf26abb89c28fb260ed575 Mon Sep 17 00:00:00 2001 +From: Steffen Maier +Date: Fri, 20 Jan 2023 18:22:19 +0100 +Subject: [PATCH 08/23] feat(zfcp_rules): remove zfcp handling consolidated in + s390-tools + +These are handled by s390-tools zdev dracut module 95zdev as of +https://github.com/ibm-s390-linux/s390-tools/commit/06a30ae529a5d6ad2369ed81da056bf3a6147bb6 +("zdev/dracut: add rd.zfcp cmdline option handling"). + +Even though this removes one implementation of parsing rd.zfcp in dracut, +above s390-tools change introduces another implementation of parsing the +exact same rd.zfcp syntax. Therefore, it would be good to keep the +documentation in man/dracut.cmdline.7 of dracut as one central place +describing all s390 device types that dracut handles. + +This also fixes problems such as RHBZ 1552619/1745470. It was due to a +duplicate configuration because the SUSE-specific module 95zfcp_rules does +not have any distro-specific dependency and thus also ran in Red Hat +distros. + +That also caused a kind of competition with 95zfcp regarding the same hook +registration: + inst_hook cmdline 30 "$moddir/parse-zfcp.sh" +"luckily" 95zfcp wins since it runs lexicographically first +and the first one registering the hook via inst_simple wins. + +Because commit c8aa1d949aec ("95zfcp_rules: simplified rd.zfcp commandline +for NPIV") extended the emitted rd.zfcp syntax for hostonly-cmdline in +95zfcp_rules, kdump initrds built with hostonly-cmdline parsed such rd.zfcp +with 95zfcp, which did not understand the extended syntax yet and aborted +early boot with a syntax error. + +It also seems that parse-zfcp.sh on its own is without effect because +create_udev_rule() [similar to what zfcp_disk_configure had generated] does +not handle the pre-requisite of setting an FCP device (vHBA) online first. +So the rport match does not trigger unless something else happens to set an +FCP device online [such as rules generated by zfcp_host_configure]. Related +to commit d40c49a8dfe2 ("fix(zfcp_rules): remove collect based udev rule +creators"). + +module-setup.sh having copied all udev rules from the root-fs into the +initrd conflicted with s390-tools dracut module zdev-kdump, which +intentionally only activates the dependencies of the kdump target. + +Signed-off-by: Steffen Maier +--- + modules.d/95zfcp_rules/module-setup.sh | 80 -------------------------- + modules.d/95zfcp_rules/parse-zfcp.sh | 74 ------------------------ + 2 files changed, 154 deletions(-) + delete mode 100755 modules.d/95zfcp_rules/module-setup.sh + delete mode 100755 modules.d/95zfcp_rules/parse-zfcp.sh + +diff --git a/modules.d/95zfcp_rules/module-setup.sh b/modules.d/95zfcp_rules/module-setup.sh +deleted file mode 100755 +index dfa79514..00000000 +--- a/modules.d/95zfcp_rules/module-setup.sh ++++ /dev/null +@@ -1,80 +0,0 @@ +-#!/bin/bash +- +-# called by dracut +-cmdline() { +- is_zfcp() { +- local _dev=$1 +- local _devpath +- _devpath=$( +- cd -P /sys/dev/block/"$_dev" || exit +- echo "$PWD" +- ) +- local _sdev _scsiid _hostno _lun _wwpn _ccw _port_type +- local _allow_lun_scan _is_npiv +- +- read -r _allow_lun_scan < /sys/module/zfcp/parameters/allow_lun_scan +- [ "${_devpath#*/sd}" == "$_devpath" ] && return 1 +- _sdev="${_devpath%%/block/*}" +- [ -e "${_sdev}"/fcp_lun ] || return 1 +- _scsiid="${_sdev##*/}" +- _hostno="${_scsiid%%:*}" +- [ -d /sys/class/fc_host/host"${_hostno}" ] || return 1 +- read -r _port_type < /sys/class/fc_host/host"${_hostno}"/port_type +- case "$_port_type" in +- NPIV*) +- _is_npiv=1 +- ;; +- esac +- read -r _ccw < "${_sdev}"/hba_id +- if [ "$_is_npiv" ] && [ "$_allow_lun_scan" = "Y" ]; then +- echo "rd.zfcp=${_ccw}" +- else +- read -r _lun < "${_sdev}"/fcp_lun +- read -r _wwpn < "${_sdev}"/wwpn +- echo "rd.zfcp=${_ccw},${_wwpn},${_lun}" +- fi +- return 0 +- } +- [[ $hostonly ]] || [[ $mount_needs ]] && { +- for_each_host_dev_and_slaves_all is_zfcp +- } | sort | uniq +-} +- +-# called by dracut +-check() { +- local _arch=${DRACUT_ARCH:-$(uname -m)} +- local _ccw +- [ "$_arch" = "s390" -o "$_arch" = "s390x" ] || return 1 +- +- [[ $hostonly ]] || [[ $mount_needs ]] && { +- found=0 +- for _ccw in /sys/bus/ccw/devices/*/host*; do +- [ -d "$_ccw" ] || continue +- found=$((found + 1)) +- done +- [ $found -eq 0 ] && return 255 +- } +- return 0 +-} +- +-# called by dracut +-depends() { +- echo bash +- return 0 +-} +- +-# called by dracut +-install() { +- inst_hook cmdline 30 "$moddir/parse-zfcp.sh" +- if [[ $hostonly_cmdline == "yes" ]]; then +- local _zfcp +- +- for _zfcp in $(cmdline); do +- printf "%s\n" "$_zfcp" >> "${initdir}/etc/cmdline.d/94zfcp.conf" +- done +- fi +- if [[ $hostonly ]]; then +- inst_rules_wildcard "51-zfcp-*.rules" +- inst_rules_wildcard "41-zfcp-*.rules" +- fi +-} +diff --git a/modules.d/95zfcp_rules/parse-zfcp.sh b/modules.d/95zfcp_rules/parse-zfcp.sh +deleted file mode 100755 +index a474b81b..00000000 +--- a/modules.d/95zfcp_rules/parse-zfcp.sh ++++ /dev/null +@@ -1,74 +0,0 @@ +-#!/bin/bash +- +-create_udev_rule() { +- local ccw=$1 +- local wwpn=$2 +- local lun=$3 +- local _rule=/etc/udev/rules.d/51-zfcp-${ccw}.rules +- local _cu_type _dev_type +- +- if [ -x /sbin/cio_ignore ] && cio_ignore -i "$ccw" > /dev/null; then +- cio_ignore -r "$ccw" +- fi +- +- if [ -e /sys/bus/ccw/devices/"${ccw}" ]; then +- read -r _cu_type < /sys/bus/ccw/devices/"${ccw}"/cutype +- read -r _dev_type < /sys/bus/ccw/devices/"${ccw}"/devtype +- fi +- if [ "$_cu_type" != "1731/03" ]; then +- return 0 +- fi +- if [ "$_dev_type" != "1732/03" ] && [ "$_dev_type" != "1732/04" ]; then +- return 0 +- fi +- +- [ -z "$wwpn" ] || [ -z "$lun" ] && return +- m=$(sed -n "/.*${wwpn}.*${lun}.*/p" "$_rule") +- if [ -z "$m" ]; then +- cat >> "$_rule" << EOF +-ACTION=="add", KERNEL=="rport-*", ATTR{port_name}=="$wwpn", SUBSYSTEMS=="ccw", KERNELS=="$ccw", ATTR{[ccw/$ccw]$wwpn/unit_add}="$lun" +-EOF +- fi +-} +- +-if [[ -f /sys/firmware/ipl/ipl_type ]] \ +- && [[ $(< /sys/firmware/ipl/ipl_type) == "fcp" ]]; then +- ( +- read -r _wwpn < /sys/firmware/ipl/wwpn +- read -r _lun < /sys/firmware/ipl/lun +- read -r _ccw < /sys/firmware/ipl/device +- +- create_udev_rule "$_ccw" "$_wwpn" "$_lun" +- ) +-fi +- +-for zfcp_arg in $(getargs rd.zfcp); do +- ( +- OLDIFS="$IFS" +- IFS="," +- # shellcheck disable=SC2086 +- set $zfcp_arg +- IFS="$OLDIFS" +- create_udev_rule "$1" "$2" "$3" +- ) +-done +- +-for zfcp_arg in $(getargs root=) $(getargs resume=); do +- ( +- case $zfcp_arg in +- /dev/disk/by-path/ccw-*) +- ccw_arg=${zfcp_arg##*/} +- ;; +- esac +- if [ -n "$ccw_arg" ]; then +- OLDIFS="$IFS" +- IFS="-" +- # shellcheck disable=SC2086 +- set -- $ccw_arg +- IFS="$OLDIFS" +- _wwpn=${4%:*} +- _lun=${4#*:} +- create_udev_rule "$2" "$wwpn" "$lun" +- fi +- ) +-done +-- +2.42.0 + diff --git a/0008-fix-pkcs11-delete-trailing-dot-on-libcryptsetup-toke.patch b/0008-fix-pkcs11-delete-trailing-dot-on-libcryptsetup-toke.patch deleted file mode 100644 index 08b749f..0000000 --- a/0008-fix-pkcs11-delete-trailing-dot-on-libcryptsetup-toke.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 461db48fc56a8521a78314e5f02ed516ed76b1ee Mon Sep 17 00:00:00 2001 -From: innovara -Date: Fri, 27 Oct 2023 11:53:49 +0100 -Subject: [PATCH 08/10] fix(pkcs11): delete trailing dot on - libcryptsetup-token-systemd-pkcs11.so - -libcryptsetup-token-systemd-pkcs11.so.* doesn't match the file libcryptsetup-token-systemd-pkcs11.so - -(Cherry-picked commit 5edaca7637d76a05429a31c28304ef3f476fe2f9 from PR#2540) ---- - modules.d/91pkcs11/module-setup.sh | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/modules.d/91pkcs11/module-setup.sh b/modules.d/91pkcs11/module-setup.sh -index 547631db..5675efb5 100755 ---- a/modules.d/91pkcs11/module-setup.sh -+++ b/modules.d/91pkcs11/module-setup.sh -@@ -30,6 +30,6 @@ install() { - {"tls/$_arch/",tls/,"$_arch/",}"libffi.so.*" \ - {"tls/$_arch/",tls/,"$_arch/",}"libp11-kit.so.*" \ - {"tls/$_arch/",tls/,"$_arch/",}"libcryptsetup.so.*" \ -- {"tls/$_arch/",tls/,"$_arch/",}"/cryptsetup/libcryptsetup-token-systemd-pkcs11.so.*" -+ {"tls/$_arch/",tls/,"$_arch/",}"/cryptsetup/libcryptsetup-token-systemd-pkcs11.so*" - - } --- -2.42.0 - diff --git a/0009-feat-zfcp-minimize-zfcp-handling-consolidated-in-s39.patch b/0009-feat-zfcp-minimize-zfcp-handling-consolidated-in-s39.patch new file mode 100644 index 0000000..7f494b2 --- /dev/null +++ b/0009-feat-zfcp-minimize-zfcp-handling-consolidated-in-s39.patch @@ -0,0 +1,104 @@ +From 8d6098969aa9dc34edfd1bc96e6aa0384ae2fb99 Mon Sep 17 00:00:00 2001 +From: Steffen Maier +Date: Tue, 31 Jan 2023 09:14:40 +0100 +Subject: [PATCH 09/23] feat(zfcp): minimize zfcp handling consolidated in + s390-tools + +Parsing of rd.zfcp is handled by s390-tools zdev dracut module 95zdev as of +https://github.com/ibm-s390-linux/s390-tools/commit/06a30ae529a5d6ad2369ed81da056bf3a6147bb6 +("zdev/dracut: add rd.zfcp cmdline option handling"). + +Even though this removes the last implementation of parsing rd.zfcp in +dracut, above s390-tools change introduces another implementation of +parsing the exact same rd.zfcp syntax. Therefore, it would be good to keep +the documentation in man/dracut.cmdline.7 of dracut as one central place +describing all s390 device types that dracut handles. + +For the time being, keep copying /etc/zfcp.conf. +Retain the call of zfcp_cio_free so /etc/zfcp.conf gets processed even +with the typical cio_ignore kernel boot parameter ignoring most devices. +Also keep handling rd.zfcp.conf=0 so users can, at boot time, ignore +/etc/zfcp.conf already copied into initrd. + +Preparation for consolidating persistent configuration with zdev. + +Signed-off-by: Steffen Maier +--- + man/dracut.cmdline.7.asc | 12 +++++++++++- + modules.d/95zfcp/module-setup.sh | 4 ++-- + modules.d/95zfcp/parse-zfcp.sh | 11 ----------- + 3 files changed, 13 insertions(+), 14 deletions(-) + +diff --git a/man/dracut.cmdline.7.asc b/man/dracut.cmdline.7.asc +index 858991fa..01bdf10f 100644 +--- a/man/dracut.cmdline.7.asc ++++ b/man/dracut.cmdline.7.asc +@@ -980,12 +980,22 @@ ZFCP + **rd.zfcp=**____,____,____:: + 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=**____:: + 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 and 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 + -- +diff --git a/modules.d/95zfcp/module-setup.sh b/modules.d/95zfcp/module-setup.sh +index e1f3aa35..b547f9bc 100755 +--- a/modules.d/95zfcp/module-setup.sh ++++ b/modules.d/95zfcp/module-setup.sh +@@ -5,7 +5,7 @@ check() { + arch=${DRACUT_ARCH:-$(uname -m)} + [ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1 + +- require_binaries zfcp_cio_free grep sed seq || return 1 ++ require_binaries zfcp_cio_free sed || return 1 + + return 0 + } +@@ -23,7 +23,7 @@ installkernel() { + # called by dracut + install() { + inst_hook cmdline 30 "$moddir/parse-zfcp.sh" +- inst_multiple zfcp_cio_free grep sed seq ++ inst_multiple zfcp_cio_free sed + + inst_script /sbin/zfcpconf.sh + inst_rules 56-zfcp.rules +diff --git a/modules.d/95zfcp/parse-zfcp.sh b/modules.d/95zfcp/parse-zfcp.sh +index 495aa67f..41216dd9 100755 +--- a/modules.d/95zfcp/parse-zfcp.sh ++++ b/modules.d/95zfcp/parse-zfcp.sh +@@ -2,15 +2,4 @@ + + getargbool 1 rd.zfcp.conf -d -n rd_NO_ZFCPCONF || rm /etc/zfcp.conf + +-for zfcp_arg in $(getargs rd.zfcp -d 'rd_ZFCP='); do +- echo "$zfcp_arg" | grep '^0\.[0-9a-fA-F]\.[0-9a-fA-F]\{4\}\(,0x[0-9a-fA-F]\{16\},0x[0-9a-fA-F]\{16\}\)\?$' > /dev/null +- test $? -ne 0 && die "For argument 'rd.zfcp=$zfcp_arg'\nSorry, invalid format." +- ( +- IFS="," +- # shellcheck disable=SC2086 +- set $zfcp_arg +- echo "$@" >> /etc/zfcp.conf +- ) +-done +- + zfcp_cio_free +-- +2.42.0 + diff --git a/0009-fix-pcsc-add-disable-polkit-to-pcscd.service.patch b/0009-fix-pcsc-add-disable-polkit-to-pcscd.service.patch deleted file mode 100644 index 6792edc..0000000 --- a/0009-fix-pcsc-add-disable-polkit-to-pcscd.service.patch +++ /dev/null @@ -1,30 +0,0 @@ -From edd63a5f7542e010fb44ff62146938bda80406f7 Mon Sep 17 00:00:00 2001 -From: Manuel Fombuena -Date: Fri, 3 Nov 2023 11:53:38 +0000 -Subject: [PATCH 09/10] fix(pcsc): add --disable-polkit to pcscd.service - -Needs pcsc >= 2.0.0 - -polkit is not included in dracut and without this option, pcscd simply fails - -(Cherry-picked commit 842be0c89fe0cc8cac9efa88e68b07ae1c2d2464 from PR#2547) ---- - modules.d/91pcsc/pcscd.service | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/modules.d/91pcsc/pcscd.service b/modules.d/91pcsc/pcscd.service -index 639decd2..7d4e0a2b 100644 ---- a/modules.d/91pcsc/pcscd.service -+++ b/modules.d/91pcsc/pcscd.service -@@ -5,7 +5,7 @@ Documentation=man:pcscd(8) - Requires=pcscd.socket - - [Service] --ExecStart=/usr/sbin/pcscd --foreground --auto-exit -+ExecStart=/usr/sbin/pcscd --foreground --auto-exit --disable-polkit - ExecReload=/usr/sbin/pcscd --hotplug - - [Install] --- -2.42.0 - diff --git a/0010-feat-dasd_rules-remove-dasd-handling-consolidated-in.patch b/0010-feat-dasd_rules-remove-dasd-handling-consolidated-in.patch new file mode 100644 index 0000000..2887176 --- /dev/null +++ b/0010-feat-dasd_rules-remove-dasd-handling-consolidated-in.patch @@ -0,0 +1,151 @@ +From 7294e45b5204e47bb8ee2108e2c38c5843e64fac Mon Sep 17 00:00:00 2001 +From: Steffen Maier +Date: Thu, 23 Mar 2023 18:06:23 +0100 +Subject: [PATCH 10/23] feat(dasd_rules): remove dasd handling consolidated in + s390-tools + +These are handled by s390-tools zdev dracut module 95zdev as of +https://github.com/ibm-s390-linux/s390-tools/commit/99270236805972544932feab9692ee7122a343b8 +("zdev/dracut: add rd.dasd cmdline option handling"). + +Even though this removes one implementation of parsing rd.dasd in dracut, +above s390-tools change introduces another implementation of parsing the +exact same rd.dasd syntax. Therefore, it would be good to keep the +documentation in man/dracut.cmdline.7 of dracut as one central place +describing all s390 device types that dracut handles. + +module-setup.sh having copied all udev rules from the root-fs into the +initrd conflicted with s390-tools dracut module zdev-kdump, which +intentionally only activates the dependencies of the kdump target. + +Signed-off-by: Steffen Maier +--- + modules.d/95dasd_rules/module-setup.sh | 65 -------------------------- + modules.d/95dasd_rules/parse-dasd.sh | 43 ----------------- + 2 files changed, 108 deletions(-) + delete mode 100755 modules.d/95dasd_rules/module-setup.sh + delete mode 100755 modules.d/95dasd_rules/parse-dasd.sh + +diff --git a/modules.d/95dasd_rules/module-setup.sh b/modules.d/95dasd_rules/module-setup.sh +deleted file mode 100755 +index 06c57a48..00000000 +--- a/modules.d/95dasd_rules/module-setup.sh ++++ /dev/null +@@ -1,65 +0,0 @@ +-#!/bin/bash +- +-# called by dracut +-cmdline() { +- is_dasd() { +- local _dev=$1 +- local _devpath +- _devpath=$( +- cd -P /sys/dev/block/"$_dev" || exit +- echo "$PWD" +- ) +- +- [ "${_devpath#*/dasd}" == "$_devpath" ] && return 1 +- _ccw="${_devpath%%/block/*}" +- echo "rd.dasd=${_ccw##*/}" +- return 0 +- } +- [[ $hostonly ]] || [[ $mount_needs ]] && { +- for_each_host_dev_and_slaves_all is_dasd || return 255 +- } | sort | uniq +-} +- +-# called by dracut +-check() { +- local _arch=${DRACUT_ARCH:-$(uname -m)} +- local found=0 +- local bdev +- [ "$_arch" = "s390" -o "$_arch" = "s390x" ] || return 1 +- +- [[ $hostonly ]] || [[ $mount_needs ]] && { +- for bdev in /sys/block/*; do +- case "${bdev##*/}" in +- dasd*) +- found=$((found + 1)) +- break +- ;; +- esac +- done +- [ $found -eq 0 ] && return 255 +- } +- return 0 +-} +- +-# called by dracut +-depends() { +- echo 'dasd_mod' bash +- return 0 +-} +- +-# called by dracut +-install() { +- inst_hook cmdline 30 "$moddir/parse-dasd.sh" +- if [[ $hostonly_cmdline == "yes" ]]; then +- local _dasd +- _dasd=$(cmdline) +- [[ $_dasd ]] && printf "%s\n" "$_dasd" >> "${initdir}/etc/cmdline.d/95dasd.conf" +- fi +- if [[ $hostonly ]]; then +- inst_rules_wildcard "51-dasd-*.rules" +- inst_rules_wildcard "41-dasd-*.rules" +- mark_hostonly /etc/udev/rules.d/51-dasd-*.rules +- mark_hostonly /etc/udev/rules.d/41-dasd-*.rules +- fi +- inst_rules 59-dasd.rules +-} +diff --git a/modules.d/95dasd_rules/parse-dasd.sh b/modules.d/95dasd_rules/parse-dasd.sh +deleted file mode 100755 +index 4454aec3..00000000 +--- a/modules.d/95dasd_rules/parse-dasd.sh ++++ /dev/null +@@ -1,43 +0,0 @@ +-#!/bin/bash +- +-allow_device() { +- local ccw=$1 +- +- if [ -x /sbin/cio_ignore ] && cio_ignore -i "$ccw" > /dev/null; then +- cio_ignore -r "$ccw" +- fi +-} +- +-if [[ -f /sys/firmware/ipl/ipl_type ]] && [[ $(< /sys/firmware/ipl/ipl_type) == "ccw" ]]; then +- allow_device "$(< /sys/firmware/ipl/device)" +-fi +- +-for dasd_arg in $(getargs root=) $(getargs resume=); do +- [[ $dasd_arg =~ /dev/disk/by-path/ccw-* ]] || continue +- +- ccw_dev="${dasd_arg##*/ccw-}" +- allow_device "${ccw_dev%%-*}" +-done +- +-for dasd_arg in $(getargs rd.dasd=); do +- IFS=',' read -r -a devs <<< "$dasd_arg" +- declare -p devs +- for dev in "${devs[@]}"; do +- case "$dev" in +- autodetect | probeonly) ;; +- +- *-*) +- IFS="-" read -r start end _ <<< "${dev%(ro)}" +- prefix=${start%.*} +- start=${start##*.} +- for rdev in $(seq $((16#$start)) $((16#$end))); do +- allow_device "$(printf "%s.%04x" "$prefix" "$rdev")" +- done +- ;; +- *) +- IFS="." read -r sid ssid chan _ <<< "${dev%(ro)}" +- allow_device "$(printf "%01x.%01x.%04x" $((16#$sid)) $((16#$ssid)) $((16#$chan)))" +- ;; +- esac +- done +-done +-- +2.42.0 + diff --git a/0010-fix-pcsc-add-opensc-load-module-file.patch b/0010-fix-pcsc-add-opensc-load-module-file.patch deleted file mode 100644 index 78acec8..0000000 --- a/0010-fix-pcsc-add-opensc-load-module-file.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 8069d40c0e180cd74d4e897c007096523ecce459 Mon Sep 17 00:00:00 2001 -From: Manuel Fombuena -Date: Fri, 3 Nov 2023 09:04:53 +0000 -Subject: [PATCH 10/10] fix(pcsc): add opensc load module file - -On Fedora, and possibly others, this file loads opensc-pkcs11.so which you need to interact with the smart card to unlock a LUKS encrypted volume. - -(Cherry-picked commit 6da61a2c0e38da4e6e880e1bb7f47d55d2c54c65 from PR#2547) ---- - modules.d/91pcsc/module-setup.sh | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/modules.d/91pcsc/module-setup.sh b/modules.d/91pcsc/module-setup.sh -index 6f8b2c88..26b463d4 100755 ---- a/modules.d/91pcsc/module-setup.sh -+++ b/modules.d/91pcsc/module-setup.sh -@@ -29,7 +29,8 @@ install() { - inst_simple "$moddir/pcscd.socket" "${systemdsystemunitdir}"/pcscd.socket - - inst_multiple -o \ -- pcscd -+ pcscd \ -+ /usr/share/p11-kit/modules/opensc.module - - # Enable systemd type unit(s) - for i in \ --- -2.42.0 - diff --git a/0011-feat-dasd_mod-minimize-dasd-handling-consolidated-in.patch b/0011-feat-dasd_mod-minimize-dasd-handling-consolidated-in.patch new file mode 100644 index 0000000..6114794 --- /dev/null +++ b/0011-feat-dasd_mod-minimize-dasd-handling-consolidated-in.patch @@ -0,0 +1,73 @@ +From a82045ef34bc8c913502eba37b6b9c60709d6997 Mon Sep 17 00:00:00 2001 +From: Steffen Maier +Date: Thu, 23 Mar 2023 18:22:56 +0100 +Subject: [PATCH 11/23] feat(dasd_mod): minimize dasd handling consolidated in + s390-tools + +Parsing of rd.dasd is handled by s390-tools zdev dracut module 95zdev as of +https://github.com/ibm-s390-linux/s390-tools/commit/99270236805972544932feab9692ee7122a343b8 +("zdev/dracut: add rd.dasd cmdline option handling"). + +Even though this removes one implementation of parsing rd.dasd in dracut, +above s390-tools change introduces another implementation of parsing the +exact same rd.dasd syntax. Therefore, it would be good to keep the +documentation in man/dracut.cmdline.7 of dracut as one central place +describing all s390 device types that dracut handles. + +95dasd/modules-setup.sh copies /etc/dasd.conf from root-fs into initrd. +Retain the call of dasd_cio_free here so /etc/dasd.conf gets processed even +with the typical cio_ignore kernel boot parameter ignoring most devices. + +Preparation for consolidating persistent configuration with zdev. + +Signed-off-by: Steffen Maier +--- + modules.d/95dasd_mod/module-setup.sh | 2 -- + modules.d/95dasd_mod/parse-dasd-mod.sh | 14 -------------- + 2 files changed, 16 deletions(-) + +diff --git a/modules.d/95dasd_mod/module-setup.sh b/modules.d/95dasd_mod/module-setup.sh +index c59dd3ac..155eaacc 100755 +--- a/modules.d/95dasd_mod/module-setup.sh ++++ b/modules.d/95dasd_mod/module-setup.sh +@@ -4,7 +4,6 @@ + check() { + local _arch=${DRACUT_ARCH:-$(uname -m)} + [ "$_arch" = "s390" -o "$_arch" = "s390x" ] || return 1 +- require_binaries grep sed seq + + return 0 + } +@@ -22,6 +21,5 @@ installkernel() { + # called by dracut + install() { + inst_hook cmdline 31 "$moddir/parse-dasd-mod.sh" +- inst_multiple grep sed seq + inst_multiple -o dasd_cio_free + } +diff --git a/modules.d/95dasd_mod/parse-dasd-mod.sh b/modules.d/95dasd_mod/parse-dasd-mod.sh +index 2b86d454..b635ecf9 100755 +--- a/modules.d/95dasd_mod/parse-dasd-mod.sh ++++ b/modules.d/95dasd_mod/parse-dasd-mod.sh +@@ -1,18 +1,4 @@ + #!/bin/sh +-mod_args="" +- +-for dasd_arg in $(getargs rd.dasd= -d rd_DASD= DASD=); do +- mod_args="$mod_args,$dasd_arg" +-done +- +-mod_args="${mod_args#*,}" +- +-if [ -x /sbin/dasd_cio_free -a -n "$mod_args" ]; then +- [ -d /etc/modprobe.d ] || mkdir -m 0755 -p /etc/modprobe.d +- echo "options dasd_mod dasd=$mod_args" >> /etc/modprobe.d/dasd_mod.conf +-fi +- +-unset dasd_arg + if [ -x /sbin/dasd_cio_free ]; then + dasd_cio_free + fi +-- +2.42.0 + diff --git a/0012-feat-dasd-minimize-dasd-handling-consolidated-in-s39.patch b/0012-feat-dasd-minimize-dasd-handling-consolidated-in-s39.patch new file mode 100644 index 0000000..7ab681f --- /dev/null +++ b/0012-feat-dasd-minimize-dasd-handling-consolidated-in-s39.patch @@ -0,0 +1,100 @@ +From 1ff6be8aef787513b8143df444a1dd2d696b0944 Mon Sep 17 00:00:00 2001 +From: Steffen Maier +Date: Thu, 23 Mar 2023 19:33:52 +0100 +Subject: [PATCH 12/23] feat(dasd): minimize dasd handling consolidated in + s390-tools + +Parsing of rd.dasd is handled by s390-tools zdev dracut module 95zdev as of +https://github.com/ibm-s390-linux/s390-tools/commit/99270236805972544932feab9692ee7122a343b8 +("zdev/dracut: add rd.dasd cmdline option handling"). + +Even though this removes the last implementation of parsing rd.dasd in +dracut, above s390-tools change introduces another implementation of +parsing the exact same rd.dasd syntax. Therefore, it would be good to keep +the documentation in man/dracut.cmdline.7 of dracut as one central place +describing all s390 device types that dracut handles. + +For the time being, keep copying /etc/dasd.conf. +The corresponding call to dasd_cio_free is in 95dasd_mod/parse-dasd-mod.sh +and indirectly triggers processing of /etc/dasd.conf even with the typical +cio_ignore kernel boot parameter ignoring most devices. + +Preparation for consolidating persistent configuration with zdev. + +Signed-off-by: Steffen Maier +--- + man/dracut.cmdline.7.asc | 11 ++++++++++- + modules.d/95dasd/module-setup.sh | 6 ++---- + modules.d/95dasd/parse-dasd.sh | 11 ----------- + 3 files changed, 12 insertions(+), 16 deletions(-) + delete mode 100755 modules.d/95dasd/parse-dasd.sh + +diff --git a/man/dracut.cmdline.7.asc b/man/dracut.cmdline.7.asc +index 01bdf10f..c31dbfc6 100644 +--- a/man/dracut.cmdline.7.asc ++++ b/man/dracut.cmdline.7.asc +@@ -973,7 +973,16 @@ 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 + ~~~~ +diff --git a/modules.d/95dasd/module-setup.sh b/modules.d/95dasd/module-setup.sh +index 180da140..825f95d8 100755 +--- a/modules.d/95dasd/module-setup.sh ++++ b/modules.d/95dasd/module-setup.sh +@@ -4,20 +4,18 @@ + check() { + local _arch=${DRACUT_ARCH:-$(uname -m)} + [ "$_arch" = "s390" -o "$_arch" = "s390x" ] || return 1 +- require_binaries normalize_dasd_arg || return 1 ++ require_binaries dasdconf.sh || return 1 + return 0 + } + + # called by dracut + depends() { +- echo "dasd_mod" + return 0 + } + + # called by dracut + install() { +- inst_hook cmdline 30 "$moddir/parse-dasd.sh" +- inst_multiple dasdinfo dasdconf.sh normalize_dasd_arg ++ inst_multiple dasdconf.sh + conf=/etc/dasd.conf + if [[ $hostonly && -f $conf ]]; then + inst -H $conf +diff --git a/modules.d/95dasd/parse-dasd.sh b/modules.d/95dasd/parse-dasd.sh +deleted file mode 100755 +index cda3970c..00000000 +--- a/modules.d/95dasd/parse-dasd.sh ++++ /dev/null +@@ -1,11 +0,0 @@ +-#!/bin/sh +-for dasd_arg in $(getargs rd.dasd= -d rd_DASD= DASD=); do +- ( +- local OLDIFS="$IFS" +- IFS="," +- # shellcheck disable=SC2086 +- set -- $dasd_arg +- IFS="$OLDIFS" +- echo "$@" | normalize_dasd_arg >> /etc/dasd.conf +- ) +-done +-- +2.42.0 + diff --git a/0013-feat-znet-use-zdev-for-consolidated-device-configura.patch b/0013-feat-znet-use-zdev-for-consolidated-device-configura.patch new file mode 100644 index 0000000..5181de5 --- /dev/null +++ b/0013-feat-znet-use-zdev-for-consolidated-device-configura.patch @@ -0,0 +1,149 @@ +From 86b6e2979999cf5ecce8c76c6230d1f085b3a333 Mon Sep 17 00:00:00 2001 +From: Steffen Maier +Date: Tue, 25 Jul 2023 19:43:05 +0200 +Subject: [PATCH 13/23] feat(znet): use zdev for consolidated device + configuration + +Remove any distribution-specifics from s390 channel-attached network device +configuration. + +Similar to 95qeth_rules, copy the existing persistent network configuration +into the initrd. This needs to go via chzdev import so chzdev updates (adds +to) the cio_ignore persistent config inside the initrd, because other +dracut modules such as zdev from s390-tools also import +persistent (non-network) config into initrd and the set union of devices +needs to end up in the cio_ignore persistent config inside the initrd. + +Additional debugging output can be generated with e.g. dracut option +"--stdlog 5" (or short -L5). It shows the chzdev export result, the output +of chzdev imports, and an overview of the resulting persistent config +within the initrd. Typically combined with "--debug" to get a shell trace +from building an initrd (Note: --debug does not increase the log levels). + +Note that nm-initrd-generator also parses rd.znet and rd.znet_ifname +to fill in s390 options of a NetworkManager connection definition. + +Signed-off-by: Steffen Maier +--- + modules.d/95znet/module-setup.sh | 37 +++++++++++++++++++++++-- + modules.d/95znet/parse-ccw.sh | 47 ++++++++++++++++++++++++++++++-- + 2 files changed, 78 insertions(+), 6 deletions(-) + +diff --git a/modules.d/95znet/module-setup.sh b/modules.d/95znet/module-setup.sh +index df37c660..95164bba 100755 +--- a/modules.d/95znet/module-setup.sh ++++ b/modules.d/95znet/module-setup.sh +@@ -5,7 +5,7 @@ check() { + arch=${DRACUT_ARCH:-$(uname -m)} + [ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1 + +- require_binaries znet_cio_free grep sed seq readlink || return 1 ++ require_binaries grep sed seq readlink chzdev || return 1 + + return 0 + } +@@ -24,6 +24,37 @@ installkernel() { + # called by dracut + install() { + inst_hook cmdline 30 "$moddir/parse-ccw.sh" +- inst_rules 81-ccw.rules +- inst_multiple znet_cio_free grep sed seq readlink /lib/udev/ccw_init ++ inst_multiple grep sed seq readlink chzdev ++ if [[ $hostonly ]]; then ++ local _tempfile ++ _tempfile=$(mktemp --tmpdir="${DRACUT_TMPDIR}" dracut-zdev.XXXXXX) ++ { ++ chzdev qeth --export - --configured --persistent --quiet --type ++ chzdev lcs --export - --configured --persistent --quiet --type ++ chzdev ctc --export - --configured --persistent --quiet --type ++ } 2> /dev/null > "$_tempfile" ++ ddebug < "$_tempfile" ++ chzdev --import "$_tempfile" --persistent --base "/etc=$initdir/etc" \ ++ --yes --no-root-update --force 2>&1 | ddebug ++ lszdev --configured --persistent --info \ ++ --base "/etc=$initdir/etc" 2>&1 | ddebug ++ rm -f "$_tempfile" ++ # these are purely generated udev rules so we have to glob expand ++ # within $initdir and strip the $initdir prefix for mark_hostonly ++ local -a _array ++ # shellcheck disable=SC2155 ++ local _nullglob=$(shopt -p nullglob) ++ shopt -u nullglob ++ # shellcheck disable=SC2086 ++ readarray -t _array < <( ++ ls -1 $initdir/etc/udev/rules.d/41-*.rules 2> /dev/null ++ ) ++ [[ ${#_array[@]} -gt 0 ]] && mark_hostonly "${_array[@]#$initdir}" ++ # shellcheck disable=SC2086 ++ readarray -t _array < <( ++ ls -1 $initdir/etc/modprobe.d/s390x-*.conf 2> /dev/null ++ ) ++ [[ ${#_array[@]} -gt 0 ]] && mark_hostonly "${_array[@]#$initdir}" ++ $_nullglob ++ fi + } +diff --git a/modules.d/95znet/parse-ccw.sh b/modules.d/95znet/parse-ccw.sh +index d8953605..aacc988e 100755 +--- a/modules.d/95znet/parse-ccw.sh ++++ b/modules.d/95znet/parse-ccw.sh +@@ -1,7 +1,50 @@ + #!/bin/bash + ++znet_base_args="--no-settle --yes --no-root-update --force" ++ ++# at this point in time dracut's vinfo() only logs to journal which is hard for ++# s390 users to find and access on a line mode console such as 3215 mode ++# so use a vinfo alternative that still prints to the console via kmsg ++znet_vinfo() { ++ while read -r _znet_vinfo_line || [ -n "$_znet_vinfo_line" ]; do ++ # Prefix "<30>" represents facility LOG_DAEMON 3 and loglevel INFO 6: ++ # (facility << 3) | level. ++ echo "<30>dracut: $_znet_vinfo_line" > /dev/kmsg ++ done ++} ++ + for ccw_arg in $(getargs rd.ccw -d 'rd_CCW=') $(getargs rd.znet -d 'rd_ZNET='); do +- echo "$ccw_arg" >> /etc/ccw.conf ++ ( ++ SAVED_IFS="$IFS" ++ IFS="," ++ # shellcheck disable=SC2086 ++ set -- $ccw_arg ++ IFS="$SAVED_IFS" ++ type="$1" ++ subchannel1="$2" ++ subchannel2="$3" ++ subchannel3="$4" ++ echo "rd.znet ${ccw_arg} :" | znet_vinfo ++ if [ "$#" -lt 3 ]; then ++ echo "rd.znet needs at least 3 list items: type,subchannel1,subchannel2" | znet_vinfo ++ fi ++ if [ "$1" = "qeth" ]; then ++ if [ "$#" -lt 4 ]; then ++ echo "rd.znet for type qeth needs at least 4 list items: qeth,subchannel1,subchannel2,subchannel3" | znet_vinfo ++ fi ++ subchannels="$subchannel1:$subchannel2:$subchannel3" ++ shift 4 ++ # shellcheck disable=SC2086 ++ chzdev --enable --persistent $znet_base_args \ ++ "$type" "$subchannels" "$@" 2>&1 | znet_vinfo ++ else ++ subchannels="$subchannel1:$subchannel2" ++ shift 3 ++ # shellcheck disable=SC2086 ++ chzdev --enable --persistent $znet_base_args \ ++ "$type" "$subchannels" "$@" 2>&1 | znet_vinfo ++ fi ++ ) + done + + for ifname in $(getargs rd.znet_ifname); do +@@ -21,5 +64,3 @@ for ifname in $(getargs rd.znet_ifname); do + } > /etc/udev/rules.d/81-ccw-ifname.rules + fi + done +- +-znet_cio_free +-- +2.42.0 + diff --git a/0014-docs-dracut.cmdline-generalize-description-of-rd.zne.patch b/0014-docs-dracut.cmdline-generalize-description-of-rd.zne.patch new file mode 100644 index 0000000..e92bccd --- /dev/null +++ b/0014-docs-dracut.cmdline-generalize-description-of-rd.zne.patch @@ -0,0 +1,36 @@ +From addb383b375fd0db07eacf8a9f5d9b4e23343855 Mon Sep 17 00:00:00 2001 +From: Steffen Maier +Date: Fri, 26 May 2023 19:25:41 +0200 +Subject: [PATCH 14/23] docs(dracut.cmdline): generalize description of rd.znet + +As of the preceding commit ("feat(znet): use zdev for consolidated device +configuration"), rd.znet is no longer specific to RHEL/Fedora. + +Signed-off-by: Steffen Maier +--- + man/dracut.cmdline.7.asc | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/man/dracut.cmdline.7.asc b/man/dracut.cmdline.7.asc +index c31dbfc6..e6b8d988 100644 +--- a/man/dracut.cmdline.7.asc ++++ b/man/dracut.cmdline.7.asc +@@ -1018,9 +1018,12 @@ rd.zfcp=0.0.4000 + ZNET + ~~~~ + **rd.znet=**____,____,____:: +- 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. ++ is one of: qeth, lcs, ctc. ++ is a comma-separated list of ccw device bus-IDs. ++ The list consists of 3 entries with nettype qeth, and 2 for other nettype. ++ is a comma-separated list of = pairs, ++ where refers to a device sysfs attribute to which gets written. + rd.znet can be specified multiple times on the kernel command line. + + **rd.znet_ifname=**____:____:: +-- +2.42.0 + diff --git a/0015-feat-qeth_rules-remove-qeth-handling-consolidated-in.patch b/0015-feat-qeth_rules-remove-qeth-handling-consolidated-in.patch new file mode 100644 index 0000000..827881a --- /dev/null +++ b/0015-feat-qeth_rules-remove-qeth-handling-consolidated-in.patch @@ -0,0 +1,90 @@ +From 7ad6fef8fe110093939c422b5c3b381ebe47e4e9 Mon Sep 17 00:00:00 2001 +From: Steffen Maier +Date: Fri, 26 May 2023 19:51:09 +0200 +Subject: [PATCH 15/23] feat(qeth_rules): remove qeth handling consolidated in + 95znet + +Dracut module 95znet handles a superset of qeth_rules as of the preceding +commit ("feat(znet): use zdev for consolidated device configuration"). + +The instmods list in installkernel() seemed to have been incomplete because +qeth needs one or both of qeth_l2 and qeth_l3 but qeth intentionally does +not depend on them so depmod cannot resolve that. + +In contrast to the old dracut module 95znet, 95qeth_rules also did not seem +to have parsing for the upstream dracut cmdline options "rd.znet=" and +"rd.znet_ifname=". + +Signed-off-by: Steffen Maier +--- + modules.d/95qeth_rules/module-setup.sh | 58 -------------------------- + 1 file changed, 58 deletions(-) + delete mode 100755 modules.d/95qeth_rules/module-setup.sh + +diff --git a/modules.d/95qeth_rules/module-setup.sh b/modules.d/95qeth_rules/module-setup.sh +deleted file mode 100755 +index a84ac151..00000000 +--- a/modules.d/95qeth_rules/module-setup.sh ++++ /dev/null +@@ -1,58 +0,0 @@ +-#!/bin/bash +- +-# called by dracut +-check() { +- local _arch=${DRACUT_ARCH:-$(uname -m)} +- local _online=0 +- [ "$_arch" = "s390" -o "$_arch" = "s390x" ] || return 1 +- dracut_module_included network || return 1 +- +- [[ $hostonly ]] && { +- for i in /sys/devices/qeth/*/online; do +- [ ! -f "$i" ] && continue +- read -r _online < "$i" +- [ "$_online" -eq 1 ] && return 0 +- done +- } +- return 255 +-} +- +-# called by dracut +-installkernel() { +- instmods qeth +-} +- +-# called by dracut +-install() { +- ccwid() { +- qeth_path=$(readlink -e -q "$1"/device) +- basename "$qeth_path" +- } +- +- inst_rules_qeth() { +- for rule in /etc/udev/rules.d/{4,5}1-qeth-${1}.rules; do +- # prefer chzdev generated 41- rules +- if [ -f "$rule" ]; then +- inst_rules "$rule" +- break +- fi +- done +- } +- +- has_carrier() { +- carrier=0 +- # not readable in qeth interfaces +- # that have just been assembled, ignore +- # read error and assume no carrier +- read -r carrier 2> /dev/null < "$1/carrier" +- [ "$carrier" -eq 1 ] && return 0 +- return 1 +- } +- +- for dev in /sys/class/net/*; do +- has_carrier "$dev" || continue +- id=$(ccwid "$dev") +- [ -n "$id" ] && inst_rules_qeth "$id" +- done +- +-} +-- +2.42.0 + diff --git a/0016-fix-znet-append-to-udev-rules-so-each-rd.znet_ifname.patch b/0016-fix-znet-append-to-udev-rules-so-each-rd.znet_ifname.patch new file mode 100644 index 0000000..a4055fb --- /dev/null +++ b/0016-fix-znet-append-to-udev-rules-so-each-rd.znet_ifname.patch @@ -0,0 +1,44 @@ +From cbc5eece88b8f6d0e69fdfbb8f34eabb45425c86 Mon Sep 17 00:00:00 2001 +From: Steffen Maier +Date: Fri, 26 May 2023 19:47:35 +0200 +Subject: [PATCH 16/23] fix(znet): append to udev rules so each rd.znet_ifname + is effective + +Otherwise the last rd.znet_ifname statement overwrites the persistent +network interface settings of previous such statements. + +Signed-off-by: Steffen Maier +--- + modules.d/95znet/parse-ccw.sh | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +diff --git a/modules.d/95znet/parse-ccw.sh b/modules.d/95znet/parse-ccw.sh +index aacc988e..ccf05bc6 100755 +--- a/modules.d/95znet/parse-ccw.sh ++++ b/modules.d/95znet/parse-ccw.sh +@@ -53,14 +53,16 @@ for ifname in $(getargs rd.znet_ifname); do + warn "Invalid arguments for rd.znet_ifname=" + else + { +- ifname_subchannels=${ifname_subchannels//,/|} ++ ifname_subchannels="${ifname_subchannels//,/|}" ++ # sanitize for use in udev label: replace non-word characters by _ ++ ifname_if_label="${ifname_if//[^[:word:]]/_}" + +- echo 'ACTION!="add|change", GOTO="ccw_ifname_end"' +- echo 'ATTR{type}!="1", GOTO="ccw_ifname_end"' +- echo 'SUBSYSTEM!="net", GOTO="ccw_ifname_end"' ++ echo "ACTION!=\"add|change\", GOTO=\"ccw_ifname_${ifname_if_label}_end\"" ++ echo "ATTR{type}!=\"1\", GOTO=\"ccw_ifname_${ifname_if_label}_end\"" ++ echo "SUBSYSTEM!=\"net\", GOTO=\"ccw_ifname_${ifname_if_label}_end\"" + echo "SUBSYSTEMS==\"ccwgroup\", KERNELS==\"$ifname_subchannels\", DRIVERS==\"?*\" NAME=\"$ifname_if\"" +- echo 'LABEL="ccw_ifname_end"' ++ echo "LABEL=\"ccw_ifname_${ifname_if_label}_end\"" + +- } > /etc/udev/rules.d/81-ccw-ifname.rules ++ } >> /etc/udev/rules.d/81-ccw-ifname.rules + fi + done +-- +2.42.0 + diff --git a/0017-refactor-ifcfg-delete-code-duplication-using-iface_g.patch b/0017-refactor-ifcfg-delete-code-duplication-using-iface_g.patch new file mode 100644 index 0000000..7bdb334 --- /dev/null +++ b/0017-refactor-ifcfg-delete-code-duplication-using-iface_g.patch @@ -0,0 +1,40 @@ +From b6913f66b6c9e9ea81fd0832405c170876bc993a Mon Sep 17 00:00:00 2001 +From: Steffen Maier +Date: Wed, 26 Jul 2023 12:42:03 +0200 +Subject: [PATCH 17/23] refactor(ifcfg): delete code duplication using + iface_get_subchannels() + +Signed-off-by: Steffen Maier +--- + modules.d/45ifcfg/write-ifcfg.sh | 10 ++-------- + 1 file changed, 2 insertions(+), 8 deletions(-) + +diff --git a/modules.d/45ifcfg/write-ifcfg.sh b/modules.d/45ifcfg/write-ifcfg.sh +index 5550cce3..4ca96e98 100755 +--- a/modules.d/45ifcfg/write-ifcfg.sh ++++ b/modules.d/45ifcfg/write-ifcfg.sh +@@ -31,19 +31,13 @@ print_s390() { + 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%,} +-- +2.42.0 + diff --git a/0018-feat-ifcfg-minimize-s390-specific-network-configurat.patch b/0018-feat-ifcfg-minimize-s390-specific-network-configurat.patch new file mode 100644 index 0000000..2a88e6a --- /dev/null +++ b/0018-feat-ifcfg-minimize-s390-specific-network-configurat.patch @@ -0,0 +1,95 @@ +From 110fec3e41faf47277447f1c56635c5a876c1f96 Mon Sep 17 00:00:00 2001 +From: Steffen Maier +Date: Wed, 26 Jul 2023 12:59:19 +0200 +Subject: [PATCH 18/23] feat(ifcfg): minimize s390-specific network + configuration aspects + +Since consolidated s390 network device configuration with zdev is used, +it takes care of all s390-specific settings. +None of the s390-specific ifcfg variables should be used anymore. +NETTYPE and OPTIONS can be removed entirely. +SUBCHANNELS is kept because there are some dependency chains +(probably around the interface identifiying key, which is not HWADDR): + +modules.d/35network-legacy/module-setup.sh +parses (sources) each of /etc/sysconfig/network-scripts/ifcfg-* +and if that contains SUBCHANNELS, creates a symlink from the ifcfg file to +/etc/sysconfig/network-scripts/ccw-${SUBCHANNELS}.conf + +modules.d/35network-legacy/ifup.sh installed as /sbin/ifup +checks during team setup if a slave interface is an s390 channel-attached +network interface and then parses (sources) +/etc/sysconfig/network-scripts/ccw-${SUBCHANNELS}.conf +from above, if that file exists + +Signed-off-by: Steffen Maier +--- + modules.d/45ifcfg/write-ifcfg.sh | 41 -------------------------------- + 1 file changed, 41 deletions(-) + +diff --git a/modules.d/45ifcfg/write-ifcfg.sh b/modules.d/45ifcfg/write-ifcfg.sh +index 4ca96e98..a7804b50 100755 +--- a/modules.d/45ifcfg/write-ifcfg.sh ++++ b/modules.d/45ifcfg/write-ifcfg.sh +@@ -10,28 +10,10 @@ 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 OLD_IFS + + _netif="$1" + # if we find ccw channel, then use those, instead of +@@ -43,29 +25,6 @@ print_s390() { + 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 + } + +-- +2.42.0 + diff --git a/0019-fix-dracut-move-hooks-directory-from-usr-lib-to-var-.patch b/0019-fix-dracut-move-hooks-directory-from-usr-lib-to-var-.patch new file mode 100644 index 0000000..b0a1efb --- /dev/null +++ b/0019-fix-dracut-move-hooks-directory-from-usr-lib-to-var-.patch @@ -0,0 +1,87 @@ +From 55a56c546bde71fb42c99aadd96e98fca2199823 Mon Sep 17 00:00:00 2001 +From: Laszlo Gombos +Date: Fri, 5 Apr 2024 15:50:20 +0200 +Subject: [PATCH 19/23] fix(dracut): move hooks directory from /usr/lib to + /var/lib + +Since https://github.com/systemd/systemd/commit/ffc1ec73, /usr is mounted as +read-only in the initramfs by default. + +Fixes #2588 + +Co-authored-by: Antonio Alvarez Feijoo +--- + dracut-init.sh | 2 +- + dracut.sh | 6 +++++- + modules.d/99base/module-setup.sh | 5 ++++- + modules.d/99shutdown/module-setup.sh | 8 +++++--- + 4 files changed, 15 insertions(+), 6 deletions(-) + +diff --git a/dracut-init.sh b/dracut-init.sh +index c37038e3..1c7ca58a 100755 +--- a/dracut-init.sh ++++ b/dracut-init.sh +@@ -630,7 +630,7 @@ inst_hook() { + dfatal "No such hook type $1. Aborting initrd creation." + exit 1 + fi +- hook="/lib/dracut/hooks/${1}/${2}-${3##*/}" ++ hook="/var/lib/dracut/hooks/${1}/${2}-${3##*/}" + inst_simple "$3" "$hook" + chmod u+x "$initdir/$hook" + } +diff --git a/dracut.sh b/dracut.sh +index a0af3dd2..5d43f44c 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1883,7 +1883,11 @@ mkdir -p "${initdir}"/lib/dracut + + if [[ $kernel_only != yes ]]; then + mkdir -p "${initdir}/etc/cmdline.d" +- mkdir -m 0755 "${initdir}"/lib/dracut/hooks ++ mkdir -m 0755 -p "${initdir}"/var/lib/dracut/hooks ++ ++ # symlink to old hooks location for compatibility ++ ln_r /var/lib/dracut/hooks /lib/dracut/hooks ++ + for _d in $hookdirs; do + # shellcheck disable=SC2174 + mkdir -m 0755 -p "${initdir}/lib/dracut/hooks/$_d" +diff --git a/modules.d/99base/module-setup.sh b/modules.d/99base/module-setup.sh +index 54b0deb9..bfdc51d4 100755 +--- a/modules.d/99base/module-setup.sh ++++ b/modules.d/99base/module-setup.sh +@@ -45,7 +45,10 @@ install() { + + [ -e "${initdir}/lib" ] || mkdir -m 0755 -p "${initdir}"/lib + mkdir -m 0755 -p "${initdir}"/lib/dracut +- mkdir -m 0755 -p "${initdir}"/lib/dracut/hooks ++ mkdir -m 0755 -p "${initdir}"/var/lib/dracut/hooks ++ ++ # symlink to old hooks location for compatibility ++ ln_r /var/lib/dracut/hooks /lib/dracut/hooks + + mkdir -p "${initdir}"/tmp + +diff --git a/modules.d/99shutdown/module-setup.sh b/modules.d/99shutdown/module-setup.sh +index 2b999024..f53017ff 100755 +--- a/modules.d/99shutdown/module-setup.sh ++++ b/modules.d/99shutdown/module-setup.sh +@@ -17,9 +17,11 @@ install() { + inst_multiple umount poweroff reboot halt losetup stat sleep timeout + inst_multiple -o kexec + inst "$moddir/shutdown.sh" "$prefix/shutdown" +- [ -e "${initdir}/lib" ] || mkdir -m 0755 -p "${initdir}"/lib +- mkdir -m 0755 -p "${initdir}"/lib/dracut +- mkdir -m 0755 -p "${initdir}"/lib/dracut/hooks ++ mkdir -m 0755 -p "${initdir}"/var/lib/dracut/hooks ++ ++ # symlink to old hooks location for compatibility ++ ln_r /var/lib/dracut/hooks /lib/dracut/hooks ++ + for _d in $hookdirs shutdown shutdown-emergency; do + mkdir -m 0755 -p "${initdir}"/lib/dracut/hooks/"$_d" + done +-- +2.42.0 + diff --git a/0020-fix-systemd-explicitly-install-some-libs-that-will-n.patch b/0020-fix-systemd-explicitly-install-some-libs-that-will-n.patch new file mode 100644 index 0000000..0d662cd --- /dev/null +++ b/0020-fix-systemd-explicitly-install-some-libs-that-will-n.patch @@ -0,0 +1,72 @@ +From bad2bc80cdcfac8915374497cc47ce9d5670d015 Mon Sep 17 00:00:00 2001 +From: Antonio Alvarez Feijoo +Date: Thu, 4 Apr 2024 13:49:26 +0200 +Subject: [PATCH 20/23] fix(systemd): explicitly install some libs that will + not be statically included + +Some required libraries that used to be statically included are in the process +to be opened via `dlopen()`. + +References: +- https://github.com/systemd/systemd/pull/31131 +- https://github.com/systemd/systemd/pull/31550 +- https://github.com/systemd/systemd/pull/32019 + +Closes #2642 +--- + modules.d/00systemd/module-setup.sh | 2 ++ + modules.d/01systemd-coredump/module-setup.sh | 7 +++++++ + modules.d/01systemd-journald/module-setup.sh | 5 +++-- + 3 files changed, 12 insertions(+), 2 deletions(-) + +diff --git a/modules.d/00systemd/module-setup.sh b/modules.d/00systemd/module-setup.sh +index 66e08ea6..72341746 100755 +--- a/modules.d/00systemd/module-setup.sh ++++ b/modules.d/00systemd/module-setup.sh +@@ -260,6 +260,8 @@ EOF + # Install library file(s) + _arch=${DRACUT_ARCH:-$(uname -m)} + inst_libdir_file \ ++ {"tls/$_arch/",tls/,"$_arch/",}"libgcrypt.so*" \ ++ {"tls/$_arch/",tls/,"$_arch/",}"libkmod.so*" \ + {"tls/$_arch/",tls/,"$_arch/",}"libnss_*" + + } +diff --git a/modules.d/01systemd-coredump/module-setup.sh b/modules.d/01systemd-coredump/module-setup.sh +index 69ec9668..47666b6c 100755 +--- a/modules.d/01systemd-coredump/module-setup.sh ++++ b/modules.d/01systemd-coredump/module-setup.sh +@@ -40,6 +40,13 @@ install() { + "$sysusers"/systemd-coredump.conf \ + coredumpctl + ++ # Install library file(s) ++ _arch=${DRACUT_ARCH:-$(uname -m)} ++ inst_libdir_file \ ++ {"tls/$_arch/",tls/,"$_arch/",}"liblz4.so.*" \ ++ {"tls/$_arch/",tls/,"$_arch/",}"liblzma.so.*" \ ++ {"tls/$_arch/",tls/,"$_arch/",}"libzstd.so.*" ++ + # Install the hosts local user configurations if enabled. + if [[ $hostonly ]]; then + inst_multiple -H -o \ +diff --git a/modules.d/01systemd-journald/module-setup.sh b/modules.d/01systemd-journald/module-setup.sh +index 3cf2a1a1..276e7528 100755 +--- a/modules.d/01systemd-journald/module-setup.sh ++++ b/modules.d/01systemd-journald/module-setup.sh +@@ -53,9 +53,10 @@ install() { + # Install library file(s) + _arch=${DRACUT_ARCH:-$(uname -m)} + inst_libdir_file \ ++ {"tls/$_arch/",tls/,"$_arch/",}"libgcrypt.so*" \ + {"tls/$_arch/",tls/,"$_arch/",}"liblz4.so.*" \ +- {"tls/$_arch/",tls/,"$_arch/",}"libzstd.so.*" \ +- {"tls/$_arch/",tls/,"$_arch/",}"liblzma.so.*" ++ {"tls/$_arch/",tls/,"$_arch/",}"liblzma.so.*" \ ++ {"tls/$_arch/",tls/,"$_arch/",}"libzstd.so.*" + + # Install the hosts local user configurations if enabled. + if [[ $hostonly ]]; then +-- +2.42.0 + diff --git a/0021-fix-nvmf-move-etc-nvme-host-nqn-id-requirement-to-ho.patch b/0021-fix-nvmf-move-etc-nvme-host-nqn-id-requirement-to-ho.patch new file mode 100644 index 0000000..d097ade --- /dev/null +++ b/0021-fix-nvmf-move-etc-nvme-host-nqn-id-requirement-to-ho.patch @@ -0,0 +1,54 @@ +From 10b86edba3ffe0ce13c5f43ff0193cdf04661358 Mon Sep 17 00:00:00 2001 +From: Tomas Bzatek +Date: Thu, 21 Sep 2023 14:31:07 +0200 +Subject: [PATCH 21/23] fix(nvmf): move /etc/nvme/host{nqn,id} requirement to + hostonly + +When creating initramfs for universal boot image such as an installer, +we can't include any machine-specific IDs. Let's move the check +for /etc/nvme/hostnqn and /etc/nvme/hostid files presence to +the hostonly section to avoid unsatisfied requirements. + +Signed-off-by: Tomas Bzatek + +Resolves: #2266331 +--- + modules.d/95nvmf/module-setup.sh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/modules.d/95nvmf/module-setup.sh b/modules.d/95nvmf/module-setup.sh +index a8f30341..6a1e3f5b 100755 +--- a/modules.d/95nvmf/module-setup.sh ++++ b/modules.d/95nvmf/module-setup.sh +@@ -3,8 +3,6 @@ + # called by dracut + check() { + require_binaries nvme jq || return 1 +- [ -f /etc/nvme/hostnqn ] || return 255 +- [ -f /etc/nvme/hostid ] || return 255 + + is_nvmf() { + local _dev=$1 +@@ -36,6 +34,8 @@ check() { + } + + [[ $hostonly ]] || [[ $mount_needs ]] && { ++ [ -f /etc/nvme/hostnqn ] || return 255 ++ [ -f /etc/nvme/hostid ] || return 255 + pushd . > /dev/null + for_each_host_dev_and_slaves is_nvmf + local _is_nvmf=$? +@@ -130,8 +130,8 @@ install() { + _nvmf_args=$(cmdline) + [[ "$_nvmf_args" ]] && printf "%s" "$_nvmf_args" >> "${initdir}/etc/cmdline.d/95nvmf-args.conf" + fi +- inst_simple "/etc/nvme/hostnqn" +- inst_simple "/etc/nvme/hostid" ++ inst_simple -H "/etc/nvme/hostnqn" ++ inst_simple -H "/etc/nvme/hostid" + + inst_multiple ip sed + +-- +2.42.0 + diff --git a/0022-feat-hwdb-add-hwdb-module-to-install-hwdb.bin-on-dem.patch b/0022-feat-hwdb-add-hwdb-module-to-install-hwdb.bin-on-dem.patch new file mode 100644 index 0000000..1971943 --- /dev/null +++ b/0022-feat-hwdb-add-hwdb-module-to-install-hwdb.bin-on-dem.patch @@ -0,0 +1,54 @@ +From 0b65ac224d831cc96da940cce510523c7276a5ec Mon Sep 17 00:00:00 2001 +From: Pavel Valena +Date: Tue, 25 Apr 2023 14:56:59 +0200 +Subject: [PATCH 22/23] feat(hwdb): add hwdb module to install hwdb.bin on + demand + +Module to install hwdb.bin. Further extensions might make only selected +part of hwdb installable to save space. The module is not included by default. + +Including the module adds 2MB of compressed data (on Fedora, the file has 12MB). + +Installing hwdb.bin is needed in case of custom HW like a keyboard/mouse, or various interfaces. + +Original PR: https://github.com/dracutdevs/dracut/pull/1681 +--- + modules.d/95hwdb/module-setup.sh | 26 ++++++++++++++++++++++++++ + 1 file changed, 26 insertions(+) + create mode 100755 modules.d/95hwdb/module-setup.sh + +diff --git a/modules.d/95hwdb/module-setup.sh b/modules.d/95hwdb/module-setup.sh +new file mode 100755 +index 00000000..5d3250f3 +--- /dev/null ++++ b/modules.d/95hwdb/module-setup.sh +@@ -0,0 +1,26 @@ ++#!/bin/bash ++# This file is part of dracut. ++# SPDX-License-Identifier: GPL-2.0-or-later ++ ++check() { ++ return 255 ++} ++ ++# called by dracut ++install() { ++ local hwdb_bin ++ ++ # Follow the same priority as `systemd-hwdb`; `/etc` is the default ++ # and `/usr/lib` an alternative location. ++ hwdb_bin="${udevconfdir}"/hwdb.bin ++ ++ if [[ ! -r ${hwdb_bin} ]]; then ++ hwdb_bin="${udevdir}"/hwdb.bin ++ fi ++ ++ if [[ $hostonly ]]; then ++ inst_multiple -H "${hwdb_bin}" ++ else ++ inst_multiple "${hwdb_bin}" ++ fi ++} +-- +2.42.0 + diff --git a/0023-fix-rngd-install-system-service-file.patch b/0023-fix-rngd-install-system-service-file.patch new file mode 100644 index 0000000..affedec --- /dev/null +++ b/0023-fix-rngd-install-system-service-file.patch @@ -0,0 +1,59 @@ +From 9df3cb58a19f38157a615c311356cfd6ae55d2d7 Mon Sep 17 00:00:00 2001 +From: Pavel Valena +Date: Sun, 23 Jul 2023 19:44:17 +0200 +Subject: [PATCH 23/23] fix(rngd): install system service file + +as there's no reason to keep a copy; there shouldn't be any modifications. + +In case there are args stored in a separate file (Fedora and alike), +it needs to be supplied too, but without the option to change the user. +--- + modules.d/06rngd/module-setup.sh | 7 ++++++- + modules.d/06rngd/rngd.service | 8 -------- + modules.d/06rngd/sysconfig | 1 + + 3 files changed, 7 insertions(+), 9 deletions(-) + delete mode 100644 modules.d/06rngd/rngd.service + create mode 100644 modules.d/06rngd/sysconfig + +diff --git a/modules.d/06rngd/module-setup.sh b/modules.d/06rngd/module-setup.sh +index aec8d576..e8bdf7f5 100755 +--- a/modules.d/06rngd/module-setup.sh ++++ b/modules.d/06rngd/module-setup.sh +@@ -32,7 +32,12 @@ depends() { + + install() { + inst rngd +- inst_simple "${moddir}/rngd.service" "${systemdsystemunitdir}/rngd.service" ++ inst_simple "${systemdsystemunitdir}/rngd.service" ++ ++ if [ -r /etc/sysconfig/rngd ]; then ++ inst_simple "${moddir}/sysconfig" "/etc/sysconfig/rngd" ++ fi ++ + # make sure dependent libs are installed too + inst_libdir_file opensc-pkcs11.so + +diff --git a/modules.d/06rngd/rngd.service b/modules.d/06rngd/rngd.service +deleted file mode 100644 +index dd5374d7..00000000 +--- a/modules.d/06rngd/rngd.service ++++ /dev/null +@@ -1,8 +0,0 @@ +-[Unit] +-Description=Hardware RNG Entropy Gatherer Daemon +-DefaultDependencies=no +-Before=systemd-udevd.service +-ConditionVirtualization=!container +- +-[Service] +-ExecStart=/usr/sbin/rngd -f +diff --git a/modules.d/06rngd/sysconfig b/modules.d/06rngd/sysconfig +new file mode 100644 +index 00000000..68047ec1 +--- /dev/null ++++ b/modules.d/06rngd/sysconfig +@@ -0,0 +1 @@ ++RNGD_ARGS="-x pkcs11 -x nist" +-- +2.42.0 + diff --git a/dracut.spec b/dracut.spec index 3743d94..1756b4c 100644 --- a/dracut.spec +++ b/dracut.spec @@ -7,8 +7,8 @@ %global __requires_exclude pkg-config Name: dracut -Version: 060 -Release: 2%{?dist} +Version: 101 +Release: 1%{?dist} Summary: Initramfs generator using udev @@ -17,58 +17,80 @@ Summary: Initramfs generator using udev # except util/* which is GPLv2 License: GPL-2.0-or-later AND LGPL-2.1-or-later AND GPL-2.0-only -URL: https://github.com/dracutdevs/dracut/wiki/ +URL: https://github.com/dracut-ng/dracut-ng/wiki/ -# Currently upstream does not create releases, therefore -# source is created from commit 856e7acdb1462803c2517c8d64afb2e34c73c735 -# Reference PR: https://github.com/dracutdevs/dracut/pull/2509 -# Unpacked archive: https://github.com/pvalena/dracut-fedora/tree/v60-srpm-unpacked -Source0: dracut-%{version}.tar.xz -#Source0: https://github.com/dracutdevs/dracut/archive/refs/tags/%%{version}.tar.gz +Source0: https://github.com/dracut-ng/dracut-ng/archive/refs/tags/%{version}.tar.gz Source1: https://www.gnu.org/licenses/lgpl-2.1.txt # feat(kernel-install): do nothing when $KERNEL_INSTALL_INITRD_GENERATOR says so # Author: Zbigniew Jędrzejewski-Szmek Patch1: 0001-feat-kernel-install-do-nothing-when-KERNEL_INSTALL_I.patch -# fix(systemd-pcrphase): rename systemd-pcrphase binary to systemd-pcrextend -# Author: Antonio Alvarez Feijoo -Patch2: 0002-fix-systemd-pcrphase-rename-systemd-pcrphase-binary-.patch -# fix(resume): add new systemd-hibernate-resume.service -# Author: Antonio Alvarez Feijoo -Patch3: 0003-fix-resume-add-new-systemd-hibernate-resume.service.patch -# fix: wait 12 hours before halt on media check fail -# Author: Adam Williamson -Patch4: 0004-fix-wait-12-hours-before-halt-on-media-check-fail.patch -# feat(network): include 98-default-mac-none.link if it exists -# Author: Dusty Mabe -Patch5: 0005-feat-network-include-98-default-mac-none.link-if-it-.patch -# feat(kernel-modules): add Qualcomm IPC router to enable USB -# Author: Jeremy Linton -Patch6: 0006-feat-kernel-modules-add-Qualcomm-IPC-router-to-enabl.patch # fix(kernel-install): do not generate an initrd when one was specified # Author: Zbigniew Jędrzejewski-Szmek -Patch7: 0007-fix-kernel-install-do-not-generate-an-initrd-when-on.patch -# fix(pkcs11): delete trailing dot on libcryptsetup-token-systemd-pkcs11.so -# Author: innovara -Patch8: 0008-fix-pkcs11-delete-trailing-dot-on-libcryptsetup-toke.patch -# fix(pcsc): add --disable-polkit to pcscd.service -# Author: Manuel Fombuena -Patch9: 0009-fix-pcsc-add-disable-polkit-to-pcscd.service.patch -# fix(pcsc): add opensc load module file -# Author: Manuel Fombuena -Patch10: 0010-fix-pcsc-add-opensc-load-module-file.patch - -# Not done with source-git, sorry, sometimes provenpackagers need to do stuff -# fix(systemd): explicitly install some libs that will not be statically included -# Author: Antonio Alvarez Feijoo -# https://github.com/dracut-ng/dracut-ng/commit/04b362d713235459cff1f370efb4cd5e36e4a358 -# Needed for system to boot with systemd 256 -# https://github.com/systemd/systemd/issues/32508 -Patch100: 0001-fix-systemd-explicitly-install-some-libs-that-will-n.patch +Patch2: 0002-fix-kernel-install-do-not-generate-an-initrd-when-on.patch +# refactor(cms): use zdev to simplify handling CMSDASD=... boot option +# Author: Steffen Maier +Patch3: 0003-refactor-cms-use-zdev-to-simplify-handling-CMSDASD-..patch +# refactor(cms): use consolidated zfcp config with zdev from s390-tools +# Author: Steffen Maier +Patch4: 0004-refactor-cms-use-consolidated-zfcp-config-with-zdev-.patch +# refactor(cms): use consolidated dasd config with zdev from s390-tools +# Author: Steffen Maier +Patch5: 0005-refactor-cms-use-consolidated-dasd-config-with-zdev-.patch +# refactor(cms): use consolidated network config with zdev from s390-tools +# Author: Steffen Maier +Patch6: 0006-refactor-cms-use-consolidated-network-config-with-zd.patch +# refactor(cms): remove now unnecessary inclusion of full s390utils-base +# Author: Steffen Maier +Patch7: 0007-refactor-cms-remove-now-unnecessary-inclusion-of-ful.patch +# feat(zfcp_rules): remove zfcp handling consolidated in s390-tools +# Author: Steffen Maier +Patch8: 0008-feat-zfcp_rules-remove-zfcp-handling-consolidated-in.patch +# feat(zfcp): minimize zfcp handling consolidated in s390-tools +# Author: Steffen Maier +Patch9: 0009-feat-zfcp-minimize-zfcp-handling-consolidated-in-s39.patch +# feat(dasd_rules): remove dasd handling consolidated in s390-tools +# Author: Steffen Maier +Patch10: 0010-feat-dasd_rules-remove-dasd-handling-consolidated-in.patch +# feat(dasd_mod): minimize dasd handling consolidated in s390-tools +# Author: Steffen Maier +Patch11: 0011-feat-dasd_mod-minimize-dasd-handling-consolidated-in.patch +# feat(dasd): minimize dasd handling consolidated in s390-tools +# Author: Steffen Maier +Patch12: 0012-feat-dasd-minimize-dasd-handling-consolidated-in-s39.patch +# feat(znet): use zdev for consolidated device configuration +# Author: Steffen Maier +Patch13: 0013-feat-znet-use-zdev-for-consolidated-device-configura.patch +# docs(dracut.cmdline): generalize description of rd.znet +# Author: Steffen Maier +Patch14: 0014-docs-dracut.cmdline-generalize-description-of-rd.zne.patch +# feat(qeth_rules): remove qeth handling consolidated in 95znet +# Author: Steffen Maier +Patch15: 0015-feat-qeth_rules-remove-qeth-handling-consolidated-in.patch +# fix(znet): append to udev rules so each rd.znet_ifname is effective +# Author: Steffen Maier +Patch16: 0016-fix-znet-append-to-udev-rules-so-each-rd.znet_ifname.patch +# refactor(ifcfg): delete code duplication using iface_get_subchannels() +# Author: Steffen Maier +Patch17: 0017-refactor-ifcfg-delete-code-duplication-using-iface_g.patch +# feat(ifcfg): minimize s390-specific network configuration aspects +# Author: Steffen Maier +Patch18: 0018-feat-ifcfg-minimize-s390-specific-network-configurat.patch # fix(dracut): move hooks directory from /usr/lib to /var/lib # Author: Laszlo Gombos -# Co-authored-by: Antonio Alvarez Feijoo -Patch101: 0001-fix-dracut-move-hooks-directory-from-usr-lib-to-var-.patch +Patch19: 0019-fix-dracut-move-hooks-directory-from-usr-lib-to-var-.patch +# fix(systemd): explicitly install some libs that will not be statically included +# Author: Antonio Alvarez Feijoo +Patch20: 0020-fix-systemd-explicitly-install-some-libs-that-will-n.patch +# fix(nvmf): move /etc/nvme/host{nqn,id} requirement to hostonly +# Author: Tomas Bzatek +Patch21: 0021-fix-nvmf-move-etc-nvme-host-nqn-id-requirement-to-ho.patch +# feat(hwdb): add hwdb module to install hwdb.bin on demand +# Author: Pavel Valena +Patch22: 0022-feat-hwdb-add-hwdb-module-to-install-hwdb.bin-on-dem.patch +# fix(rngd): install system service file +# Author: Pavel Valena +Patch23: 0023-fix-rngd-install-system-service-file.patch # Please use source-git to work with this spec file: # HowTo: https://packit.dev/source-git/work-with-source-git @@ -198,7 +220,7 @@ in a squashfs image, result in a smaller initramfs size and reduce runtime memor usage. %prep -%autosetup -n %{name}-%{version} -S git_am +%autosetup -n %{name}-ng-%{version} -S git_am cp %{SOURCE1} . %build @@ -234,11 +256,8 @@ rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/81cio_ignore rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/91zipl rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95dasd rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95dasd_mod -rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95dasd_rules rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95dcssblk -rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95qeth_rules rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95zfcp -rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95zfcp_rules rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95znet %else rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00warpclock @@ -335,6 +354,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{dracutlibdir}/modules.d/09dbus %{dracutlibdir}/modules.d/10i18n %{dracutlibdir}/modules.d/30convertfs +%{dracutlibdir}/modules.d/45net-lib %{dracutlibdir}/modules.d/45url-lib %{dracutlibdir}/modules.d/50drm %{dracutlibdir}/modules.d/50plymouth @@ -365,6 +385,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{dracutlibdir}/modules.d/91tpm2-tss %{dracutlibdir}/modules.d/95debug %{dracutlibdir}/modules.d/95fstab-sys +%{dracutlibdir}/modules.d/95hwdb %{dracutlibdir}/modules.d/95lunmask %{dracutlibdir}/modules.d/95resume %{dracutlibdir}/modules.d/95rootfs-block @@ -378,11 +399,8 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{dracutlibdir}/modules.d/91zipl %{dracutlibdir}/modules.d/95dasd %{dracutlibdir}/modules.d/95dasd_mod -%{dracutlibdir}/modules.d/95dasd_rules %{dracutlibdir}/modules.d/95dcssblk -%{dracutlibdir}/modules.d/95qeth_rules %{dracutlibdir}/modules.d/95zfcp -%{dracutlibdir}/modules.d/95zfcp_rules %endif %{dracutlibdir}/modules.d/96securityfs %{dracutlibdir}/modules.d/97masterkey @@ -473,6 +491,9 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{_prefix}/lib/kernel/install.d/51-dracut-rescue.install %changelog +* Thu May 16 2024 Pavel Valena - 101-1 +- Update to dracut 101. + * Fri Apr 26 2024 Adam Williamson - 060-2 - Backport fix to pull in required libs for systemd (dracut-ng PR #118) - Backport fix to move hook directory for systemd (dracut-ng PR #194) diff --git a/sources b/sources index bab943b..975c2f3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (dracut-060.tar.xz) = eca5b779307a86f1072201f576ebdd2187d0ae3603dfe009acb9ff6fff81f028c9b5b3d2fa70c723d138e00d40b1c0f97a8ae6cd1fcbeefc898d692c54db33e3 +SHA512 (101.tar.gz) = 827f073b749a374b703f317ba249479312043ed54af82609ce45332c27349870a68a1d9883118e0a3ecd1cbb33d64aca8bcf6aac56eb75f721fd3380bd12005b diff --git a/tests/add-luks-keys/Makefile b/tests/add-luks-keys/Makefile deleted file mode 100644 index 17a923a..0000000 --- a/tests/add-luks-keys/Makefile +++ /dev/null @@ -1,52 +0,0 @@ -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Makefile of /dracut/add-luks-keys -# Description: Create and add a luks key to all luks devices to allow booting of a system without entering a passphrase -# Author: Jan Stodola -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2016 Red Hat, Inc. All rights reserved. -# Red Hat Internal -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -export TEST=/dracut/add-luks-keys -export TESTVERSION=1.0 -export DESCRIPTION="Create and add a luks key to all luks devices to allow booting of a system without entering a passphrase" - -BUILT_FILES= - -FILES=$(METADATA) runtest.sh Makefile PURPOSE - -.PHONY: all install download clean - -run: $(FILES) build - ./runtest.sh - -build: $(BUILT_FILES) - test -x runtest.sh || chmod a+x runtest.sh - -clean: - rm -f *~ $(BUILT_FILES) - - -include /usr/share/rhts/lib/rhts-make.include - -$(METADATA): Makefile - @echo "Owner: Jan Stodola " > $(METADATA) - @echo "Name: $(TEST)" >> $(METADATA) - @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) - @echo "Path: $(TEST_DIR)" >> $(METADATA) - @echo "Description: $(DESCRIPTION)" >> $(METADATA) - @echo "Type: Install" >> $(METADATA) - @echo "TestTime: 10m" >> $(METADATA) - @echo "RunFor: dracut" >> $(METADATA) - @echo "Requires: dracut" >> $(METADATA) - @echo "Priority: Normal" >> $(METADATA) - @echo "License: Red Hat Internal" >> $(METADATA) - @echo "Confidential: no" >> $(METADATA) - @echo "Destructive: no" >> $(METADATA) - @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) - - rhts-lint $(METADATA) diff --git a/tests/add-luks-keys/PURPOSE b/tests/add-luks-keys/PURPOSE deleted file mode 100644 index a7c6063..0000000 --- a/tests/add-luks-keys/PURPOSE +++ /dev/null @@ -1,3 +0,0 @@ -PURPOSE of /dracut/add-luks-keys -Description: Create and add a luks key to all luks devices to allow booting of a system without entering a passphrase. -Author: Jan Stodola diff --git a/tests/add-luks-keys/runtest.sh b/tests/add-luks-keys/runtest.sh deleted file mode 100644 index 7ef652b..0000000 --- a/tests/add-luks-keys/runtest.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash -# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# runtest.sh of /dracut/add-luks-keys -# Description: Create and add a luks key to all luks devices to allow booting of a system without entering a passphrase -# Author: Jan Stodola -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2016 Red Hat, Inc. All rights reserved. -# Red Hat Internal -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -# Include Beaker environment -. /usr/bin/rhts-environment.sh || exit 1 -. /usr/share/beakerlib/beakerlib.sh || exit 1 - -PACKAGE="dracut" - -keyfile="/root/keyfile" -kernel_file=`grubby --default-kernel` -initrd_file=`grubby --info=$kernel_file | grep ^initrd= | sed 's/^initrd=//' | head -n1` -kernel_version=`rpm -qf $kernel_file --qf '%{VERSION}-%{RELEASE}.%{ARCH}\n'` - -rlJournalStart - rlPhaseStartTest "Add luks keys to initramfs" - - if [ ! -e "$keyfile" ]; then - rlLog "Creating new key file: $keyfile" - rlRun "dd if=/dev/urandom bs=1 count=32 of=$keyfile" - rlRun "chmod 0400 $keyfile" - else - rlLog "Using existing key file: $keyfile" - fi - - rlAssertExists "/etc/crypttab" - rlFileSubmit "/etc/crypttab" - UUIDS=`cat /etc/crypttab | cut -d' ' -f2 | cut -d'=' -f2` - for UUID in $UUIDS; do - rlRun "echo 'redhat' | /sbin/cryptsetup luksAddKey /dev/disk/by-uuid/$UUID $keyfile" - done; - - # modify /etc/crypttab, set key file in the thirth column of the file - rlRun "awk -v \"KEY_FILE=$keyfile\" '{\$3=KEY_FILE; print \$0}' /etc/crypttab > crypttab_mod" - rlRun "mv -Z crypttab_mod /etc/crypttab" - rlRun "chmod 0600 /etc/crypttab" - - rlRun "dracut -f -I $keyfile $initrd_file $kernel_version" - - # zipl has to be executed on s390x - if [ -x /sbin/zipl ]; then - rlRun "/sbin/zipl" - fi - - rlPhaseEnd -rlJournalEnd - diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index 60a098d..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -# This first play always runs on the local staging system -- hosts: localhost - roles: - - role: standard-test-beakerlib - tags: - - classic - tests: - - add-luks-keys - required_packages: - - dracut # Required for add-luks-keys