Skip to content

Commit 6118988

Browse files
committed
jetson-orin: enroll UEFI secure boot keys from certs
1 parent 57e6fe0 commit 6118988

File tree

3 files changed

+44
-0
lines changed

3 files changed

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

0 commit comments

Comments
 (0)