Skip to content

Commit

Permalink
dracut.sh: fail hard, if we find modules and modules.dep is missing
Browse files Browse the repository at this point in the history
If modules are present in /lib/modules/<kernelversion> and modules.dep
is empty, depmod was not run most likely.
  • Loading branch information
haraldh committed Jan 13, 2016
1 parent 0a7d7f6 commit b019952
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dracut.sh
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,12 @@ abs_outfile=$(readlink -f "$outfile") && outfile="$abs_outfile"

if [[ $no_kernel != yes ]] && [[ -d $srcmods ]]; then
if ! [[ -f $srcmods/modules.dep ]]; then
dwarn "$srcmods/modules.dep is missing. Did you run depmod?"
if [[ -n "$(find "$srcmods" -name '*.ko*')" ]]; then
dfatal "$srcmods/modules.dep is missing. Did you run depmod?"
exit 1
else
dwarn "$srcmods/modules.dep is missing. Did you run depmod?"
fi
elif ! ( command -v gzip &>/dev/null && command -v xz &>/dev/null); then
read _mod < $srcmods/modules.dep
_mod=${_mod%%:*}
Expand Down

0 comments on commit b019952

Please sign in to comment.