From 31e36e195caae9be140a72bd34fe35dfd2bb41d5 Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Wed, 9 Jun 2021 23:39:29 -0700 Subject: [PATCH] install: explicitly install osk-sdl when needed (MR 2066) This adds osk-sdl to the rootfs when --fde is set, or when building a rootfs for the ondev installer. Ideally the ondev installer would selectively install osk-sdl if the user opted for fde at runtime, but I haven't found a straight forward way to enable that yet, and this behavior here is no different than the current behavior (where osk-sdl is always installed in the rootfs by way of depends= in pmos-mkinitfs). For images that are built without --fde, osk-sdl won't be installed at all in the rootfs, once the dependency is dropped from pmos-mkinitfs. Instead, a dummy package postmarketos-base-nofde will be installed instead to satisfy the dependency that postmarketos-mkinitfs has on the virtual package "postmarketos-fde-unlocker" --- pmb/install/_install.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pmb/install/_install.py b/pmb/install/_install.py index 5ad9dccf..748d9edf 100644 --- a/pmb/install/_install.py +++ b/pmb/install/_install.py @@ -713,6 +713,13 @@ def install_on_device_installer(args, step, steps): "postmarketos-ondev"] + get_kernel_package(args, args.device) + get_nonfree_packages(args, args.device)) + + pmaports_cfg = pmb.config.pmaports.read_config(args) + # Use the fde unlocker dummy package instead of osk-sdl if pmaports + # supports it, since the ondev image isn't using fde itself + if pmaports_cfg.get("supported_base_nofde", None): + packages += ["postmarketos-base-nofde"] + suffix_installer = f"installer_{args.device}" pmb.chroot.apk.install(args, packages, suffix_installer) @@ -806,6 +813,19 @@ def create_device_rootfs(args, step, steps): if locale_is_set: install_packages += ["lang", "musl-locales"] + pmaports_cfg = pmb.config.pmaports.read_config(args) + # postmarketos-base supports a dummy package for blocking osk-sdl install + # when not required + if pmaports_cfg.get("supported_base_nofde", None): + # The ondev installer *could* enable fde at runtime, so include it + # explicitly in the rootfs until there's a mechanism to selectively + # install it when the ondev installer is running. + # Always install it when --fde is specified. + if args.full_disk_encryption or args.on_device_installer: + install_packages += ["osk-sdl"] + else: + install_packages += ["postmarketos-base-nofde"] + pmb.helpers.repo.update(args, args.deviceinfo["arch"]) # Explicitly call build on the install packages, to re-build them or any