Skip to content

Android A/B Bootloader support

Alex Deymo u-boot 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6image: Update include/android_image.hcommon/image-android.c include/android_image.h+28 -52 replies
2/6image: Implement a function to load Android Images.common/image-android.c include/image.h+70 -01 reply
3/6cmd: Add 'load_android' command to load Android images.cmd/Kconfig cmd/Makefile cmd/load_android.c+66 -01 reply
4/6disk: Return the partition number in part_get_info_by_name()common/fb_mmc.c disk/part.c include/part.h+6 -52 replies
5/6Initial support for the Android Bootloader flowREADME common/Kconfig common/Makefile +3 more+607 -41 reply
6/6cmd: Add "boot_android" command.README cmd/Kconfig cmd/Makefile +1 more+143 -01 reply

Reviews trailers per patch

2 of 6 patches have a Reviewed-by or Acked-by.

PatchSimon Glass
1/6R-b
2/6
3/6
4/6R-b
5/6
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [U-Boot] [PATCH 0/6] Android A/B Bootloader support

An "Android Bootloader" has a lot of requirements about how it should behave which Android partners must implement. In particular, the new A/B updates [1] added more requirements and flows to the bootloader which are not common, on top of the existing flows.

For example, a few uncommon requirements include:
* Lookup in the BCB (boot control block) whether a "recovery" message is stored. This is used by the recovery environment when applying a multi-stage update in the legacy update model (recovery reboots to recovery again) and for interrumpted factory-reset (a reboot during the factory reset should continue to reboot into factory reset until it is done).
* A new "repair" mode. In the A/B model, when none of the slots is bootable, the device would boot into repair mode, which is often the same as "bootloader" mode (fastboot).
* Recovery as root: In newer version of AOSP, it is possible to mount the system image as / without an initramfs, which then frees up the initramfs in the "boot" partition to hold the "recovery" initramfs. This is the default for new devices and required for the A/B setup.

This patchset updates the Android-related headers and introduces new commands to boot a recent Android build. This work is based on the bootloader used in the Raspberry Pi in Android Things and extensively tested there.

[1] https://source.android.com/devices/tech/ota/ab_updates.html

Alex Deymo (6):
image: Update include/android_image.h
image: Implement a function to load Android Images.
cmd: Add 'load_android' command to load Android images.
disk: Return the partition number in part_get_info_by_name() Initial support for the Android Bootloader flow
cmd: Add "boot_android" command.

 README                               |  25 ++-
 cmd/Kconfig                          |  19 ++
 cmd/Makefile                         |   2 +
 cmd/boot_android.c                   | 126 +++++++++++++
 cmd/load_android.c                   |  56 ++++++
 common/Kconfig                       |  19 ++
 common/Makefile                      |   1 +
 common/android_bootloader.c          | 350 +++++++++++++++++++++++++++++++++++
 common/fb_mmc.c                      |   6 +-
 common/image-android.c               |  60 ++++++
 disk/part.c                          |   2 +-
 include/android_bootloader.h         |  48 +++++
 include/android_bootloader_message.h | 174 +++++++++++++++++
 include/android_image.h              |  24 ++-
 include/image.h                      |  19 ++
 include/part.h                       |   3 +-
 16 files changed, 920 insertions(+), 14 deletions(-)
 create mode 100644 cmd/boot_android.c
 create mode 100644 cmd/load_android.c
 create mode 100644 common/android_bootloader.c
 create mode 100644 include/android_bootloader.h
 create mode 100644 include/android_bootloader_message.h
Signature · 1 line
2.12.2.564.g063fe858b8-goog