]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
feat(dracut.sh): check if target kernel has zstd support compiled in
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Fri, 10 Sep 2021 11:45:46 +0000 (13:45 +0200)
committerJóhann B. Guðmundsson <johannbg@gmail.com>
Sat, 11 Sep 2021 06:44:40 +0000 (06:44 +0000)
If compression option is zstd, check if target kernel supports it.
Otherwise, do not compress the initramfs image.

dracut.sh

index 19d21ed9715e9c1f0afc33a28b5fc5a72f1296fb..0f111e80cf06c07984ddd957acd4af27aed35459 100755 (executable)
--- 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"