mirror of
https://github.com/NixOS/nixos-hardware.git
synced 2025-12-15 21:41:15 +01:00
chore: format repo using treefmt-nix and nixfmt-rfc-style
This commit is contained in:
parent
fc7c471412
commit
51e51e6014
266 changed files with 3721 additions and 2733 deletions
|
|
@ -1,6 +1,7 @@
|
|||
{ runCommand
|
||||
, buildPackages
|
||||
, pkgs
|
||||
{
|
||||
runCommand,
|
||||
buildPackages,
|
||||
pkgs,
|
||||
}:
|
||||
|
||||
let
|
||||
|
|
@ -10,26 +11,29 @@ let
|
|||
withPayload = "${uboot}/u-boot.bin";
|
||||
withFDT = "${uboot}/u-boot.dtb";
|
||||
};
|
||||
in runCommand "firmware-starfive-visionfive-v1" {
|
||||
nativeBuildInputs = with buildPackages; [ xxd ];
|
||||
} ''
|
||||
function handle_file {
|
||||
inFile=$1
|
||||
echo inFile: $inFile
|
||||
outFile=$2
|
||||
inSize=`stat -c "%s" $inFile`
|
||||
inSize32HexBe=`printf "%08x\n" $inSize`
|
||||
inSize32HexLe=''${inSize32HexBe:6:2}''${inSize32HexBe:4:2}''${inSize32HexBe:2:2}''${inSize32HexBe:0:2}
|
||||
echo "inSize: $inSize (0x$inSize32HexBe, LE:0x$inSize32HexLe)"
|
||||
echo $inSize32HexLe | xxd -r -ps > $outFile
|
||||
cat $inFile >> $outFile
|
||||
echo outFile: $outFile
|
||||
outSize=`stat -c "%s" $outFile`
|
||||
outSize32HexBe=`printf "%08x\n" $outSize`
|
||||
echo "outSize: $outSize (0x$outSize32HexBe)"
|
||||
in
|
||||
runCommand "firmware-starfive-visionfive-v1"
|
||||
{
|
||||
nativeBuildInputs = with buildPackages; [ xxd ];
|
||||
}
|
||||
''
|
||||
function handle_file {
|
||||
inFile=$1
|
||||
echo inFile: $inFile
|
||||
outFile=$2
|
||||
inSize=`stat -c "%s" $inFile`
|
||||
inSize32HexBe=`printf "%08x\n" $inSize`
|
||||
inSize32HexLe=''${inSize32HexBe:6:2}''${inSize32HexBe:4:2}''${inSize32HexBe:2:2}''${inSize32HexBe:0:2}
|
||||
echo "inSize: $inSize (0x$inSize32HexBe, LE:0x$inSize32HexLe)"
|
||||
echo $inSize32HexLe | xxd -r -ps > $outFile
|
||||
cat $inFile >> $outFile
|
||||
echo outFile: $outFile
|
||||
outSize=`stat -c "%s" $outFile`
|
||||
outSize32HexBe=`printf "%08x\n" $outSize`
|
||||
echo "outSize: $outSize (0x$outSize32HexBe)"
|
||||
}
|
||||
|
||||
mkdir -p "$out/nix-support"
|
||||
echo "file bin \"$out/opensbi_u-boot_starfive_visionfive_v1.bin\"" >> "$out/nix-support/hydra-build-products"
|
||||
handle_file ${opensbi}/share/opensbi/lp64/generic/firmware/fw_payload.bin $out/opensbi_u-boot_starfive_visionfive_v1.bin
|
||||
''
|
||||
mkdir -p "$out/nix-support"
|
||||
echo "file bin \"$out/opensbi_u-boot_starfive_visionfive_v1.bin\"" >> "$out/nix-support/hydra-build-products"
|
||||
handle_file ${opensbi}/share/opensbi/lp64/generic/firmware/fw_payload.bin $out/opensbi_u-boot_starfive_visionfive_v1.bin
|
||||
''
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue