pmbootstrap: install: make cached remote repositories available on first install v2 APPLIED

Pablo Correa Gómez: 1
 install: make cached remote repositories available on first install

 1 files changed, 9 insertions(+), 2 deletions(-)
#948389 .build.yml success
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~postmarketos/pmbootstrap-devel/patches/39354/mbox | git am -3
Learn more about email & git

[PATCH pmbootstrap v2] install: make cached remote repositories available on first install Export this patch

This allows the usage of APK (and apk-polkit-rs) on first boot without
the need to establish an internet connection.

Closes https://gitlab.com/postmarketOS/pmbootstrap/-/issues/2206

Signed-off-by: Pablo Correa Gómez <ablocorrea@hotmail.com>

This provides a functional GS app on install from the pmOS side. First
boot still needs internet and is terribly slow due to
only existing in 44, but I am pretty confident that with that code the
first GS use will actually be remarkably seamless!

 * Fix flake8

 pmb/install/_install.py | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/pmb/install/_install.py b/pmb/install/_install.py
index 768fa86d..563fc20f 100644
--- a/pmb/install/_install.py
+++ b/pmb/install/_install.py
@@ -164,8 +164,8 @@ def create_home_from_skel(args):
def configure_apk(args):
    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
    (unless --no-local-pkgs is set). Then copy the corresponding APKINDEX files
    and remove the /mnt/pmbootstrap-packages repository.
    # Official keys
    pattern = f"{pmb.config.apk_keys_path}/*.pub"
@@ -179,6 +179,13 @@ def configure_apk(args):
    for key in glob.glob(pattern):
        pmb.helpers.run.root(args, ["cp", key, rootfs + "/etc/apk/keys/"])

    # Copy over the corresponding APKINDEX files from cache
    index_files = pmb.helpers.repo.apkindex_files(args,
    for f in index_files:
        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",
                                rootfs + "/etc/apk/repositories"])
pmbootstrap/patches/.build.yml: SUCCESS in 15m55s

[install: make cached remote repositories available on first install][0] v2 from [Pablo Correa Gómez][1]

[0]: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/patches/39354
[1]: mailto:ablocorrea@hotmail.com

✓ #948389 SUCCESS pmbootstrap/patches/.build.yml https://builds.sr.ht/~postmarketos/job/948389