ERROR after flashing J401 Orin NX Board boot\extlinux\extlinux.conf: Not Found

I’m own a J4012 Orin NX (16GB). And I’m following the instructions from the manufacturer, which follow closely to Nvidia’s and does not have a custom BSP Seeed Studio steps for flashing. And I’ve tried flashing it with both Jetpack 5.1.2 and 5.1.3

I use a slight modification of the command [-S 62545443840] to make my app partition ~62GB.

sudo ./tools/kernel_flash/l4t_initrd_flash.sh  -S 62545443840 --external-device nvme0n1p1 \
  -c tools/kernel_flash/flash_l4t_external.xml -p "-c bootloader/t186ref/cfg/flash_t234_qspi.xml" \
  --showlogs --network usb0 p3509-a02+p3767-0000 internal

I’ve also tried other commands like the one shown as Nvidia’s "official method"

sudo ./tools/kernel_flash/l4t_initrd_flash.sh -S 62545443840 --external-device nvme0n1p1 \
-c tools/kernel_flash/flash_l4t_t234_nvme.xml  -p "-c bootloader/t186ref/cfg/flash_t234_qspi.xml" \
--showlogs --network usb0 p3509-a02+p3767-0000 nvme0n1p1

I also tried:

sudo ./tools/kernel_flash/l4t_initrd_flash.sh -S 62545443840 --external-device nvme0n1p1 \
-c tools/kernel_flash/flash_l4t_external.xml -p "-c bootloader/t186ref/cfg/flash_t234_qspi.xml"  \
--showlogs --network usb0 p3509-a02+p3767-0000 internal

All approaches yield the same result. The device “successfully flashes”, but it fails to boot. It displays the error boot\extlinux\extlinux.conf: Not Found and then hangs.

Error Codes:

Jetson UEFI firmware (version 5.0-35550185 built on 2024-02-20T04-21:22-00:00)
ESC to enter Setup.
F11 to enter Boot Manager Menu.
Enter to continue boot.
** WARNING: Test Key is used. **
L4TLauncher: Attempting Direct Boot
OpenAndReadUntrustedFileToBuffer: Failed to open boot\extlinux\extlinux.conf: No
t Found
ProcessExtLinuxConfig:sds Failed to Authenticate boot\extlinux\extlinux.conf (No
t Found)
L4TLauncher: Unable to process extlinux config: Not Found
L4TLauncher: Attempting Kernel Boot
EFI stub: Booting Linux Kernel
EFI stub: Usinb 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...

Have you tried other NVMe drives or USB drives?

I have. I’ve installed into this 2TB NVME and the original manufacturer’s NVME (128GB) using the SDK Manager.

I believe I might also have successfully flashed in the past with this command:

sudo ./tools/kernel_flash/l4t_initrd_flash.sh -S 68719476736 --external-device nvme0n1p1   -c tools/ \
kernel_flash/flash_l4t_t234_nvme.xml -p "-c bootloader/t186ref/cfg/flash_t234_qspi.xml"   --showlogs -- \
network usb0 jetson-orin-nano-devkit  nvme0n1p1

I think this command only flashes “external”. And so it did not corrupt the bootloaders (which I think might be installed in the QSPI device?).

Are you sure UEFI is trying to boot from the NVMe drive you just flash?
Maybe take out the -S option and try again.

Not sure. I will check again, but I believe it was only seeing one device and trying to boot from it.

Can you help me understand what is meant with “internal” or “external” in the flash_initrd script? And what is the QSPI used for? Where are the bootloaders supposed to be flashed to? I just read all of these different ‘recipes’ for the flashing but don’t fully get it…

Linux_for_Tegra/tools/kernel_flash/README_initrd_flash.txt:

