Rootfs redundancy


I’m trying like this thread :

To enable A/B redundancy on rootfs but for TX2.

I’working on L4T 32.3.1.

I’am able to create and flash my dual rootfs, but i can’t read from u-boot the current slot to boot to the correct rootfs.

I copied the code of the function tegrabl_get_boot_slot_reg from cboot to u-boot like in this thread :

But there is a 0 value inside the scratch register. Is there a way to know the current slot in u-boot ?


Hi nago,

We are still checking this issue internally. May I ask why do you need redundancy for rootfs?

The TX2 will be in a system without the usb recovery access, we want to have permanently a working system, even if one partition is corrupted or if the update process failed. During the update procedure we don’t want to update the current running partition.

Hi nago,

Scratch register has been cleared by cboot before it passes control to u-boot/kernel and this register is supposedly not to be referenced beyond cboot.

Current boot slot info can be retrieved through command line parameters if cboot has been modified properly to support rootfs redundancy:
slot A:
boot.slot_suffix= (empty)
root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4

slot B:
root=/dev/mmcblk0p2 rw rootwait rootfstype=ext4


It’s working fine now. I had to modify cboot an u-boot :


I didn’t found Cboot source for L4T 32.3.1, so i took the 28.3.

To compile it with gcc-linaro-7.3.1 i had to remove some GLOBAL_CFLAGS in :
-Werror=uninitialized and -Werror

To change the root value i added the following code in dtb_update.c in the function add_board_info :

	uint32_t slot =0;
        tegrabl_a_b_get_active_slot(NULL, &slot);

        if(slot == BOOT_SLOT_B)
           param_value_override(dtb_cmdline, &len, "root=", "/dev/mmcblk0p2");


Uboot is looking for /boot/extlinux/extlinux.conf in the mmcblk0p1 partition even if we are in B slot.

By modifing distro_bootpart env, u-boot looks in the correct partition :

Slot A: distro_bootpart = 1
Slot B: distro_bootpart = 2