From b8c7678589aafbd7a2d2f2618f8a6725ba591da9 Mon Sep 17 00:00:00 2001 From: Andy Lau Date: Sun, 24 Nov 2024 14:14:56 +0800 Subject: [PATCH] dracut command line options do not override .conf files (cherry picked from commit 2cec0b535fb54fb1726fd65cbb56c28e8bd6684e) --- ....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