[Orin Nano NVME] SKU 003 Enable UEFI secure boot by OTA from 35.5.0 to 35.6.0

Hi Nvidia team,
I have some trouble with OTA to enable secure boot on L4T 35.5.0 from non UEFI secure boot (L4T 35.5.0). My device have enable Secureboot + disk encryption
Here is my testing steps:

  1. I already achieved OTA non UEFI secure boot from 35.5.0 to 35.6.0 without any issue.
  2. switching back to slot 35.5.0 and have followed instructions here Secure Boot — NVIDIA Jetson Linux Developer Guide
  3. Here is my steps to generate capsules:
  • sudo ADDITIONAL_DTB_OVERLAY=“UefiDefaultSecurityKeys.dtbo” ROOTFS_AB=1 ROOTFS_ENC= FAB=000 BOARDID=3767 BOARDSKU=0003 BOARDREV= FUSELEVEL=fuselevel_production CHIPREV= CHIP_SKU=00:00:00:D5 ./build_l4t_bup.sh --multi-spec -u /home/hao/key/rsa.pem -v /home/hao/key/sbk.key --bup-type bl jetson-orin-nano-devkit nvme0n1p1
    +./generate_capsule/l4t_generate_soc_capsule.sh -i bootloader/payloads_t23x/bl_only_payload -o ./TEGRA_BL.Cap t234
  1. After update capsule successfully
    I met the errors
    EnrollFromDefaultKeysApp: Cannot enroll dbt: Not Found
    EnrollFromDefaultKeysApp: Cannot enroll dbx: Not Found
    Jetson UEFI firmware (version 6.0-37391689 built on 2024-08-28T08:47:11+00:00)
    ESC to enter Setup.
    F11 to enter Boot Manager Menu.
    Enter to continue boot.
    ** WARNING: Test Key is used. **
    ..
    ▒▒I/TC: Reserved shared memory is disabled
    I/TC: Dynamic shared memory is enabled
    I/TC: Normal World virtualization support is disabled
    I/TC: Asynchronous notifications are disabled
    ▒▒L4TLauncher: Attempting Direct Boot
    ▒▒E/TA: decrypt_image:99 TEE_InvokeTACommand failed with res = 0xffff0006
    E/TA: decrypt_image:99 TEE_InvokeTACommand failed with res = 0xffff0007
    E/TA: decrypt_image:99 TEE_InvokeTACommand failed with res = 0xffff0007
    E/TA: decrypt_image:99 TEE_InvokeTACommand failed with res = 0xffff0007
    E/TA: decrypt_image:99 TEE_InvokeTACommand failed with res = 0xffff0007
    E/TA: decrypt_image:99 TEE_InvokeTACommand failed with res = 0xffff0007
    ▒▒OpenAndReadFileToBuffer: \boot\initrd failed signature verification: Security Vi
    olation
    ExtLinuxBoot:sds Failed to Authenticate \boot\initrd (Security Violation)
    L4TLauncher: Unable to boot via extlinux: Security Violation
    L4TLauncher: Attempting Kernel Boot
    ▒▒E/TA: decrypt_image:99 TEE_InvokeTACommand failed with res = 0xffff0006
    E/TA: decrypt_image:99 TEE_InvokeTACommand failed with res = 0xffff0007
    E/TA: decrypt_image:99 TEE_InvokeTACommand failed with res = 0xffff0007
    E/TA: decrypt_image:99 TEE_InvokeTACommand failed with res = 0xffff0007
    E/TA: decrypt_image:99 TEE_InvokeTACommand failed with res = 0xffff0007
    E/TA: decrypt_image:99 TEE_InvokeTACommand failed with res = 0xffff0007
    E/TA: decrypt_image:99 TEE_InvokeTACommand failed with res = 0xffff0007
    E/TA: decrypt_image:99 TEE_InvokeTACommand failed with res = 0xffff0007
    E/TA: decrypt_image:99 TEE_InvokeTACommand failed with res = 0xffff0007
    E/TA: decrypt_image:99 TEE_InvokeTACommand failed with res = 0xffff0007
    E/TA: decrypt_image:99 TEE_InvokeTACommand failed with res = 0xffff0007
    E/TA: decrypt_image:99 TEE_InvokeTACommand failed with res = 0xffff0007
    E/TA: decrypt_image:99 TEE_InvokeTACommand failed with res = 0xffff0007
    E/TA: decrypt_image:99 TEE_InvokeTACommand failed with res = 0xffff0007
    E/TA: decrypt_image:99 TEE_InvokeTACommand failed with res = 0xffff0007

full log attached
uefi_secure_boot.txt (303.0 KB)

Here is my step to generate eks.img

