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
This commit is contained in:
Johannes Marbach 2021-12-30 20:14:34 +01:00 committed by Oliver Smith
parent 6f6a3b0408
commit 2ad5427126
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 6 additions and 1 deletions

View File

@ -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"]