From 591118c56da2bfcea060e3b7671bc87b23c0e44a Mon Sep 17 00:00:00 2001 From: Antonio Alvarez Feijoo Date: Fri, 10 Sep 2021 13:45:46 +0200 Subject: [PATCH] feat(dracut.sh): check if target kernel has zstd support compiled in If compression option is zstd, check if target kernel supports it. Otherwise, do not compress the initramfs image. --- dracut.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dracut.sh b/dracut.sh index 19d21ed971..0f111e80cf 100755 --- a/dracut.sh +++ b/dracut.sh @@ -2381,6 +2381,11 @@ case $compress in ;; esac +if [[ $compress == $DRACUT_COMPRESS_ZSTD* ]] && ! check_kernel_config CONFIG_RD_ZSTD; then + dwarn "dracut: kernel has no zstd support compiled in." + compress="cat" +fi + if ! ( umask 077 cd "$initdir"