Hello,
I’m currently facing an issue with disk encryption on the Orin NX 16GB with L4T 35.5.0.
My distribution is Buildroot based, but all of the flashing scripts are from the L4T sources so I would expect it to behave the same as a Jetpack installation.
[ 10.245753] Run /init as init process
[ 10.262337] Root device found: UUID=51424804-e148-490a-87ec-d3a99b067f27
[ 10.281267] Cryptsetup version: 2.6.1
[ 10.416932] ERROR: encrypted dev /dev/nvme0n1p2 is not LUKS device.
[ 10.425129] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00
I am running the following commands as per the Jetson documentation for flashing external NVME with encryption;
Put target in recovery mode and then run the following;
sudo ./tools/kernel_flash/l4t_initrd_flash.sh --showlogs -p "-c bootloader/t186ref/cfg/flash_t234_qspi.xml" --no-flash --network usb0 jetson-orin-nano-devkit internal 2>&1 | tee flash_qspi.log
sudo ROOTFS_ENC=1 ./tools/kernel_flash/l4t_initrd_flash.sh --showlogs --no-flash --external-device nvme0n1p1 -i ./ekb.key -c ./tools/kernel_flash/flash_l4t_t234_nvme_rootfs_enc.xml --external-only --append --network usb0 jetson-orin-nano-devkit external 2>&1 | tee flash_nvme.log
sudo ./tools/kernel_flash/l4t_initrd_flash.sh --showlogs --network usb0 --flash-only
In the initrd, if I run cryptsetup isLuks /dev/nvme0n1p2 --verbose --debug I can see that the on-disk vs in-memory checksum is different. Is the LUKS header somehow being corrupted?
# cryptsetup 2.6.1 processing "cryptsetup isLuks /dev/nvme0n1p2 --verbose --debug"
# Verifying parameters for command isLuks.
# Running command isLuks.
# Installing SIGINT/SIGTERM handler.
# Unblocking interruption on signal.
# Allocating context for crypt device /dev/nvme0n1p2.
# Trying to open and read device /dev/nvme0n1p2 with direct-io.
# Initialising device-mapper backend library.
# Trying to load any crypt type from device /dev/nvme0n1p2.
# Crypto backend (OpenSSL 1.1.1t 7 Feb 2023) initialized in cryptsetup library version 2.6.1.
# Detected kernel Linux 5.10.192-g6099b0d88488 aarch64.
# Loading LUKS2 header (repair disabled).
# Acquiring read lock for device /dev/nvme0n1p2.
# Opening lock resource file /run/cryptsetup/L_259:2
# Verifying lock handle for /dev/nvme0n1p2.
# Device /dev/nvme0n1p2 READ lock taken.
# Trying to read primary LUKS2 header at offset 0x0.
# Opening locked device /dev/nvme0n1p2
# Verifying locked device handle (bdev)
# LUKS2 header version 2 of size 16384 bytes, checksum sha256.
# Checksum:622f5c554f6204076a6e9498ce28afbcc62d05481edcdba1c8b75f0e5421c82c (on-disk)
# Checksum:ca0b6827e1349d8fca331da1c752e2282720cd611b71667a9e534511a9adacfe (in-memory)
# LUKS2 header checksum error (offset 0).
# Trying to read secondary LUKS2 header at offset 0x4000.
# Reusing open ro fd on device /dev/nvme0n1p2
# LUKS2 header version 2 of size 16384 bytes, checksum sha256.
# Checksum:9ac304a2d396b61251daa49d1a2a42d0e4e377bf4fd8c50ccaa27fb6a4dc68e1 (on-disk)
# Checksum:c3687a7d6acb764e3e6e5b6dd595b214500392c7d22032c0746f7cb4530dd3b7 (in-memory)
# LUKS2 header checksum error (offset 16384).
# Trying to read secondary LUKS2 header at offset 0x8000.
# Reusing open ro fd on device /dev/nvme0n1p2
# Trying to read secondary LUKS2 header at offset 0x10000.
# Reusing open ro fd on device /dev/nvme0n1p2
# Trying to read secondary LUKS2 header at offset 0x20000.
# Reusing open ro fd on device /dev/nvme0n1p2
# Trying to read secondary LUKS2 header at offset 0x40000.
# Reusing open ro fd on device /dev/nvme0n1p2
# Trying to read secondary LUKS2 header at offset 0x80000.
# Reusing open ro fd on device /dev/nvme0n1p2
# Trying to read secondary LUKS2 header at offset 0x100000.
# Reusing open ro fd on device /dev/nvme0n1p2
# Trying to read secondary LUKS2 header at offset 0x200000.
# Reusing open ro fd on device /dev/nvme0n1p2
# Trying to read secondary LUKS2 header at offset 0x400000.
# Reusing open ro fd on device /dev/nvme0n1p2
# LUKS2 header read failed (-22).
# Device /dev/nvme0n1p2 READ lock released.
# Releasing crypt device /dev/nvme0n1p2 context.
# Releasing device-mapper backend.
# Closing read only fd for /dev/nvme0n1p2.
Command failed with code -1 (wrong or missing parameters).
Log files from flash are attached.
Is anyone able to help?
Thank you in advance.
flash_1-4.2_0_20240410-204109.log (39.6 KB)
flash_nvme.log (159.7 KB)
flash_qspi.log (213.4 KB)

