Blame SOURCES/0486-dracut.sh-fail-hard-if-we-find-modules-and-modules.d.patch

712866
From 9301650e17a24194b0a4f78d8f91b87ef62d46dc Mon Sep 17 00:00:00 2001
712866
From: Harald Hoyer <harald@redhat.com>
712866
Date: Wed, 13 Jan 2016 09:32:24 +0100
712866
Subject: [PATCH] dracut.sh: fail hard, if we find modules and modules.dep is
712866
 missing
712866
712866
If modules are present in /lib/modules/<kernelversion> and modules.dep
712866
is empty, depmod was not run most likely.
712866
---
712866
 dracut.sh | 11 ++++++++---
712866
 1 file changed, 8 insertions(+), 3 deletions(-)
712866
712866
diff --git a/dracut.sh b/dracut.sh
712866
index e45dc7b..f4e8509 100755
712866
--- a/dracut.sh
712866
+++ b/dracut.sh
712866
@@ -969,9 +969,14 @@ esac
712866
 abs_outfile=$(readlink -f "$outfile") && outfile="$abs_outfile"
712866
 
712866
 if [[ -d $srcmods ]]; then
712866
-    [[ -f $srcmods/modules.dep ]] || {
712866
-      dwarn "$srcmods/modules.dep is missing. Did you run depmod?"
712866
-    }
712866
+    if ! [[ -f $srcmods/modules.dep ]]; then
712866
+        if [[ -n "$(find "$srcmods" -name '*.ko*')" ]]; then
712866
+            dfatal "$srcmods/modules.dep is missing. Did you run depmod?"
712866
+            exit 1
712866
+        else
712866
+            dwarn "$srcmods/modules.dep is missing. Did you run depmod?"
712866
+        fi
712866
+    fi
712866
 fi
712866
 
712866
 if [[ ! $print_cmdline ]]; then