mirror of
https://github.com/NixOS/nixos-hardware
synced 2024-11-26 21:09:42 +01:00
starfive visionfive2: Fix cross compilation
This commit is contained in:
parent
f5298eb1d7
commit
16d6b81a47
1 changed files with 13 additions and 8 deletions
|
@ -1,11 +1,11 @@
|
||||||
{ callPackage, runCommand, writeText, stdenv, dtc }:
|
{ callPackage, pkgsBuildHost, runCommand, writeText, stdenv, dtc }:
|
||||||
let
|
let
|
||||||
uboot = callPackage ./uboot.nix { };
|
uboot = callPackage ./uboot.nix { };
|
||||||
opensbi = callPackage ./opensbi.nix {
|
opensbi = callPackage ./opensbi.nix {
|
||||||
withPayload = "${uboot}/u-boot.bin";
|
withPayload = "${uboot}/u-boot.bin";
|
||||||
withFDT = "${uboot}/starfive_visionfive2.dtb";
|
withFDT = "${uboot}/starfive_visionfive2.dtb";
|
||||||
};
|
};
|
||||||
spl-tool = callPackage ./spl-tool.nix { };
|
spl-tool = pkgsBuildHost.callPackage ./spl-tool.nix { };
|
||||||
its-file = writeText "visionfive2-uboot-fit-image.its" ''
|
its-file = writeText "visionfive2-uboot-fit-image.its" ''
|
||||||
/dts-v1/;
|
/dts-v1/;
|
||||||
|
|
||||||
|
@ -38,12 +38,17 @@ let
|
||||||
'';
|
'';
|
||||||
in {
|
in {
|
||||||
inherit opensbi uboot;
|
inherit opensbi uboot;
|
||||||
spl = runCommand "starfive-visionfive2-spl" { } ''
|
spl = stdenv.mkDerivation {
|
||||||
|
name = "starfive-visionfive2-spl";
|
||||||
|
depsBuildBuild = [ spl-tool ];
|
||||||
|
phases = [ "installPhase" ];
|
||||||
|
installPhase = ''
|
||||||
mkdir -p $out/share/starfive-visionfive2/
|
mkdir -p $out/share/starfive-visionfive2/
|
||||||
ln -s ${uboot}/u-boot-spl.bin .
|
ln -s ${uboot}/u-boot-spl.bin .
|
||||||
${spl-tool}/bin/spl_tool -c -f ./u-boot-spl.bin
|
spl_tool -c -f ./u-boot-spl.bin
|
||||||
cp u-boot-spl.bin.normal.out $out/share/starfive-visionfive2/spl.bin
|
cp u-boot-spl.bin.normal.out $out/share/starfive-visionfive2/spl.bin
|
||||||
'';
|
'';
|
||||||
|
};
|
||||||
uboot-fit-image = stdenv.mkDerivation {
|
uboot-fit-image = stdenv.mkDerivation {
|
||||||
name = "starfive-visionfive2-uboot-fit-image";
|
name = "starfive-visionfive2-uboot-fit-image";
|
||||||
nativeBuildInputs = [ dtc ];
|
nativeBuildInputs = [ dtc ];
|
||||||
|
|
Loading…
Reference in a new issue