From 9663307ceb244ae6293e090f418f9888d6dff8bf Mon Sep 17 00:00:00 2001 From: Benjamin Drung Date: Thu, 20 Jun 2024 14:11:02 +0200 Subject: [PATCH] feat(dracut): search for zstd compressor first Searching for an available compressor was introduced in commit 693b7a32833b ("Cleanup compressor handling") but the order was not justified. Ubuntu uses zstd for compressing the packages, the kernel modules, firmware files, and the initrd (when using initramfs-tools). zstd has a good compromise between compression ratio and speed. Therefore search for zstd first. Further readings: * https://lists.ubuntu.com/archives/ubuntu-devel/2021-December/041726.html * analysis.ipynb on https://github.com/waveform80/compression --- dracut.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dracut.sh b/dracut.sh index 211742bdb..f3f6c6827 100755 --- a/dracut.sh +++ b/dracut.sh @@ -2364,7 +2364,7 @@ fi if ! [[ $compress ]]; then # check all known compressors, if none specified - for i in $DRACUT_COMPRESS_PIGZ $DRACUT_COMPRESS_GZIP $DRACUT_COMPRESS_LZ4 $DRACUT_COMPRESS_LZOP $DRACUT_COMPRESS_ZSTD $DRACUT_COMPRESS_LZMA $DRACUT_COMPRESS_XZ $DRACUT_COMPRESS_LBZIP2 $DRACUT_COMPRESS_BZIP2 $DRACUT_COMPRESS_CAT; do + for i in $DRACUT_COMPRESS_ZSTD $DRACUT_COMPRESS_PIGZ $DRACUT_COMPRESS_GZIP $DRACUT_COMPRESS_LZ4 $DRACUT_COMPRESS_LZOP $DRACUT_COMPRESS_LZMA $DRACUT_COMPRESS_XZ $DRACUT_COMPRESS_LBZIP2 $DRACUT_COMPRESS_BZIP2 $DRACUT_COMPRESS_CAT; do [[ $i != "$DRACUT_COMPRESS_ZSTD" || $DRACUT_KERNEL_RD_ZSTD ]] || continue command -v "$i" &> /dev/null || continue compress="$i" -- 2.47.3