nixos/uki: add ".dtb" section if devicetree is used

This ensures a ".dtb" PE section makes it into the UKI so systemd-stub
can install the correct devicetree for use by the Linux kernel. This is
often needed on systems that boot with u-boot since the devicetree used
by u-boot is often a paired down version of what the Linux kernel needs.
On those kinds of boards, the lack of this PE section means that u-boot
will end up installing its internal devicetree into the UEFI
configuration table, which is what the Linux kernel ends up using.
This commit is contained in:
Jared Baur 2024-03-11 12:42:21 -07:00
parent ee0bc95d48
commit 2837c0d9aa
No known key found for this signature in database

View file

@ -75,6 +75,8 @@ in
OSRelease = lib.mkOptionDefault "@${config.system.build.etc}/etc/os-release"; OSRelease = lib.mkOptionDefault "@${config.system.build.etc}/etc/os-release";
# This is needed for cross compiling. # This is needed for cross compiling.
EFIArch = lib.mkOptionDefault efiArch; EFIArch = lib.mkOptionDefault efiArch;
} // lib.optionalAttrs (config.hardware.deviceTree.enable && config.hardware.deviceTree.name != null) {
DeviceTree = lib.mkOptionDefault "${config.hardware.deviceTree.package}/${config.hardware.deviceTree.name}";
}; };
}; };