pmbootstrap/pmb
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
..
aportgen args.arch_native: remove (MR 2130) 2021-10-24 14:34:30 +02:00
build args.arch_native: remove (MR 2130) 2021-10-24 14:34:30 +02:00
chroot args.arch_native: remove (MR 2130) 2021-10-24 14:34:30 +02:00
config pmb.config/install: add flexible provider selection for "pmbootstrap init" (MR 2132) 2021-11-06 15:04:34 +01:00
data pmb: data: keys: sync with Alpine (MR 2131) 2021-10-19 01:44:35 +02:00
export pmb/export/symlinks: add support for a single 'flavor' (MR 2093) 2021-09-02 18:18:13 -07:00
flasher pmb/config/flashers: add support for single kernel 'flavor' (MR 2093) 2021-09-02 18:18:13 -07:00
helpers pmb.config/install: add flexible provider selection for "pmbootstrap init" (MR 2132) 2021-11-06 15:04:34 +01:00
install pmb.config/install: add flexible provider selection for "pmbootstrap init" (MR 2132) 2021-11-06 15:04:34 +01:00
parse pmb.parse._apkbuild: parse provider_priority as int (MR 2132) 2021-11-06 15:04:25 +01:00
qemu pmb.qemu.run: workaround for new mkinitfs requirements (MR 2138) 2021-11-06 13:36:34 +01:00
sideload pmb.sideload: support non-standard SSH port (!2046) 2021-04-25 21:04:49 +03:00
__init__.py remove unused args argument (MR 2130) 2021-10-24 14:34:26 +02:00