Skip to content

Commit

Permalink
feat(dracut-init.sh): specify if a module cannot be found or cannot b…
Browse files Browse the repository at this point in the history
…e installed

Do not print the same error message for both situations.
  • Loading branch information
aafeijoo-suse committed Feb 2, 2023
1 parent 1f84ff8 commit a10078a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dracut-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,7 @@ for_each_module_dir() {
local _mod
local _moddir
local _func
local _reason
_func=$1
for _moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
[[ -d $_moddir ]] || continue
Expand All @@ -1085,7 +1086,10 @@ for_each_module_dir() {
&& [[ " $omit_dracutmodules " == *\ $_mod\ * ]] \
&& continue

derror "dracut module '$_mod' cannot be found or installed."
[[ -d $(echo "$dracutbasedir/modules.d"/[0-9][0-9]"$_mod") ]] \
&& _reason="installed" \
|| _reason="found"
derror "dracut module '$_mod' cannot be $_reason."
[[ " $force_add_dracutmodules " == *\ $_mod\ * ]] && exit 1
[[ " $dracutmodules " == *\ $_mod\ * ]] && exit 1
[[ " $add_dracutmodules " == *\ $_mod\ * ]] && exit 1
Expand Down

0 comments on commit a10078a

Please sign in to comment.