Skip to content

Commit

Permalink
feat(dracut-init.sh): give --force-add precedence over --omit
Browse files Browse the repository at this point in the history
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: dracut-ng/dracut-ng#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
  • Loading branch information
pvalena committed Aug 19, 2024
1 parent b925190 commit 097d4bd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dracut-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 097d4bd

Please sign in to comment.