echo “2d4a614e645267556b58703273357638792f423f4428472b4b6250655368566d” > oem_k1.key
echo “0000000000000000000000000000000000000000000000000000000000000000” > sym_t234.key
echo “f0e0d0c0b0a001020304050607080900” > sym2_t234.key
echo “d9f7b49e3b6264985f1326f541bb43c9” > auth_t234.key
echo “bad66eb4484983684b992fe54a648bb8” > fv_ekb_t234
python3 source/public/optee/samples/hwkey-agent/host/tool/gen_ekb/gen_ekb.py -chip t234 -oem_k1_key oem_k1.key
-fv fv_ekb_t234
-in_sym_key sym_t234.key
-in_sym_key2 sym2_t234.key
-in_auth_key auth_t234.key
-out bootloader/eks_t234.img

hello anhhao.hcmus,

you may see-also.. Enabling UEFI Secureboot through UEFI Utilities by Running from an Ubuntu Prompt.

Hi Jerry can we do by capsule update or OTA?
like from 35.5.0 non UEFI secure boot to 35.6.0 with UEFI secureboot

Yes, it could be enabled through the capsule update.

Please just refer to this flow from the latest document, it should also work on your r35.x case.
You have to finish Generate Signed UEFI Payloads to sign them before generating capsule payload.

Thanks for your response!

sudo ADDITIONAL_DTB_OVERLAY=“UefiDefaultSecurityKeys.dtbo” ROOTFS_AB=1 ROOTFS_ENC= FAB=000 BOARDID=3767 BOARDSKU=0003 BOARDREV= FUSELEVEL=fuselevel_production CHIPREV= CHIP_SKU=00:00:00:D5 ./build_l4t_bup.sh --multi-spec -u /home/hao/key/rsa.pem -v /home/hao/key/sbk.key --bup-type bl jetson-orin-nano-devkit nvme0n1p1

my device is enable secure boot + disk encryption + rootfs_ab.

I got the same issue as mentioned above.

when ROOTFS_ENC=1
I got
###############################################################################

L4T BSP Information:

R35 , REVISION: 6.0

User release: 0.0

###############################################################################
Error: When disk encryption is enabled, root device cannot be nvme0n1p1
hao@hao-server:~/repo/os-builder/build/OrinNano_35.5.0/downloads/Linux_for_Tegra

Hi,

I’ve tried to reflash my devkit with ROOTFS_AB=1 ROOTFS_ENC=1

sudo ROOTFS_AB=1 ROOTFS_ENC=1 ./tools/kernel_flash/l4t_initrd_flash.sh --network usb0 --external-device nvme0n1p1 --uefi-keys uefi_keys/uefi_keys.conf --uefi-enc source/public/optee/samples/hwkey-agent/host/tool/gen_ekb/sym_t234.key -u rsa.pem -v sbk.key -i sym2_t234.key -c ./tools/kernel_flash/flash_l4t_nvme_rootfs_ab_enc.xml -p “-c ./bootloader/t186ref/cfg/flash_t234_qspi.xml” --showlogs jetson-orin-nano-devkit internal

Always end up with erorr
Active index file is /mnt/internal/flash.idx
Number of lines is 76
max_index=75
writing item=59, 6:0:primary_gpt, 512, 19968, gpt_primary_6_0.bin, 16896, fixed--0, 64b69d9ae6791c808095a86674f3001178d4ec39
Error: Could not stat device /dev/mmcblk0 - No such file or directory.
Flash failure
Cleaning up…

without ROOTFS_ENC it’s fine.

did I miss some thing to enable UEFI secure boot with ROOTFS_AB=1 ROOTFS_ENC=1
?

Thanks

hello anhhao.hcmus,

this property meant you’re flashing to internal storage, which is eMMC.

Hi Jerry,

I followed this Quick Start — NVIDIA Jetson Linux Developer Guide 1 documentation

when I changed to external, it threw Error: When disk encryption is enabled, root device cannot be external

hello anhhao.hcmus,

please try to generate images for internal device and external device separately, then flash,
for instance,
(1) here’s flash command-line
$ sudo ROOTFS_AB=1 ./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
$ sudo ROOTFS_ENC=1 ROOTFS_AB=1 ./tools/kernel_flash/l4t_initrd_flash.sh --showlogs --no-flash --external-device nvme0n1p1 -i ~/KEY/sym2_t234.key -p -S 50GiB -c ./tools/kernel_flash/flash_l4t_t234_nvme_rootfs_ab_enc.xml --external-only --append --network usb0 jetson-orin-nano-devkit external
$ sudo ./tools/kernel_flash/l4t_initrd_flash.sh --showlogs --network usb0 --flash-only

(2.1) please re-create eks_t234.img, you’ll need to download r35.6.0 public release sources.
(2.2) updating your $OUT/Linux_for_Tegra/bootloader/eks_t234.img.

(3) you should also include ROOTFS_AB=1 ROOTFS_ENC=1 to the command-line for creating OTA payload,
$ sudo ROOTFS_AB=1 ROOTFS_ENC=1 -E ./tools/ota_tools/version_upgrade/l4t_generate_ota_package.sh --external-device nvme0n1 -S 50GiB -i sym2_t234.key -p jetson-orin-nano-devkit R35-6

Thanks Jerry, could you provide me the way to reflash board with uefi secureboot and OTA payload with UEFI secure boot enabled?

