chroot: /mnt/pmbootstrap-* -> /mnt/pmbootstrap/*

Have one /mnt/pmbootstrap directory with subdirectories, instead of
several /mnt/pmbootstrap-* directories.

Reviewed-by: Pablo Correa Gómez <ablocorrea@hotmail.com>
Reviewed-by: Luca Weiss <luca@z3ntu.xyz>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230806184729.4891-2-ollieparanoid@postmarketos.org%3E
This commit is contained in:
Oliver Smith 2023-08-06 20:43:28 +02:00
parent b08d29df5d
commit fdbb8eebb8
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
8 changed files with 27 additions and 27 deletions

View File

@ -260,7 +260,7 @@ def override_source(args, apkbuild, pkgver, src, suffix="native"):
return
# Mount source in chroot
mount_path = "/mnt/pmbootstrap-source-override/"
mount_path = "/mnt/pmbootstrap/source-override/"
mount_path_outside = args.work + "/chroot_" + suffix + mount_path
pmb.helpers.mount.bind(args, src, mount_path_outside, umount=True)

View File

@ -54,7 +54,7 @@ def init(args, suffix="native"):
# Copy package signing key to /etc/apk/keys
for key in glob.glob(chroot +
"/mnt/pmbootstrap-abuild-config/*.pub"):
"/mnt/pmbootstrap/abuild-config/*.pub"):
key = key[len(chroot):]
pmb.chroot.root(args, ["cp", key, "/etc/apk/keys/"], suffix)

View File

@ -143,7 +143,7 @@ def packages_get_locally_built_apks(args, packages, arch):
:param packages: list of pkgnames
:param arch: architecture that the locally built packages should have
:returns: list of apk file paths that are valid inside the chroots, e.g.
["/mnt/pmbootstrap-packages/x86_64/hello-world-1-r6.apk", ...]
["/mnt/pmbootstrap/packages/x86_64/hello-world-1-r6.apk", ...]
"""
channel = pmb.config.pmaports.read_config(args)["channel"]
ret = []
@ -157,7 +157,7 @@ def packages_get_locally_built_apks(args, packages, arch):
if not os.path.exists(f"{args.work}/packages/{channel}/{arch}/{apk_file}"):
continue
ret.append(f"/mnt/pmbootstrap-packages/{arch}/{apk_file}")
ret.append(f"/mnt/pmbootstrap/packages/{arch}/{apk_file}")
return ret

View File

@ -210,15 +210,15 @@ chroot_mount_bind = {
"/proc": "/proc",
"$WORK/cache_apk_$ARCH": "/var/cache/apk",
"$WORK/cache_appstream/$ARCH/$CHANNEL": "/mnt/appstream-data",
"$WORK/cache_ccache_$ARCH": "/mnt/pmbootstrap-ccache",
"$WORK/cache_ccache_$ARCH": "/mnt/pmbootstrap/ccache",
"$WORK/cache_distfiles": "/var/cache/distfiles",
"$WORK/cache_git": "/mnt/pmbootstrap-git",
"$WORK/cache_go": "/mnt/pmbootstrap-go",
"$WORK/cache_rust": "/mnt/pmbootstrap-rust",
"$WORK/config_abuild": "/mnt/pmbootstrap-abuild-config",
"$WORK/cache_git": "/mnt/pmbootstrap/git",
"$WORK/cache_go": "/mnt/pmbootstrap/go",
"$WORK/cache_rust": "/mnt/pmbootstrap/rust",
"$WORK/config_abuild": "/mnt/pmbootstrap/abuild-config",
"$WORK/config_apk_keys": "/etc/apk/keys",
"$WORK/images_netboot": "/mnt/pmbootstrap-netboot",
"$WORK/packages/$CHANNEL": "/mnt/pmbootstrap-packages",
"$WORK/images_netboot": "/mnt/pmbootstrap/netboot",
"$WORK/packages/$CHANNEL": "/mnt/pmbootstrap/packages",
}
# Building chroots (all chroots, except for the rootfs_ chroot) get symlinks in
@ -234,14 +234,14 @@ chroot_mount_bind = {
# rust depends caching described above) and to cache build artifacts (GOCACHE,
# similar to ccache).
chroot_home_symlinks = {
"/mnt/pmbootstrap-abuild-config": "/home/pmos/.abuild",
"/mnt/pmbootstrap-ccache": "/home/pmos/.ccache",
"/mnt/pmbootstrap-packages": "/home/pmos/packages/pmos",
"/mnt/pmbootstrap-go/gocache": "/home/pmos/.cache/go-build",
"/mnt/pmbootstrap-go/gomodcache": "/home/pmos/go/pkg/mod",
"/mnt/pmbootstrap-rust/registry/index": "/home/pmos/.cargo/registry/index",
"/mnt/pmbootstrap-rust/registry/cache": "/home/pmos/.cargo/registry/cache",
"/mnt/pmbootstrap-rust/git/db": "/home/pmos/.cargo/git/db",
"/mnt/pmbootstrap/abuild-config": "/home/pmos/.abuild",
"/mnt/pmbootstrap/ccache": "/home/pmos/.ccache",
"/mnt/pmbootstrap/packages": "/home/pmos/packages/pmos",
"/mnt/pmbootstrap/go/gocache": "/home/pmos/.cache/go-build",
"/mnt/pmbootstrap/go/gomodcache": "/home/pmos/go/pkg/mod",
"/mnt/pmbootstrap/rust/registry/index": "/home/pmos/.cargo/registry/index",
"/mnt/pmbootstrap/rust/registry/cache": "/home/pmos/.cargo/registry/cache",
"/mnt/pmbootstrap/rust/git/db": "/home/pmos/.cargo/git/db",
}
# Device nodes to be created in each chroot. Syntax for each entry:

View File

@ -43,10 +43,10 @@ def hash(url, length=8):
def urls(args, user_repository=True, postmarketos_mirror=True, alpine=True):
"""
Get a list of repository URLs, as they are in /etc/apk/repositories.
:param user_repository: add /mnt/pmbootstrap-packages
:param user_repository: add /mnt/pmbootstrap/packages
:param postmarketos_mirror: add postmarketos mirror URLs
:param alpine: add alpine mirror URLs
:returns: list of mirror strings, like ["/mnt/pmbootstrap-packages",
:returns: list of mirror strings, like ["/mnt/pmbootstrap/packages",
"http://...", ...]
"""
ret = []
@ -59,7 +59,7 @@ def urls(args, user_repository=True, postmarketos_mirror=True, alpine=True):
# Local user repository (for packages compiled with pmbootstrap)
if user_repository:
ret.append("/mnt/pmbootstrap-packages")
ret.append("/mnt/pmbootstrap/packages")
# Upstream postmarketOS binary repository
if postmarketos_mirror:

View File

@ -165,7 +165,7 @@ def configure_apk(args):
"""
Copy over all official keys, and the keys used to compile local packages
(unless --no-local-pkgs is set). Then copy the corresponding APKINDEX files
and remove the /mnt/pmbootstrap-packages repository.
and remove the /mnt/pmbootstrap/packages repository.
"""
# Official keys
pattern = f"{pmb.config.apk_keys_path}/*.pub"
@ -187,7 +187,7 @@ def configure_apk(args):
pmb.helpers.run.root(args, ["cp", f, rootfs + "/var/cache/apk/"])
# Disable pmbootstrap repository
pmb.helpers.run.root(args, ["sed", "-i", r"/\/mnt\/pmbootstrap-packages/d",
pmb.helpers.run.root(args, ["sed", "-i", r"/\/mnt\/pmbootstrap\/packages/d",
rootfs + "/etc/apk/repositories"])
pmb.helpers.run.user(args, ["cat", rootfs + "/etc/apk/repositories"])

View File

@ -20,7 +20,7 @@ def start_nbd_server(args, ip="172.16.42.2", port=9999):
chroot = f"{args.work}/chroot_native"
rootfs_path = f"/mnt/pmbootstrap-netboot/{args.device}.img"
rootfs_path = f"/mnt/pmbootstrap/netboot/{args.device}.img"
if not os.path.exists(chroot + rootfs_path) or args.replace:
rootfs_path2 = f"/home/pmos/rootfs/{args.device}.img"
if not os.path.exists(chroot + rootfs_path2):

View File

@ -51,7 +51,7 @@ def test_urls(args, monkeypatch):
monkeypatch.setattr(pmb.config.pmaports, "read_config", read_config)
# Channel: v20.05
assert func(args) == ["/mnt/pmbootstrap-packages",
assert func(args) == ["/mnt/pmbootstrap/packages",
"http://localhost/pmos1/v20.05",
"http://localhost/pmos2/v20.05",
"http://localhost/alpine/v3.11/main",
@ -59,7 +59,7 @@ def test_urls(args, monkeypatch):
# Channel: edge (has Alpine's testing)
channel = "edge"
assert func(args) == ["/mnt/pmbootstrap-packages",
assert func(args) == ["/mnt/pmbootstrap/packages",
"http://localhost/pmos1/master",
"http://localhost/pmos2/master",
"http://localhost/alpine/edge/main",