liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 0bf98c524391b7db2e1bf8beb8b33362a0292ed7
parent dc42969ef6b32b289fff0a1059fbe125b24d0156
Author: Daniel Barlow <dan@telent.net>
Date:   Fri, 29 Dec 2023 17:07:47 +0000

add output for u-boot

Diffstat:
Mmodules/arch/aarch64.nix | 1+
Mmodules/arch/arm.nix | 1+
Mmodules/arch/mipseb.nix | 1+
Mmodules/outputs.nix | 3+++
Mmodules/outputs/mbrimage.nix | 2+-
Mtests/tftpboot/test.nix | 14+++++++-------
6 files changed, 14 insertions(+), 8 deletions(-)

diff --git 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 @@ -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 @@ -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 @@ -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 @@ -42,7 +42,7 @@ in { ln -s ${o.mbrimage} ./mbrimage cat > run.sh <<EOF #!${pkgs.runtimeShell} - ${pkgs.pkgsBuildBuild.run-liminix-vm}/bin/run-liminix-vm --arch ${pkgs.stdenv.hostPlatform.qemuArch} --u-boot ${pkgs.ubootQemuArm}/u-boot.bin --phram-address 0x${phram_address} --disk-image ${o.mbrimage} /dev/null /dev/null + ${pkgs.pkgsBuildBuild.run-liminix-vm}/bin/run-liminix-vm --arch ${pkgs.stdenv.hostPlatform.qemuArch} --u-boot ${o.u-boot}/u-boot.bin --phram-address 0x${phram_address} --disk-image ${o.mbrimage} /dev/null /dev/null EOF chmod +x run.sh ''; diff --git a/tests/tftpboot/test.nix b/tests/tftpboot/test.nix @@ -1,7 +1,7 @@ { liminix }: -let check = deviceName : ubootName : config : +let check = deviceName : config : let derivation = (import liminix { device = import "${liminix}/devices/${deviceName}/"; liminix-config = { pkgs, ... } : { @@ -10,7 +10,7 @@ let derivation = (import liminix { }; }); img = derivation.outputs.tftpboot; - uboot = derivation.pkgs.${ubootName}; + uboot = derivation.outputs.u-boot; pkgsBuild = derivation.pkgs.pkgsBuildBuild; in pkgsBuild.runCommand "check" { nativeBuildInputs = with pkgsBuild; [ @@ -35,13 +35,13 @@ run-liminix-vm \ expect ${./script.expect} 2>&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; }; }