Bug#989143: initramfs-tools: doesn’t actually compress with zstd
Control: tags -1 + moreinfo
Hi Christoph,
> Just noted by coincidence, that even though I have set:
> COMPRESS=zstd
> and zstd is installed and even runs (seen in e.g. top utility) when running
> update-initramfs -u
> the files are in the end nevertheless plain cpio:
> file /boot/initrd.img-5.10.0-7-amd64
> /boot/initrd.img-5.10.0-7-amd64: ASCII cpio archive (SVR4 with no CRC)
I can see the same behaviour on my amd64 machine, but on my arm64
system 'file' identifies the initramfs images as zstd archives:
/boot/initrd.img-5.10.0-6-arm64: Zstandard compressed data (v0.8+), Dictionary ID: None
According to the last lines of /usr/sbin/mkinitramfs, there seems to be
a non-compressed cpio at the top of your amd64's initrd.img which is
followed by the zstd-compressed one. To validate my argumentation,
please set 'COMPRESS=gzip' in '/etc/initramfs-tools/initramfs.conf',
run 'update-initramfs -u' again and compare the sizes of the (probably)
zstd-compressed one with the gzip-compressed one.
On my amd64 machine, it looks like this:
$ file initrd-*/*
initrd-gzip-compressed/initrd.img-5.10.0-6-amd64: ASCII cpio archive (SVR4 with no CRC)
initrd-zstd-compressed/initrd.img-5.10.0-6-amd64: ASCII cpio archive (SVR4 with no CRC)
$ ls -hs initrd-*/*
36M initrd-gzip-compressed/initrd.img-5.10.0-6-amd64
28M initrd-zstd-compressed/initrd.img-5.10.0-6-amd64
.
Kind regards,
Nicolas
PS: Does anyone know, how to extract the second (aka compressed) cpio
archive from the combined initrd.img?
Reply to: