Skip to content

Commit

Permalink
Move packages and patches into their own directories
Browse files Browse the repository at this point in the history
  • Loading branch information
danielfullmer committed Oct 8, 2023
1 parent fca2d0c commit 62f116b
Show file tree
Hide file tree
Showing 39 changed files with 28 additions and 29 deletions.
2 changes: 1 addition & 1 deletion UPGRADE_CHECKLIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- [ ] Grep for "sha256 = ", see if there is anything else not covered
- [ ] Grep for the previous version strings e.g. "35.3.1"
- [ ] Compare files from `unpackedDebs` before and after
- [ ] Ensure the soc variants in device-pkgs.nix match those in jetson_board_spec.cfg from BSP
- [ ] Ensure the soc variants in device-pkgs/default.nix match those in jetson_board_spec.cfg from BSP
- [ ] Ensure logic in ota-utils/ota_helpers.func matches nvidia-l4t-init/opt/nvidia/nv-l4t-bootloader-config.sh

### Testing
Expand Down
36 changes: 18 additions & 18 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,34 +36,34 @@ let
${lib.concatStringsSep "\n" (lib.mapAttrsToList (n: p: "echo Unpacking ${n}; dpkg -x ${p.src} $out/${n}") debs.t234)}
'';

inherit (pkgsAarch64.callPackages ./uefi-firmware.nix { inherit l4tVersion; })
inherit (pkgsAarch64.callPackages ./pkgs/uefi-firmware { inherit l4tVersion; })
edk2-jetson uefi-firmware;

