]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut.sh: fail hard, if we find modules and modules.dep is missing
authorHarald Hoyer <harald@redhat.com>
Wed, 13 Jan 2016 08:32:24 +0000 (09:32 +0100)
committerHarald Hoyer <harald@redhat.com>
Wed, 13 Jan 2016 08:32:24 +0000 (09:32 +0100)
If modules are present in /lib/modules/<kernelversion> and modules.dep
is empty, depmod was not run most likely.

dracut.sh

index 6dc98582ec75898fa96703aedf0d08f12af93606..98dbe0bcc2594374a281bc2a4d9f17b07ec8ef28 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -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%%:*}