Selecting different rootfs partition


we are planning for custom A/B OTA update in our carried boards. By default, NX loads boot images (kernel and dtb) from mmcblk0p1 on boot. Is there any way configure the cboot to load boot images from another partition (say mmcblk0p2 or mmcblk0p3 ) and mount the same as rootfs.


The boot device is chosen by cboot for NX. I am not very sure if there is an option for you to choose the boot device.
Could you check your serial console log?

I am more familiar with uboot case so take uboot for example, uboot would check mmc0 (emmc) and mmc1 (sdcard) when it tries to load kernel.

If it finds kernel on mmc0, it will load it. Please note that kernel file could be separate from rootfs.

One case is the “rootfs on usb” on Nano and TX2. The usb controller in uboot does not work on these platforms. But it can still mount the rootfs on usb. The reason behind this is because the uboot loads the kernel from emmc and uses kernel to load the rootfs on usb drive.

Thus, back to your question on NX.

First, whether cboot gives you an option to choose mmcblk0p2?
Second, if kernel is able to load rootfs from mmcblk0p2?

CBoot looks first for a partition of type “6637b54f-c21b-48a7-952e-a8d071029d6b”. That’s not the PARTUUID, it’s the UUID of the partition type. That appears to be some custom type that’s not listed anywhere public. I couldn’t find a way to set that type on a partition but if you can, that’d be a way to designate which partition to read extlinux.conf, kernel, dtb and initramfs from. Failing that, CBoot simply grabs partition 1. It’d be a nice enhancement if it looked for the “APP” partition name.

You can use the build in A/B slot mechanism to use an alternate kernel and dtb but you’d have to figure out how to pass a different “root” parameter to each to use a separate root filesystem for each.

Another option is to create partition 1 so it only has the /boot directory on it with your new and old kernels, etc. then create additional partitions for your root filesystems. You can then use extlinux.conf to select which kernel and root filesystem to use. Something like this…

DEFAULT current

MENU TITLE L4T boot options

LABEL current
    MENU LABEL current
    LINUX /boot/Image-4.9.140-new
    INITRD /boot/initramfs-4.9.140-new.img
    FDT /boot/tegra194-p3668-all-p3509-0000-new.dtb
    APPEND ${cbootargs} root=/dev/mmcblk0p12 rw rootwait rootfstype=ext4

LABEL last
    MENU LABEL last
    LINUX /boot/Image-4.9.140-last
    INITRD /boot/initramfs-4.9.140-last
    FDT /boot/tegra194-p3668-all-p3509-0000-last.dtb
    APPEND ${cbootargs} root=/dev/mmcblk0p13 rw rootwait rootfstype=ext4

This solution worked for me.