From 1232c35e48c79c2e20274878549f092fa8be2103 Mon Sep 17 00:00:00 2001 From: Caleb Connolly Date: Thu, 4 Apr 2024 13:00:13 +0200 Subject: [PATCH] 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 --- pmb/build/init.py | 3 +++ pmb/chroot/mount.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pmb/build/init.py b/pmb/build/init.py index b3f3edd7..d138fb38 100644 --- a/pmb/build/init.py +++ b/pmb/build/init.py @@ -20,6 +20,9 @@ def init_abuild_minimal(args: PmbArgs, chroot: Chroot=Chroot.native()): if os.path.exists(marker): 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) # Fix permissions diff --git a/pmb/chroot/mount.py b/pmb/chroot/mount.py index b6919149..87b64d89 100644 --- a/pmb/chroot/mount.py +++ b/pmb/chroot/mount.py @@ -107,7 +107,7 @@ def mount_native_into_foreign(args: PmbArgs, chroot: Chroot): if not musl_link.is_symlink(): pmb.helpers.run.root(args, ["ln", "-s", "/native/lib/" + musl, 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): """ Safely remove /mnt/pmbootstrap directories from the chroot, without