Skip to content
Snippets Groups Projects
Unverified Commit 97e58220 authored by Martin Piatka's avatar Martin Piatka Committed by Oliver Smith
Browse files

postmarketos-mkinitfs: Support initramfs compressions other than gzip (!334)

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_initfs_compression='lzma'
or even deviceinfo_initfs_compression='lzma -9'. When no option is
specified it defaults to 'gzip -1'.

I've also added dependencies to compression utilities for all possible
initramfs compression algorithms.
parent badaed71
No related branches found
No related tags found
No related merge requests found
pkgname=postmarketos-mkinitfs pkgname=postmarketos-mkinitfs
pkgver=0.7.6 pkgver=0.7.7
pkgrel=0 pkgrel=0
pkgdesc="Tool to generate initramfs images for postmarketOS" pkgdesc="Tool to generate initramfs images for postmarketOS"
url="https://postmarketos.org" url="https://postmarketos.org"
# multipath-tools: kpartx # multipath-tools: kpartx
depends="busybox-extras lddtree cryptsetup kmod multipath-tools postmarketos-splash depends="busybox-extras lddtree cryptsetup kmod multipath-tools postmarketos-splash
device-mapper parted e2fsprogs e2fsprogs-extra osk-sdl charging-sdl triggerhappy" device-mapper parted e2fsprogs e2fsprogs-extra osk-sdl charging-sdl triggerhappy xz bzip2 lz4"
triggers="$pkgname.trigger=/etc/postmarketos-mkinitfs/hooks:/usr/share/kernel/*" triggers="$pkgname.trigger=/etc/postmarketos-mkinitfs/hooks:/usr/share/kernel/*"
source="init.sh.in init_functions.sh mkinitfs.sh" source="init.sh.in init_functions.sh mkinitfs.sh"
arch="noarch" arch="noarch"
...@@ -26,4 +26,4 @@ package() { ...@@ -26,4 +26,4 @@ package() {
sha512sums="2479b08e48450f7d46c83b1117d0d81edf26dad8f2107e2ae1b10689f1b063c38181be735957ec1a16392302815355ca879ab71fc28d084e075f490cb2ac42b5 init.sh.in sha512sums="2479b08e48450f7d46c83b1117d0d81edf26dad8f2107e2ae1b10689f1b063c38181be735957ec1a16392302815355ca879ab71fc28d084e075f490cb2ac42b5 init.sh.in
e4972ba261a72daba0d1f2fad425a3df082e18263a716746005f31a5cae313d66c168e09cd1bd0af3cee6a97bdb4b329ee3a8d03381a5b104fb39476bdcc7938 init_functions.sh e4972ba261a72daba0d1f2fad425a3df082e18263a716746005f31a5cae313d66c168e09cd1bd0af3cee6a97bdb4b329ee3a8d03381a5b104fb39476bdcc7938 init_functions.sh
5ad842720e7f322bab43aa585103f5bd7e4b11e2e8cce553d406123e4379c160a1b8d7ed1b6aae75b040b2df309c105c412826a8467d552576d6d9ac1f6792ab mkinitfs.sh" 2de44d5109be98aa2476640cb298b5dcb8366b8104af188768634ea3a0eeea9b7cc71e94f2f1ce09cd3b8200b7d4515719905ecf1301fcce94ded34f36e849e1 mkinitfs.sh"
...@@ -192,9 +192,10 @@ replace_init_variables() ...@@ -192,9 +192,10 @@ replace_init_variables()
create_cpio_image() create_cpio_image()
{ {
cd "$1" cd "$1"
[ -z "$deviceinfo_initfs_compression" ] && deviceinfo_initfs_compression='gzip -1'
find . -print0 \ find . -print0 \
| cpio --quiet -o -H newc \ | cpio --quiet -o -H newc \
| gzip -1 > "$2" | $deviceinfo_initfs_compression > "$2"
} }
# Required command check with useful error message # Required command check with useful error message
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment