RFE: support loading Devicetree overlays through UKI addons
Component
systemd-stub
Is your feature request related to a problem? Please describe
SBCs like the Arduino UNO Q can have a number of extension boards, like the UNO Media Carrier or an Arduino shield connected. On top of this extra hardware may be connected through e.g. CSI camera connectors and DSI display connectors.
Each of these possible hardware addons needs a DT overlay to work. This requires some method for the user to select which DT overlays to use.
There have been several attempts a decade ago to allow loading DT overlays from Linux userspace for this, but non has ever been accepted upstream.
Currently UKI addons can provide an updated DTB, replacing whatever DTB was loaded before. We are looking into using UKI-addons as a way to allow Linux userspace to manage DT overlays without requiring kernel changes (at the cost of needing a reboot to apply changes).
For non secure-boot setups userspace can simply generate a merged DTB and put that in an UKI addon.
For secure-boot setups all addons should be prebuilt and signed outside of the actual system. Since there are too many possible combinations to prebuilt merged DTBs for all possible combinations, thiis requires putting a DTBO inside the UKI addon and having the stub merge the DTBO iinto the DTB before passing it to Linux.
Describe the solution you'd like
The desired solution is for the UKI systemd-stub to be extended to support UKI addons with a .dtbo section and then having it merge the contects into the already loaded DTB. This is somewhat related to #21742 which requests a similar feature for sd-boot.
Note we do not expect systemd upstream to implement this feature for us. The main purpose of this RFE is to start a discussion about the idea of using UKI addons to load DT overlays and to see if the proposed new systemd-stub functionality would be acceptable to systemd-upstream assuming a PR implementing this in a reasonably clean way is provided.
Describe alternatives you've considered
An alternative would be for the bootloader to take care of merging DT overlays into the DTB before starting the kernel/stub. The probems with that approach is that there are too many different bootloaders where we would then need to add support for this. For example from a systemd pov this would just shift the problem from the stub to sd-boot and we would need to at a minimum also make sure this works in grub.
Also different bootloaders will likely also have different config mechanisms to configure which overlays to load, while we want a unified interface for this and having the bootloader do this is problematic from a secureboot pov since there is no uniform way to sign dtb[o]s yet.
The systemd version you checked that didn't have the feature you are asking for
No response
Source: systemd/systemd