#976881 Allow to configure compression algorithms other than GZIP

Package:
tiny-initramfs-core
Source:
tiny-initramfs
Description:
Minimalistic initramfs implementation (core tools)
Submitter:
Paul Menzel
Date:
2020-12-08 20:57:03 UTC
Severity:
wishlist
#976881#5
Date:
2020-12-08 20:56:20 UTC
From:
To:
Dear Debian folks,


I only learned about tiny-initramfs today, when Ben Hutchings told me
about it. What a great program! Thank you for packaging it for Debian.

On my test device, the resulting initrd is 1.3 MB big:

     -rw------- 1 root root 1,3M  8. Dez 20:15
/boot/initrd.img-5.9.0-3-amd64

The resulting boot time is 12.6 ms:

     [    0.199542] calling  populate_rootfs+0x0/0x109 @ 1
     [    0.199574] Trying to unpack rootfs image as initramfs...
     [    0.212449] Freeing initrd memory: 1328K
     [    0.212455] initcall populate_rootfs+0x0/0x109 returned 0 after
12606 usecs

Using a different compression algorithm, can improve this even more.

For example, LZ4 is expected to increase the image size but to be much
faster when decompressing.

Editing `/usr/sbin/mktirfs` to use `lz4 -9 -l` (copied from `mkinitramfs`)

     find . ! -name . -print0 | sort -z | cpio --null -o --quiet -R 0:0
-H newc | lz4 -9 -l >> "$image_name"

and running `sudo update-tirfs`, the initrd image size increases a
little to 1.6 MB:

     -rw------- 1 root root 1,6M  8. Dez 21:37 initrd.img-5.9.0-3-amd64

But loading and unpacking takes now only 3.6 ms:

     [    0.203611] calling  populate_rootfs+0x0/0x109 @ 1
     [    0.203638] Trying to unpack rootfs image as initramfs...
     [    0.207279] Freeing initrd memory: 1552K
     [    0.207289] initcall populate_rootfs+0x0/0x109 returned 0 after
3588 usecs

So, it’d be really great, if the compression algorithm could be changed.


Kind regards,

Paul


PS: For the record, here is my initrd content:

```
$ lsinitramfs /boot/initrd.img-5.9.0-3-amd64
kernel
kernel/x86
kernel/x86/microcode
kernel/x86/microcode/.enuineIntel.align.0123456789abc
kernel/x86/microcode/GenuineIntel.bin
crc16.ko
crc32c_generic.ko
crc32c-intel.ko
crct10dif_common.ko
crct10dif_generic.ko
crc-t10dif.ko
crct10dif-pclmul.ko
dev
ext4.ko
init
jbd2.ko
mbcache.ko
mmc_block.ko
mmc_core.ko
modules
nvme-core.ko
nvme.ko
proc
scsi_mod.ko
sd_mod.ko
t10-pi.ko
target
```