Skip to content
Snippets Groups Projects

main/postmarketos-mkinitfs: Support initramfs compressions other than gzip

Merged Imported Administrator requested to merge initramfs_compression into master
All threads resolved!

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.

Edited by Administrator

Merge request reports

Approved by

Merged by AdministratorAdministrator 5 years ago (Apr 30, 2019 5:12pm UTC)

Merge details

  • Changes merged into master with 97e58220.
  • Deleted the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Author Owner

    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

  • Author Owner

    This is very useful, it's good for low-end devices like the LG P698 which only has 5 MB with the boot partition (even through the device doesn't boot because vfp isn't implemented).

    By Danct12 on 2019-04-26T21:21:09

  • Author Owner

    Isn't there any compression algoritm which reliably produces the smallest archives?

    Compressing speeds doesn't really matter, decompressing does however.

    By Bart Ribbers on 2019-04-28T08:08:48

  • Administrator mentioned in issue #237 (closed) · Imported

    mentioned in issue #237 (closed)

    By Oliver Smith on 2019-04-28T22:40:27

  • Author Owner

    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

  • Administrator
  • Administrator added 1 commit · Imported

    added 1 commit

    • 7da884f1 - main/postmarketos-mkinitfs: rename initramfs to initfs

    Compare with previous version

    By Martin Piatka on 2019-04-29T13:31:00

  • Administrator resolved all discussions · Imported

    resolved all discussions

    By Martin Piatka on 2019-04-29T13:31:30

  • Administrator changed the description · Imported

    changed the description

    By Martin Piatka on 2019-04-29T13:32:35

  • Administrator added 7 commits · Imported

    added 7 commits

    Compare with previous version

    By Oliver Smith on 2019-04-30T17:07:48

  • Author Owner

    Thanks again @mpiatka! :tada:

    By Oliver Smith on 2019-04-30T17:12:27

  • Administrator approved this merge request · Imported

    approved this merge request

    By Oliver Smith on 2019-04-30T17:12:31

  • Administrator merged · Imported

    merged

    By Oliver Smith on 2019-04-30T17:12:34

  • Administrator mentioned in commit 8caa3706 · Imported

    mentioned in commit 8caa3706

    By Martin Piatka on 2019-04-30T17:12:34

  • Administrator mentioned in issue pmbootstrap#890 (closed) · Imported

    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

  • Please register or sign in to reply
    Loading