Boot Jetson AGX Xavier from SD on jetpack 5.1.2

I am working on Xavier AGX with Jetpack4.6 with an sd-card.
in jp4.6 I was doing the following.

cd L4T-bsp
sudo BOOTDEV=mmcblk1p1 ./flash.sh -S 8GiB jetson-xavier mmcblk1p

and then generated an sd-card using the following commands

    mkdir tmpfs/
	sudo mount bootloader/system.img.raw tmpfs/
	sudo cp -ax tmpfs/* /mnt/
	sync

Now when moving to JP5.1.2 I tried the same approach with no luck (device booted when sd-card was inserted , though modification I made were not affected in the sd-card).

I read several topics such as https://forums.developer.nvidia.com/t/boot-jetson-agx-xavier-from-sd-card/215709

And also looked at the following link https://docs.nvidia.com/jetson/archives/l4t-archived/l4t-3261/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/flashing.html#wwpID0E01O0HA

with no luck.
May I ask what are the commands to program the eMMC so JP5.1.2 will boot from sd-card ?

Hi,

Can you be more specific about this?
What is modification I made here?
Did you select SD card as the booting device in UEFI?

Did you configure the SD card as the boot device in the UEFI settings?

Yes, the device only boots when the SD card is inserted.

However, the changes I made don’t seem to be applied.

I edited the file /boot/extboot/extlinux.conf, as an example, by adding the line “#hello world”. After restarting the device, the changes were visible. But when I moved the SD card to another computer and checked the file, there were no modifications. It appears that the modifications were applied to the eMMC storage, even though the Xavier is booting from the SD card.

Here’s the scenario:

Boot the system.
Modify the file /boot/extboot/extlinux.conf (add lines, etc.).
Reboot the system.
The modifications are visible.
Upon examining the SD card, no changes are found.

Check df -h to know where rootfs gets mounted.
Maybe you should check /boot/extlinux/extlinux.conf on the SD card, and make sure rootdev= is pointing to the SD card instead of eMMC.

I feel like that’s because the image created this way specifies rootfs to be mounted over eMMC, but you directly put it to the SD card; hence no changes were made to the SD card when you were actually doing everything on eMMC.

In JP4.6 this is what I have.

LABEL va70xx_EVK_test
        MENU LABEL va70xx_EVK kernel
        LINUX /boot/Image
        FDT /boot/fdt/moish/tegra194-vlns-evk-high-bw.dtb
        INITRD /boot/initrd
        APPEND ${cbootargs} root=/dev/mmcblk1p1 rw rootwait rootfstype=ext4
lab@sw-xavier2:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk1p1   30G   13G   15G  47% /
none             16G     0   16G   0% /dev
tmpfs            16G   40K   16G   1% /dev/shm
tmpfs            16G   18M   16G   1% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs            16G     0   16G   0% /sys/fs/cgroup
/dev/loop0       69M   69M     0 100% /snap/core22/867
/dev/loop1      128K  128K     0 100% /snap/bare/5
/dev/loop2       36M   36M     0 100% /snap/snapd/20298
/dev/loop3       70M   70M     0 100% /snap/core22/1035
/dev/loop4       12M   12M     0 100% /snap/snap-store/963
/dev/loop5       47M   47M     0 100% /snap/snapd/19459
tmpfs           3.2G  152K  3.2G   1% /run/user/1000
/dev/mmcblk0p1  7.9G  5.0G  2.5G  68% /media/lab/3d3cadd1-3a27-412d-b550-944ac5a42ca7

this is in Jp4.6 what should be different in jp5.1.2 ?

mkdir tmpfs/
sudo mount bootloader/system.img.raw tmpfs/
sudo cp -ax tmpfs/* /mnt/
sync
regarding this , it was to generate the 1st sd-card image only (after running the command
sudo BOOTDEV=mmcblk1p1 ./flash.sh -S 8GiB jetson-xavier mmcblk1p
Which technically points to the sd-card.

I’m asking what you are getting with 5.1.2, not 4.6.

Sorry my bad :)

desktop:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk1p1   30G  6.7G   21G  25% /
none             16G     0   16G   0% /dev
tmpfs            16G   36K   16G   1% /dev/shm
tmpfs           3.1G   12M  3.1G   1% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs            16G     0   16G   0% /sys/fs/cgroup
tmpfs           3.1G   20K  3.1G   1% /run/user/124
tmpfs           3.1G   28K  3.1G   1% /run/user/1000

checking it out again , it was my bad , the file /boot/extboot/extlinux.conf is updated , and sd-card is good but for some reason the dtb file and the kernel is not loaded from extlinux.conf and I do not know how to ask it to load from there. (seems like extlinux .conf is deprecated).
terminal.txt (78.0 KB)

I have attached the terminal log.
TIA

I don’t see anything weird in the booting log.

What is this based on?

L4TLauncher: Attempting Direct Boot
EFI stub: Booting Linux Kernel...
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...

Direct Boot means stuff is loaded from rootfs.

I just ran

sudo BOOTDEV=mmcblk1p1 ./flash.sh -S 8GiB jetson-xavier mmcblk1p

and then made an sd-card from bootloader/system.img.raw Image

In JP4.6 , I used to use the /boot/extlinux/extlinux.conf file (from rootfs)
Here the file is taken from somewhere else which I am not familiar with.
In other words , how can I configure the Xavier to take my Image/dt files from extlinux.conf ?
any thing I need to re-configure ?

I mean how did you confirm this?

Yes , I have modified extlinux.conf file , and it is not even loaded … (in an orin AGX when I have several elements in the file , I get a menu item when device inits , here I get nothing , and dtb is not taken from conf file as I have modified it… )

Then what do you have with extlinux.conf now? (I mean the one on your SD card.)
Can you please be more specific? Your description is very vague.

Sorry , will elaborate.
I am trying to migrate fromJP4.6 to JP5.1.2
I do the same

  1. generate and sd-card (as described)
  2. program the xavier to be on jp5.1.2
  3. then I put the sd-card , and modify the extlinux.conf (for example to take my proprietary device tree)
    When system is up and running , the device tree , is not taken from the extlinux.conf as it did in JP4.6 , but from somewhere else (which I don’t even know from where.

Again , in jp4.6 I did and it works great (I have 6 different device tree , which I can switch between them very easy)
I wish todo the same in jp5.1.2 , but for some reason the device tree is not take from extlinux.conf but seems to be taken from somwhere else.

TIMEOUT 30
DEFAULT world
MENU TITLE L4T boot options

LABEL hello
        MENU LABEL hello kernel
        LINUX /boot/Image.Moish
        FDT /boot/fdt/moish/leopard/tegra194-leopard-7044-ox0b40.dtb
        INITRD /boot/initrd
        APPEND ${cbootargs} root=/dev/mmcblk1p1 rw rootwait rootfstype=ext4


LABEL world
        MENU LABEL world kernel
        LINUX /boot/Image.vlns
        FDT /boot/fdt/moish/tegra194-vlns-evk.dtb
        INITRD /boot/initrd
        APPEND ${cbootargs} root=/dev/mmcblk1p1 rw rootwait rootfstype=ext4

here is example of my extlinux.conf file , Image and kernel are not being taken from here , seems that this file is ignored

Then are you getting the prompt which asks you which setting in extlinux you want to boot from?
I mean, are you sure it really reads kernel/dtb from the SD card?

I hope…though in the terminal log you can see

Kernel command line: root=/dev/mmcblk1p1 rw rootwait rootfstype=ext4 mminit_loglevel=4 console=ttyTCU0,115200n8

And also what I update the extlinux.conf on the Xavier , it is updated in the sd-card as well (as I am reading the sd-card from another linux host as an external driver ).
So file modifications are done on the sd-card , which is good , only this is that the device is not booting from extlinux.conf , which maybe there was a change (by default in jp51.1.2 , which I manually need to update).

How about this?
It just feel like it’s still booting from eMMC with the default kernel/device tree.

Maybe , but for sure all files in the filesystem I change are from the sd-card
and if so , what is the procedure to set the Xavier to boot from sd-card (extlinux.conf)
again , doing this in jp4.6 works great for dozens of my xaviers …
maybe the terminal log can point to smth ?

[   10.093776] EXT4-fs (mmcblk1p1): mounted filesystem with ordered data mode. Opts: (null)
[   10.103735] Rootfs mounted over mmcblk1p1
[   10.138880]  sda: sda1
[   10.142971] Switching from initrd to actual rootfs

???

It only tells that rootfs is mounted over SD card, but not whether it’s the booting device in UEFI.
Maybe try re-flashing it from the scratch:

sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device mmcblk1p1
-c tools/kernel_flash/flash_l4t_external.xml
–showlogs --network usb0 jetson-agx-xavier-devkit internal

OK, I have an internal image ? what should I do next ?
should I flash the xavier ? or make a new sd-card ? (how)