From bc639c976358c77ea6b5cce51dceffa3485055ce Mon Sep 17 00:00:00 2001 From: Kairui Song Date: Thu, 15 Oct 2020 18:16:43 +0800 Subject: [PATCH] Add a helper to omit non-mandatory dracut module Use dracut_args to omit some non-mandatory modules. Signed-off-by: Kairui Song Acked-by: Lianbo Jiang --- dracut-module-setup.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index ae7af4e..b54447b 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -20,6 +20,10 @@ check() { depends() { local _dep="base shutdown" + add_opt_module() { + [[ " $omit_dracutmodules " != *\ $1\ * ]] && _dep="$_dep $1" + } + is_squash_available() { for kmodule in squashfs overlay loop; do if [ -z "$KDUMP_KERNELVER" ]; then @@ -31,7 +35,7 @@ depends() { } if is_squash_available && ! is_fadump_capable; then - _dep="$_dep squash" + add_opt_module squash else dwarning "Required modules to build a squashed kdump image is missing!" fi @@ -45,7 +49,7 @@ depends() { fi if [ -n "$( find /sys/devices -name drm )" ] || [ -d /sys/module/hyperv_fb ]; then - _dep="$_dep drm" + add_opt_module drm fi if is_generic_fence_kdump || is_pcs_fence_kdump; then