pmbootstrap install --no-local-pkgs: new option (MR 1951)

Don't install locally compiled packages and package signing keys. This
will be used for the official images generated with pmbootstrap.
This commit is contained in:
Oliver Smith 2020-06-22 13:40:30 +02:00 committed by Alexey Min
parent 05849a9f80
commit c8d581e749
No known key found for this signature in database
GPG key ID: EBF5ECFFFEE34DED
3 changed files with 27 additions and 3 deletions

View file

@ -154,12 +154,20 @@ def create_home_from_skel(args):
def configure_apk(args):
"""
Copies over all keys used locally to compile packages, and disables the
/mnt/pmbootstrap-packages repository.
Copy over all official keys, and the keys used to compile local packages
(unless --no-local-pkgs is set). Then disable the /mnt/pmbootstrap-packages
repository.
"""
# Official keys
pattern = f"{pmb.config.apk_keys_path}/*.pub"
# Official keys + local keys
if args.install_local_pkgs:
pattern = f"{args.work}/config_apk_keys/*.pub"
# Copy over keys
rootfs = args.work + "/chroot_native/mnt/install"
for key in glob.glob(args.work + "/config_apk_keys/*.pub"):
for key in glob.glob(pattern):
pmb.helpers.run.root(args, ["cp", key, rootfs + "/etc/apk/keys/"])
# Disable pmbootstrap repository