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:
parent
1560a3f221
commit
9f8edf539d
34 changed files with 130 additions and 127 deletions
|
@ -5,6 +5,7 @@ from pmb.core.context import Context
|
|||
from pmb.helpers import logging
|
||||
import os
|
||||
import pathlib
|
||||
import shutil
|
||||
|
||||
import pmb.build
|
||||
import pmb.config
|
||||
|
@ -54,16 +55,15 @@ def init(chroot: Chroot = Chroot.native()) -> bool:
|
|||
init_abuild_minimal(chroot)
|
||||
|
||||
# Generate package signing keys
|
||||
if not os.path.exists(get_context().config.work / "config_abuild/abuild.conf"):
|
||||
if not os.path.exists(get_context().config.cache / "abuild-config/abuild.conf"):
|
||||
logging.info(f"({chroot}) generate abuild keys")
|
||||
pmb.chroot.user(
|
||||
["abuild-keygen", "-n", "-q", "-a"], chroot, env={"PACKAGER": "pmos <pmos@local>"}
|
||||
)
|
||||
|
||||
# Copy package signing key to /etc/apk/keys
|
||||
for key in (chroot / "mnt/pmbootstrap/abuild-config").glob("*.pub"):
|
||||
key = key.relative_to(chroot.path)
|
||||
pmb.chroot.root(["cp", key, "/etc/apk/keys/"], chroot)
|
||||
for key in (get_context().config.cache / "abuild-config").glob("*.pub"):
|
||||
shutil.copy(key, chroot / "etc/apk/keys")
|
||||
|
||||
apk_arch = chroot.arch
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue