From b43e6bf42ae98f7b46ce3ed088d0c1e95e0cff54 Mon Sep 17 00:00:00 2001 From: wangyuhang Date: Thu, 18 Apr 2024 10:45:28 +0800 Subject: [PATCH 1/6] remove microcode check based on CONFIG_MICROCODE_[AMD|INTEL] --- ...move-microcode-check-based-on-CONFIG.patch | 48 +++++++++++++++++++ dracut.spec | 7 ++- 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 backport-fix-dracut.sh-remove-microcode-check-based-on-CONFIG.patch diff --git a/backport-fix-dracut.sh-remove-microcode-check-based-on-CONFIG.patch b/backport-fix-dracut.sh-remove-microcode-check-based-on-CONFIG.patch new file mode 100644 index 0000000..bbf075d --- /dev/null +++ b/backport-fix-dracut.sh-remove-microcode-check-based-on-CONFIG.patch @@ -0,0 +1,48 @@ +From 6c80408c8644a0add1907b0593eb83f90d6247b1 Mon Sep 17 00:00:00 2001 +From: Antonio Alvarez Feijoo +Date: Mon, 14 Aug 2023 12:28:11 +0200 +Subject: [PATCH] fix(dracut.sh): remove microcode check based on + CONFIG_MICROCODE_[AMD|INTEL] + +`CONFIG_MICROCODE_AMD` and `CONFIG_MICROCODE_INTEL` are hidden since +https://lore.kernel.org/all/20230810160805.081212701@linutronix.de/, therefore +this check is wrong and early microcode is always disabled. +--- + dracut.sh | 11 ++++------- + 1 file changed, 4 insertions(+), 7 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index e0abdb3b..3b292910 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1561,23 +1561,20 @@ fi + + if [[ $early_microcode == yes ]]; then + if [[ $hostonly ]]; then +- if [[ $(get_cpu_vendor) == "AMD" ]]; then +- check_kernel_config CONFIG_MICROCODE_AMD || unset early_microcode +- elif [[ $(get_cpu_vendor) == "Intel" ]]; then +- check_kernel_config CONFIG_MICROCODE_INTEL || unset early_microcode ++ if [[ $(get_cpu_vendor) == "AMD" || $(get_cpu_vendor) == "Intel" ]]; then ++ check_kernel_config CONFIG_MICROCODE || unset early_microcode + else + unset early_microcode + fi + else +- ! check_kernel_config CONFIG_MICROCODE_AMD \ +- && ! check_kernel_config CONFIG_MICROCODE_INTEL \ ++ ! check_kernel_config CONFIG_MICROCODE \ + && unset early_microcode + fi + # Do not complain on non-x86 architectures as it makes no sense + case "${DRACUT_ARCH:-$(uname -m)}" in + x86_64 | i?86) + [[ $early_microcode != yes ]] \ +- && dwarn "Disabling early microcode, because kernel does not support it. CONFIG_MICROCODE_[AMD|INTEL]!=y" ++ && dwarn "Disabling early microcode, because kernel does not support it. CONFIG_MICROCODE!=y" + ;; + *) ;; + esac +-- +2.33.0 + diff --git a/dracut.spec b/dracut.spec index 41e02e1..25c0510 100644 --- a/dracut.spec +++ b/dracut.spec @@ -9,7 +9,7 @@ Name: dracut Version: 059 -Release: 4 +Release: 6 Summary: Initramfs generator using udev @@ -38,6 +38,8 @@ Patch11: backport-fix-fs-lib-remove-quoting-form-the-first-argument-of.patch # Unbreak systemd 255 Patch12: backport-feat-systemd-install-systemd-executor.patch +Patch6000: backport-fix-dracut.sh-remove-microcode-check-based-on-CONFIG.patch + Source1: https://www.gnu.org/licenses/lgpl-2.1.txt Source2: openEuler.conf.example @@ -525,6 +527,9 @@ rm -f 51-dracut-rescue-postinst.sh %endif %changelog +* Thu Apr 18 2024 wangyuhang - 059-6 +- Backport patches to remove microcode check based on CONFIG_MICROCODE_[AMD|INTEL] + * Mon Jan 22 2024 huyubiao - 059-5 - Backport patches to fix compatibility with systemd 255 -- Gitee From fcda6c6d06b7f5b98775057940f899e231d0675a Mon Sep 17 00:00:00 2001 From: hongjinghao Date: Thu, 13 Jun 2024 14:14:56 +0800 Subject: [PATCH 2/6] backport update stream --- ...orrect-shellcheck-regression-when-pa.patch | 31 +++++++++++++++++++ dracut.spec | 6 +++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 backport-fix-zfcp_rules-correct-shellcheck-regression-when-pa.patch diff --git a/backport-fix-zfcp_rules-correct-shellcheck-regression-when-pa.patch b/backport-fix-zfcp_rules-correct-shellcheck-regression-when-pa.patch new file mode 100644 index 0000000..1667c5d --- /dev/null +++ b/backport-fix-zfcp_rules-correct-shellcheck-regression-when-pa.patch @@ -0,0 +1,31 @@ +From 5d2bda46f4e75e85445ee4d3bd3f68bf966287b9 Mon Sep 17 00:00:00 2001 +From: Ihno Krumreich +Date: Wed, 28 Feb 2024 08:24:35 +0100 +Subject: [PATCH] fix(zfcp_rules): correct shellcheck regression when parsing + ccw args + +Fixes 032ecd95c94b77f3f08237e0f765b355dacb9573 + +Conflict:NA +Reference:https://github.com/dracutdevs/dracut/commit/5d2bda46f4e75e85445ee4d3bd3f68bf966287b9 +--- + modules.d/95zfcp_rules/parse-zfcp.sh | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/modules.d/95zfcp_rules/parse-zfcp.sh b/modules.d/95zfcp_rules/parse-zfcp.sh +index 5e7d9095..a474b81b 100755 +--- a/modules.d/95zfcp_rules/parse-zfcp.sh ++++ b/modules.d/95zfcp_rules/parse-zfcp.sh +@@ -63,7 +63,8 @@ for zfcp_arg in $(getargs root=) $(getargs resume=); do + if [ -n "$ccw_arg" ]; then + OLDIFS="$IFS" + IFS="-" +- set -- "$ccw_arg" ++ # shellcheck disable=SC2086 ++ set -- $ccw_arg + IFS="$OLDIFS" + _wwpn=${4%:*} + _lun=${4#*:} +-- +2.33.0 + diff --git a/dracut.spec b/dracut.spec index 25c0510..26fd2ad 100644 --- a/dracut.spec +++ b/dracut.spec @@ -9,7 +9,7 @@ Name: dracut Version: 059 -Release: 6 +Release: 7 Summary: Initramfs generator using udev @@ -39,6 +39,7 @@ Patch11: backport-fix-fs-lib-remove-quoting-form-the-first-argument-of.patch Patch12: backport-feat-systemd-install-systemd-executor.patch Patch6000: backport-fix-dracut.sh-remove-microcode-check-based-on-CONFIG.patch +Patch6001: backport-fix-zfcp_rules-correct-shellcheck-regression-when-pa.patch Source1: https://www.gnu.org/licenses/lgpl-2.1.txt Source2: openEuler.conf.example @@ -527,6 +528,9 @@ rm -f 51-dracut-rescue-postinst.sh %endif %changelog +* Thu Jun 13 2024 hongjinghao - 059-7 +- backport update stream + * Thu Apr 18 2024 wangyuhang - 059-6 - Backport patches to remove microcode check based on CONFIG_MICROCODE_[AMD|INTEL] -- Gitee From dc147b4f39bbba8533be5d2ba30243823766e3c5 Mon Sep 17 00:00:00 2001 From: zhengxiaoxiao Date: Thu, 11 Jul 2024 14:02:43 +0800 Subject: [PATCH 3/6] add backport-fix-dracut-install-copy-xattr-when-use-clone-ioctl.patch (cherry picked from commit fd7c58e5b36f390d9a424f349c398563864de7b9) --- ...tall-copy-xattr-when-use-clone-ioctl.patch | 100 ++++++++++++++++++ dracut.spec | 6 +- 2 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 backport-fix-dracut-install-copy-xattr-when-use-clone-ioctl.patch diff --git a/backport-fix-dracut-install-copy-xattr-when-use-clone-ioctl.patch b/backport-fix-dracut-install-copy-xattr-when-use-clone-ioctl.patch new file mode 100644 index 0000000..b120764 --- /dev/null +++ b/backport-fix-dracut-install-copy-xattr-when-use-clone-ioctl.patch @@ -0,0 +1,100 @@ +From 1cf0db26e43fe4c6173acdb8047f16666ebf070a Mon Sep 17 00:00:00 2001 +From: Huaxin Lu +Date: Thu, 20 Jun 2024 13:38:26 +0800 +Subject: [PATCH] fix(dracut-install): copy xattr when use clone ioctl + +When use clone ioctl to copy a file, the extended attributes of files are +missing, which is inconsistent with the result by using the cp command. +This commit add the process to copy extended attributes after clone_file(). + +Signed-off-by: Huaxin Lu + +Reference:https://github.com/dracut-ng/dracut-ng/pull/461/commits/1cf0db26e43fe4c6173acdb8047f16666ebf070a +Conflict:NA +--- + src/install/dracut-install.c | 56 ++++++++++++++++++++++++++++++++++++ + 1 file changed, 56 insertions(+) + +diff --git a/src/install/dracut-install.c b/src/install/dracut-install.c +index 1862c599d..dd70382cb 100644 +--- a/src/install/dracut-install.c ++++ b/src/install/dracut-install.c +@@ -42,6 +42,7 @@ + #include + #include + #include ++#include + + #include "log.h" + #include "hashmap.h" +@@ -292,6 +293,56 @@ static inline int clone_file(int dest_fd, int src_fd) + return ioctl(dest_fd, BTRFS_IOC_CLONE, src_fd); + } + ++static int copy_xattr(int dest_fd, int src_fd) ++{ ++ int ret = 0; ++ ssize_t name_len = 0, value_len = 0; ++ char *name_buf = NULL, *name = NULL, *value = NULL, *value_save = NULL; ++ ++ name_len = flistxattr(src_fd, NULL, 0); ++ if (name_len < 0) ++ return -1; ++ ++ name_buf = calloc(1, name_len + 1); ++ if (name_buf == NULL) ++ return -1; ++ ++ name_len = flistxattr(src_fd, name_buf, name_len); ++ if (name_len < 0) ++ goto out; ++ ++ for (name = name_buf; name != name_buf + name_len; name = strchr(name, '\0') + 1) { ++ value_len = fgetxattr(src_fd, name, NULL, 0); ++ if (value_len < 0) { ++ ret = -1; ++ continue; ++ } ++ ++ value_save = value; ++ value = realloc(value, value_len); ++ if (value == NULL) { ++ value = value_save; ++ ret = -1; ++ goto out; ++ } ++ ++ value_len = fgetxattr(src_fd, name, value, value_len); ++ if (value_len < 0) { ++ ret = -1; ++ continue; ++ } ++ ++ value_len = fsetxattr(dest_fd, name, value, value_len, 0); ++ if (value_len < 0) ++ ret = -1; ++ } ++ ++out: ++ free(name_buf); ++ free(value); ++ return ret; ++} ++ + static bool use_clone = true; + + static int cp(const char *src, const char *dst) +@@ -333,6 +384,11 @@ static int cp(const char *src, const char *dst) + log_info("Failed to chown %s: %m", dst); + } + ++ if (geteuid() == 0 && no_xattr == false) { ++ if (copy_xattr(dest_desc, source_desc) != 0) ++ log_error("Failed to copy xattr %s: %m", dst); ++ } ++ + tv[0].tv_sec = sb.st_atime; + tv[0].tv_usec = 0; + tv[1].tv_sec = sb.st_mtime; +-- +2.27.0 diff --git a/dracut.spec b/dracut.spec index 26fd2ad..ef2ee98 100644 --- a/dracut.spec +++ b/dracut.spec @@ -9,7 +9,7 @@ Name: dracut Version: 059 -Release: 7 +Release: 8 Summary: Initramfs generator using udev @@ -40,6 +40,7 @@ Patch12: backport-feat-systemd-install-systemd-executor.patch Patch6000: backport-fix-dracut.sh-remove-microcode-check-based-on-CONFIG.patch Patch6001: backport-fix-zfcp_rules-correct-shellcheck-regression-when-pa.patch +Patch6003: backport-fix-dracut-install-copy-xattr-when-use-clone-ioctl.patch Source1: https://www.gnu.org/licenses/lgpl-2.1.txt Source2: openEuler.conf.example @@ -528,6 +529,9 @@ rm -f 51-dracut-rescue-postinst.sh %endif %changelog +* Thu Jul 11 2024 zhengxiaoxiao - 059-8 +- add backport-fix-dracut-install-copy-xattr-when-use-clone-ioctl.patch + * Thu Jun 13 2024 hongjinghao - 059-7 - backport update stream -- Gitee From 52c5754e4a6515dcb1576a817fe7c3e8b61b8353 Mon Sep 17 00:00:00 2001 From: Huaxin Lu Date: Wed, 21 Aug 2024 15:02:32 +0800 Subject: [PATCH 4/6] fix(dracut-install): copy mode when use clone ioctl --- dracut.spec | 6 +++- ...stall-copy-mode-when-use-clone-ioctl.patch | 31 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 fix-dracut-install-copy-mode-when-use-clone-ioctl.patch diff --git a/dracut.spec b/dracut.spec index 0b54da3..c1bcc64 100644 --- a/dracut.spec +++ b/dracut.spec @@ -9,7 +9,7 @@ Name: dracut Version: 059 -Release: 9 +Release: 10 Summary: Initramfs generator using udev @@ -41,6 +41,7 @@ Patch12: backport-feat-systemd-install-systemd-executor.patch Patch6000: backport-fix-dracut.sh-remove-microcode-check-based-on-CONFIG.patch Patch6001: backport-fix-zfcp_rules-correct-shellcheck-regression-when-pa.patch Patch6003: backport-fix-dracut-install-copy-xattr-when-use-clone-ioctl.patch +Patch6004: fix-dracut-install-copy-mode-when-use-clone-ioctl.patch Patch9000: remove-iscsi-related-code-since-it-is-no-longer-main.patch @@ -531,6 +532,9 @@ rm -f 51-dracut-rescue-postinst.sh %endif %changelog +* Fri Sep 6 2024 luhuaxin - 059-10 +- fix(dracut-install): copy mode when use clone ioctl + * Mon Aug 26 2024 yanshuai - 059-9 - remove iscsi-related code since it is no longer maintained by open-iscsi diff --git a/fix-dracut-install-copy-mode-when-use-clone-ioctl.patch b/fix-dracut-install-copy-mode-when-use-clone-ioctl.patch new file mode 100644 index 0000000..828e571 --- /dev/null +++ b/fix-dracut-install-copy-mode-when-use-clone-ioctl.patch @@ -0,0 +1,31 @@ +From a1c9480ac9791eb961507b44b7c0813a9ffd4ca4 Mon Sep 17 00:00:00 2001 +From: Huaxin Lu +Date: Wed, 21 Aug 2024 14:51:53 +0800 +Subject: [PATCH] fix(dracut-install): copy mode when use clone ioctl + +When use clone ioctl to copy a file, the mode of files are missing, +which is inconsistent with the result by using the cp command. +This commit add the process to set mode after clone_file(). + +Signed-off-by: Huaxin Lu +--- + src/install/dracut-install.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/install/dracut-install.c b/src/install/dracut-install.c +index 291c70a..47b799e 100644 +--- a/src/install/dracut-install.c ++++ b/src/install/dracut-install.c +@@ -363,6 +363,9 @@ static int cp(const char *src, const char *dst) + log_info("Failed to chown %s: %m", dst); + } + ++ if (fchmod(dest_desc, sb.st_mode) != 0) ++ log_error("Failed to chown %s: %m", dst); ++ + if (geteuid() == 0 && no_xattr == false) { + if (copy_xattr(dest_desc, source_desc) != 0) + log_error("Failed to copy xattr %s: %m", dst); +-- +2.33.0 + -- Gitee From c903080c7aba822715033ef94aa12cc15f6d8e4e Mon Sep 17 00:00:00 2001 From: root Date: Mon, 26 Aug 2024 17:00:59 +0800 Subject: [PATCH 5/6] remove iscsi-related code since it is no longer maintained by open-iscsi --- dracut.spec | 7 +- ...ated-code-since-it-is-no-longer-main.patch | 129 ++++++++++++++++++ 2 files changed, 135 insertions(+), 1 deletion(-) create mode 100644 remove-iscsi-related-code-since-it-is-no-longer-main.patch diff --git a/dracut.spec b/dracut.spec index ef2ee98..0b54da3 100644 --- a/dracut.spec +++ b/dracut.spec @@ -9,7 +9,7 @@ Name: dracut Version: 059 -Release: 8 +Release: 9 Summary: Initramfs generator using udev @@ -42,6 +42,8 @@ Patch6000: backport-fix-dracut.sh-remove-microcode-check-based-on-CONFIG.patch Patch6001: backport-fix-zfcp_rules-correct-shellcheck-regression-when-pa.patch Patch6003: backport-fix-dracut-install-copy-xattr-when-use-clone-ioctl.patch +Patch9000: remove-iscsi-related-code-since-it-is-no-longer-main.patch + Source1: https://www.gnu.org/licenses/lgpl-2.1.txt Source2: openEuler.conf.example @@ -529,6 +531,9 @@ rm -f 51-dracut-rescue-postinst.sh %endif %changelog +* Mon Aug 26 2024 yanshuai - 059-9 +- remove iscsi-related code since it is no longer maintained by open-iscsi + * Thu Jul 11 2024 zhengxiaoxiao - 059-8 - add backport-fix-dracut-install-copy-xattr-when-use-clone-ioctl.patch diff --git a/remove-iscsi-related-code-since-it-is-no-longer-main.patch b/remove-iscsi-related-code-since-it-is-no-longer-main.patch new file mode 100644 index 0000000..808d9ae --- /dev/null +++ b/remove-iscsi-related-code-since-it-is-no-longer-main.patch @@ -0,0 +1,129 @@ +From 38a3ee547e93c0b11020818cc4a244f89d492031 Mon Sep 17 00:00:00 2001 +From: luck +Date: Sun, 4 Dec 2022 16:00:32 +0800 +Subject: [PATCH] remove iscsi-related code since it is no longer maintained by + open-iscsi + +--- + modules.d/95iscsi/cleanup-iscsi.sh | 3 --- + modules.d/95iscsi/iscsiroot.sh | 8 ------- + modules.d/95iscsi/module-setup.sh | 29 +++-------------------- + test/container/Dockerfile-OpenSuse-latest | 2 +- + 4 files changed, 4 insertions(+), 38 deletions(-) + +diff --git a/modules.d/95iscsi/cleanup-iscsi.sh b/modules.d/95iscsi/cleanup-iscsi.sh +index 8338503..13f4793 100755 +--- a/modules.d/95iscsi/cleanup-iscsi.sh ++++ b/modules.d/95iscsi/cleanup-iscsi.sh +@@ -1,5 +1,2 @@ + #!/bin/sh + +-if [ -z "${DRACUT_SYSTEMD}" ] && { [ -e /sys/module/bnx2i ] || [ -e /sys/module/qedi ]; }; then +- killproc iscsiuio +-fi +diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh +index b6af7f4..39c5f6d 100755 +--- a/modules.d/95iscsi/iscsiroot.sh ++++ b/modules.d/95iscsi/iscsiroot.sh +@@ -36,14 +36,6 @@ iroot=${iroot#:} + # figured out a way how to check whether this is built-in or not + modprobe crc32c 2> /dev/null + +-# start iscsiuio if needed +-if [ -z "${DRACUT_SYSTEMD}" ] \ +- && { [ -e /sys/module/bnx2i ] || [ -e /sys/module/qedi ]; } \ +- && ! [ -e /tmp/iscsiuio-started ]; then +- iscsiuio +- : > /tmp/iscsiuio-started +-fi +- + handle_firmware() { + local ifaces retry _res + +diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh +index e7d74fe..dcb6eea 100755 +--- a/modules.d/95iscsi/module-setup.sh ++++ b/modules.d/95iscsi/module-setup.sh +@@ -185,7 +185,6 @@ cmdline() { + + # called by dracut + install() { +- inst_multiple -o iscsiuio + inst_libdir_file 'libgcc_s.so*' + inst_multiple umount iscsi-iname iscsiadm iscsid + inst_binary sort +@@ -193,10 +192,7 @@ install() { + inst_multiple -o \ + "$systemdsystemunitdir"/iscsid.socket \ + "$systemdsystemunitdir"/iscsid.service \ +- "$systemdsystemunitdir"/iscsiuio.service \ +- "$systemdsystemunitdir"/iscsiuio.socket \ +- "$systemdsystemunitdir"/sockets.target.wants/iscsid.socket \ +- "$systemdsystemunitdir"/sockets.target.wants/iscsiuio.socket ++ "$systemdsystemunitdir"/sockets.target.wants/iscsid.socket + + if [[ $hostonly ]]; then + local -a _filenames +@@ -227,13 +223,10 @@ install() { + "$systemdsystemunitdir"/iscsi-init.service \ + "$systemdsystemunitdir"/iscsid.service \ + "$systemdsystemunitdir"/iscsid.socket \ +- "$systemdsystemunitdir"/iscsiuio.service \ +- "$systemdsystemunitdir"/iscsiuio.socket \ + iscsiadm iscsid + + for i in \ +- iscsid.socket \ +- iscsiuio.socket; do ++ iscsid.socket; do + $SYSTEMCTL -q --root "$initdir" enable "$i" + done + +@@ -253,22 +246,6 @@ install() { + echo "Before=shutdown.target sockets.target" + } > "${initdir}/$systemdsystemunitdir/iscsid.socket.d/dracut.conf" + +- mkdir -p "${initdir}/$systemdsystemunitdir/iscsiuio.service.d" +- { +- echo "[Unit]" +- echo "DefaultDependencies=no" +- echo "Conflicts=shutdown.target" +- echo "Before=shutdown.target" +- } > "${initdir}/$systemdsystemunitdir/iscsiuio.service.d/dracut.conf" +- +- mkdir -p "${initdir}/$systemdsystemunitdir/iscsiuio.socket.d" +- { +- echo "[Unit]" +- echo "DefaultDependencies=no" +- echo "Conflicts=shutdown.target" +- echo "Before=shutdown.target sockets.target" +- } > "${initdir}/$systemdsystemunitdir/iscsiuio.socket.d/dracut.conf" +- + # Fedora 34 iscsid requires iscsi-shutdown.service + # which would terminate all iSCSI connections on switch root + cat > "${initdir}/$systemdsystemunitdir/iscsi-shutdown.service" << EOF +@@ -277,7 +254,7 @@ Description=Dummy iscsi-shutdown.service for the initrd + Documentation=man:iscsid(8) man:iscsiadm(8) + DefaultDependencies=no + Conflicts=shutdown.target +-After=systemd-remount-fs.service network.target iscsid.service iscsiuio.service ++After=systemd-remount-fs.service network.target iscsid.service + Before=remote-fs-pre.target + + [Service] +diff --git a/test/container/Dockerfile-OpenSuse-latest b/test/container/Dockerfile-OpenSuse-latest +index 9007865..32dd8b1 100644 +--- a/test/container/Dockerfile-OpenSuse-latest ++++ b/test/container/Dockerfile-OpenSuse-latest +@@ -13,7 +13,7 @@ RUN dnf -y install --setopt=install_weak_deps=False \ + strace libkmod-devel gcc bzip2 xz tar wget rpm-build make git bash-completion \ + sudo kernel dhcp-client qemu-kvm /usr/bin/qemu-system-$(uname -m) e2fsprogs \ + tcpdump iproute iputils kbd NetworkManager btrfsprogs tgt dbus-broker \ +- iscsiuio open-iscsi which ShellCheck shfmt procps pigz parted squashfs ntfsprogs \ ++ open-iscsi which ShellCheck shfmt procps pigz parted squashfs ntfsprogs \ + && dnf -y remove dracut && dnf -y update && dnf clean all + + # Set default command +-- +2.27.0 + -- Gitee From 2cec0b535fb54fb1726fd65cbb56c28e8bd6684e Mon Sep 17 00:00:00 2001 From: Andy Lau Date: Sun, 24 Nov 2024 14:14:56 +0800 Subject: [PATCH 6/6] dracut command line options do not override .conf files --- ....sh-give-force-add-precedence-over-o.patch | 45 +++++++++++++++++++ dracut.spec | 6 ++- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 backport-feat-dracut-init.sh-give-force-add-precedence-over-o.patch diff --git a/backport-feat-dracut-init.sh-give-force-add-precedence-over-o.patch b/backport-feat-dracut-init.sh-give-force-add-precedence-over-o.patch new file mode 100644 index 0000000..5dd01a7 --- /dev/null +++ b/backport-feat-dracut-init.sh-give-force-add-precedence-over-o.patch @@ -0,0 +1,45 @@ +From 097d4bdb20443c1c5a86cc617ac2ab0c24193d75 Mon Sep 17 00:00:00 2001 +From: Pavel Valena +Date: Sat, 17 Aug 2024 01:43:50 +0200 +Subject: [PATCH] feat(dracut-init.sh): give --force-add precedence over --omit + +This gives precedence of force_add_dracutmodules to omit_dracutmodules, +as there is not other way to override omit_dracutmodules list, and users +would expect it to be overriden from command line. + +Ref: https://github.com/dracut-ng/dracut-ng/pull/569 + +This way, `--add` retains it behaviour, and `--force-add` gains additional +functionality in non-hostonly mode. The module may still be skipped +if the module check returns 1, but it should throw error (as I'd expect +for `--force-add`). + +Ref: https://issues.redhat.com/browse/RHEL-26114 + +(cherry picked from commit a669346f48cbb3278c51ba5e95b1b91f9bfdee0a) + +Resolves: RHEL-26114 +--- + dracut-init.sh | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/dracut-init.sh b/dracut-init.sh +index fe1b1426..27abb07b 100644 +--- a/dracut-init.sh ++++ b/dracut-init.sh +@@ -921,8 +921,10 @@ check_module() { + [[ $2 ]] || mods_checked_as_dep+=" $_mod " + + if [[ " $omit_dracutmodules " == *\ $_mod\ * ]]; then +- ddebug "dracut module '$_mod' will not be installed, because it's in the list to be omitted!" +- return 1 ++ if [[ " $force_add_dracutmodules " != *\ $_mod\ * ]]; then ++ ddebug "Module '$_mod' will not be installed, because it's in the list to be omitted!" ++ return 1 ++ fi + fi + + if [[ " $dracutmodules $add_dracutmodules $force_add_dracutmodules" == *\ $_mod\ * ]]; then +-- +2.34.1 + diff --git a/dracut.spec b/dracut.spec index c1bcc64..0e6d8be 100644 --- a/dracut.spec +++ b/dracut.spec @@ -9,7 +9,7 @@ Name: dracut Version: 059 -Release: 10 +Release: 11 Summary: Initramfs generator using udev @@ -42,6 +42,7 @@ Patch6000: backport-fix-dracut.sh-remove-microcode-check-based-on-CONFIG.patch Patch6001: backport-fix-zfcp_rules-correct-shellcheck-regression-when-pa.patch Patch6003: backport-fix-dracut-install-copy-xattr-when-use-clone-ioctl.patch Patch6004: fix-dracut-install-copy-mode-when-use-clone-ioctl.patch +Patch6005: backport-feat-dracut-init.sh-give-force-add-precedence-over-o.patch Patch9000: remove-iscsi-related-code-since-it-is-no-longer-main.patch @@ -532,6 +533,9 @@ rm -f 51-dracut-rescue-postinst.sh %endif %changelog +* Mon Nov 25 2024 andy - 059-11 +- add backport-feat-dracut-init.sh-give-force-add-precedence-over-o.patch + * Fri Sep 6 2024 luhuaxin - 059-10 - fix(dracut-install): copy mode when use clone ioctl -- Gitee