Skip to content

Commit d63c467

Browse files
committed
jetson-orin: enroll UEFI secure boot keys from certs
Signed-off-by: vadik likholetov <vadikas@gmail.com>
1 parent 57e6fe0 commit d63c467

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

modules/reference/hardware/jetpack/nvidia-jetson-orin/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
imports = [
77
./partition-template.nix
88
./jetson-orin.nix
9+
./secureboot.nix
910

1011
./pci-passthrough-common.nix
1112

modules/reference/hardware/jetpack/nvidia-jetson-orin/jetson-orin.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ in
4949
};
5050

5151
config = mkIf cfg.enable {
52+
ghaf.hardware.nvidia.orin.secureboot.enable = lib.mkDefault true;
53+
5254
hardware.nvidia-jetpack.kernel.version = "${cfg.kernelVersion}";
5355
nixpkgs.hostPlatform.system = "aarch64-linux";
5456

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# SPDX-FileCopyrightText: 2022-2026 TII (SSRC) and the Ghaf contributors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
{
5+
config,
6+
lib,
7+
pkgs,
8+
...
9+
}:
10+
let
11+
cfg = config.ghaf.hardware.nvidia.orin.secureboot;
12+
13+
eslFromCert =
14+
name: cert:
15+
pkgs.runCommand name { nativeBuildInputs = [ pkgs.buildPackages.efitools ]; } ''
16+
${pkgs.buildPackages.efitools}/bin/cert-to-efi-sig-list ${cert} $out
17+
'';
18+
19+
keysDir = cfg.keysSource;
20+
21+
pkEsl = eslFromCert "PK.esl" "${keysDir}/PK.crt";
22+
kekEsl = eslFromCert "KEK.esl" "${keysDir}/KEK.crt";
23+
dbEsl = eslFromCert "db.esl" "${keysDir}/db.crt";
24+
in
25+
{
26+
options.ghaf.hardware.nvidia.orin.secureboot = {
27+
enable = lib.mkEnableOption "UEFI Secure Boot key enrollment for Jetson Orin";
28+
29+
keysSource = lib.mkOption {
30+
type = lib.types.path;
31+
default = ../../../../secureboot/keys;
32+
description = "Directory containing PK.crt, KEK.crt and db.crt used to generate ESLs.";
33+
};
34+
};
35+
36+
config = lib.mkIf cfg.enable {
37+
hardware.nvidia-jetpack.firmware.uefi.secureBoot = {
38+
enrollDefaultKeys = true;
39+
defaultPkEslFile = pkEsl;
40+
defaultKekEslFile = kekEsl;
41+
defaultDbEslFile = dbEsl;
42+
};
43+
};
44+
}

0 commit comments

Comments
 (0)