Hi,
I’m trying to set up encrypted rootfs on NVMe on a Jetson Orin NX 16GB (carrier: p3767, module: p3768) using JetPack 6.2.1 (L4T R36.4), with keys stored in EKS / OP-TEE (LUKS key derived from hwkey-agent).
The goal is:
-
QSPI: normal boot chain + EKS, secure boot etc.
-
External NVMe: APP as a small boot partition, APP_ENC as encrypted rootfs (
crypto_LUKS), root mounted via dm-crypt.
At the moment I can successfully flash QSPI + NVMe, but APP_ENC is never created, no encrypted rootfs image is generated, and the board boots from a plain ext4 APP on nvme0n1p1.
Environment
-
Board: Jetson Orin NX
-
Module: p3768-0000
-
Carrier: p3767-0000
-
-
JetPack: 6.2.1 (SDK Manager)
-
L4T: R36.4.0
-
Host: Ubuntu 22.04 (VM), running the BSP under:
~/nvidia/nvidia_sdk/JetPack_6.2.1_Linux_JETSON_ORIN_NX_TARGETS/Linux_for_Tegra
What I’m doing (high level)
Generate keys & EKS for T234 using gen_ekb.py under:
source/optee/samples/hwkey-agent/host/tool/gen_ekb
oem_k1_key.hex(32-byte OEM K1 key, hex)sym32.hex(32-byte symmetric key)sym16.hex(16-byte symmetric key)auth16.hex(16-byte auth key)
Then:
python3 gen_ekb.py -chip t234
-oem_k1_key oem_k1_key.hex
-in_sym_key sym32.hex
-in_sym_key2 sym16.hex
-in_auth_key auth16.hex
-out eks_t234.img
cp eks_t234.img “$L4T/bootloader/eks.img”
cp sym_key2.bin “$L4T/disk_enc.key”
eks_t234_sigheader.img.encrypt (parittion: A_eks / B_eks)
Use NVIDIA’s encrypted NVMe rootfs XML:
tools/kernel_flash/flash_l4t_t234_nvme_rootfs_enc.xml
The external device section contains:
... 419430400 16384 APPUUID system_boot.img ... `/dev/nvme0n1p1` ... sequential basic APP_ENC_SIZE 0 0x8 16384 0 APP_ENC_UUID system_root_encrypted.img_ext Contains the encrypted root partition("/") ...Initrd flashing (QSPI + external) using l4t_initrd_flash.sh:
- Internal/QSPI packages (no flash):
sudo BOARDID=3768 FAB=0000 BOARDSKU=0000 BOARDREV=A.0 \
./tools/kernel_flash/l4t_initrd_flash.sh \
--showlogs \
--no-flash \
--network usb0 \
-p "-c ./bootloader/generic/cfg/flash_t234_qspi.xml" \
p3768-0000-p3767-0000-a0 internal
- External NVMe encrypted image packages (no flash): I tried Both
# with ENC_ROOTFS
sudo ENC_ROOTFS=1 \
./tools/kernel_flash/l4t_initrd_flash.sh \
--showlogs \
--no-flash \
--network usb0 \
--external-device nvme0n1 \
--external-only \
-c ./tools/kernel_flash/flash_l4t_t234_nvme_rootfs_enc.xml \
-p "-c ./bootloader/generic/cfg/flash_t234_qspi.xml" \
-i ./disk_enc.key \
--append \
p3768-0000-p3767-0000-a0 external
and also explicitly defining APP_ENC_SIZE:
sudo APP_ENC_SIZE=107374182400 ENC_ROOTFS=1 \
./tools/kernel_flash/l4t_initrd_flash.sh \
--showlogs \
--no-flash \
--network usb0 \
--external-device nvme0n1 \
--external-only \
-c ./tools/kernel_flash/flash_l4t_t234_nvme_rootfs_enc.xml \
-p "-c ./bootloader/generic/cfg/flash_t234_qspi.xml" \
-i ./disk_enc.key \
--append \
p3768-0000-p3767-0000-a0 external
The saved initrd parameters confirm the XML used:
–external-device nvme0n1 -c “./tools/kernel_flash/flash_l4t_t234_nvme_rootfs_enc.xml” --network usb0 p3768-0000-p3767-0000-a0 external
Flash-only once packages are built:
sudo ./tools/kernel_flash/l4t_initrd_flash.sh \
--showlogs \
--network usb0 \
--flash-only \
p3768-0000-p3767-0000-a0 external
Logs show:
-
QSPI written successfully
-
External device (NVMe) GPT created and partitions flashed
-
Flash is successful / Reboot device
Symptoms on the host (image packaging)
After building the external images (no flash), I inspect:
grep -n “APP_ENC” tools/kernel_flash/images/external/flash.idx || echo “APP_ENC not in flash.idx”
Result:
APP_ENC not in flash.idx
And the supposed encrypted rootfs image does not exist:
cd tools/kernel_flash/images/external
ls system_root_encrypted.img_ext
# ls: cannot access 'system_root_encrypted.img_ext': No such file or directory
So, even before touching the Jetson, the image package created by l4t_initrd_flash.sh:
-
Has no APP_ENC entry in
flash.idx. -
Does not generate
system_root_encrypted.img_ext.
This is the core of the problem: the APP_ENC partition and encrypted rootfs image are never created by the BSP tools.
Symptoms on the Jetson
After a “successful” flash-only and reboot:
jetson@ubuntu:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
nvme0n1 259:0 0 119.2G 0 disk
├─nvme0n1p1 259:1 0 117.8G 0 part /
...
├─nvme0n1p14 259:14 0 400M 0 part
└─nvme0n1p15 259:15 0 479.5M 0 part
jetson@ubuntu:~$ findmnt /
TARGET SOURCE FSTYPE OPTIONS
/ /dev/nvme0n1p1 ext4 rw,relatime
jetson@ubuntu:~$ sudo blkid | egrep 'nvme0n1p|crypto_LUKS' || echo "no LUKS found"
/dev/nvme0n1p1: TYPE="ext4" PARTLABEL="APP" ...
/dev/nvme0n1p14: PARTLABEL="UDA" ...
no `crypto_LUKS` entries
So on the device:
-
APP(nvme0n1p1) is huge (~117.8 GiB) and is mounted as/(plain ext4). -
UDAis present as a ~400M partition, but not LUKS. -
There is no APP_ENC partition and no dm-crypt mapper.
-
sudo cryptsetup isLuks /dev/nvme0n1p1→ NOT LUKS.
This does not match the XML (where APP was 400 MiB and APP_ENC was intended to be the encrypted rootfs).
What I’ve already tried / verified
-
EKS is generated and flashed; logs show
eks_t234_sigheader.img.encryptwritten to QSPI (A_eks/B_eks). -
disk_enc.keyis a 32-byte binary key (checked withhexdump/xxd). -
All required host tools installed (cryptsetup, sshpass, nfs-kernel-server, abootimg, libxml2-utils, parted).
-
Internal (QSPI) flash using
flash_t234_qspi.xmlis fine. -
External initrd flash is using
flash_l4t_t234_nvme_rootfs_enc.xml(confirmed frominitrdflashparam.txt). -
Tried defining
APP_ENC_SIZEboth in the environment and in the board conf. -
Always the same result: APP_ENC never appears in
tools/kernel_flash/images/external/flash.idxandsystem_root_encrypted.img_extis never produced.
So from what I can tell, the encrypted NVMe rootfs path is never actually engaged by the current JetPack 6.2.1 tooling for this board + XML.
Questions
-
Is encrypted rootfs on external NVMe (using APP_ENC with LUKS) officially supported for Jetson Orin NX with JetPack 6.2.1 / L4T R36.4?
- If yes, is
flash_l4t_t234_nvme_rootfs_enc.xmlthe correct starting point, or is there a newer/different XML / method for R36.4?
- If yes, is
-
What additional steps or variables are required so that:
-
l4t_initrd_flash.shactually:-
creates APP_ENC in
tools/kernel_flash/images/external/flash.idx, and -
generates
system_root_encrypted.img_extas acrypto_LUKSimage,
rather than leaving only a large plain ext4 APP?
-
-
-
Is there any documentation or reference example for:
-
LUKS rootfs on external NVMe,
-
using EKS / hwkey-agent-derived keys (no passphrase at boot),
-
with JetPack 6.x and Orin NX?
-
I can attach:
-
flash_l4t_t234_nvme_rootfs_enc.xml, -
tools/kernel_flash/images/external/flash.idx, -
initrdlog/flash_3-2_0_20251117-170149.log(or latest), -
p3768-0000-p3767-0000-a0.conf,
if that helps.
Right now it looks like the BSP tools simply ignore the APP_ENC definition for external NVMe and never build the encrypted rootfs image, but I’d like to confirm whether I’m missing a step or this is a limitation/bug in R36.4.
Thanks in advance for any guidance.