Initrd flash depends on --external-device options and the last parameter <rootdev>
to generate the correct images. The following combinations are supported:
+-------------------+-----------------+-------------------------------------------------------+
| --external-device |       <rootdev> | Results                                               |
+-------------------+-----------------+-------------------------------------------------------+
| nvme*n*p* / sda*  |        internal | External device contains full root filesystem with    |
|                   |                 | kernel commandline: rootfs=PARTUUID=<external-uuid>   |
|                   |                 |                                                       |
|                   |                 | Internal device contains full root filesystem with    |
|                   |                 | kernel commandline: rootfs=PARTUUID=<internal-uuid>   |
+-------------------+-----------------+-------------------------------------------------------+
| nvme*n*p* / sda*  | nvme0n*p* / sd* | External device  contains full root filesystem with   |
|                   |                 | with kernel commandline rootfs=/dev/nvme0n1p1         |
|                   |                 |                                                       |
|                   |                 | Internal device contains minimal filesystem with     |
|                   |                 | kernel command line rootfs=/dev/nvme0n1p1             |
+-------------------+-----------------+-------------------------------------------------------+
| nvme*n*p* / sda*  |       mmcblk0p1 | External device  contains full root filesystem with   |
|                   |                 | with kernel commandline rootfs=/dev/nvme0n1p1         |
|                   |                 |                                                       |
|                   |                 | Internal device contains full filesystem with     |
|                   |                 | kernel command line rootfs=/dev/mmcblk0p1             |
+-------------------+-----------------+-------------------------------------------------------+
| nvme*n*p* / sda*  |        external | External device contains full root filesystem with    |
|                   |                 | kernel commandline: rootfs=PARTUUID=<external-uuid>   |
|                   |                 |                                                       |
|                   |                 | Internal device contains minimal root filesystem with |
|                   |                 | kernel commandline: rootfs=PARTUUID=<external-uuid>   |
+-------------------+-----------------+-------------------------------------------------------+

QSPI is used to stored bootloader stuff, which is mainly MB1, MB2, UEFI, etc.

I see. So you say the bootloaders should be in the QSPI device, but UEFI should be trying to boot from the nvme?

YES.
UEFI bootloader will be loaded from QSPI, and UEFI will in turn try to boot from a device like NVMe/USB, where Linux kernel and rootfs actually live in.

I see. But the missing file:

boot\extlinux\extlinux.conf

Lives in the bootloaders (in QSPI), not in the NVME. So this error occurs before the initramfs tries to mount the NVME. No?

/boot/extlinux/extlinux.conf should live in the main storage device (NVMe/USB), and UEFI will try to locate this file upon booting, but somehow it either cannot be found or opened.
That’s why I told you to try other NVMe/USB drives.

I see. So probably some alignment problem with the [-S App_Size] flag. I’m trying flashing without it. I will report back briefly.

@DaveYYY. I tried the manufacturer specified command (without the [-S flag]).

sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 \
  -c tools/kernel_flash/flash_l4t_external.xml -p "-c bootloader/t186ref/cfg/flash_t234_qspi.xml" \
  --showlogs --network usb0 p3509-a02+p3767-0000 internal

It fails. This time it shows the boot menu, but then it reboots once the bar at the bottom finishes loading.

UEFI Boot Menu does show the NVME drive as the top option to boot from.

