main/postmarketos-mkinitfs: Support initramfs compressions other than gzip
The postmarketos initramfs is larger than android initramfs. This causes problems on some devices like htc-ace that have a very small boot partition (4MB in htc-ace). I've been able to make the boot image small enough to fit by compressing initramfs using lzma.
With this change it should be possible to change the compression in deviceinfo like this: deviceinfo_initramfs_compression='lzma' or even deviceinfo_initramfs_compression='lzma -9'
When no option is specified it defaults to 'gzip -1'.
I'm not very experienced in shell scripting so I'm not sure if this is the best way to do it. I've also added dependencies to compression utilities for all possible initramfs compression algorithms.
Merge request reports
Activity
I'm wondering why we have been using
gzip -1
by default anyway, I might have put it there to make it generate the archive faster... but that's of course not useful when optimizing for size.I'm out of time for today, but I'll think about this MR and write more/merge it over the next days.
In the meantime, maybe someone from @postmarketos has an opinion on this?
Thank you for the patch @mpiatka!
By Oliver Smith on 2019-04-26T21:19:05
mentioned in issue #237 (closed)
By Oliver Smith on 2019-04-28T22:40:27
Isn't there any compression algoritm which reliably produces the smallest archives?
I was wondering about that as well. I think we would need to go with something, that is supported in all kernels that we ship - so something more or less brand new like zstd will not work. But maybe we can go with bzip2 after making sure that it works everywhere.
Compressing speeds doesn't really matter, decompressing does however.
The problem is, that the compression is done through qemu, so you really notice the speed difference.
Let's put the issue of changing the default/mostly used algorithm in a new issue: #237 (closed) (help welcome for anyone interested!)
...and get this one merged as standalone improvement.
@mpiatka: it would be great if you could change the variable name, and add it here: https://wiki.postmarketos.org/wiki/Deviceinfo_reference
By Oliver Smith on 2019-04-28T22:40:48
- Resolved by Administrator
added 1 commit
- 7da884f1 - main/postmarketos-mkinitfs: rename initramfs to initfs
By Martin Piatka on 2019-04-29T13:31:00
added 7 commits
-
7da884f1...badaed71 - 6 commits from branch
postmarketOS:master
- 97e58220 - postmarketos-mkinitfs: Support initramfs compressions other than gzip (!334 (merged))
By Oliver Smith on 2019-04-30T17:07:48
-
7da884f1...badaed71 - 6 commits from branch
mentioned in commit 8caa3706
By Martin Piatka on 2019-04-30T17:12:34
mentioned in issue pmbootstrap#890 (closed)
By Daniele Debernardi on 2020-04-13T20:47:53
mentioned in issue postmarketos-mkinitfs#2 (closed)
By Oliver Smith on 2021-09-03T01:08:11