ab.txt 1.9 KB

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