From 2837c0d9aa2c344212541776c9bedd69fc8b4111 Mon Sep 17 00:00:00 2001 From: Jared Baur Date: Mon, 11 Mar 2024 12:42:21 -0700 Subject: [PATCH] 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. --- nixos/modules/system/boot/uki.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/modules/system/boot/uki.nix b/nixos/modules/system/boot/uki.nix index ce00ac8e6397..0965b887c12e 100644 --- a/nixos/modules/system/boot/uki.nix +++ b/nixos/modules/system/boot/uki.nix @@ -75,6 +75,8 @@ in OSRelease = lib.mkOptionDefault "@${config.system.build.etc}/etc/os-release"; # This is needed for cross compiling. 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}"; }; };