Skip to content

Add AB boot functionality

Eberhard Stoll requested to merge feature/ab-boot into develop-v2020.10-stm32mp-ktn

Add boot scripts for 'AB double copy boot with fallback' to the u-boot environment. These boot scripts can handle a double copy root filesystem layout with partition root_A and root_B and fallback boot on the standby partition when active boot fails and bootcounter exceds.

This is a basic feature which can be used for sofware update systems like SWUpdate or rauc.

Use 'bootcmd_ab' to boot from AB partitionned systems. Also 'bootcmd_multi' can be used to fall back to extlinux boot for each boot target if AB scheme is not discovered (compatibility).

The interface to linux userspace is based on a ext4 boot partition. The contents of this partition are:

  • root_A and root_B directory with the recommended boot files (Linux Kernel, devicetree, ...) and root_A/.is_A, root_B/.is_B files to ease the identification of the A or B configuration for u-boot scripts.
  • Symbolic links active and standby which link to either root_A or root_B directory, depending which shall be used for normal (active) or emergency (standby) boot.

Emergency boot is activated if the bootcounter exceeds the configured boot limit. Normal boot is indicated in the linux kernel command line with rootselect=active. For emergency boot it contains rootselect=standby

Update systems like SWUpdate or rauc can set the active and standby links appropriately.

Linux userspace can detect emergency boot by examining the kernel command line.

For AB boot the following partition scheme is required:

  • boot partition with boot contents (ext4)
  • root_A first root filesystem partition
  • root_B second root filesystem partition

For storage types with a partition table (like eMMC, SD card, USB storage) boot, root_A, root_B are the required partition names. For UBI based storage, they are the required volume names.

Edited by Eberhard Stoll

Merge request reports