It seems you are using the custom carrier board with JP5.1.1.
Please refer to the following steps to enable disk-encryption on your board.
a. create default key
$ echo "f0e0d0c0b0a001020304050607080900" > sym2_t234.key
b. create internal
$ 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
c. create external
(you may specify 461373440 for num_sectors in <base BSP>/tools/kernel_flash/flash_l4t_t234_nvme_rootfs_ab_enc.xml)
$ sudo ROOTFS_ENC=1 ./tools/kernel_flash/l4t_initrd_flash.sh --showlogs --no-flash --external-device nvme0n1p1 -i ./sym2_t234.key -S 100GiB -c ./tools/kernel_flash/flash_l4t_t234_nvme_rootfs_enc.xml --external-only --append --network usb0 jetson-orin-nano-devkit external
d. flash both
$ sudo ./tools/kernel_flash/l4t_initrd_flash.sh --showlogs --network usb0 --flash-only
What’s the physical size of your NVMe SSD in use?
What’s the size you want to use for rootfs?
Please also check if there’s any error showed in every steps.
I have the ./tools/kernel_flash/flash_l4t_t234_nvme_rootfs_enc.xml in the right directory, I also changed the physical SSD size according to the config, it is around 120GiB, so the -S param should also be ok.
The package provided by Advantech seemed to be incomplete. Downloading a fresh 35.4.1 flashing package for Orin worked fine with the official documentation.
There is one more problem i encountered during massflashing an encrypted drive, following this workflow:
Workflow 3: To massflash the backup image
Steps:
Make sure you have only ONE device in recovery mode plugged in the host
Run this command from the Linux_for_Tegra folder:
$ sudo ./tools/backup_restore/l4t_backup_restore.sh -b -c
Where are similar to the corresponding variables used
in the flash.sh command. (See more details in the official documentation’s
board name table).
If this command completes successfully, an initrd flash image is stored in
Linux_for_Tegra/tools/kernel_flash/images.
Put the device in recovery mode again and generate a massflash package using backup image:
$ sudo ./tools/kernel_flash/l4t_initrd_flash.sh --use-backup-image --no-flash --network usb0 --massflash mmcblk0p1
Where is the highest possible number of devices to be flashed concurrently.
are similar to the corresponding variables used
in the flash.sh command. (See more details in the official documentation’s
board name table).
After generate the massflash image and environment, you can flash new device by putting the device into recovery mode:
$ sudo ./tools/kernel_flash/l4t_initrd_flash.sh --flash-only --massflash --network usb0
Alternatively, use the generated mfi_.tar.gz tarball. More
detailed instruction can be found in the Initrd flash README.
I generate the massflash package but flashing using ‘–use-backup-image’ fails every time at the end of the script:
Writing APP_ENC partition done
writing item=18, 9:0:secondary_gpt, 128035659264, 16896, gpt_secondary_9_0.bin, 16896, fixed--0, 39cebea8ba4b425cf3602d21a69ae39a157145e6
[ 294]: l4t_flash_from_kernel: Successfully flash the external device
[ 294]: l4t_flash_from_kernel: /mnt/internal/flash.idx is not found. Skipping spi flashing
[ 294]: l4t_flash_from_kernel: Error: /mnt/internal/flash.idx is not found
[ 294]: l4t_flash_from_kernel: Error flashing qspi
Flash failure
Cleaning up…
Yes, we confirmed that it works without using backup image, but the result is a fresh, encripted rootfs, and we need to clone our software and its dependencies while mass flashing.
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for target to boot-up...
Waiting for device to expose ssh ......RTNETLINK answers: File exists
RTNETLINK answers: File exists
Waiting for device to expose ssh ...Run command: flash on fc00:1:1:1::2
SSH ready
blockdev: cannot open /dev/mmcblk0boot0: No such file or directory
[ 0]: l4t_flash_from_kernel: Starting to flash to qspi
QSPI storage size: 67108864 bytes.
Erased 67108864 bytes from address 0x00000000 in flash
[ 179]: l4t_flash_from_kernel: Error: /mnt/internal/flash.idx is not found
[ 179]: l4t_flash_from_kernel: /mnt/internal/flash.idx is not found. Skipping spi flashing
[ 179]: l4t_flash_from_kernel: Error flashing qspi
Flash failure
Cleaning up...