Hi JerryChang and Kevin.

I’ve manged to get UEFI secure enabled. But during boot process I see

Jetson UEFI firmware (version v35.6.0 built on 2024-09-17T13:50:43+00:00)
ESC to enter Setup.
F11 to enter Boot Manager Menu.
Enter to continue boot.
** WARNING: Test Key is used. **
.
▒▒I/TC: Reserved shared memory is disabled
I/TC: Dynamic shared memory is enabled
I/TC: Normal World virtualization support is disabled
I/TC: Asynchronous notifications are disabled
E/TC:?? 00 get_rpc_alloc_res:645 RPC allocation failed. Non-secure world result: ret=0xffff0000 ret_origin=0
E/LD: init_elf:486 sys_open_ta_bin(0e35e2c9-b329-4ad9-a2f5-8ca9bbbd7713)
E/TC:?? 00 ldelf_init_with_ldelf:131 ldelf failed with res: 0xffff000c
▒▒GetImageEncryptionInfo: Failed to open session to cpubl payload decryption TA 4
294901772
L4TLauncher: Unable to get image status: Unsupported
L4TLauncher: Attempting Direct Boot
EFI stub: Booting Linux Kernel…
EFI stub: UEFI Secure Boot is enabled.
EFI stub: Using DTB from configuration table
EFI stub: Loaded initrd from LINUX_EFI_INITRD_MEDIA_GUID device path
EFI stub: Exiting boot services and installing virtual address map..

Could you please confirm if these warnings and errors (e.g., Test Key is used , RPC allocation failed , and Failed to open session to cpubl payload decryption TA ) will have any impact on the system during runtime?

hello anhhao.hcmus,

you should add -t options to build OP-TEE with fTPM support enabled.
for instance, ./optee_src_build.sh -p t<platform> -t

hello anhhao.hcmus,

FYI,
here’re steps we’ve verify OTA update with UEFI Secureboot + Disk Encryption + Rootfs-AB.
it’s tested with Orin Nano/ r36.4.3

here’re steps for your reference,
(1) Commands for image flashing, which flash r36.4.3 with ROOTFS AB enable + Disk Encryption enable + UEFI Secureboot enable on Orin-Nano.
$ sudo ROOTFS_AB=1 ./tools/kernel_flash/l4t_initrd_flash.sh --network usb0 --no-flash --uefi-keys uefi_keys/uefi_keys.conf --showlogs -p "-c bootloader/generic/cfg/flash_t234_qspi.xml" jetson-orin-nano-devkit internal
$ sudo ROOTFS_AB=1 ROOTFS_ENC=1 ./tools/kernel_flash/l4t_initrd_flash.sh --showlogs --no-flash --external-device nvme0n1p1 -i ./sym2_t234.key --uefi-keys uefi_keys/uefi_keys.conf -c ./tools/kernel_flash/flash_l4t_t234_nvme_rootfs_ab_enc.xml --external-only --append --network usb0 jetson-orin-nano-devkit external
$ sudo ./tools/kernel_flash/l4t_initrd_flash.sh --showlogs --uefi-keys uefi_keys/uefi_keys.conf --network usb0 --flash-only

(2) The command-line for creating OTA payload, which has ROOTFS_AB=1, ROOTFS_ENC=1 and --uefi-keys added.
$ export TARGET_BSP=/home/carol/4TBNVME/JEP/JetPack/JetPack-6.2/Linux_for_Tegra
$ sudo ROOTFS_AB=1 ROOTFS_ENC=1 -E ./tools/ota_tools/version_upgrade/l4t_generate_ota_package.sh --external-device nvme0n1 -i ./sym2_t234.key --uefi-keys ./uefi_keys/uefi_keys.conf --rootfs-uuid 2ff299c5-0b33-46ce-8ba7-136ecf882384 --rootfs-b-uuid 7da5fc07-9ca4-4cd3-94b9-e08b2c479ada --uda-uuid 8e109028-09f6-4c37-abee-af196dbea12a jetson-orin-nano-devkit R36-4

note:
please see-also developer guide, OTA Upgrades with UEFI Secure Boot Enabled.

(3) Copy the payloads to your target, and running OTA update script.
[Host]
$ scp ./bootloader/jetson-orin-nano-devkit/ota_payload_package.tar.gz nvidia@10.19.106.207:/home/nvidia/.
$ scp ../ota_tools_R36.4.3_aarch64.tbz2 nvidia@10.19.106.207:/home/nvidia/.
$ scp ./bootloader/uefi_overlay/uefi_secureboot_overlay_multi_specs.tar.gz nvidia@10.19.106.207:/home/nvidia/
[Target]
$ sudo cp ota_payload_package.tar.gz uefi_secureboot_overlay_multi_specs.tar.gz /mnt/crypt_root_other/.
$ mkdir OTA
$ tar xpvf ota_tools_R36.4.3_aarch64.tbz2 -C ./OTA
$ sudo ./nv_ota_start.sh /mnt/crypt_root_other/ota_payload_package.tar.gz