Here is something strange I think. In the flashing logs, in the Flasing Step (#3) there is a corrupted table error. Also the App partition looks to be 60Gib, when I did not pass in the [-S AppSize] flag.

Writing primary_gpt partition done
Error: The backup GPT table is corrupt, but the primary appears OK, so that will be used.
Warning: Not all of the space available to /dev/nvme0n1 appears to be used, you can fix the GPT to use all of the space (an extra 3784870064 blocks) or continue with the current setting?
Writing secondary_gpt partition with gpt_secondary_9_0.bin
Offset is not aligned to K Bytes, no optimization is applied
dd if=/mnt/external/gpt_secondary_9_0.bin of=/dev/nvme0n1 bs=1 skip=0  seek=62545444352 count=16896
16896+0 records in
16896+0 records out
16896 bytes (17 kB, 16 KiB) copied, 0.0215961 s, 782 kB/s
Writing secondary_gpt partition done
Warning: Not all of the space available to /dev/nvme0n1 appears to be used, you can fix the GPT to use all of the space (an extra 3784870064 blocks) or continue with the current setting?
^M                                                                          ^M^M                                                                          ^MFix/Ignore? Fix
Model: SHGP31-2000GM (nvme)
Disk /dev/nvme0n1: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name                       Flags
 2      20.5kB  134MB   134MB                A_kernel                   msftdata
 3      134MB   135MB   786kB                A_kernel-dtb               msftdata
 4      135MB   168MB   33.2MB               reserved_for_chain_A_user  msftdata
 5      168MB   302MB   134MB                B_kernel                   msftdata
 6      302MB   303MB   786kB                B_kernel-dtb               msftdata
 7      303MB   336MB   33.2MB               reserved_for_chain_B_user  msftdata
 8      336MB   420MB   83.9MB               recovery                   msftdata
 9      420MB   421MB   524kB                recovery-dtb               msftdata
10      421MB   735MB   315MB   fat32        RECROOTFS                  msftdata
11      735MB   802MB   67.1MB  fat32        esp                        boot, esp
12      802MB   886MB   83.9MB               recovery_alt               msftdata
13      886MB   887MB   524kB                recovery-dtb_alt           msftdata
14      887MB   954MB   67.1MB               esp_alt                    msftdata
15      954MB   1373MB  419MB                UDA                        msftdata
 1      1373MB  60.4GB  59.1GB  ext4         APP                        msftdata

[ 16]: l4t_flash_from_kernel: Successfully create gpt for external device
[ 16]: l4t_flash_from_kernel: Starting to flash to emmc
[ 16]: l4t_flash_from_kernel: Starting to flash to external device
Active index file is /mnt/internal/flash.idx
Active index file is /mnt/external/flash.idx

So the following command does successfully Flash + Boot.

sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1  \
    -c tools/kernel_flash/flash_l4t_t234_nvme.xml -p "-c bootloader/t186ref/cfg/flash_t234_qspi.xml" \
    --showlogs --network usb0 jetson-orin-nano-devkit  nvme0n1p1

I do am afraid that since it uses the board=jetson-orin-nano-devkit instead of the manufacturer’s recommended p3509-a02+p3767 that not all the hardware functionality is going to be there.

I’ve kept trying to have my nvme0n1p1 partition to be sized around 64GiB. I tried by passing [-S 64GiB] and by hard coding the number of segments APP_SIZE=134217728 in the flash_l4t_234_nvme.xml partition definition file. I still keep getting a partition the size of the entire hard drive (~2TB).

Dump the log, please.
A screenshot does not help anything.

You are supposed to be greeted with the OEM config upon first boot, and you will be asked how much you want the APP partition to be.

I don’t have other logs. That’s all I see in the screen. If you meen the serialized console UART logs, then I will go buy a cable for it but I don’t have one at the moment.

@DaveYYY What OEM config are you referring to? I don’t think I’ve seen this. It would be great if we can resize this partition. My requirement is for the Root Filesystem partition to be smaller, so I can create other partitions in my device. This can be done after flashing no problem.

I mean you should see a graphical version of this stuff upon boot:
https://docs.nvidia.com/jetson/archives/r35.5.0/DeveloperGuide/SD/FlashingSupport.html#headless-mode-flow-in-oem-config

I don’t see why you cannot manually resize the rootfs.

I see what you mean. @DaveYYY. In the Graphical version of the oem-config / ubiquity menu, there is no Partition Size configuration. It is a variation of what is shown in the headless-mode-flow-in-oem-config link you sent, but the GUI config only goes through keyboard layout, Timezone / region, setting up username/password, and if “choosing to install Chromium”.

Do you recommend trying to go the headless route, so I might see the menu that is documented in the guide?

Also, I don’t know how else to resize the rootfs? Once I boot into the device, there is no way to shrink an ext4 filesystem while it is mounted.

Oh, looks like this option is only available on AGX Orin and Xavier NX.
You can try booting into initrd, or making another bootable device like USB, so you can operate on the /dev/nvme0n1p1 partition.

sudo ./tools/kernel_flash/l4t_initrd_flash.sh --initrd <board-name> <rootdev>

That’s not really a viable solution for us. That process won’t scale.

Do you have an idea why the [-S APP_SIZE] flag does not work? Or why setting in the partition_definition.xml file is not working either?