Browse Source

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 <kasong@redhat.com>
master
Kairui Song 4 years ago committed by Daniel Molkentin
parent
commit
83c65fd3db
  1. 11
      dracut.sh
  2. 9
      modules.d/99squash/module-setup.sh

11
dracut.sh

@ -1846,17 +1846,6 @@ fi @@ -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" )

9
modules.d/99squash/module-setup.sh

@ -11,6 +11,13 @@ check() { @@ -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() { @@ -20,7 +27,7 @@ depends() {
}

installkernel() {
hostonly="" instmods -c squashfs loop overlay
hostonly="" instmods squashfs loop overlay
}

install() {

Loading…
Cancel
Save