Inquiry regarding A/B Partition Swap on Jetson Orin

I am currently developing with the Jetson Orin platform and have some questions regarding the A/B partition swap described in the following documentation:

https://docs.nvidia.com/jetson/archives/r34.1/DeveloperGuide/text/SD/Bootloader/UpdateAndRedundancy.html#update-engine

Questions:

  1. Scope of A/B Partition Swap: Is the A/B partition swap mechanism valid only during an OTA (Over-the-Air) update, or is it also applicable during a standard system boot?

  2. Boot Slot Metadata Location: Where is the boot slot metadata stored? Is it located within the QSPI? If it is in the QSPI, which specific section of the T234 QSPI flash memory map does it correspond to? If it is not in the QSPI, where is it stored?

  3. Testing A/B Swap: I would like to verify the actual swap operation by testing the conditions under which an A/B swap occurs. How can I perform a test on the EV Kit to observe the actual transition/swap behavior?

  4. A/B Configuration and Control: The A/B structure seems to consist of components such as MB1, MB2, Kernel, and RootFS. Are all these items enabled for A/B swap by default in the standard release? Or are they only partially enabled? Furthermore, can a developer selectively enable or disable A/B redundancy for specific components?

hello jsko,

it looks you’re referred the r34.1 developer guide, please note that, Jetson Linux 34.1 is a developer preview release. you may moving to the latest JP-6 release version, please refer to rel-36 developer guide as well, Update and Redundancy.

>> Q1
yes.

>> Q2
it’s located in QSPI. you may see-also partition layout for reference,
for instance, $OUT/Linux_for_Tegra/bootloader/generic/cfg/flash_t234_qspi.xml

>> Q3
you may check

$ ls -la /dev/disk/by-partlabel/
total 0
drwxr-xr-x 2 root root 340 Jan 30 06:15 .
drwxr-xr-x 7 root root 140 Jan 30 06:15 ..
lrwxrwxrwx 1 root root  15 Aug 26 15:23 APP -> ../../mmcblk0p1
lrwxrwxrwx 1 root root  15 Aug 26 15:23 A_kernel -> ../../mmcblk0p2
lrwxrwxrwx 1 root root  15 Aug 26 15:23 A_kernel-dtb -> ../../mmcblk0p3
lrwxrwxrwx 1 root root  15 Aug 26 15:23 A_reserved_on_user -> ../../mmcblk0p4
lrwxrwxrwx 1 root root  15 Aug 26 15:23 B_kernel -> ../../mmcblk0p5
lrwxrwxrwx 1 root root  15 Aug 26 15:23 B_kernel-dtb -> ../../mmcblk0p6
lrwxrwxrwx 1 root root  15 Aug 26 15:23 B_reserved_on_user -> ../../mmcblk0p7
lrwxrwxrwx 1 root root  16 Aug 26 15:23 UDA -> ../../mmcblk0p14
lrwxrwxrwx 1 root root  16 Jan 30 06:15 esp -> ../../mmcblk0p10
lrwxrwxrwx 1 root root  16 Aug 26 15:23 esp_alt -> ../../mmcblk0p13
lrwxrwxrwx 1 root root  15 Aug 26 15:23 recovery -> ../../mmcblk0p8
lrwxrwxrwx 1 root root  15 Aug 26 15:23 recovery-dtb -> ../../mmcblk0p9
lrwxrwxrwx 1 root root  16 Aug 26 15:23 recovery-dtb_alt -> ../../mmcblk0p12
lrwxrwxrwx 1 root root  16 Aug 26 15:23 recovery_alt -> ../../mmcblk0p11
lrwxrwxrwx 1 root root  16 Aug 26 15:23 reserved -> ../../mmcblk0p15

you may use dd command to corrupt a partition, for example, $ sudo dd if=/dev/zero of=/dev/mmcblk0p3 bs=1M count=1
please reboot the system and check the serial console logs for the details of error handling.

>> Q4
as mentioned by developer guide, Rootfs Selection.
When rootfs A/B is enabled, Jetson Linux always links the rootfs A/B with Bootloader A/B.

Please check if I have correctly understood the answer to Q4:

  1. A/B Swap Activation: Whether the A/B swap operation is enabled is determined by the ROOTFS A/B Swap enable setting.

  2. Boot Success Criteria: Successful system operation is determined by whether the Kernel boots normally and whether the RootFS operates normally.

  3. Group-based Execution: During an A/B swap, the Bootloader, Kernel, and RootFS all switch together to run as either Group A or Group B.

hello jsko,

this seems incorrect, bootloader A/B is always enabled. you’ll need to re-flash a target for writing new partition layout to enable Root File System Redundancy.

furthermore.
you may use nvbootctrl utility to dump the slot information.
there’s -t options to specify the target, such as bootloader or rootfs.
for instance, $ sudo nvbootctrl -t <bootloader/rootfs> dump-slots-info

You mentioned that the Bootloader A/B is always enabled. Suppose the Root FS A/B is disabled; if Bootloader A fails, will it automatically swap to Bootloader B?

In that case, if the swap to Bootloader B occurs, do the subsequent partitions also follow the “B group” (e.g., will Kernel B be executed instead of Kernel A)?

hello jsko,

yes, if Bootloader A fails, it switch to Bootloader B automatically. it’s designed for a safe Bootloader update and ensures that a workable Bootloader partition.

  1. Is kernel A/B swap always enabled?
  2. Can the kernel A/B swap be configured separately? Or does it follow the RootFS settings?

hello jsko,

>> Q1. Is kernel A/B swap always enabled?
yes.

>> Q2. Can the kernel A/B swap be configured separately? Or does it follow the RootFS settings?
may I know what’s the actual use-case?
just an FYI,
although bootloader has kernel slots, it’s UEFI to load the kernel image from the root file system.
please dig into /boot/extlinux/extlinux.conf for LINUX entry.