From 3840ebaf74820e44419b7d68005feb3ab40be898 Mon Sep 17 00:00:00 2001 From: mwojcik Date: Thu, 2 Sep 2021 15:02:15 +0200 Subject: [PATCH] better solution for fw type based on variant --- default.nix | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/default.nix b/default.nix index e36d5b95..e6a472f0 100644 --- a/default.nix +++ b/default.nix @@ -14,6 +14,7 @@ let inherit pkgs; board = target; }; + fwtype = if variant == "satellite" then "satman" else "runtime"; firmware = rustPlatform.buildRustPackage rec { # note: due to fetchCargoTarball, cargoSha256 depends on package name @@ -39,11 +40,10 @@ let # there's probably a better way to go around it installPhase = '' mkdir -p $out $out/nix-support - export FWTYPE=${if variant == "satellite" then "satman" else "runtime"} - cp ../build/$FWTYPE.bin $out/$FWTYPE.bin - cp ../build/firmware/armv7-none-eabihf/release/$FWTYPE $out/$FWTYPE.elf - echo file binary-dist $out/$FWTYPE.bin >> $out/nix-support/hydra-build-products - echo file binary-dist $out/$FWTYPE.elf >> $out/nix-support/hydra-build-products + cp ../build/${fwtype}.bin $out/${fwtype}.bin + cp ../build/firmware/armv7-none-eabihf/release/${fwtype} $out/${fwtype}.elf + echo file binary-dist $out/${fwtype}.bin >> $out/nix-support/hydra-build-products + echo file binary-dist $out/${fwtype}.elf >> $out/nix-support/hydra-build-products ''; doCheck = false; @@ -68,8 +68,7 @@ let '' mkdir $out ln -s ${szl}/szl.elf $out - ln -s ${firmware}/runtime.bin $out - ln -s ${firmware}/satman.bin $out + ln -s ${firmware}/${fwtype}.bin $out ln -s ${gateware}/top.bit $out ''; sd = pkgs.runCommand "${target}-${variant}-sd"