From: Kairui Song Date: Mon, 12 Oct 2020 07:23:30 +0000 (+0800) Subject: 99squash: Check require module earlier, and properly X-Git-Tag: 051~42 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=83c65fd3db9f5f3436cfe74ec67d2894dedda397;p=thirdparty%2Fdracut.git 99squash: Check require module earlier, and properly Let 99squash fail earlier if required modules are not enabled or missing, using the new added helper. Signed-off-by: Kairui Song --- diff --git a/dracut.sh b/dracut.sh index 2f2fadd1b..c03d9c58c 100755 --- 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" ) diff --git a/modules.d/99squash/module-setup.sh b/modules.d/99squash/module-setup.sh index 6307377c9..5a6546ad3 100644 --- a/modules.d/99squash/module-setup.sh +++ b/modules.d/99squash/module-setup.sh @@ -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() {