Make initramfs smaller #6006
Replies: 2 comments
-
I am an idiot.
part later, but dracut is built right. For aosc 675, the compression currently does:
which is less than satisfactory, but not nothing. |
Beta Was this translation helpful? Give feedback.
-
So I experimented a bit with decompressing before putting them into initrd. The short story is that there appears to be 1.5 MB of saving, which isn't much: drwxr-xr-x 1 root root 126 May 15 16:26 675
-rw-r--r-- 1 root root 527473132 May 15 16:35 675-decomp.cpio
-rw-r--r-- 1 a2 users 169533002 May 15 16:35 675-decomp.cpio.zst
-rw-r--r-- 1 a2 users 151227720 May 15 16:35 675-decomp.cpio.zst.15
-rw-r--r-- 1 a2 users 239912448 May 15 16:19 675real.img
-rw-r--r-- 1 a2 users 171053780 May 15 16:19 675real.img.zst (though look at the 151M from zstd -15!)
Then to produce the two compressed files:
Since
So unpacking does help with compression, but zstd needs to be working hard enough for that help to matter. Do we want to slow down initramfs generation for that? If we don't want to compromise on speed, we might have better luck just thinking about what to not include in initramfs.
|
Beta Was this translation helpful? Give feedback.
-
This used to be a misguided bug report.
Bug description
/boot/initramfs-6.7.5-aosc-main.img
is not a compressed file, despite the intentions of our dracut.conf clearly asking for zstd.Steps to reproduce
file /boot/initramfs-6.7.5-aosc-main.img
says/boot/initramfs-6.7.5-aosc-main.img: ASCII cpio archive (SVR4 with no CRC)
binwalk /boot/initramfs-6.7.5-aosc-main.img
reveals that it's actually a bunch of cpios, some carrying xz-compressed firmware, others carrying zst-compressed modules. Surely we can improve the compression somewhat by going solid: don't compress the individual files, compress the whole thing.Update channel(s)
stable
Package and version
While we're at it: dracut has its own opinion on zstd flags when you just write
compress=zstd
; see https://github.com/dracutdevs/dracut/blob/5d2bda46f4e75e85445ee4d3bd3f68bf966287b9/dracut.sh#L2412C1-L2414C11Beta Was this translation helpful? Give feedback.
All reactions