1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-14 20:09:49 +03:00

treewide: split chroots from workdir

Introduce a new "cache" subdirectory in the pmbootstrap workdir, all the
cache and config bits go in here, anything that needs to be accessible
from inside a chroot. The whole dir is then bind-mounted into the chroot
as /cache with appropriate symlinks.

This dir is in the config as config.cache.

In addition, all the cache_* and other config dirs are renamed to
be closer to the names of the equivalent dirs in the chroot (e.g.
abuild-config) and to avoid redundant naming since they are now under a
"cache" dir.

Signed-off-by: Casey Connolly <kcxt@postmarketos.org>
This commit is contained in:
Casey Connolly 2025-05-26 18:23:49 +02:00
parent 1560a3f221
commit 9f8edf539d
34 changed files with 130 additions and 127 deletions

View file

@ -34,7 +34,7 @@ def override_source(
return
# Mount source in chroot
mount_path = "mnt/pmbootstrap/source-override/"
mount_path = "work/source-override/"
mount_path_outside = chroot / mount_path
pmb.helpers.mount.bind(src, mount_path_outside, umount=True)
@ -227,7 +227,7 @@ def run_abuild(
)
pmb.mount.bind(hostchroot.path, buildchroot / "/mnt/sysroot", umount=True)
pkgdir = context.config.work / "packages" / channel
pkgdir = context.config.cache / "packages" / channel
if not pkgdir.exists():
pmb.helpers.run.root(["mkdir", "-p", pkgdir])
pmb.helpers.run.root(
@ -243,7 +243,7 @@ def run_abuild(
[
["mkdir", "-p", "/home/pmos/packages"],
["rm", "-f", "/home/pmos/packages/pmos"],
["ln", "-sf", f"/mnt/pmbootstrap/packages/{channel}", "/home/pmos/packages/pmos"],
["ln", "-sf", f"/cache/packages/{channel}", "/home/pmos/packages/pmos"],
],
buildchroot,
)