Using Jetpack 4.6.1 with L4T 32.7.1, I am trying to enable disk encryption on a jetson xavier nx (production with onboard eMMC) with the rootfs existing on an external drive (an SD card), however using l4t_initrd_flash.sh
as described in both the online docs and README_initrd_flash.txt
, does not work. I’ve created the following helper script for this task:
#!/bin/bash
sudo ROOTFS_ENC=1 bash -x tools/kernel_flash/l4t_initrd_flash.sh --no-flash --showlogs \
-u /mnt/keys//pkc.pem -v /mnt/keys//sbk \
-p "-i /mnt/keys/ekb.key --user_key /mnt/keys/user_key_flash" \
jetson-xavier-nx-devkit-qspi internal |& tee qspi.log
read -rp "Recovery"
sudo ROOTFS_ENC=1 bash -x tools/kernel_flash/l4t_initrd_flash.sh --no-flash --showlogs --append \
-u /mnt/keys//pkc.pem -v /mnt/keys//sbk \
"-p -i /mnt/keys/ekb.key --user_key /mnt/keys/user_key_flash" \
-c tools/kernel_flash/flash_d4t_sdcard_512GB_rootfs_enc.xml \
--external-device mmcblk1p1 --external-only -S 100GiB jetson-xavier-nx-devkit-emmc mmcblk1p1 \
|& tee external.log
read -rp "Recovery"
sudo ROOTFS_ENC=1 ./tools/kernel_flash/l4t_initrd_flash.sh --showlogs --flash-only |& tee flash.log
Attached are the logs from each of the three steps:
qspi.log (199.6 KB)
flash.log (22.8 KB)
external.log (157.0 KB)
I’ve seen various errors here including: scripts replacing my external storage targets with internal targets, scripts denying that external disk encryption is supported, flashing succeeding but device is failing to boot (with multiple different failures).
I am at a loss at what to try next, all the Nvidia docs point to this function being supported but I cannot seem to get it to work.
Additional background:
I am using boards that have secure boot enabled (SKB+PKC) and all KEK fuses burned.
I have been able to successfully get disk encryption working using the internal eMMC by: changing the eks.img, flashing (with: sudo ROOTFS_ENC=1 ./flash.sh --showlogs -u /mnt/keys/pkc.pem -v /mnt/keys/sbk -i /mnt/keys/ekb.key --user_key /mnt/keys/user_key_flash jetson-xavier-nx-devkit-emmc mmcblk0p1
), booted and proved disk encryption is enabled.
I have digested other forum posts for information as well:
https://forums.developer.nvidia.com/t/disk-encryption-of-external-sda-in-jatson-agx-xavier-rs32-7-1-js4-6-1/211094/60?page=2
https://forums.developer.nvidia.com/t/encrypted-filesystem-works-on-32-6-1-but-not-on-32-5-1/205243
Why the initrd_flash can encrypt the disk without SBKPKC mode - #16 by QOP
The current setup I am using to flash and boot from an external drive (SD card) with secure boot is as follows:
# Configure jetson to boot from sd card - no rootfs flash
sudo ./flash.sh -u /mnt/keys/pkc.pem -v /mnt/keys/sbk jetson-xavier-nx-devkit-emmc mmcblk1p1
# Reboot to RCM
# Flash rootfs to sd card
bash -x tools/kernel_flash/l4t_initrd_flash.sh --showlogs \
-u /mnt/keys/pkc.pem -v /mnt/keys/sbk \
--external-device mmcblk1p1 -S 470GiB -c tools/kernel_flash/flash_l4t_sdcard_512GB.xml \
--external-only jetson-xavier-nx-devkit-emmc mmcblk1p1