Add a helper to omit non-mandatory dracut module

Use dracut_args to omit some non-mandatory modules.

Signed-off-by: Kairui Song <kasong@redhat.com>
Acked-by: Lianbo Jiang <lijiang@redhat.com>
This commit is contained in:
Kairui Song 2020-10-15 18:16:43 +08:00
parent 08de712528
commit bc639c9763

View File

@ -20,6 +20,10 @@ check() {
depends() { depends() {
local _dep="base shutdown" local _dep="base shutdown"
add_opt_module() {
[[ " $omit_dracutmodules " != *\ $1\ * ]] && _dep="$_dep $1"
}
is_squash_available() { is_squash_available() {
for kmodule in squashfs overlay loop; do for kmodule in squashfs overlay loop; do
if [ -z "$KDUMP_KERNELVER" ]; then if [ -z "$KDUMP_KERNELVER" ]; then
@ -31,7 +35,7 @@ depends() {
} }
if is_squash_available && ! is_fadump_capable; then if is_squash_available && ! is_fadump_capable; then
_dep="$_dep squash" add_opt_module squash
else else
dwarning "Required modules to build a squashed kdump image is missing!" dwarning "Required modules to build a squashed kdump image is missing!"
fi fi
@ -45,7 +49,7 @@ depends() {
fi fi
if [ -n "$( find /sys/devices -name drm )" ] || [ -d /sys/module/hyperv_fb ]; then if [ -n "$( find /sys/devices -name drm )" ] || [ -d /sys/module/hyperv_fb ]; then
_dep="$_dep drm" add_opt_module drm
fi fi
if is_generic_fence_kdump || is_pcs_fence_kdump; then if is_generic_fence_kdump || is_pcs_fence_kdump; then