1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-23 12:35:12 +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

@ -22,7 +22,7 @@ def start_nbd_server(device: str, replace: bool, ip: str = "172.16.42.2", port:
chroot = Chroot.native()
pmb.chroot.init(chroot)
rootfs_path = Path("/mnt/pmbootstrap/netboot") / f"{device}.img"
rootfs_path = Path("/cache/netboot") / f"{device}.img"
if not (chroot / rootfs_path).exists() or replace:
rootfs_path2 = Path("/home/pmos/rootfs") / f"{device}.img"
if not (chroot / rootfs_path2).exists():
@ -35,7 +35,7 @@ def start_nbd_server(device: str, replace: bool, ip: str = "172.16.42.2", port:
return
pmb.chroot.root(["cp", rootfs_path2, rootfs_path])
logging.info(
f"NOTE: Copied device image to {get_context().config.work}"
f"NOTE: Copied device image to {get_context().config.cache}"
f'/images_netboot/. The image will persist "pmbootstrap '
f'zap" for your convenience. Use "pmbootstrap netboot '
f'serve --help" for more options.'