From 3888c940a2d6110cb9d4abc15b0feb9ac348e2c3 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Mar 28 2023 08:33:05 +0000 Subject: import dracut-049-223.git20230119.el8 --- diff --git a/SOURCES/0209.patch b/SOURCES/0209.patch new file mode 100644 index 0000000..263d09e --- /dev/null +++ b/SOURCES/0209.patch @@ -0,0 +1,66 @@ +From 7e148e3b6f922e5eb1dcb7fc3c1fed715004e2ab Mon Sep 17 00:00:00 2001 +From: Lee Duncan +Date: Mon, 25 Mar 2019 16:49:19 -0700 +Subject: [PATCH] Dracut: only login to one target at a time + +For handling the configuration where there are two +paths to an iscsi root target, each using a different +NIC. In such a case, the initramfs was trying to configure +the first NIC, then call iscsiroot to login to both targets, +which would fail for the 2nd target, since the path to the +2nd target was not yet configured. This would eventually +work after a timeout. But it's better to login to just +one target at a time. +This change makes the initramfs handle multiple paths to an +iscsi target better by logging into only one target at a time, +rather than trying to login to all targets when only one of +several NICs is up. + +This can be further optimized by using the initrd parameter +"rd.iscsi.testroute", which would skip iscsiadm login attempts +for targets to which no route exists. + +If the script is called again via the timeout initqueue, +we try "iscsiadm -L onboot" again, hoping that some targets +may now have become reachable. +--- + modules.d/95iscsi/iscsiroot.sh | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh +index 4efc1d12..f3f88259 100755 +--- a/modules.d/95iscsi/iscsiroot.sh ++++ b/modules.d/95iscsi/iscsiroot.sh +@@ -228,7 +228,7 @@ handle_netroot() + fi + [ -n "$iscsi_param" ] && for param in $iscsi_param; do EXTRA="$EXTRA --name=${param%=*} --value=${param#*=}"; done + +- iscsiadm -m node -T $target \ ++ CMD="iscsiadm -m node -T $target \ + ${iscsi_iface_name:+-I $iscsi_iface_name} \ + -p $iscsi_target_ip${iscsi_target_port:+:$iscsi_target_port} \ + --op=update \ +@@ -238,14 +238,20 @@ handle_netroot() + ${iscsi_in_username:+--name=node.session.auth.username_in --value=$iscsi_in_username} \ + ${iscsi_in_password:+--name=node.session.auth.password_in --value=$iscsi_in_password} \ + $EXTRA \ +- $NULL ++ $NULL" ++ $CMD ++ if [ "$netif" != "timeout" ]; then ++ $CMD --login ++ fi + ;; + *) + ;; + esac + done + +- iscsiadm -m node -L onboot || : ++ if [ "$netif" = "timeout" ]; then ++ iscsiadm -m node -L onboot || : ++ fi + > $hookdir/initqueue/work + + netroot_enc=$(str_replace "$1" '/' '\2f') + diff --git a/SOURCES/0210.patch b/SOURCES/0210.patch new file mode 100644 index 0000000..ba85405 --- /dev/null +++ b/SOURCES/0210.patch @@ -0,0 +1,39 @@ +From 96fc660c9170fbea5ac80235ab7d0e7cfdbe243e Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Thu, 21 Mar 2019 16:27:04 +0100 +Subject: [PATCH] iscsi: don't continue waiting if the root device is present + +dracut waits for every iscsiroot connection to be established +before switching root. This is not necessary in multipath scenarios, +where a single path is usually sufficient to set up the root device, +and where users expect booting to succeed unless all paths are down. + +Don't wait for the iscsi portal to start if the root device has +already been found. +--- + modules.d/95iscsi/parse-iscsiroot.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/modules.d/95iscsi/parse-iscsiroot.sh b/modules.d/95iscsi/parse-iscsiroot.sh +index f00a83bb..8d6e3e8c 100755 +--- a/modules.d/95iscsi/parse-iscsiroot.sh ++++ b/modules.d/95iscsi/parse-iscsiroot.sh +@@ -84,7 +84,7 @@ if [ -n "$iscsi_firmware" ]; then + modprobe -b -q iscsi_boot_sysfs 2>/dev/null + modprobe -b -q iscsi_ibft + # if no ip= is given, but firmware +- echo "[ -f '/tmp/iscsistarted-firmware' ]" > $hookdir/initqueue/finished/iscsi_started.sh ++ echo "${DRACUT_SYSTEMD+systemctl is-active initrd-root-device.target || }[ -f '/tmp/iscsistarted-firmware' ]" > $hookdir/initqueue/finished/iscsi_started.sh + initqueue --unique --online /sbin/iscsiroot online "iscsi:" "$NEWROOT" + initqueue --unique --onetime --timeout /sbin/iscsiroot timeout "iscsi:" "$NEWROOT" + initqueue --unique --onetime --settled /sbin/iscsiroot online "iscsi:" "'$NEWROOT'" +@@ -145,7 +145,7 @@ for nroot in $(getargs netroot); do + type parse_iscsi_root >/dev/null 2>&1 || . /lib/net-lib.sh + parse_iscsi_root "$nroot" || return 1 + netroot_enc=$(str_replace "$nroot" '/' '\2f') +- echo "[ -f '/tmp/iscsistarted-$netroot_enc' ]" > $hookdir/initqueue/finished/iscsi_started.sh ++ echo "${DRACUT_SYSTEMD+systemctl is-active initrd-root-device.target || }[ -f '/tmp/iscsistarted-$netroot_enc' ]" > $hookdir/initqueue/finished/iscsi_started.sh + done + + # Done, all good! + diff --git a/SOURCES/0211.patch b/SOURCES/0211.patch new file mode 100644 index 0000000..59fe258 --- /dev/null +++ b/SOURCES/0211.patch @@ -0,0 +1,24 @@ +From 5e06ab6cc6398fb82b8cd1dbc8da9969d874bb75 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Thu, 21 Mar 2019 21:31:15 +0100 +Subject: [PATCH] network: stop waiting for interfaces if root device is + present + +--- + modules.d/35network-legacy/net-genrules.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/35network-legacy/net-genrules.sh b/modules.d/35network-legacy/net-genrules.sh +index e6035e5e..0d4ef27b 100755 +--- a/modules.d/35network-legacy/net-genrules.sh ++++ b/modules.d/35network-legacy/net-genrules.sh +@@ -96,7 +96,7 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh + + for iface in $IFACES; do + if [ "$bootdev" = "$iface" ] || [ "$NEEDNET" = "1" ]; then +- echo "[ -f /tmp/net.${iface}.did-setup ]" >$hookdir/initqueue/finished/wait-$iface.sh ++ echo "${DRACUT_SYSTEMD+systemctl is-active initrd-root-device.target || }[ -f /tmp/net.${iface}.did-setup ]" >$hookdir/initqueue/finished/wait-$iface.sh + fi + done + # Default: We don't know the interface to use, handle all + diff --git a/SOURCES/0212.patch b/SOURCES/0212.patch new file mode 100644 index 0000000..d3dc6de --- /dev/null +++ b/SOURCES/0212.patch @@ -0,0 +1,39 @@ +From 032129d0eb47d08eff7bd8b4c82a835a8929e9d3 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Thu, 4 Apr 2019 15:29:04 +0200 +Subject: [PATCH] iscsiroot: parse_iscsi_root overwrites command line args + +iscsi_target_name, iscsi_target_ip, iscsi_target_port are +unconditionally overwritten by parse_iscsi_root. Don't set +them here, for code clarity. +--- + modules.d/95iscsi/iscsiroot.sh | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh +index f3f88259..45db89c1 100755 +--- a/modules.d/95iscsi/iscsiroot.sh ++++ b/modules.d/95iscsi/iscsiroot.sh +@@ -92,12 +92,6 @@ handle_netroot() + # override conf settings by command line options + arg=$(getarg rd.iscsi.initiator -d iscsi_initiator=) + [ -n "$arg" ] && iscsi_initiator=$arg +- arg=$(getargs rd.iscsi.target.name -d iscsi_target_name=) +- [ -n "$arg" ] && iscsi_target_name=$arg +- arg=$(getarg rd.iscsi.target.ip -d iscsi_target_ip) +- [ -n "$arg" ] && iscsi_target_ip=$arg +- arg=$(getarg rd.iscsi.target.port -d iscsi_target_port=) +- [ -n "$arg" ] && iscsi_target_port=$arg + arg=$(getarg rd.iscsi.target.group -d iscsi_target_group=) + [ -n "$arg" ] && iscsi_target_group=$arg + arg=$(getarg rd.iscsi.username -d iscsi_username=) +@@ -112,6 +106,8 @@ handle_netroot() + iscsi_param="$iscsi_param $p" + done + ++ # this sets iscsi_target_name and possibly overwrites most ++ # parameters read from the command line above + parse_iscsi_root "$1" || return 1 + + # Bail out early, if there is no route to the destination + diff --git a/SOURCES/0213.patch b/SOURCES/0213.patch new file mode 100644 index 0000000..ae02bfa --- /dev/null +++ b/SOURCES/0213.patch @@ -0,0 +1,42 @@ +From a590dfb3670a68b9eebc3e0ea617c5cf192c51ae Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Thu, 4 Apr 2019 15:40:14 +0200 +Subject: [PATCH] iscsiroot: there's never more than one target per call + +iscsi_target_name is set by iscsi_root, and thus can't have +more than one member. This allows us to get rid of one bashism +in iscsiroot.sh. +--- + modules.d/95iscsi/iscsiroot.sh | 11 +++-------- + 1 file changed, 3 insertions(+), 8 deletions(-) + +diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh +index 45db89c1..a334b76e 100755 +--- a/modules.d/95iscsi/iscsiroot.sh ++++ b/modules.d/95iscsi/iscsiroot.sh +@@ -213,10 +213,8 @@ handle_netroot() + targets=$(iscsiadm -m discovery -t st -p $iscsi_target_ip:${iscsi_target_port:+$iscsi_target_port} | sed 's/^.*iqn/iqn/') + [ -z "$targets" ] && echo "Target discovery to $iscsi_target_ip:${iscsi_target_port:+$iscsi_target_port} failed with status $?" && exit 1 + +- for target in $iscsi_target_name; do +- case "$targets" in +- *$target*) +- EXTRA="" ++ for target in $targets; do ++ if [ "$target" = "$iscsi_target_name" ]; then + if [ -n "$iscsi_iface_name" ]; then + iscsiadm -m iface -I $iscsi_iface_name --op=new + EXTRA=" ${iscsi_netdev_name:+--name=iface.net_ifacename --value=$iscsi_netdev_name} " +@@ -239,10 +237,7 @@ handle_netroot() + if [ "$netif" != "timeout" ]; then + $CMD --login + fi +- ;; +- *) +- ;; +- esac ++ fi + done + + if [ "$netif" = "timeout" ]; then + diff --git a/SOURCES/0214.patch b/SOURCES/0214.patch new file mode 100644 index 0000000..5a5df3a --- /dev/null +++ b/SOURCES/0214.patch @@ -0,0 +1,55 @@ +From 261d278332e0af85a0311a75d7b81c6cf35e4816 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Thu, 4 Apr 2019 16:16:40 +0200 +Subject: [PATCH] iscsiroot: try targets only once + +In multipath scenarios, "iscsiadm -m node" may contain +several records with the same target. +There's no point in trying "iscsiadm --login" multiple +time for the same target, through the same portal. + +Moreover, warn if the desired target is not on the node +list. +--- + modules.d/95iscsi/iscsiroot.sh | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh +index a334b76e..e8e0b4b8 100755 +--- a/modules.d/95iscsi/iscsiroot.sh ++++ b/modules.d/95iscsi/iscsiroot.sh +@@ -87,7 +87,7 @@ handle_netroot() + local iscsi_in_username iscsi_in_password + local iscsi_iface_name iscsi_netdev_name + local iscsi_param param +- local p ++ local p found + + # override conf settings by command line options + arg=$(getarg rd.iscsi.initiator -d iscsi_initiator=) +@@ -213,6 +213,7 @@ handle_netroot() + targets=$(iscsiadm -m discovery -t st -p $iscsi_target_ip:${iscsi_target_port:+$iscsi_target_port} | sed 's/^.*iqn/iqn/') + [ -z "$targets" ] && echo "Target discovery to $iscsi_target_ip:${iscsi_target_port:+$iscsi_target_port} failed with status $?" && exit 1 + ++ found= + for target in $targets; do + if [ "$target" = "$iscsi_target_name" ]; then + if [ -n "$iscsi_iface_name" ]; then +@@ -237,11 +238,16 @@ handle_netroot() + if [ "$netif" != "timeout" ]; then + $CMD --login + fi ++ found=yes ++ break + fi + done + + if [ "$netif" = "timeout" ]; then + iscsiadm -m node -L onboot || : ++ elif [ "$found" != yes ]; then ++ warn "iSCSI target \"$iscsi_target_name\" not found on portal $iscsi_target_ip:$iscsi_target_port" ++ return 1 + fi + > $hookdir/initqueue/work + + diff --git a/SOURCES/0215.patch b/SOURCES/0215.patch new file mode 100644 index 0000000..496a7ac --- /dev/null +++ b/SOURCES/0215.patch @@ -0,0 +1,77 @@ +From 0df65c3c001fb5656838274b172c247c41dc0442 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Thu, 4 Apr 2019 17:12:07 +0200 +Subject: [PATCH] iscsiroot: remove bashisms + +According to the dracut README, module code to be run in +the initrd must be POSIX-compliant. Replace remaining +bashisms (as reported by checkbashisms) with POSIX compliant +code. + +The use of "type" is not strictly POSIX compliant, but it's +all over the place in dracut code. dash supports it, anyway. +--- + modules.d/95iscsi/iscsiroot.sh | 26 +++++++++++++------------- + 1 file changed, 13 insertions(+), 13 deletions(-) + +diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh +index e8e0b4b8..4ab0b6a0 100755 +--- a/modules.d/95iscsi/iscsiroot.sh ++++ b/modules.d/95iscsi/iscsiroot.sh +@@ -54,11 +54,11 @@ handle_firmware() + if ! iscsiadm -m fw; then + warn "iscsiadm: Could not get list of targets from firmware." + else +- ifaces=( $(echo /sys/firmware/ibft/ethernet*) ) ++ ifaces=$(set -- /sys/firmware/ibft/ethernet*; echo $#) + retry=$(cat /tmp/session-retry) + +- if [ $retry -lt ${#ifaces[*]} ]; then +- let retry++ ++ if [ $retry -lt $ifaces ]; then ++ retry=$((retry+1)) + echo $retry > /tmp/session-retry + return 1 + else +@@ -88,6 +88,7 @@ handle_netroot() + local iscsi_iface_name iscsi_netdev_name + local iscsi_param param + local p found ++ local login_retry_max_seen= + + # override conf settings by command line options + arg=$(getarg rd.iscsi.initiator -d iscsi_initiator=) +@@ -103,7 +104,9 @@ handle_netroot() + arg=$(getarg rd.iscsi.in.password -d iscsi_in_password=) + [ -n "$arg" ] && iscsi_in_password=$arg + for p in $(getargs rd.iscsi.param -d iscsi_param); do +- iscsi_param="$iscsi_param $p" ++ [ "${p%=*}" = node.session.initial_login_retry_max ] && \ ++ login_retry_max_seen=yes ++ iscsi_param="$iscsi_param $p" + done + + # this sets iscsi_target_name and possibly overwrites most +@@ -116,15 +119,12 @@ handle_netroot() + fi + + #limit iscsistart login retries +- case "$iscsi_param" in +- *node.session.initial_login_retry_max*) ;; +- *) +- retries=$(getargnum 3 0 10000 rd.iscsi.login_retry_max) +- if [ $retries -gt 0 ]; then +- iscsi_param="${iscsi_param% } node.session.initial_login_retry_max=$retries" +- fi +- ;; +- esac ++ if [ "$login_retry_max_seen" != yes ]; then ++ retries=$(getargnum 3 0 10000 rd.iscsi.login_retry_max) ++ if [ $retries -gt 0 ]; then ++ iscsi_param="${iscsi_param% } node.session.initial_login_retry_max=$retries" ++ fi ++ fi + + # XXX is this needed? + getarg ro && iscsirw=ro + diff --git a/SOURCES/0216.patch b/SOURCES/0216.patch new file mode 100644 index 0000000..3e51ddb --- /dev/null +++ b/SOURCES/0216.patch @@ -0,0 +1,44 @@ +From ee0bba8d350920b8beb4c0629262ec359983ad65 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Tue, 1 Oct 2019 12:02:04 +0200 +Subject: [PATCH] fixup "Dracut: only login to one target at a time" + +On SLE15-SP1 at least, iscsiadm doesn't support combining --op and --login": + +> # iscsiadm -m node -T iqn.2018-06.de.suse.zeus:01 --op=update --name=node.startup --value=onboot --login +> iscsiadm: Invalid parameters. Login/logout and op passed in + +This breaks iSCSI login in initrd, and thus, iSCSI boot. + +Fix it by not coalescing everything into a single iscsiadm command. +Fixes: a59b776bc215 ("Dracut: only login to one target at a time") +References: bsc#1152650 +--- + modules.d/95iscsi/iscsiroot.sh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh +index 4ab0b6a0..6a12a108 100755 +--- a/modules.d/95iscsi/iscsiroot.sh ++++ b/modules.d/95iscsi/iscsiroot.sh +@@ -225,8 +225,8 @@ handle_netroot() + + CMD="iscsiadm -m node -T $target \ + ${iscsi_iface_name:+-I $iscsi_iface_name} \ +- -p $iscsi_target_ip${iscsi_target_port:+:$iscsi_target_port} \ +- --op=update \ ++ -p $iscsi_target_ip${iscsi_target_port:+:$iscsi_target_port}" ++ __op="--op=update \ + --name=node.startup --value=onboot \ + ${iscsi_username:+ --name=node.session.auth.username --value=$iscsi_username} \ + ${iscsi_password:+ --name=node.session.auth.password --value=$iscsi_password} \ +@@ -234,7 +234,7 @@ handle_netroot() + ${iscsi_in_password:+--name=node.session.auth.password_in --value=$iscsi_in_password} \ + $EXTRA \ + $NULL" +- $CMD ++ $CMD $__op + if [ "$netif" != "timeout" ]; then + $CMD --login + fi + diff --git a/SOURCES/0217.patch b/SOURCES/0217.patch new file mode 100644 index 0000000..f80cc76 --- /dev/null +++ b/SOURCES/0217.patch @@ -0,0 +1,37 @@ +From 934e69b64f4eff5df84d0d94a39aca1933bf3419 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Fri, 27 Sep 2019 13:26:10 +0200 +Subject: [PATCH] 35network-legacy: only skip waiting for interfaces if netroot + is set + +Commmit 8a33e52e2f94 assumes that dracut's work is done if a root device +is found. This holds usually for booting computers, but it may be wrong +for other environments. + +Only short-cut the waiting if $netroot is also set. + +Fixes: 8a33e52e2f94 ("network: stop waiting for interfaces if root device is present") +References: bsc#1152006 + +Resolves: rhbz#2115199 +--- + modules.d/35network-legacy/net-genrules.sh | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/modules.d/35network-legacy/net-genrules.sh b/modules.d/35network-legacy/net-genrules.sh +index 0d4ef27b..d531bb56 100755 +--- a/modules.d/35network-legacy/net-genrules.sh ++++ b/modules.d/35network-legacy/net-genrules.sh +@@ -96,7 +96,11 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh + + for iface in $IFACES; do + if [ "$bootdev" = "$iface" ] || [ "$NEEDNET" = "1" ]; then +- echo "${DRACUT_SYSTEMD+systemctl is-active initrd-root-device.target || }[ -f /tmp/net.${iface}.did-setup ]" >$hookdir/initqueue/finished/wait-$iface.sh ++ if [ -n "$netroot" ] && [ -n "$DRACUT_SYSTEMD" ]; then ++ echo "systemctl is-active initrd-root-device.target || [ -f /tmp/net.${iface}.did-setup ]" ++ else ++ echo "[ -f /tmp/net.${iface}.did-setup ]" ++ fi >$hookdir/initqueue/finished/wait-$iface.sh + fi + done + # Default: We don't know the interface to use, handle all diff --git a/SOURCES/0218.patch b/SOURCES/0218.patch new file mode 100644 index 0000000..c108c35 --- /dev/null +++ b/SOURCES/0218.patch @@ -0,0 +1,27 @@ +From c14d276bc5dd17d881478bbce57d54e3c4ffb094 Mon Sep 17 00:00:00 2001 +From: Pavel Valena +Date: Tue, 6 Dec 2022 20:35:52 +0100 +Subject: [PATCH] fix(80lvmthinpool-monitor): use systemsctl instead of + $SYSTEMCTL + +as the change is not backported to RHEL-8. + +rhel-only + +Resolves: #2141480 +--- + modules.d/80lvmthinpool-monitor/module-setup.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/80lvmthinpool-monitor/module-setup.sh b/modules.d/80lvmthinpool-monitor/module-setup.sh +index ca015bdc..550f3f16 100755 +--- a/modules.d/80lvmthinpool-monitor/module-setup.sh ++++ b/modules.d/80lvmthinpool-monitor/module-setup.sh +@@ -20,5 +20,5 @@ install() { + inst_script "$moddir/start-thinpool-monitor.sh" "/bin/start-thinpool-monitor" + + inst "$moddir/start-thinpool-monitor.service" "$systemdsystemunitdir/start-thinpool-monitor.service" +- $SYSTEMCTL -q --root "$initdir" add-wants initrd.target start-thinpool-monitor.service ++ systemctl -q --root "$initdir" add-wants initrd.target start-thinpool-monitor.service + } + diff --git a/SOURCES/0219.patch b/SOURCES/0219.patch new file mode 100644 index 0000000..5bfca81 --- /dev/null +++ b/SOURCES/0219.patch @@ -0,0 +1,101 @@ +From 3aca4acaea9569573d3d0e83c3c7998b56ea74c4 Mon Sep 17 00:00:00 2001 +From: Hari Bathini +Date: Tue, 12 Jul 2022 13:55:47 +0530 +Subject: [PATCH] fix(squash): build ld cache for squash loader + +Commit dc21638c3f0a fixes kdump kernel crash, due to non-conventional +library path in powerpc, by copying /etc/ld.so.cache under initdir. +While that works in general, it is vulnerable to failure because of +missing links, when the CPU is reconfigured to run in compatibility +mode of older CPU version. Avoid this by running ldconfig for squash +loader to create the necessary links & ld cache for it. Doing this +also saves a few kilobyes of space as the copied ld cache is bigger +in size than the one needed for squash loader environment. + +Fixes: dc21638c3f0a ("fix(squash): keep ld cache under initdir") +Cc: Pingfan Liu +Signed-off-by: Hari Bathini + +(Cherry-picked from f5e8250a06b5a53f6fd8e47ec976db933c91b3cd) + +Resolves: #2055026 +--- + dracut-init.sh | 14 ++++++++++++++ + dracut.sh | 11 +---------- + modules.d/99squash/module-setup.sh | 8 +++----- + 3 files changed, 18 insertions(+), 15 deletions(-) + +diff --git a/dracut-init.sh b/dracut-init.sh +index 032c38c2..5df2e583 100644 +--- a/dracut-init.sh ++++ b/dracut-init.sh +@@ -443,6 +443,20 @@ inst_rules_wildcard() { + [[ $_found ]] || dinfo "Skipping udev rule: $_rule" + } + ++# make sure that library links are correct and up to date ++build_ld_cache() { ++ for f in "$dracutsysrootdir"/etc/ld.so.conf "$dracutsysrootdir"/etc/ld.so.conf.d/*; do ++ [[ -f $f ]] && inst_simple "${f#$dracutsysrootdir}" ++ done ++ if ! $DRACUT_LDCONFIG -r "$initdir" -f /etc/ld.so.conf; then ++ if [[ $EUID == 0 ]]; then ++ derror "ldconfig exited ungracefully" ++ else ++ derror "ldconfig might need uid=0 (root) for chroot()" ++ fi ++ fi ++} ++ + prepare_udev_rules() { + [ -z "$UDEVVERSION" ] && export UDEVVERSION=$(udevadm --version | { read v _ ; echo $v ; }) + +diff --git a/dracut.sh b/dracut.sh +index 702b2f78..57f51e91 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1601,16 +1601,7 @@ done + + if [[ $kernel_only != yes ]]; then + # make sure that library links are correct and up to date +- for f in /etc/ld.so.conf /etc/ld.so.conf.d/*; do +- [[ -f $f ]] && inst_simple "$f" +- done +- if ! ldconfig -r "$initdir"; then +- if [[ $EUID = 0 ]]; then +- derror "ldconfig exited ungracefully" +- else +- derror "ldconfig might need uid=0 (root) for chroot()" +- fi +- fi ++ build_ld_cache + fi + + if [[ $do_hardlink = yes ]] && command -v hardlink >/dev/null; then +diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh +index e73d3184..8a0923fb 100644 +--- a/modules.d/99squash/module-setup.sh ++++ b/modules.d/99squash/module-setup.sh +@@ -28,11 +28,6 @@ installpost() { + [[ "$squash_dir" == "$i"/* ]] || mv "$i" "$squash_dir"/ + done + +- # initdir also needs ld.so.* to make ld.so work +- inst /etc/ld.so.cache +- inst /etc/ld.so.conf +- inst_dir /etc/ld.so.conf.d +- + # Create mount points for squash loader + mkdir -p "$initdir"/squash/ + mkdir -p "$squash_dir"/squash/ +@@ -68,6 +63,9 @@ installpost() { + ln_r /usr/bin /bin + ln_r /usr/sbin /sbin + inst_simple "$moddir"/init-squash.sh /init ++ ++ # make sure that library links are correct and up to date for squash loader ++ build_ld_cache + } + + install() { + diff --git a/SOURCES/0220.patch b/SOURCES/0220.patch new file mode 100644 index 0000000..10ca1dc --- /dev/null +++ b/SOURCES/0220.patch @@ -0,0 +1,31 @@ +From 82a47345a8e7d54616481098b7b16de6e7fba83b Mon Sep 17 00:00:00 2001 +From: Beniamino Galvani +Date: Mon, 9 Aug 2021 09:01:32 +0200 +Subject: [PATCH] fix(network-manager): write DHCP filename option to dhcpopts + file + +Anaconda parses the 'filename' variable [1] set in /tmp/net.$netif.dhcpopts to +determine the name of the kickstart file to use. + +[1] https://github.com/rhinstaller/anaconda/blob/anaconda-35.21-1/dracut/fetch-kickstart-net.sh#L31-L34 + +(Cherry-picked from commit 1513505db452f9425ae1d25b9bb28c176d9c7ed9) + +Resolves: #1991449 +--- + modules.d/35network-manager/nm-run.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules.d/35network-manager/nm-run.sh b/modules.d/35network-manager/nm-run.sh +index 61752384..94c19545 100755 +--- a/modules.d/35network-manager/nm-run.sh ++++ b/modules.d/35network-manager/nm-run.sh +@@ -22,7 +22,7 @@ do + state=/run/NetworkManager/devices/$(cat $_i/ifindex) + grep -q connection-uuid= $state 2>/dev/null || continue + ifname=${_i##*/} +- sed -n 's/root-path/new_root_path/p;s/next-server/new_next_server/p' <$state >/tmp/dhclient.$ifname.dhcpopts ++ sed -n 's/root-path/new_root_path/p;s/next-server/new_next_server/p;s/dhcp-bootfile/filename/p' <$state >/tmp/dhclient.$ifname.dhcpopts + source_hook initqueue/online $ifname + /sbin/netroot $ifname + done diff --git a/SOURCES/0221.patch b/SOURCES/0221.patch new file mode 100644 index 0000000..13c2971 --- /dev/null +++ b/SOURCES/0221.patch @@ -0,0 +1,26 @@ +From 7e401546ec38b3b5858136e93aeeffb93e496556 Mon Sep 17 00:00:00 2001 +From: Lukas Nykryn +Date: Tue, 10 Jan 2023 10:43:50 +0100 +Subject: [PATCH] fix(dracut-init): use ldconfig directly instead of + DRACUT_LDCONFIG + +RHEL-only +Resolves: #2141480 +--- + dracut-init.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dracut-init.sh b/dracut-init.sh +index 5df2e583..b6708288 100644 +--- a/dracut-init.sh ++++ b/dracut-init.sh +@@ -448,7 +448,7 @@ build_ld_cache() { + for f in "$dracutsysrootdir"/etc/ld.so.conf "$dracutsysrootdir"/etc/ld.so.conf.d/*; do + [[ -f $f ]] && inst_simple "${f#$dracutsysrootdir}" + done +- if ! $DRACUT_LDCONFIG -r "$initdir" -f /etc/ld.so.conf; then ++ if ! ldconfig -r "$initdir" -f /etc/ld.so.conf; then + if [[ $EUID == 0 ]]; then + derror "ldconfig exited ungracefully" + else + diff --git a/SOURCES/0222.patch b/SOURCES/0222.patch new file mode 100644 index 0000000..2876131 --- /dev/null +++ b/SOURCES/0222.patch @@ -0,0 +1,47 @@ +From a7eaedb1679d871c213753fad872d65b23070240 Mon Sep 17 00:00:00 2001 +From: Pavel Valena +Date: Thu, 19 Jan 2023 16:04:19 +0100 +Subject: [PATCH] fix(dracut-init.sh): backport common paths + +While backporting, some paths might be expected to be defined. +Backporting these paths as a preemptive measure (there's no test) +to avoid possible regressions when they're undefined. + +(Cherry-picked from a01204202b3014c0c761c93bc7de8bf35e6dc5ef +and 18d36fabf5ab20404e63ae56f166a5a53a874ba9) + +RHEL-only +Resolves: #2141480 +--- + dracut-init.sh | 4 ++++ + dracut.sh | 2 ++ + 2 files changed, 6 insertions(+) + +diff --git a/dracut-init.sh b/dracut-init.sh +index b6708288..50f9cf98 100644 +--- a/dracut-init.sh ++++ b/dracut-init.sh +@@ -79,6 +79,10 @@ export srcmods + export hookdirs + } + ++DRACUT_LDD=${DRACUT_LDD:-ldd} ++DRACUT_TESTBIN=${DRACUT_TESTBIN:-/bin/sh} ++DRACUT_LDCONFIG=${DRACUT_LDCONFIG:-ldconfig} ++ + . $dracutbasedir/dracut-functions.sh + + # Detect lib paths +diff --git a/dracut.sh b/dracut.sh +index 57f51e91..f58559e8 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -730,6 +730,8 @@ done + export PATH="${NPATH#:}" + unset NPATH + ++export SYSTEMCTL=${SYSTEMCTL:-systemctl} ++ + # these options add to the stuff in the config file + (( ${#add_dracutmodules_l[@]} )) && add_dracutmodules+=" ${add_dracutmodules_l[@]} " + (( ${#force_add_dracutmodules_l[@]} )) && force_add_dracutmodules+=" ${force_add_dracutmodules_l[@]} " diff --git a/SPECS/dracut.spec b/SPECS/dracut.spec index 54b94f4..0cdb185 100644 --- a/SPECS/dracut.spec +++ b/SPECS/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 209.git20220815 +%define dist_free_release 223.git20230119 Name: dracut Version: 049 @@ -236,6 +236,20 @@ Patch205: 0205.patch Patch206: 0206.patch Patch207: 0207.patch Patch208: 0208.patch +Patch209: 0209.patch +Patch210: 0210.patch +Patch211: 0211.patch +Patch212: 0212.patch +Patch213: 0213.patch +Patch214: 0214.patch +Patch215: 0215.patch +Patch216: 0216.patch +Patch217: 0217.patch +Patch218: 0218.patch +Patch219: 0219.patch +Patch220: 0220.patch +Patch221: 0221.patch +Patch222: 0222.patch Source1: https://www.gnu.org/licenses/lgpl-2.1.txt @@ -690,6 +704,26 @@ echo '# Since rhel-8.3 dracut moved to use NetworkManager add_dracutmodules+=" network-legacy "' > /etc/dracut.conf.d/50-network-legacy.conf %changelog +* Thu Jan 19 2023 Pavel Valena - 049-223.git20230119 +- fix(dracut-init): use ldconfig directly instead of +- fix(dracut-init.sh): backport common paths + +* Wed Dec 14 2022 Pavel Valena - 049-221.git20221214 +- fix(80lvmthinpool-monitor): use systemsctl instead of +- fix(squash): build ld cache for squash loader +- fix(network-manager): write DHCP filename option to dhcpopts + +* Thu Oct 20 2022 Pavel Valena - 049-218.git20221019 +- Dracut: only login to one target at a time +- iscsi: don't continue waiting if the root device is present +- network: stop waiting for interfaces if root device is +- iscsiroot: parse_iscsi_root overwrites command line args +- iscsiroot: there's never more than one target per call +- iscsiroot: try targets only once +- iscsiroot: remove bashisms +- fixup "Dracut: only login to one target at a time" +- 35network-legacy: only skip waiting for interfaces if netroot + * Mon Aug 15 2022 Pavel Valena - 049-209.git20220815 - fix(95iscsi): Fix network setup - fix(dracut-systemd): correct service dependencies