better solution for fw type based on variant

drtio_port
mwojcik 2021-09-02 15:02:15 +02:00
parent e38c4a14ca
commit 3840ebaf74
1 changed files with 6 additions and 7 deletions

View File

@ -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"