From 0bf98c524391b7db2e1bf8beb8b33362a0292ed7 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Fri, 29 Dec 2023 17:07:47 +0000 Subject: [PATCH] add output for u-boot --- modules/arch/aarch64.nix | 1 + modules/arch/arm.nix | 1 + modules/arch/mipseb.nix | 1 + modules/outputs.nix | 3 +++ modules/outputs/mbrimage.nix | 2 +- tests/tftpboot/test.nix | 14 +++++++------- 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/modules/arch/aarch64.nix b/modules/arch/aarch64.nix index 7279e42..3a18ffd 100644 --- a/modules/arch/aarch64.nix +++ b/modules/arch/aarch64.nix @@ -13,5 +13,6 @@ # USE_OF = "y"; }; hardware.ram.startAddress = lim.parseInt "0x40000000"; + system.outputs.u-boot = pkgs.ubootQemuAarch64; }; } diff --git a/modules/arch/arm.nix b/modules/arch/arm.nix index 474f780..1d569bc 100644 --- a/modules/arch/arm.nix +++ b/modules/arch/arm.nix @@ -5,5 +5,6 @@ OF = "y"; }; hardware.ram.startAddress = lim.parseInt "0x40000000"; + system.outputs.u-boot = pkgs.ubootQemuArm; }; } diff --git a/modules/arch/mipseb.nix b/modules/arch/mipseb.nix index 77a5e65..5e7eefa 100644 --- a/modules/arch/mipseb.nix +++ b/modules/arch/mipseb.nix @@ -5,5 +5,6 @@ kernel.config = { CPU_BIG_ENDIAN = "y"; }; + system.outputs.u-boot = pkgs.ubootQemuMips; }; } diff --git a/modules/outputs.nix b/modules/outputs.nix index f244657..933a730 100644 --- a/modules/outputs.nix +++ b/modules/outputs.nix @@ -60,6 +60,9 @@ in Combined kernel and FDT in uImage (U-Boot compatible) format ''; }; + u-boot = mkOption { + type = types.package; + }; manifest = mkOption { type = types.package; internal = true; diff --git a/modules/outputs/mbrimage.nix b/modules/outputs/mbrimage.nix index 6f7904f..4bf04a0 100644 --- a/modules/outputs/mbrimage.nix +++ b/modules/outputs/mbrimage.nix @@ -42,7 +42,7 @@ in { ln -s ${o.mbrimage} ./mbrimage cat > run.sh <&1 |tee $out ''; in { - aarch64 = check "qemu-aarch64" "ubootQemuAarch64" {}; - arm = check "qemu-armv7l" "ubootQemuArm" {}; - armZimage = check "qemu-armv7l" "ubootQemuArm" { + aarch64 = check "qemu-aarch64" {}; + arm = check "qemu-armv7l" {}; + armZimage = check "qemu-armv7l" { boot.tftp.kernelFormat = "zimage"; }; - mips = check "qemu" "ubootQemuMips" {}; - mipsLz = check "qemu" "ubootQemuMips" { + mips = check "qemu" {}; + mipsLz = check "qemu" { boot.tftp.compressRoot = true; }; }