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

@ -47,13 +47,13 @@ def check_grsec() -> None:
)
def migrate_success(work: Path, version: int) -> None:
def migrate_success(localdir: Path, version: int) -> None:
logging.info("Migration to version " + str(version) + " done")
with open(work / "version", "w") as handle:
with open(localdir / "version", "w") as handle:
handle.write(str(version) + "\n")
def migrate_work_folder() -> None:
def migrate_localdir() -> None:
# Read current version
context = get_context()
current = 0
@ -131,7 +131,7 @@ def migrate_work_folder() -> None:
raise NonBugError(
"Sorry, we can't migrate that automatically. Please"
" run 'pmbootstrap shutdown', then delete your"
" current work folder manually ('sudo rm -rf "
" current localdir manually ('sudo rm -rf "
f"{context.config.work}') and start over with 'pmbootstrap"
" init'. All your binary packages and caches will"
" be lost."