From 73bb5d2a1b3d61be5ba8b39ce83b00ec159ebad5 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Fri, 8 Aug 2025 20:52:58 +0200 Subject: [PATCH] dracut-057-101.git20250808 Resolves: RHEL-101901,RHEL-104222,RHEL-94663,RHEL-96106,RHEL-97169 --- 0090.patch | 38 ++++++++++++++++++++++++++++++ 0093.patch | 52 +++++++++++++++++++++++++++++++++++++++++ 0094.patch | 43 ++++++++++++++++++++++++++++++++++ 0095.patch | 36 ++++++++++++++++++++++++++++ 0096.patch | 56 ++++++++++++++++++++++++++++++++++++++++++++ 0097.patch | 46 ++++++++++++++++++++++++++++++++++++ 0098.patch | 37 +++++++++++++++++++++++++++++ 0099.patch | 45 +++++++++++++++++++++++++++++++++++ 0100.patch | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++ dracut.spec | 22 +++++++++++++++++- 10 files changed, 441 insertions(+), 1 deletion(-) create mode 100644 0090.patch create mode 100644 0093.patch create mode 100644 0094.patch create mode 100644 0095.patch create mode 100644 0096.patch create mode 100644 0097.patch create mode 100644 0098.patch create mode 100644 0099.patch create mode 100644 0100.patch diff --git a/0090.patch b/0090.patch new file mode 100644 index 0000000..7e91c80 --- /dev/null +++ b/0090.patch @@ -0,0 +1,38 @@ +From 31bc18ffe0bdec790e18166e44c8a545410f8198 Mon Sep 17 00:00:00 2001 +From: Antonio Alvarez Feijoo +Date: Wed, 21 Sep 2022 11:54:17 +0200 +Subject: [PATCH] fix(systemd): add missing modprobe@.service + +sys-kernel-config.mount needs modprobe@configfs.service since systemd v246.7 +(https://github.com/systemd/systemd/commit/42cc2855), so the kernel configfs +fails to mount in the initrd. + +(cherry picked from commit 928252a145ca44627ba5873e01245eabe246992f) + +Resolves: RHEL-97169 +--- + modules.d/00systemd/module-setup.sh | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/modules.d/00systemd/module-setup.sh b/modules.d/00systemd/module-setup.sh +index 38393855..2d6fc9ff 100755 +--- a/modules.d/00systemd/module-setup.sh ++++ b/modules.d/00systemd/module-setup.sh +@@ -83,6 +83,7 @@ install() { + \ + "$systemdsystemunitdir"/sys-kernel-config.mount \ + \ ++ "$systemdsystemunitdir"/modprobe@.service \ + "$systemdsystemunitdir"/kmod-static-nodes.service \ + "$systemdsystemunitdir"/systemd-tmpfiles-setup.service \ + "$systemdsystemunitdir"/systemd-tmpfiles-setup-dev.service \ +@@ -176,6 +177,8 @@ install() { + /etc/systemd/journald.conf.d/*.conf \ + /etc/systemd/system.conf \ + /etc/systemd/system.conf.d/*.conf \ ++ "$systemdsystemconfdir"/modprobe@.service \ ++ "$systemdsystemconfdir/modprobe@.service.d/*.conf" \ + /etc/hosts \ + /etc/hostname \ + /etc/nsswitch.conf \ + diff --git a/0093.patch b/0093.patch new file mode 100644 index 0000000..48cd38c --- /dev/null +++ b/0093.patch @@ -0,0 +1,52 @@ +From 27a740a5b37b5cc5dee808d4818a82746b98638b Mon Sep 17 00:00:00 2001 +From: Coiby Xu +Date: Mon, 26 May 2025 15:34:30 +0800 +Subject: [PATCH] fix: let check_vol_slaves_all return 1 when checks on all + slaves fail +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Currently check_vol_slaves_all return 0 even after checks on all slaves +fail. And this leads to an issue that "dracut -hostonly-mode strict" +gets stuck forever because instmods keeps waiting for user input when +it's passed empty argument in the kernel-modules module. + +Fixes: c7c8c498 ("dracut-functions.sh: catch all lvm slaves") +Reported-by: Tomáš Bžatek +Signed-off-by: Coiby Xu +(cherry picked from commit 1fcfb2bffdad22873a804043eeeb9bb65a99caa8) + +Resolves: RHEL-104222 +--- + dracut-functions.sh | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/dracut-functions.sh b/dracut-functions.sh +index 2e582ebc..0cf605dc 100755 +--- a/dracut-functions.sh ++++ b/dracut-functions.sh +@@ -661,7 +661,7 @@ check_vol_slaves() { + } + + check_vol_slaves_all() { +- local _vg _pv _majmin ++ local _vg _pv _majmin _ret=1 + _majmin="$2" + _dm="/sys/dev/block/$_majmin/dm" + [[ -f $_dm/uuid && $(< "$_dm"/uuid) =~ LVM-* ]] || return 1 +@@ -675,11 +675,10 @@ check_vol_slaves_all() { + fi + + for _pv in $(lvm vgs --noheadings -o pv_name "$_vg" 2> /dev/null); do +- check_block_and_slaves_all "$1" "$(get_maj_min "$_pv")" ++ check_block_and_slaves_all "$1" "$(get_maj_min "$_pv")" && _ret=0 + done +- return 0 + fi +- return 1 ++ return $_ret + } + + # fs_get_option + diff --git a/0094.patch b/0094.patch new file mode 100644 index 0000000..82eb659 --- /dev/null +++ b/0094.patch @@ -0,0 +1,43 @@ +From 61c98d1ce74f96e1089ada51b161632c0ca1e079 Mon Sep 17 00:00:00 2001 +From: Tomas Bzatek +Date: Tue, 3 Jun 2025 18:34:39 +0200 +Subject: [PATCH] improvement(74nvmf): lookup required NIC kernel modules for + NBFT interfaces + +When dracut is called with '--hostonly-mode strict' and perhaps even +with --hostonly-nics '' as done by kdump/mkdumprd, all the kernel +modules related to hostonly networking are stripped down. In such +a case it is viable to lookup and install the required kernel modules +ourselves, based on any currently present nbft interfaces. + +Note: the lookup depends on the current 'nbftX' network interface +naming. + +Signed-off-by: Tomas Bzatek +(cherry picked from commit e949a76aaa8f1a1e4cb01d4cacf89c69c7bbd801) + +Resolves: RHEL-104222 +--- + modules.d/95nvmf/module-setup.sh | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/modules.d/95nvmf/module-setup.sh b/modules.d/95nvmf/module-setup.sh +index 0b90d8be..bf051e41 100755 +--- a/modules.d/95nvmf/module-setup.sh ++++ b/modules.d/95nvmf/module-setup.sh +@@ -61,6 +61,14 @@ depends() { + installkernel() { + instmods nvme_fc lpfc qla2xxx + hostonly="" instmods nvme_tcp nvme_fabrics 8021q ++ # lookup NIC kernel modules for active NBFT interfaces ++ if [[ $hostonly ]]; then ++ for i in /sys/class/net/nbft*; do ++ [ -d "$i" ] || continue ++ _driver=$(basename "$(readlink -f "$i/device/driver/module")") ++ [ -z "$_driver" ] || instmods "$_driver" ++ done ++ fi + } + + # called by dracut + diff --git a/0095.patch b/0095.patch new file mode 100644 index 0000000..539b888 --- /dev/null +++ b/0095.patch @@ -0,0 +1,36 @@ +From 5015e56e3dc0e67b8115cfbddb1b575cf0551784 Mon Sep 17 00:00:00 2001 +From: Tomas Bzatek +Date: Tue, 24 Jun 2025 16:50:31 +0200 +Subject: [PATCH] fix(74nvmf): set root=nvmf + +In a restricted image like kdump the kernel commandline argument root= +is typically absent. However it is required by the 45net-lib/netroot.sh +module that fails with: + + [ 23.599862] dracut: FATAL: No or empty root= argument + [ 23.604956] dracut: Refusing to continue + +Inspired by the 74iscsi module, let's set it to root=nvmf if not set +before. + +Signed-off-by: Tomas Bzatek +(cherry picked from commit a6dce328ea9738a558db848fa8dbed253b15ee3d) + +Resolves: RHEL-104222 +--- + modules.d/95nvmf/parse-nvmf-boot-connections.sh | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/modules.d/95nvmf/parse-nvmf-boot-connections.sh b/modules.d/95nvmf/parse-nvmf-boot-connections.sh +index 66018371..4721efce 100755 +--- a/modules.d/95nvmf/parse-nvmf-boot-connections.sh ++++ b/modules.d/95nvmf/parse-nvmf-boot-connections.sh +@@ -324,3 +324,7 @@ fi + + /sbin/initqueue --settled --onetime --name nvmf-connect-settled /sbin/nvmf-autoconnect.sh settled + /sbin/initqueue --timeout --onetime --name nvmf-connect-timeout /sbin/nvmf-autoconnect.sh timeout ++ ++# shellcheck disable=SC2034 ++rootok=1 ++[ -z "$root" ] && root="nvmf" + diff --git a/0096.patch b/0096.patch new file mode 100644 index 0000000..e011b29 --- /dev/null +++ b/0096.patch @@ -0,0 +1,56 @@ +From f7e5515272ec62735a283addc642a3930ee5e943 Mon Sep 17 00:00:00 2001 +From: Antonio Alvarez Feijoo +Date: Mon, 3 Mar 2025 15:22:14 +0100 +Subject: [PATCH] chore(multipath): remove `rd_NO_MULTIPATH` kernel command + line option + +Deprecated since 778b3543609d8c9d32df7111229f4072d00d02f0 (Nov 25, 2014). + +(cherry picked from commit 954420374a63be32f6ece5fc1476ba18163da1f7) + +Related: RHEL-96106 +--- + man/dracut.cmdline.7.asc | 2 -- + modules.d/90multipath/multipathd.service | 1 - + modules.d/90multipath/multipathd.sh | 2 +- + 3 files changed, 1 insertion(+), 4 deletions(-) + +diff --git a/man/dracut.cmdline.7.asc b/man/dracut.cmdline.7.asc +index abe1ec3f..697f81d9 100644 +--- a/man/dracut.cmdline.7.asc ++++ b/man/dracut.cmdline.7.asc +@@ -1383,8 +1383,6 @@ rd_NO_MD:: rd.md=0 + + rd_MD_UUID:: rd.md.uuid + +-rd_NO_MULTIPATH: rd.multipath=0 +- + rd_NFS_DOMAIN:: rd.nfs.domain + + iscsi_initiator:: rd.iscsi.initiator +diff --git a/modules.d/90multipath/multipathd.service b/modules.d/90multipath/multipathd.service +index e8182533..1ff7201a 100644 +--- a/modules.d/90multipath/multipathd.service ++++ b/modules.d/90multipath/multipathd.service +@@ -11,7 +11,6 @@ Conflicts=shutdown.target + Conflicts=initrd-cleanup.service + ConditionKernelCommandLine=!nompath + ConditionKernelCommandLine=!rd.multipath=0 +-ConditionKernelCommandLine=!rd_NO_MULTIPATH + ConditionKernelCommandLine=!multipath=off + ConditionVirtualization=!container + +diff --git a/modules.d/90multipath/multipathd.sh b/modules.d/90multipath/multipathd.sh +index 385a95fb..62649003 100755 +--- a/modules.d/90multipath/multipathd.sh ++++ b/modules.d/90multipath/multipathd.sh +@@ -5,7 +5,7 @@ if [ "$(getarg rd.multipath)" = "default" ] && [ ! -e /etc/multipath.conf ]; the + mpathconf --enable + fi + +-if getargbool 1 rd.multipath -d -n rd_NO_MULTIPATH && [ -e /etc/multipath.conf ]; then ++if getargbool 1 rd.multipath && [ -e /etc/multipath.conf ]; then + modprobe dm-multipath + multipathd -B || multipathd + need_shutdown + diff --git a/0097.patch b/0097.patch new file mode 100644 index 0000000..b78e3df --- /dev/null +++ b/0097.patch @@ -0,0 +1,46 @@ +From b0c8aaecda1d62aa925d70fcadc071e9c85c2621 Mon Sep 17 00:00:00 2001 +From: Antonio Alvarez Feijoo +Date: Mon, 3 Mar 2025 15:23:41 +0100 +Subject: [PATCH] refactor(multipath): remove custom multipathd.service + +Install `multipathd.service` provided by upstream, and add a dropin to support +`rd.multipath=0`. + +(cherry picked from commit bb343fa83de4c73890e9054329249a1491733a5c) + +Resolves: RHEL-96106 +--- + modules.d/90multipath/module-setup.sh | 3 ++- + modules.d/90multipath/multipathd-dracut.conf | 2 ++ + 2 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh +index 541e243a..2f4ac869 100755 +--- a/modules.d/90multipath/module-setup.sh ++++ b/modules.d/90multipath/module-setup.sh +@@ -90,6 +90,7 @@ install() { + [[ -d $config_dir ]] || config_dir=/etc/multipath/conf.d + + inst_multiple \ ++ "$systemdsystemunitdir"/multipathd.service \ + pkill \ + pidof \ + kpartx \ +@@ -137,7 +138,7 @@ install() { + inst_simple "${moddir}/multipathd-configure.service" "${systemdsystemunitdir}/multipathd-configure.service" + $SYSTEMCTL -q --root "$initdir" enable multipathd-configure.service + fi +- inst_simple "${moddir}/multipathd.service" "${systemdsystemunitdir}/multipathd.service" ++ inst_simple "$moddir/multipathd-dracut.conf" "$systemdsystemunitdir/multipathd.service.d/multipathd-dracut.conf" + $SYSTEMCTL -q --root "$initdir" enable multipathd.service + else + inst_hook pre-trigger 02 "$moddir/multipathd.sh" +diff --git a/modules.d/90multipath/multipathd-dracut.conf b/modules.d/90multipath/multipathd-dracut.conf +new file mode 100644 +index 00000000..783b05d5 +--- /dev/null ++++ b/modules.d/90multipath/multipathd-dracut.conf +@@ -0,0 +1,2 @@ ++[Unit] ++ConditionKernelCommandLine=!rd.multipath=0 + diff --git a/0098.patch b/0098.patch new file mode 100644 index 0000000..82f9edf --- /dev/null +++ b/0098.patch @@ -0,0 +1,37 @@ +From 90d1ed6f5acf7ba916197db1c08bb2d0de4715bc Mon Sep 17 00:00:00 2001 +From: Jo Zzsi +Date: Sun, 25 May 2025 16:16:40 -0400 +Subject: [PATCH] fix(systemd): systemd.volatile needs overlayfs kernel module + +See https://www.freedesktop.org/software/systemd/man/latest/systemd-volatile-root.service.html + +> This service is only enabled if full volatile mode is selected, +> for example by specifying "systemd.volatile=yes" on the kernel command line. +> This service runs only in the initrd, before the system transitions to the host's root directory. +> Note that this service is not used if "systemd.volatile=state" is used, as in that mode the root +> directory is non-volatile. + +Support for this systemd feature has been added in systemd v242 . +https://github.com/systemd/systemd/pull/11243 + +(cherry picked from commit 33f2e49d600294fb54620f029e10fd74de54bfa8) + +Resolves: RHEL-94663 +--- + modules.d/00systemd/module-setup.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/00systemd/module-setup.sh b/modules.d/00systemd/module-setup.sh +index 2d6fc9ff..658640ac 100755 +--- a/modules.d/00systemd/module-setup.sh ++++ b/modules.d/00systemd/module-setup.sh +@@ -18,7 +18,7 @@ depends() { + + installkernel() { + hostonly='' instmods autofs4 ipv6 algif_hash hmac sha256 sg +- instmods -s efivarfs ++ instmods -s efivarfs overlay + } + + # called by dracut + diff --git a/0099.patch b/0099.patch new file mode 100644 index 0000000..986d364 --- /dev/null +++ b/0099.patch @@ -0,0 +1,45 @@ +From ba41a1864778fb949253d4492c8c5d553ef3badc Mon Sep 17 00:00:00 2001 +From: Chris Riches +Date: Thu, 3 Jul 2025 13:42:09 +0000 +Subject: [PATCH] refactor(dracut): introduce clamp_mtimes helper function + +Avoid code duplication by introducing `clamp_mtimes`. + +(cherry picked from commit b1f5842b36182d556f76d1bf9a023c74800b0880) + +Related: RHEL-101901 +--- + dracut.sh | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index 43bc2ad0..d9f2ed83 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -2452,9 +2452,13 @@ if [[ $uefi == yes ]]; then + mkdir -p "$uefi_outdir" + fi + +-if [[ $DRACUT_REPRODUCIBLE ]]; then +- find "$initdir" -newer "$dracutbasedir/dracut-functions.sh" -print0 \ ++clamp_mtimes() { ++ find "$1" -newer "$dracutbasedir/dracut-functions.sh" -print0 \ + | xargs -r -0 touch -h -m -c -r "$dracutbasedir/dracut-functions.sh" ++} ++ ++if [[ $DRACUT_REPRODUCIBLE ]]; then ++ clamp_mtimes "$initdir" + + if [[ "$(cpio --help)" == *--reproducible* ]]; then + CPIO_REPRODUCIBLE=1 +@@ -2469,8 +2473,7 @@ if [[ $create_early_cpio == yes ]]; then + echo 1 > "$early_cpio_dir/d/early_cpio" + + if [[ $DRACUT_REPRODUCIBLE ]]; then +- find "$early_cpio_dir/d" -newer "$dracutbasedir/dracut-functions.sh" -print0 \ +- | xargs -r -0 touch -h -m -c -r "$dracutbasedir/dracut-functions.sh" ++ clamp_mtimes "$early_cpio_dir/d" + fi + + # The microcode blob is _before_ the initramfs blob, not after + diff --git a/0100.patch b/0100.patch new file mode 100644 index 0000000..5a5c548 --- /dev/null +++ b/0100.patch @@ -0,0 +1,67 @@ +From 45c50b57bfc5b6675604f90e3f6ff65511ead59c Mon Sep 17 00:00:00 2001 +From: Chris Riches +Date: Wed, 9 Jul 2025 16:40:18 +0000 +Subject: [PATCH] fix(dracut): ensure hardlink deduplication is reproducible + +By default, hardlink will only deduplicate files with identical mtimes, +down to one-second granularity. If a dracut module rapidly generates +multiple identical files, it is completely up to chance as to whether +their mtimes cross a second boundary or not, and thus whether they get +deduplicated or not. This results in non-reproducible output. + +Re-order hardlink with respect to clamping to avoid this problem. + +Fixes: https://issues.redhat.com/browse/RHEL-101901 +(cherry picked from commit f779e439ec60eafcb400501d4741c755a95fdc86) + +Resolves: RHEL-101901 +--- + dracut.sh | 21 ++++++++++++++------- + 1 file changed, 14 insertions(+), 7 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index d9f2ed83..47adee2f 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -2245,12 +2245,6 @@ for ((i = 0; i < ${#include_src[@]}; i++)); do + fi + done + +-if [[ $do_hardlink == yes ]] && command -v hardlink > /dev/null; then +- dinfo "*** Hardlinking files ***" +- hardlink "$initdir" 2>&1 | dinfo +- dinfo "*** Hardlinking files done ***" +-fi +- + # strip binaries + if [[ $do_strip == yes ]]; then + # Prefer strip from elfutils for package size +@@ -2453,7 +2447,7 @@ if [[ $uefi == yes ]]; then + fi + + clamp_mtimes() { +- find "$1" -newer "$dracutbasedir/dracut-functions.sh" -print0 \ ++ find "$@" -newer "$dracutbasedir/dracut-functions.sh" -print0 \ + | xargs -r -0 touch -h -m -c -r "$dracutbasedir/dracut-functions.sh" + } + +@@ -2467,6 +2461,19 @@ if [[ $DRACUT_REPRODUCIBLE ]]; then + fi + fi + ++# Hardlink is mtime-sensitive; do it after the above clamp. ++if [[ $do_hardlink == yes ]] && command -v hardlink > /dev/null; then ++ dinfo "*** Hardlinking files ***" ++ hardlink "$initdir" 2>&1 | ddebug ++ dinfo "*** Hardlinking files done ***" ++ ++ # Hardlink itself breaks mtimes on directories as we may have added/removed ++ # dir entries. Fix those up. ++ if [[ $DRACUT_REPRODUCIBLE ]]; then ++ clamp_mtimes "$initdir" -type d ++ fi ++fi ++ + [[ $EUID != 0 ]] && cpio_owner="0:0" + + if [[ $create_early_cpio == yes ]]; then diff --git a/dracut.spec b/dracut.spec index 1f1e1e1..b9482c1 100644 --- a/dracut.spec +++ b/dracut.spec @@ -5,7 +5,7 @@ # strip the automatically generated dep here and instead co-own the # directory. %global __requires_exclude pkg-config -%define dist_free_release 90.git20250609 +%define dist_free_release 101.git20250808 Name: dracut Version: 057 @@ -118,6 +118,15 @@ Patch86: 0086.patch Patch87: 0087.patch Patch88: 0088.patch Patch89: 0089.patch +Patch90: 0090.patch +Patch93: 0093.patch +Patch94: 0094.patch +Patch95: 0095.patch +Patch96: 0096.patch +Patch97: 0097.patch +Patch98: 0098.patch +Patch99: 0099.patch +Patch100: 0100.patch Source1: https://www.gnu.org/licenses/lgpl-2.1.txt @@ -574,6 +583,17 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{_prefix}/lib/kernel/install.d/51-dracut-rescue.install %changelog +* Fri Aug 08 2025 Pavel Valena - 057-101.git20250808 +- fix(systemd): add missing modprobe@.service +- fix: let check_vol_slaves_all return 1 when checks on all +- improvement(74nvmf): lookup required NIC kernel modules for +- fix(74nvmf): set root=nvmf +- chore(multipath): remove `rd_NO_MULTIPATH` kernel command +- refactor(multipath): remove custom multipathd.service +- fix(systemd): systemd.volatile needs overlayfs kernel module +- refactor(dracut): introduce clamp_mtimes helper function +- fix(dracut): ensure hardlink deduplication is reproducible + * Mon Jun 09 2025 Pavel Valena - 057-90.git20250609 - fix(dracut.sh): don't pass empty string as dir