From 7df3270b60e225b49f5d08735c70f33300deacc9 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: May 16 2023 06:14:04 +0000 Subject: import dracut-049-223.git20230119.el8 --- 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 4fb3b7c..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 218.git20221019 +%define dist_free_release 223.git20230119 Name: dracut Version: 049 @@ -245,6 +245,11 @@ 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 @@ -699,6 +704,15 @@ 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