forked from Mirror/pmbootstrap
chroot: always run apk static (MR 2252)
Testing by building postmarketos-initramfs (which installs >100 packages but is very fast to build, so a worst-case scenario) this results in a ~15-20% speedup (which everything cached and doing multiple back to back runs). From 32 seconds down to 25. Doing a full install with --no-image, this takes us from 70 seconds on my laptop down to 40s! This also lets us drastically simplify pmb/helpers/apk.py! Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
parent
cf651e56d5
commit
b82c4eb167
5 changed files with 41 additions and 43 deletions
|
@ -160,10 +160,16 @@ def init(args: PmbArgs, chroot: Chroot=Chroot.native(), usr_merge=UsrMerge.AUTO,
|
|||
|
||||
# Install alpine-base
|
||||
pmb.helpers.repo.update(args, arch)
|
||||
pkgs = ["alpine-base"]
|
||||
# install apk static in the native chroot so we can run it
|
||||
# we have a forked apk for systemd and this is the easiest
|
||||
# way to install/run it.
|
||||
if chroot.type == ChrootType.NATIVE:
|
||||
pkgs += ["apk-tools-static"]
|
||||
pmb.chroot.apk_static.run(args, ["--root", chroot.path,
|
||||
"--cache-dir", apk_cache,
|
||||
"--initdb", "--arch", arch,
|
||||
"add", "alpine-base"])
|
||||
"add"] + pkgs)
|
||||
|
||||
# Merge /usr
|
||||
if usr_merge is UsrMerge.AUTO and pmb.config.is_systemd_selected(args):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue