blob: 9f37ed5c58666870252e47511aeb1f9c52191119 [file] [log] [blame]
Ruslan Trofymenko68ff7692019-07-05 15:37:35 +03001Android A/B updates
2===================
3
4Overview
5--------
6
7A/B system updates ensures modern approach for system update. This feature
8allows one to use two sets (or more) of partitions referred to as slots
9(normally slot A and slot B). The system runs from the current slot while the
10partitions in the unused slot can be updated [1].
11
12A/B enablement
13--------------
14
15The A/B updates support can be activated by specifying next options in
16your board configuration file:
17
18 CONFIG_ANDROID_AB=y
19 CONFIG_CMD_AB_SELECT=y
20
21The disk space on target device must be partitioned in a way so that each
22partition which needs to be updated has two or more instances. The name of
23each instance must be formed by adding suffixes: _a, _b, _c, etc.
24For example: boot_a, boot_b, system_a, system_b, vendor_a, vendor_b.
25
26As a result you can use 'ab_select' command to ensure A/B boot process in your
27boot script. This command analyzes and processes A/B metadata stored on a
28special partition (e.g. "misc") and determines which slot should be used for
29booting up.
30
31Command usage
32-------------
33
34 ab_select <slot_var_name> <interface> <dev[:part_number|#part_name]>
35
36for example:
37
38 => ab_select slot_name mmc 1:4
39
40or
41
42 => ab_select slot_name mmc 1#misc
43
44Result:
45
46 => printenv slot_name
47 slot_name=a
48
49Based on this slot information, the current boot partition should be defined,
50and next kernel command line parameters should be generated:
51
52 - androidboot.slot_suffix=
53 - root=
54
55For example:
56
57 androidboot.slot_suffix=_a root=/dev/mmcblk1p12
58
59A/B metadata is organized according to AOSP reference [2]. On the first system
60start with A/B enabled, when 'misc' partition doesn't contain required data,
61the default A/B metadata will be created and written to 'misc' partition.
62
63References
64----------
65
66[1] https://source.android.com/devices/tech/ota/ab
67[2] bootable/recovery/bootloader_message/include/bootloader_message/bootloader_message.h