Skip to content

Commit f9c7dea

Browse files
committed
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.
1 parent 6f5f44e commit f9c7dea

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

dracut.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2381,6 +2381,11 @@ case $compress in
23812381
;;
23822382
esac
23832383
2384+
if [[ $compress == $DRACUT_COMPRESS_ZSTD* ]] && ! check_kernel_config CONFIG_RD_ZSTD; then
2385+
dwarn "dracut: kernel has no zstd support compiled in."
2386+
compress="cat"
2387+
fi
2388+
23842389
if ! (
23852390
umask 077
23862391
cd "$initdir"

0 commit comments

Comments
 (0)