pmbootstrap/pmb/install
Minecrell 8ace36113c
pmb.config/install: add flexible provider selection for "pmbootstrap init" (MR 2132)
The provider selection for "pmbootstrap init" added in this commit
is a flexible way to offer UI/device-specific configuration options
in "pmbootstrap init", without hardcoding them in pmbootstrap.
Instead, the options are defined entirely in pmaports using APK's
virtual package provider mechanism. The code in pmbootstrap searches
for available providers and displays them together with their pkgdesc.

There are many possible use cases for this but I have tested two so far:

  1. Selecting root provider (sudo vs doas). This can be defined entirely
     in postmarketos-base, without having to handle this specifically in
     pmbootstrap.

     $ pmbootstrap init
     [...]
     Available providers for postmarketos-root (2):
      * sudo: Use sudo to run root commands (**default**)
      * doas: Use doas (minimal replacement for sudo) to run root commands
              (Note: Does not support all functionality of sudo)
     Provider [default]: doas

  2. Device-specific options. My main motivation for working on this
     feature is a new configuration option for the MSM8916-based devices.
     It allows more control about which firmware to enable:

     $ pmbootstrap init
     [...]
     Available providers for soc-qcom-msm8916-rproc (3):
      * all: Enable all remote processors (audio goes through modem) (default)
      * no-modem: Disable only modem (audio bypasses modem, ~80 MiB more RAM)
      * none: Disable all remote processors (no WiFi/BT/modem, ~90 MiB more RAM)
     Provider [default]: no-modem

The configuration prompts show up dynamically by defining
_pmb_select="<virtual packages>" in postmarketos-base, a UI PKGBUILD
or the device APKBUILD. Selecting "default" (just pressing enter)
means that no provider is selected. This allows APK to choose it
automatically based on the "provider_priority". It also provides
compatibility with existing installation; APK will just choose the
default provider when upgrading. The selection can still be changed
after installation by installing another provider using "apk".

Note that at the end this is just a more convenient interface for the
already existing "extra packages" prompt. When using pmbootstrap in
automated scripts the providers (e.g. "postmarketos-root-doas") can be
simply selected through the existing "extra_packages" option.
2021-11-06 15:04:34 +01:00
..
__init__.py install: verify pmaports branch supporting fs (MR 2011) 2021-04-11 20:10:28 +02:00
_install.py pmb.config/install: add flexible provider selection for "pmbootstrap init" (MR 2132) 2021-11-06 15:04:34 +01:00
blockdevice.py Enforce E501: Limit the line length to 79 for files in pmb/install (MR 2031) 2021-03-30 14:51:53 +02:00
format.py install: verify pmaports branch supporting fs (MR 2011) 2021-04-11 20:10:28 +02:00
losetup.py pmb, test: remove redundant commas (MR 2115) 2021-09-26 17:58:40 +02:00
partition.py pmb.install.partition: fix mb_reserved calculation (MR 2123) 2021-10-17 14:27:44 +02:00
recovery.py pmb/install/recovery: add support for single kernel 'flavor' (MR 2093) 2021-09-02 18:18:13 -07:00
ui.py pmbootstrap install: support _pmb_groups (MR 2010) 2021-01-27 08:38:53 +03:00