inherit (pkgsAarch64.callPackages ./optee.nix {
inherit (pkgsAarch64.callPackages ./pkgs/optee {
# Nvidia's recommended toolchain is gcc9:
# https://nv-tegra.nvidia.com/r/gitweb?p=tegra/optee-src/nv-optee.git;a=blob;f=optee/atf_and_optee_README.txt;h=591edda3d4ec96997e054ebd21fc8326983d3464;hb=5ac2ab218ba9116f1df4a0bb5092b1f6d810e8f7#l33
stdenv = pkgsAarch64.gcc9Stdenv;
inherit bspSrc l4tVersion;
}) buildTOS buildOpteeTaDevKit opteeClient;

flash-tools = callPackage ./flash-tools.nix {
flash-tools = callPackage ./pkgs/flash-tools {
inherit bspSrc l4tVersion;
};

board-automation = callPackage ./board-automation.nix {
board-automation = callPackage ./pkgs/board-automation {
inherit bspSrc l4tVersion;
};

python-jetson = python3.pkgs.callPackage ./python-jetson.nix { };
python-jetson = python3.pkgs.callPackage ./pkgs/python-jetson { };

tegra-eeprom-tool = pkgsAarch64.callPackage ./tegra-eeprom-tool.nix { };
tegra-eeprom-tool-static = pkgsAarch64.pkgsStatic.callPackage ./tegra-eeprom-tool.nix { };
tegra-eeprom-tool = pkgsAarch64.callPackage ./pkgs/tegra-eeprom-tool { };
tegra-eeprom-tool-static = pkgsAarch64.pkgsStatic.callPackage ./pkgs/tegra-eeprom-tool { };

l4t = callPackages ./l4t.nix { inherit debs l4tVersion; };
l4t = callPackages ./pkgs/l4t { inherit debs l4tVersion; };

cudaPackages = callPackages ./cuda-packages.nix { inherit debs cudaVersion autoAddOpenGLRunpathHook l4t; };
cudaPackages = callPackages ./pkgs/cuda-packages { inherit debs cudaVersion autoAddOpenGLRunpathHook l4t; };

samples = callPackages ./samples.nix { inherit debs cudaVersion autoAddOpenGLRunpathHook l4t cudaPackages; };
samples = callPackages ./pkgs/samples { inherit debs cudaVersion autoAddOpenGLRunpathHook l4t cudaPackages; };

kernel = callPackage ./kernel { inherit (l4t) l4t-xusb-firmware; kernelPatches = []; };
kernelPackagesOverlay = self: super: {
Expand All @@ -74,15 +74,15 @@ let
rtkernel = callPackage ./kernel { inherit (l4t) l4t-xusb-firmware; kernelPatches = []; realtime = true; };
rtkernelPackages = (pkgs.linuxPackagesFor rtkernel).extend kernelPackagesOverlay;

nxJetsonBenchmarks = pkgs.callPackage ./jetson-benchmarks/default.nix {
nxJetsonBenchmarks = pkgs.callPackage ./pkgs/jetson-benchmarks {
targetSom = "nx";
inherit cudaPackages;
};
xavierAgxJetsonBenchmarks = pkgs.callPackage ./jetson-benchmarks/default.nix {
xavierAgxJetsonBenchmarks = pkgs.callPackage ./pkgs/jetson-benchmarks {
targetSom = "xavier-agx";
inherit cudaPackages;
};
orinAgxJetsonBenchmarks = pkgs.callPackage ./jetson-benchmarks/default.nix {
orinAgxJetsonBenchmarks = pkgs.callPackage ./pkgs/jetson-benchmarks {
targetSom = "orin-agx";
inherit cudaPackages;
};
Expand All @@ -105,16 +105,16 @@ let
networking.hostName = "${c.som}-${c.carrierBoard}"; # Just so it sets the flash binary name.
}) supportedConfigurations;

flashFromDevice = callPackage ./flash-from-device.nix {
flashFromDevice = callPackage ./pkgs/flash-from-device {
inherit pkgsAarch64 tegra-eeprom-tool-static;
};

# Packages whose contents are paramterized by NixOS configuration
devicePkgsFromNixosConfig = callPackage ./device-pkgs.nix {
# Packages whose contents are parameterized by NixOS configuration
devicePkgsFromNixosConfig = callPackage ./device-pkgs {
inherit l4tVersion pkgsAarch64 flash-tools flashFromDevice edk2-jetson uefi-firmware buildTOS buildOpteeTaDevKit opteeClient bspSrc;
};

otaUtils = callPackage ./ota-utils {
otaUtils = callPackage ./pkgs/ota-utils {
inherit tegra-eeprom-tool l4tVersion;
};
in rec {
Expand Down Expand Up @@ -148,7 +148,7 @@ in rec {

flash-generic = writeShellApplication {
name = "flash-generic";
text = callPackage ./flash-script.nix {
text = callPackage ./device-pkgs/flash-script.nix {
inherit flash-tools uefi-firmware;
flashCommands = ''
${runtimeShell}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 2 additions & 9 deletions modules/flash-script.nix
Original file line number Diff line number Diff line change
Expand Up @@ -290,22 +290,15 @@ in
export pkDefault=$(od -t x1 -An "${cfg.firmware.uefi.secureBoot.defaultPkEslFile}")
export kekDefault=$(od -t x1 -An "${cfg.firmware.uefi.secureBoot.defaultKekEslFile}")
export dbDefault=$(od -t x1 -An "${cfg.firmware.uefi.secureBoot.defaultDbEslFile}")
substituteAll ${../uefi-default-keys.dts} keys.dts
substituteAll ${./uefi-default-keys.dts} keys.dts
dtc -I dts -O dtb keys.dts -o $out
'';
in lib.optional cfg.firmware.uefi.secureBoot.enrollDefaultKeys uefiDefaultKeysDtbo;

hardware.nvidia-jetpack.flashScriptOverrides.fuseArgs = lib.mkAfter [ cfg.flashScriptOverrides.configFileName ];

hardware.nvidia-jetpack.firmware.uefi.edk2NvidiaPatches = [
# Have UEFI use the device tree compiled into the firmware, instead of
# using one from the kernel-dtb partition.
# See: https://github.com/anduril/jetpack-nixos/pull/18
../edk2-uefi-dtb.patch
];

# These are from l4t_generate_soc_bup.sh, plus some additional ones found in the wild.
hardware.nvidia-jetpack.firmware.variants = lib.mkOptionDefault (rec {
hardware.nvidia-jetpack.firmware.variants = lib.mkOptionDefault ({
xavier-agx = [
{ boardid="2888"; boardsku="0001"; fab="400"; boardrev="D.0"; fuselevel="fuselevel_production"; chiprev="2"; }
{ boardid="2888"; boardsku="0001"; fab="400"; boardrev="E.0"; fuselevel="fuselevel_production"; chiprev="2"; } # 16GB
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ runCommand "flash-from-device" {} ''
EOF
cat ${./flash-from-device.sh} >> $out/bin/flash-from-device
substituteInPlace $out/bin/flash-from-device \
--replace "@ota_helpers_func@" "${./ota-utils/ota_helpers.func}"
--replace "@ota_helpers_func@" "${../ota-utils/ota_helpers.func}"
chmod +x $out/bin/flash-from-device
''
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions uefi-firmware.nix → pkgs/uefi-firmware/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,13 @@ let
url = "https://github.com/NVIDIA/edk2-nvidia/commit/9604259b0d11c049f6a3eb5365a3ae10cfb9e6d9.patch";
hash = "sha256-IfnTrQnkxFXbeHDfmQd4Umpbp9MKZI1OKi7H1Ujg8K8=";
})

./capsule-authentication.patch

# Have UEFI use the device tree compiled into the firmware, instead of
# using one from the kernel-dtb partition.
# See: https://github.com/anduril/jetpack-nixos/pull/18
./edk2-uefi-dtb.patch
];
postPatch = lib.optionalString errorLevelInfo ''
sed -i 's#PcdDebugPrintErrorLevel|.*#PcdDebugPrintErrorLevel|0x8000004F#' Platform/NVIDIA/NVIDIA.common.dsc.inc
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 62f116b

Please sign in to comment.