Skip to content

Commit

Permalink
Apply nixpkgs-fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Princemachiavelli committed Jun 3, 2024
1 parent f3f5eb4 commit 5208cb3
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 52 deletions.
74 changes: 37 additions & 37 deletions device-pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -95,20 +95,20 @@ let
# Needed for signing
inherit (cfg.firmware.secureBoot) requiredSystemFeatures;
} ''
export BOARDID=${variant.boardid}
export BOARDSKU=${variant.boardsku}
export FAB=${variant.fab}
export BOARDREV=${variant.boardrev}
${lib.optionalString (variant.chipsku != null) ''
export CHIP_SKU=${toString variant.chipsku}
''}
export CHIPREV=${variant.chiprev}
export BOARDID=${variant.boardid}
export BOARDSKU=${variant.boardsku}
export FAB=${variant.fab}
export BOARDREV=${variant.boardrev}
${lib.optionalString (variant.chipsku != null) ''
export CHIP_SKU=${toString variant.chipsku}
''}
export CHIPREV=${variant.chiprev}
${cfg.firmware.secureBoot.preSignCommands}
${cfg.firmware.secureBoot.preSignCommands}
${mkFlashScript (args // { flashArgs = [ "--no-root-check" "--no-flash" ] ++ (args.flashArgs or flashArgs); }) }
${mkFlashScript (args // { flashArgs = [ "--no-root-check" "--no-flash" ] ++ (args.flashArgs or flashArgs); }) }
cp -r ./ $out
cp -r ./ $out
'';
# TODO: Do we also need these? Set in l4t_create_images_for_kernel_flash.sh
# export RAMCODE_ID
Expand Down Expand Up @@ -216,32 +216,32 @@ let
(mkFlashScript {
flashCommands = cfg.firmware.secureBoot.preSignCommands + lib.concatMapStringsSep "\n"
(v: with v; ''
BOARDID=${boardid} BOARDSKU=${boardsku} FAB=${fab} BOARDREV=${boardrev} FUSELEVEL=${fuselevel} CHIPREV=${chiprev} ${lib.optionalString (chipsku != null) "CHIP_SKU=${builtins.toString chipsku}"} ./flash.sh ${lib.optionalString (partitionTemplate != null) "-c flash.xml"} --no-root-check --no-flash --sign ${builtins.toString flashArgs}
# TODO: ideally we would add chipsku to the boardspec for flashFromDevice to match against but
# tegra-boardspec does not read the chipsku from EEPROM so we cannot match against it.
# The CHIP_SKU only determines BPFFILE which is the same within a given SOM family (orin-nx, orin-nano, etc.);
# since we already seperate Orin NX and Orin Nano, we don't have to worry about using incorrect BPFFILE.
outdir=$out/${boardid}-${fab}-${boardsku}-${boardrev}-${if fuselevel == "fuselevel_production" then "1" else "0"}-${chiprev}--
mkdir -p $outdir
cp -v bootloader/signed/flash.idx $outdir/
# Copy files referenced by flash.idx
while IFS=", " read -r partnumber partloc start_location partsize partfile partattrs partsha; do
if [[ "$partfile" != "" ]]; then
if [[ -f "bootloader/signed/$partfile" ]]; then
cp -v "bootloader/signed/$partfile" $outdir/
elif [[ -f "bootloader/$partfile" ]]; then
cp -v "bootloader/$partfile" $outdir/
else
echo "Unable to find $partfile"
exit 1
fi
fi
done < bootloader/signed/flash.idx
rm -rf bootloader/signed
BOARDID=${boardid} BOARDSKU=${boardsku} FAB=${fab} BOARDREV=${boardrev} FUSELEVEL=${fuselevel} CHIPREV=${chiprev} ${lib.optionalString (chipsku != null) "CHIP_SKU=${builtins.toString chipsku}"} ./flash.sh ${lib.optionalString (partitionTemplate != null) "-c flash.xml"} --no-root-check --no-flash --sign ${builtins.toString flashArgs}
# TODO: ideally we would add chipsku to the boardspec for flashFromDevice to match against but
# tegra-boardspec does not read the chipsku from EEPROM so we cannot match against it.
# The CHIP_SKU only determines BPFFILE which is the same within a given SOM family (orin-nx, orin-nano, etc.);
# since we already seperate Orin NX and Orin Nano, we don't have to worry about using incorrect BPFFILE.
outdir=$out/${boardid}-${fab}-${boardsku}-${boardrev}-${if fuselevel == "fuselevel_production" then "1" else "0"}-${chiprev}--
mkdir -p $outdir
cp -v bootloader/signed/flash.idx $outdir/
# Copy files referenced by flash.idx
while IFS=", " read -r partnumber partloc start_location partsize partfile partattrs partsha; do
if [[ "$partfile" != "" ]]; then
if [[ -f "bootloader/signed/$partfile" ]]; then
cp -v "bootloader/signed/$partfile" $outdir/
elif [[ -f "bootloader/$partfile" ]]; then
cp -v "bootloader/$partfile" $outdir/
else
echo "Unable to find $partfile"
exit 1
fi
fi
done < bootloader/signed/flash.idx
rm -rf bootloader/signed
'')
cfg.firmware.variants;
});
Expand Down
18 changes: 9 additions & 9 deletions modules/flash-script.nix
Original file line number Diff line number Diff line change
Expand Up @@ -385,24 +385,24 @@ in
];

orin-agx = [
{ boardid = "3701"; boardsku = "0000"; fab = "300"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku="00:00:00:D0"; }
{ boardid = "3701"; boardsku = "0004"; fab = "300"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku="00:00:00:D2"; } # 32GB
{ boardid = "3701"; boardsku = "0005"; fab = "000"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku="00:00:00:D0"; } # 64GB
{ boardid = "3701"; boardsku = "0000"; fab = "300"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku = "00:00:00:D0"; }
{ boardid = "3701"; boardsku = "0004"; fab = "300"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku = "00:00:00:D2"; } # 32GB
{ boardid = "3701"; boardsku = "0005"; fab = "000"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku = "00:00:00:D0"; } # 64GB
];

orin-agx-industrial = [
{ boardid = "3701"; boardsku = "0008"; fab = "300"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku="00:00:00:90"; }
{ boardid = "3701"; boardsku = "0008"; fab = "300"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku = "00:00:00:90"; }
];

orin-nx = [
{ boardid = "3767"; boardsku = "0000"; fab = "000"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku="00:00:00:D3";} # Orin NX 16GB
{ boardid = "3767"; boardsku = "0001"; fab = "000"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku="00:00:00:D4";} # Orin NX 8GB
{ boardid = "3767"; boardsku = "0000"; fab = "000"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku = "00:00:00:D3"; } # Orin NX 16GB
{ boardid = "3767"; boardsku = "0001"; fab = "000"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku = "00:00:00:D4"; } # Orin NX 8GB
];

orin-nano = [
{ boardid = "3767"; boardsku = "0003"; fab = "000"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku="00:00:00:D5"; } # Orin Nano 8GB
{ boardid = "3767"; boardsku = "0004"; fab = "000"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku="00:00:00:D6"; } # Orin Nano 4GB
{ boardid = "3767"; boardsku = "0005"; fab = "000"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku="00:00:00:D5"; } # Orin Nano devkit module
{ boardid = "3767"; boardsku = "0003"; fab = "000"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku = "00:00:00:D5"; } # Orin Nano 8GB
{ boardid = "3767"; boardsku = "0004"; fab = "000"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku = "00:00:00:D6"; } # Orin Nano 4GB
{ boardid = "3767"; boardsku = "0005"; fab = "000"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku = "00:00:00:D5"; } # Orin Nano devkit module
];
}.${cfg.som}
)) else lib.mkOptionDefault [ ];
Expand Down
11 changes: 5 additions & 6 deletions pkgs/optee-ftpm_manufacturer/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
opteeClient,
stdenvNoCC,
python3,
fetchFromGitHub,
openssl
{ opteeClient
, stdenvNoCC
, python3
, fetchFromGitHub
, openssl
}:
let
# Latest 1.5.1 release fails in x509.Name.build likely due
Expand Down

0 comments on commit 5208cb3

Please sign in to comment.