From 1a5efff3ae946083a2bc75f6b958985c97b4ba44 Mon Sep 17 00:00:00 2001
From: Daniel Barlow <dan@telent.net>
Date: Sun, 29 Oct 2023 11:50:23 +0000
Subject: [PATCH] in uimage FIT, honour ${arch}

---
 pkgs/kernel/kernel_fdt.its | 6 +++---
 pkgs/kernel/uimage.nix     | 6 +++++-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/pkgs/kernel/kernel_fdt.its b/pkgs/kernel/kernel_fdt.its
index 9eba3d96..c9907cf0 100644
--- a/pkgs/kernel/kernel_fdt.its
+++ b/pkgs/kernel/kernel_fdt.its
@@ -1,6 +1,6 @@
 /dts-v1/;
 
-//  used on aarch64 to provide a U-bootable image that combines
+//  used on arm/aarch64 to provide a U-bootable image that combines
 //  kernel and fdt
 
 / {
@@ -12,7 +12,7 @@
             description = "Vanilla Linux kernel";
             // data = /incbin/("./vmlinux.bin.gz");
             type = "kernel";
-            arch = "arm64";
+            // arch = "arm64";
             os = "linux";
             // compression = "gzip";
             // load = <00000000>;
@@ -28,7 +28,7 @@
             description = "Flattened Device Tree blob";
             // data = /incbin/("./target.dtb");
             type = "flat_dt";
-            arch = "arm64";
+            // arch = "arm64";
             compression = "none";
             hash-1 {
                     algo = "crc32";
diff --git a/pkgs/kernel/uimage.nix b/pkgs/kernel/uimage.nix
index e6ac6859..ceebe9a7 100644
--- a/pkgs/kernel/uimage.nix
+++ b/pkgs/kernel/uimage.nix
@@ -59,9 +59,13 @@ in {
                 data = /incbin/("./vmlinux.bin.lzma");
                 load = <${loadAddress}>;
                 entry = <${entryPoint}>;
+                arch = "${arch}";
                 compression = "lzma";
             };
-            fdt-1 { data = /incbin/("./tmp.dtb"); };
+            fdt-1 {
+                data = /incbin/("./tmp.dtb");
+                arch = "${arch}";
+            };
         };
     };
     _VARS