Add support for generating kernel cmdline from layered config

This uses a new tool to generate a kernel cmdline that feeds directly into boot-deploy. The configuration is UAPI.6 compliant and uses the "drop-in only without main conf" system mentioned in that spec.

The current implementation using deviceinfo_kernel_cmdline variables has several limitations. First, boot-deploy is distro-agnostic, so any defaults there must apply to all supported distros. This limits what can be added (kernel lockdown, plymouth splash, etc). Second, the deviceinfo vars can only add parameters, not remove them. This makes it difficult (and problematic) for users to override settings since kernel cmdline options from the defaults installed by packaging.

The new system addresses these issues:

  • Supports both adding and removing specific kernel parameters
  • Packages can define their own cmdline config without modifying shared defaults (similar to how initramfs files are handled)
  • Clear three-tier config hierarchy with well-defined ordering which is UAPI.6 compliant (distro defaults → device maintainer config → user overrides)
  • Moves deviceinfo toward representing actual device data rather than kernel configuration concerns

This also means we get to drop deviceinfo_kernel_cmdline_* variables from deviceinfo.

The initial implementation is backwards compatible. boot-deploy will prefer using the deviceinfo variables if they are present and only use the new tool if those variables are not set. We should agree on this design before merging anything, but we can migrate a handful of devices first to shake out any bugs and gain confidence before doing everything. There are almost 500 deviceinfo/device pkg changes that will be required to implement this fully so that branch will be impossible to maintain out of tree for too long and we won't be able to test every single device before merging it, which is why this is backwards compatible so we can start small initially.

For more information about how to configure this new tool, see its man5 page: https://gitlab.postmarketos.org/postmarketOS/generate-kernel-cmdline/-/blob/main/docs/generate-kernel-cmdline.5.md?ref_type=heads

Edited by Clayton Craft

Merge request reports

Loading