Skip to content

Conversation

@TravMurav
Copy link

@TravMurav TravMurav commented Dec 13, 2025

Similarly to #123 this PR introduces provisions for automatic DTB selection, this time for BLS#1 boot entries.

This PR documents a new key - "devicetree-dir" that is supposed to be used by the bootloader to construct a full path to the dtb file.

A generic OS that wishes to target DeviceTree platforms may want to be able to automatically select a correct devicetree for any of supported devices. This may be useful for multiple reasons such as the target device not having any DT loaded (i.e. because it's a Qualcomm WoA device with horrid useless ACPI) or the device having a DT loaded but outdated (i.e. if it's a device with "some" DTB baked into firmware).

Having a "devicetree-dir" key allows the distribution to install a [kernel/initramfs/dtbs dir] combination for each available kernel while making sure "mismatched" dtb/kernel combinations won't be used and the user will always get the appropriate version of the dtb when they pick a boot entry, which is especially important considering many of those devices are actively developed and the usual expectation of both-ways-compatibility of devicetrees may not always hold.

Similar key is already supported in u-boot's extlinux.conf /pxe implementation [1], with names "fdtdir" and "devicetreedir". I've decided that adding a dash to this key makes more sense to be in line with the naming of other keys in the specification.

Reference implementation: systemd/systemd#40077

[1] https://source.denx.de/u-boot/u-boot/-/blob/master/boot/pxe_utils.c#L899-900

There are many devices that require booting with devicetree. Until now,
most of those devices were of embedded kind where one would be expected
to maintain a device-specific OS image. For those devices it makes sense
to just hardcode devicetree name in the boot loader entry.

In recent years, however, many devices became available that don't fit
into such "embedded" category and instead would be more useful with a
generic OS, such as Qualcomm WoA laptops. As those laptops can't be used
with their terribly disfuncitonal ACPI implementation, distribution have
to rely on manually loading appropriate devicetrees. Unfortunately, for
rapidly evolving targets like those Qualcomm laptops, it's critical to
boot the kernel with matching version of the devicetree, as many
features are added rapidly.

UKI images already have provisions to support such devices, namely
.dtbauto section of the UKI that allows the implementation to include as
many DTBs into the same image as one wants. However same can't be said
for BLS#1 boot entries.

To solve this discrepency, document a new "devicetree-dir" key, that
would define path to a directory with devicetree files, letting the
bootloader implementation to pick an appropriate devicetree and load it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants