From 2ad54271260af91a93ef8399fc876cfdc786e56a Mon Sep 17 00:00:00 2001 From: Johannes Marbach Date: Thu, 30 Dec 2021 20:14:34 +0100 Subject: [PATCH] pmb.install: automatically pick unlocker package (MR 2154) This removes the hard-coded installation of osk-sdl when specifying --fde (or using the on-device installer) and instead determines the unlocker package by taking the most suitable provider of postmarketos-fde-unlocker (factoring provider priority and packages selected for installation). With this change applied, one can manually select an unlocker package to be installed via pmbootstrap install --fde --add other-unlocker Relates to: postmarketOS/pmaports#1309 --- pmb/install/_install.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pmb/install/_install.py b/pmb/install/_install.py index 47ff01fa..9613d1e6 100644 --- a/pmb/install/_install.py +++ b/pmb/install/_install.py @@ -888,7 +888,12 @@ def create_device_rootfs(args, step, steps): # 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"] + # Pick the most suitable unlocker depending on the packages + # selected for installation + unlocker = pmb.parse.depends.package_provider( + args, "postmarketos-fde-unlocker", install_packages, suffix) + if unlocker["pkgname"] not in install_packages: + install_packages += [unlocker["pkgname"]] else: install_packages += ["postmarketos-base-nofde"]