diff options
author | Jared Baur <jaredbaur@fastmail.com> | 2024-03-11 12:42:21 -0700 |
---|---|---|
committer | Jared Baur <jaredbaur@fastmail.com> | 2024-03-11 12:42:21 -0700 |
commit | 2837c0d9aa2c344212541776c9bedd69fc8b4111 (patch) | |
tree | 261297d52dbe034e01d2111d55d72a850b6c07f1 /nixos | |
parent | ee0bc95d48f9671fad4b7a2f394b2b1f7cb3b348 (diff) | |
download | nixlib-2837c0d9aa2c344212541776c9bedd69fc8b4111.tar nixlib-2837c0d9aa2c344212541776c9bedd69fc8b4111.tar.gz nixlib-2837c0d9aa2c344212541776c9bedd69fc8b4111.tar.bz2 nixlib-2837c0d9aa2c344212541776c9bedd69fc8b4111.tar.lz nixlib-2837c0d9aa2c344212541776c9bedd69fc8b4111.tar.xz nixlib-2837c0d9aa2c344212541776c9bedd69fc8b4111.tar.zst nixlib-2837c0d9aa2c344212541776c9bedd69fc8b4111.zip |
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.
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/system/boot/uki.nix | 2 |
1 files changed, 2 insertions, 0 deletions
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}"; }; }; |