Blame SOURCES/0222-dracut-functions.sh-exit-for-missing-force-add-or-ad.patch

18971c
From 815ab93fe9f57aa3e17066d9564ce5350f95b35a Mon Sep 17 00:00:00 2001
18971c
From: Harald Hoyer <harald@redhat.com>
18971c
Date: Fri, 12 Sep 2014 10:19:28 +0200
18971c
Subject: [PATCH] dracut-functions.sh: exit for missing  --force-add or --add
18971c
 dracut modules
18971c
18971c
Better exit with fail early, so there is no surprise on reboot.
18971c
18971c
(cherry picked from commit a49cac2e65eb1beb8b0442b74aaa4851d184c0ce)
18971c
---
18971c
 dracut-functions.sh | 10 ++++++++--
18971c
 1 file changed, 8 insertions(+), 2 deletions(-)
18971c
18971c
diff --git a/dracut-functions.sh b/dracut-functions.sh
18971c
index 8a0cd301..6e0b44ae 100755
18971c
--- a/dracut-functions.sh
18971c
+++ b/dracut-functions.sh
18971c
@@ -1314,11 +1314,17 @@ for_each_module_dir() {
18971c
 
18971c
     # Report any missing dracut modules, the user has specified
18971c
     _modcheck="$add_dracutmodules $force_add_dracutmodules"
18971c
-    [[ $dracutmodules != all ]] && _modcheck="$m $dracutmodules"
18971c
+    [[ $dracutmodules != all ]] && _modcheck="$_modcheck $dracutmodules"
18971c
     for _mod in $_modcheck; do
18971c
         [[ " $mods_to_load " == *\ $_mod\ * ]] && continue
18971c
-        [[ " $omit_dracutmodules " == *\ $_mod\ * ]] && continue
18971c
+
18971c
+        [[ " $force_add_dracutmodules " != *\ $_mod\ * ]] \
18971c
+            && [[ " $omit_dracutmodules " == *\ $_mod\ * ]] \
18971c
+            && continue
18971c
+
18971c
         derror "dracut module '$_mod' cannot be found or installed."
18971c
+        [[ " $force_add_dracutmodules " == *\ $_mod\ * ]] && exit 1
18971c
+        [[ " $add_dracutmodules " == *\ $_mod\ * ]] && exit 1
18971c
     done
18971c
 }
18971c