]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
feat(squash): use require_kernel_modules for better module checking
authorKairui Song <kasong@tencent.com>
Tue, 6 Dec 2022 16:04:40 +0000 (00:04 +0800)
committerAntonio Álvarez Feijoo <antonio.feijoo@suse.com>
Wed, 21 Dec 2022 16:07:46 +0000 (17:07 +0100)
require_kernel_modules prints more friendly erorr message and make the
code cleaner.

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

index f31ff556b60b5e4821b6ed607d97abebaa7699ce..81311d3a842b57a37f810629c4d8977a67f7f587 100755 (executable)
@@ -2,13 +2,7 @@
 
 check() {
     require_binaries mksquashfs unsquashfs || return 1
-
-    for i in CONFIG_SQUASHFS CONFIG_BLK_DEV_LOOP CONFIG_OVERLAY_FS; do
-        if ! check_kernel_config $i; then
-            dinfo "dracut-squash module requires kernel configuration $i (y or m)"
-            return 1
-        fi
-    done
+    require_kernel_modules squashfs loop overlay || return 1
 
     return 255
 }