Booting/rootfs from SD card

Hi,
From some of the forum posts, I got that there is no (complete) boot from SD card in TX2 is possible. But rootfs can be used from SDcard.
To do that,
can I update the cbootargs in the boot console directly (ie. by using printenv edit env/set cbootargs etc.)?
or Device tree to be updated (in p2771-0000.conf.common?, if so then Jetson is to be flashed again)
My thought is, without flashing the Jetson again, can I update this boot arg (root=/dev/mmcbl2p1), in runtime and see, whether the rootfs can be loaded from SD card?

Thanks

Hi,

Open the file /boot/extlinux/extlinux.conf and you can add the root there.

After updating extlinux.conf, I need to flash it again with flash.sh script? Is there any way so that I can skip the flashing step in this?

Hi,

Only the last argument in extlinux.conf will be taken by kernel and you don’t need to reflash the board. It will take effect after reboot.

For example, cbootargs has root=/dev/mmcblk0p1 but if you write “root=/dev/mmcblk2p1” after it, then the system will use 2p1 as root dev.

And please note that, since your boot device is still emmc but not sd, you have to modify the extlinux.conf on emmc but not sd. This is a common mistake that people easily get confused.

Thanks for the note.
I have updated the extlinux.conf file
APPEND ${cbootargs} quiet → old value

APPEND ${cbootargs} root=/dev/mmcblk2p1 quiet → new value.
But I dont see the new values are taken.

Because in the boot log mmcblk0p1 is shown…
“append: root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 video=tegrafb no_console_suspend=t
#”

Hi jk.t,

If you want to modify args in cboot only, then updating this in extlinux.conf will not help.
But if you want to modify the finalized arguments in kernel, then extlinux.conf will take effect.

I meant, if you only check the log in cboot, it will be still the old one. But if you check the kernel log, then it will take effect.

And actually, it is pointless to check this in cboot…

Hi WayneWWW,
Sorry I think, I dont get your answer. So to get clarity, I have some questions.

  1. “If you want to modify args in cboot only,”
    Only updating in cboot and updating in kernel → how these things differs?
    I thought, if I update the extlinux.conf, when the kernel boots it refers the latest root=“” params and so SD card rootfs will be used. Is my understanding correct?
  2. Where to check this in kernel? I have checked the dmesg, /proc/cmdline, /proc/device-tree/chosen/bootargs
    But none of them shows the SD card root=mmcblk2p1.
  3. Where to update the root=“” to take that into effect?.
    regards.

Hi jk.t,

“If you want to modify args in cboot only,”
Only updating in cboot and updating in kernel → how these things differs?

If you open extlinux.conf, you shall see

APPEND ${cbootargs} quiet

Then those you read from cboot log will form the argument ${cbootargs}. But anything write after that will appear the kernel cmdline then.

For example,

APPEND ${cbootargs} root=/dev/mmcblk2p1 quiet.

Then root=/dev/mmcblk0p1 will still appear in kernel cmdline but it won’t take effect because there should be root=/dev/mmcblk2p1 appear right before “quiet”.

  1. Where to check this in kernel? I have checked the dmesg, /proc/cmdline, /proc/device-tree/chosen/bootargs
    But none of them shows the SD card root=mmcblk2p1.
  2. Where to update the root=“” to take that into effect?.

This sounds like you already hit the my previous note that only the extlinux.conf on boot devcie will take effect…

Could you share your serial console log of uboot?

Hi Wayne,
I dont see mmcblk2p1 appears on bootargs in the log.

Here with I have attached the log file, having
reboot, dmesg after reboot and extlinux.conf in the board.

I only updated the extlinux.conf file. But did not flash it.

rootfsSD card - reboot-dmesg.log (119.8 KB)

Hi,

Could you

  1. Remove the sdcard
  2. Reboot
  3. Remove the quiet in extlinux.conf
  4. Reboot the device

and see if it will take effect?

Removing SD card test case I cannot do now, because I WFH.
But removing “quiet” in extlinux.conf, is done.
No improvement.

[ 3.642017] EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Opts: (null)
[ 3.643214] Rootfs mounted over mmcblk0p1

Are you sure that flashing is not needed? For me it looks like, the update in the extlinux.conf file is not taking effect.

Hi,

Yes I am sure. Because we don’t flash quiet to kernel cmdline…

How about directly remove the extlinux.conf and see if you can still boot or not.

As I wfh, if I remove extlinux.conf and if does not boot, its little difficult for me to recover.

So I tried adding Backup kernel LABEL in extlinux.conf. But while booting I do not see the 2 booting options. It just proceeds with primary kernel settings.

In the extlinux.conf file, I updated “DEFAULT backup”. But I see, still it boots primary kernel and there is no option provided to select from primary or backup, during booting.

Any input to test further, pls

Looks like the file your uboot is booting from is not what you are trying to modify. That is why your changes didn’t take effect.

If you can access sdcard, please check if there is another extlinux.conf on it…

Hi Wayne,
I checked my SD card, and yes there is another extlinux.conf. I have edited that conf file and got the SD card rootfs mounted.
So my observation is, when SD card is present, the Jetson reads that conf file instead or eMMC. SD card takes priority?

Actually, uboot should tell the answer. But I don’t have TX2 device now so not sure whether mmc1 is sdcard slot or not.

I guess it is according ot your log.

And if you want to change the boot order, you can do it in uboot shell console.

OK. Could you please tell, in which log of Uboot to be checked to confirm that?