Skip to content

mkinitcpio: Use uncompressed initramfs with compressed modules by default

By default, mkinitcpio decompresses kernel modules into a temporary directory when building initramfs, then compresses the resulting initramfs fully as a single blob.

This might have been a better choice when we didn't have compressed firmware, but this seems to actually slow down boot now (Especially on a slow CPU), meanwhile we don't actually need whole initramfs contents on boot. Individual modules & firmware blobs are already compressed, so the resulting initramfs size isn't affected much. This speeds up both initramfs creation and boot, while also saving up on RAM in early boot.

This is especially important considering GSP, amdgpu firmwares or the likes make up for a significant portion of initramfs size, while we aren't going to need all of them in the boot process.

On-disk default initramfs size is around 20M before & after this patch on my machine, however it would use around 80M of RAM at decompression time before, and doesn't anymore. The respective numbers for fallback initramfs are 120M on disk, and 400M of RAM used in peak before the patch.

Merge request reports