Manual OTA update of MB1 of TX2

I’m using JetPack 4.5.1 and want to update devices(With full redundant partitions and redundancy enabled with < REDUNDANCY_USER 1 > and < BL_AUTOSYNC_DISABLE 1 >) to Jetpack 4.6. Devices are already in use so no flashing via microUSB is available.
I was looking at build_l4t_bup.sh, but it:

  1. Doesn’t support falling back to old bootloader chain.
  2. Does not compress partitions.

I want to implement full bootchain update myself. I have found all the partitions on boot0/boot1 device and I am able to update them, but I have a question about order of update of partitions.

It looks to me like I should:

  1. Update all partitions of other slot(with _b suffix in case of slot 1 or without suffix in case of slot 1), including MB1, MB1_BCT, MB2. It should not affect current slot, because there is a chain of BCT → any of MB1, MB_b → MB2 from current slot(determined by SMD).
  2. Move currently used BCT to Slot 0 Block 1. (So in case of invalid new MB1 device will able to boot from other MB1)
  3. Update Slot 0 Block 0 with new BCT(So new boot will be from new MB1)
    In that case either old(Slot 0 Block 1 pointing to both MB1, MB_b, only one of signature will match) or new MB1(Slot 0 Block 0) will be bootable.

I was looking into cboot code and found following:

struct part_dependency update_sequence[] = {
	/* BCT is dependent on mb2 */
	{ BR_BCT_PARTITION_NAME,	MB2_BL_PARTITION_NAME},
#if defined(CONFIG_ENABLE_A_B_SLOT)
#if defined(CONFIG_ENABLE_A_B_UPDATE)
	/* MB1 is dependent on BRBCT */
	{ MB1_PARTITION_NAME,	BR_BCT_PARTITION_NAME },
#endif
#endif
};

This code looks kinda strange because it assumes flash order of MB2, BCT, MB1.
Code that writes BCTs is:

        Based on the search sequence, we write the
	block 0, slot 1 BCT first, followed by one BCT
	in slot 0 of subsequent blocks and lastly one BCT
	in block0, slot 0.
	*/
	/* Special case block 0 : slot 0 & 1 BCT's */
	/* Block 0 Slot 0 */
	err = tegrabl_partition_write(partition, buffer, chunk_size);

Using this code and the update order above above it looks like there is gap between BCT update(which contains MB1 signature, and won’t boot old MB1) and MB1 partition update. In case of power loss the device will be bricked.

Also I see a strange ?bug? in a code where comment says we should update block 0, slot 1 BCT first, but code actually updates block 0, slot 0 first.

So my questions are:

  1. What is the correct order of partitions update?
  2. How can I get NvBootInfoTable in Cboot so I can determine which exact slot and block of BCT was used to boot? It looks like NvBootInfoTable is only available for BPMP…