Problems with loading a kernel from /boot on external rootfs

Hi all,

I have been at this for some days and am quite stuck. I have read all of the documentation I can get my hands on and cannot figure out a configuration that works or if it’s even possible. The documentation is a bit ambiguous at times.

I have an Orin Agx that I want to boot from USB for kernel development. Getting it to boot from USB has not been a problem and I have come up with multiple configurations that work for achieving this with both my own partition configurations as well as default ones. My problem is that I cannot seem to get the system to use the kernel in /boot on my rootfs device, ie. I want to boot the kernel in /dev/sda1/boot/, setting of extlinux.conf naturally is done but not matter what I do I cannot get the device to boot my kernel with an identifiable LOCALVERSION. As it seems that the kernel is always booted from a kernel partition (either on the eMMC or on the USB, ie. sda2). If I remove all kernel partitions from my spi and external device configurations then the device fails to boot. I was hoping that in such a situation the bootloader would default to /boot on the rootfs.

A minimal example of what I ideally would like to work where there is only a single kernel and that is located on the root disk in /boot would be using the two commands for creating a boot USB from the host machine and then flashing the board.

sudo BOARDID=3701 BOARDSKU=0000 FAB=TS4 ./tools/kernel_flash/l4t_initrd_flash.sh --external-only -c rootdisk/rootfs_1_partition.xml --external-device sda1 --direct sdd jetson-agx-orin-devkit external

With the partition configuration being

<partition_layout version=“01.00.0000”>

    <!-- IMPORTANT!!! -->
    <partition name="master_boot_record" type="protective_master_boot_record">
        <allocation_policy> sequential </allocation_policy>
        <filesystem_type> basic </filesystem_type>
        <size> 512 </size>
        <file_system_attribute> 0 </file_system_attribute>
        <allocation_attribute> 8 </allocation_attribute>
        <percent_reserved> 0 </percent_reserved>
        <description> **Required.** Contains protective MBR. </description>
    </partition>
    <partition name="primary_gpt" type="primary_gpt">
        <allocation_policy> sequential </allocation_policy>
        <filesystem_type> basic </filesystem_type>
        <size> 19968 </size>
        <file_system_attribute> 0 </file_system_attribute>
        <allocation_attribute> 8 </allocation_attribute>
        <percent_reserved> 0 </percent_reserved>
        <description> **Required.** Contains primary GPT of the `external` device. All partitions defined after this entry are configured in the kernel, and are accessible by standard partition tools such as gdisk and parted. </description>
  </partition>

    <!-- Root Filesystem Partition (APP) -->
    <partition name="APP" id="1" type="data">
        <allocation_policy> sequential </allocation_policy>
        <filesystem_type> basic </filesystem_type>
        <size> APPSIZE </size>
        <file_system_attribute> 0 </file_system_attribute>
        <allocation_attribute> 0x8 </allocation_attribute>
        <align_boundary> 4096 </align_boundary>
        <percent_reserved> 0 </percent_reserved>
        <filename> APPFILE </filename>
        <unique_guid> APPUUID </unique_guid>
        <description> Contains the root filesystem with kernel and initrd in /boot. </description>
    </partition>

    <!-- Secondary GPT (optional but recommended) -->
   <partition name="secondary_gpt" type="secondary_gpt">
        <allocation_policy> sequential </allocation_policy>
        <filesystem_type> basic </filesystem_type>
        <size> 0xFFFFFFFFFFFFFFFF </size>
        <file_system_attribute> 0 </file_system_attribute>
        <allocation_attribute> 8 </allocation_attribute>
        <percent_reserved> 0 </percent_reserved>
        <description> **Required.** Contains secondary GPT of the `external`
          device. </description>
    </partition> 
</device>

</partition_layout>

Then flashing the device using the default qspi configuration “flash_t234_qspi.xml”

./flash.sh -r -c flash_t234_qspi.xml --no-systemimg jetson-agx-orin-devkit sda1

This leads to a non-bootable configuration, adding a kernel, kernel-dtb alongside the APP in the rootfs partition configuration will make the system boot but running the kernel from the kernel partition. Thus far this is my best solution, although being a basic partition I cannot mount it to adjust the kernel Image.

Any help would be greatly appreciated!

Cheers,

Alex

Hi,
If the device cannot be flashed/booted, please refer to the page to get uart log from the device:
Jetson/General debug - eLinux.org
And get logs of host PC and Jetson device for reference. If you are using custom board, you can compare uart log of developer kit and custom board to get more information.
Also please check FAQs:
Jetson AGX Orin FAQ
If possible, we would suggest follow quick start in developer guide to re-flash the system:
Quick Start — NVIDIA Jetson Linux Developer Guide 1 documentation
And see if the issue still persists on a clean-flashed system.
Thanks!

I should add that when I say fails to boot I mean that the device does not allow me to select the USB disk as a boot device despite there being all the needed kernel components on the device, there are no kernel panics etc.

Hi,

Which Jetpack version do you want to flash?
If your version is Jetpack 6.1, you can refer to this document for customizing the boot process.
Additionally, is this the workflow meet your requirement ?

# In Linux_for_Tegra/tools/kernel_flash/README_initrd_flash.txt 
Workflow 12: Manually generate a bootable external storage device:

You can manually generate a bootable external storage such as NVMe SSD, SD card or USB using this tool.
When a Jetson in recovery mode is connected, use the following command:

$ sudo ./tools/kernel_flash/l4t_initrd_flash.sh --direct <extdev_on_host> \
      -c <external-partition-layout> \
      --external-device <extdev_on_target> \
      [ -p <options> ] \
      [ -S <rootfssize> ] \
      <boardname> external

Thanks

Hi David,

thanks for the reply. We are using 5.1.2.

This appears to be the workflow that I have been following.

What would be needed to be flashed to internal for this workflow?

My current one as given earlier is

./flash.sh -r -c flash_t234_qspi.xml --no-systemimg jetson-agx-orin-devkit sda1

Hi,

After our internal check, we regret to inform you that your goal does not seem achievable, as our Jetson only supports the bootloader on QSPI or eMMC.
Please refer to related forum, Q&A for more information.

Thanks.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.