]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
99squash: Check require module earlier, and properly
authorKairui Song <kasong@redhat.com>
Mon, 12 Oct 2020 07:23:30 +0000 (15:23 +0800)
committerDaniel Molkentin <daniel@molkentin.de>
Wed, 21 Oct 2020 15:04:00 +0000 (17:04 +0200)
Let 99squash fail earlier if required modules are not enabled or
missing, using the new added helper.

Signed-off-by: Kairui Song <kasong@redhat.com>
dracut.sh
modules.d/99squash/module-setup.sh

index 2f2fadd1ba2aa527583788b6ba27fe7a52f62889..c03d9c58cca94e5284259545504c6a24297fe774 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -1846,17 +1846,6 @@ fi
 
 if dracut_module_included "squash"; then
     dinfo "*** Install squash loader ***"
-    for config in \
-      CONFIG_SQUASHFS \
-      CONFIG_OVERLAY_FS \
-      CONFIG_DEVTMPFS;
-    do
-      if ! check_kernel_config $config; then
-        dfatal "$config have to be enabled for dracut squash module to work"
-        exit 1
-      fi
-    done
-
     readonly squash_dir="$initdir/squash/root"
     readonly squash_img="$initdir/squash/root.img"
     readonly squash_candidate=( "usr" "etc" )
index 6307377c9f40fb55dedef0e9fd44f9da1e94ea9f..5a6546ad3087a8dd3a56ad191773dda51ca45281 100644 (file)
@@ -11,6 +11,13 @@ check() {
         return 1
     fi
 
+    for i in squashfs loop overlay; do
+        if ! check_kernel_module $i; then
+            derror "dracut-squash module requires kernel module $i"
+            return 1
+        fi
+    done
+
     return 255
 }
 
@@ -20,7 +27,7 @@ depends() {
 }
 
 installkernel() {
-    hostonly="" instmods -c squashfs loop overlay
+    hostonly="" instmods squashfs loop overlay
 }
 
 install() {