pmb.build: use pigz instead of gzip (MR 2252)

This is multithreaded, and by consequence much much faster than default
gzip. Since we switched to running gzip from the native chroot we also
changed from running it in the fastest mode, now we're running it with
-9 it can be pretty slow on any kind of mobile hardware.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
Caleb Connolly 2024-04-04 13:00:13 +02:00 committed by Oliver Smith
parent 31cc898dd5
commit 1232c35e48
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
2 changed files with 4 additions and 1 deletions

View file

@ -20,6 +20,9 @@ def init_abuild_minimal(args: PmbArgs, chroot: Chroot=Chroot.native()):
if os.path.exists(marker): if os.path.exists(marker):
return return
# pigz is multithreaded and makes compression must faster, we install it in the native
# chroot and then symlink it into the buildroot so we aren't running it through QEMU.
pmb.chroot.apk.install(args, ["pigz"], Chroot.native(), build=False)
pmb.chroot.apk.install(args, ["abuild"], chroot, build=False) pmb.chroot.apk.install(args, ["abuild"], chroot, build=False)
# Fix permissions # Fix permissions

View file

@ -107,7 +107,7 @@ def mount_native_into_foreign(args: PmbArgs, chroot: Chroot):
if not musl_link.is_symlink(): if not musl_link.is_symlink():
pmb.helpers.run.root(args, ["ln", "-s", "/native/lib/" + musl, pmb.helpers.run.root(args, ["ln", "-s", "/native/lib/" + musl,
musl_link]) musl_link])
pmb.helpers.run.root(args, ["ln", "-sf", "/native/bin/busybox", "/usr/local/bin/gzip"]) pmb.helpers.run.root(args, ["ln", "-sf", "/native/usr/bin/pigz", "/usr/local/bin/pigz"])
def remove_mnt_pmbootstrap(args: PmbArgs, chroot: Chroot): def remove_mnt_pmbootstrap(args: PmbArgs, chroot: Chroot):
""" Safely remove /mnt/pmbootstrap directories from the chroot, without """ Safely remove /mnt/pmbootstrap directories from the chroot, without