The current kernel config supports xz and zstd among other compression algorithms regarding the kernel itself (xz is selected):
CONFIG_HAVE_KERNEL_GZIP=y CONFIG_HAVE_KERNEL_BZIP2=y CONFIG_HAVE_KERNEL_LZMA=y CONFIG_HAVE_KERNEL_XZ=y CONFIG_HAVE_KERNEL_LZO=y CONFIG_HAVE_KERNEL_LZ4=y CONFIG_HAVE_KERNEL_ZSTD=y # CONFIG_KERNEL_GZIP is not set # CONFIG_KERNEL_BZIP2 is not set # CONFIG_KERNEL_LZMA is not set CONFIG_KERNEL_XZ=y # CONFIG_KERNEL_LZO is not set # CONFIG_KERNEL_LZ4 is not set # CONFIG_KERNEL_ZSTD is not set
But when it comes to available compression algorithms for initrd the list is limited:
CONFIG_RD_GZIP=y # CONFIG_RD_BZIP2 is not set # CONFIG_RD_LZMA is not set # CONFIG_RD_XZ is not set # CONFIG_RD_LZO is not set # CONFIG_RD_LZ4 is not set CONFIG_RD_ZSTD=y
The above means if attempting to configure initramfs.conf to use xz the result becomes gzip as fallback:
$ file initrd.img-6.1.56-amd64-vyos initrd.img-6.1.56-amd64-vyos: gzip compressed data, max compression, from Unix, original size modulo 2^32 106998272
While when using default zstd compression in initramfs.conf:
$ file initrd.img-6.1.56-amd64-vyos initrd.img-6.1.56-amd64-vyos: Zstandard compressed data (v0.8+), Dictionary ID: None
Suggested fix is to add at least support for xz like so:
CONFIG_RD_GZIP=y # CONFIG_RD_BZIP2 is not set # CONFIG_RD_LZMA is not set CONFIG_RD_XZ=y # CONFIG_RD_LZO is not set # CONFIG_RD_LZ4 is not set CONFIG_RD_ZSTD=y
If size matters then gzip can be unset like so:
# CONFIG_RD_GZIP is not set
Support for both xz and zstd should remain due to most likely upcoming changes for initrd:
https://www.phoronix.com/news/Ubuntu-2023-Initramfs-Compress