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
https://gitlab.gnome.org/GNOME/gnome-software/-/merge_requests/1607
only existing in 44, but I am pretty confident that with that code the
first GS use will actually be remarkably seamless!
v2:
* 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- repository.+ (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,+ arch=args.deviceinfo["arch"],+ user_repository=False)+ 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"])
--
2.39.2
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