All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Opaniuk <igor.opaniuk@linaro.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 0/7] android: implement A/B boot process
Date: Mon, 18 Feb 2019 18:21:50 +0200	[thread overview]
Message-ID: <1550506917-25547-1-git-send-email-igor.opaniuk@linaro.org> (raw)

This patch series adds support for Android A/B boot process [1].
Main steps of A/B boot process are:
  - A/B metadata integrity check
  - looking for the current slot (where the system should be
    booting from)
  - getting the name of the current boot partition (boot_a or boot_b) 
    and loading the corresponding Android boot image
  - getting the name of the current system partition (system_a or 
    system_b) and passing of its full name via kernel command line
    (like 'root=/dev/mmcblk1p11')
  - passing current slot via kernel command line (like
    'androidboot.slot_suffix=_a') and via A/B metadata (e.g. via
    misc partition)
  - A/B metadata processing: setting the boot success flag for
    current slot, handling the retry counter, etc

A/B metadata is organized according to Android reference [2] and stored
on 'misc' partition. On the first A/B boot process, when 'misc'
partition doesn't contain required data, default A/B metadata will be
created and stored in 'misc' partition. In the end of the Android boot,
'update_verifier' and 'update_engine' services are processing the
A/B metadata through the Boot Control HAL. To confirm the boot was
successful using current slot, "boot success" flag must be set on
Android side.

To enable Android A/B support in U-Boot:
  1. Set the following config options:

         CONFIG_ANDROID_AB=y
         CONFIG_CMD_AB_SELECT=y

  2. Change the disk layout so that it has sloted boot partitions.
     E.g. instead of 'boot' and 'system' partitions there should be
     'boot_a', 'boot_b', 'system_a' and 'system_b' partitions.

To be able to actually test this patch series, the A/B features must
be implemented and enabled in Android as well (see [1] for details).

Documentation and corresponding test for A/B boot is present here. The
last patch in this series integrates A/B boot support on AM57xx based
boards (though it's not enabled by default). Future users of A/B boot
feature can use it as a reference.

This series is a part of previous submission [3] by Alex Deymo. It
contains only A/B feature that was stripped out from there with some
modifications for using with "bootm" command preferred in upstream.

Changes in v3:
  * Minor fixes in the ab metadata handling (added additional sanity checks).
  * As Ruslan Trofymenko left Linaro and won't address comments anymore,
    continue (added my S-b tag) upstreaming patches on my own.

Changes in v2:
  * 'android_ab_select' command is renamed to 'ab_select' command and
     moved to separate 'Android support commands' menu
  * For am57xx boards slotted sections (e.g. system_a and system_b) are
    added to the default sections if CONFIG_CMD_AB_SELECT flag is
    defined
  * Returned function error codes are clarified (errno using)
  * Some types constants and files are renamed
  * Assertion condition is clarified in test case
  * 'debug' calls are changed to 'log_debug'
  * The Guide is clarified by the results of changes

[1] https://source.android.com/devices/tech/ota/ab/ab_implement
[2] bootable/recovery/bootloader_message/include/bootloader_message/bootloader_message.h
[3] https://lists.denx.de/pipermail/u-boot/2017-April/285841.html

Ruslan Trofymenko (7):
  cmd: part: Add 'number' sub-command
  disk: part: Extend API to get partition info
  common: Implement A/B metadata
  cmd: Add 'ab_select' command
  test/py: Add base test case for A/B updates
  doc: android: Add simple guide for A/B updates
  env: am57xx: Implement A/B boot process

 cmd/Kconfig                   |  15 +++
 cmd/Makefile                  |   1 +
 cmd/ab_select.c               |  52 ++++++++
 cmd/part.c                    |  16 ++-
 common/Kconfig                |  10 ++
 common/Makefile               |   1 +
 common/android_ab.c           | 290 ++++++++++++++++++++++++++++++++++++++++++
 configs/sandbox_defconfig     |   2 +
 disk/part.c                   |  68 ++++++++++
 doc/README.android-ab         |  67 ++++++++++
 include/android_ab.h          |  34 +++++
 include/android_bl_msg.h      | 169 ++++++++++++++++++++++++
 include/environment/ti/boot.h |  58 ++++++++-
 include/part.h                |  21 +++
 test/py/tests/test_ab.py      |  74 +++++++++++
 15 files changed, 871 insertions(+), 7 deletions(-)
 create mode 100644 cmd/ab_select.c
 create mode 100644 common/android_ab.c
 create mode 100644 doc/README.android-ab
 create mode 100644 include/android_ab.h
 create mode 100644 include/android_bl_msg.h
 create mode 100644 test/py/tests/test_ab.py

-- 
2.7.4

             reply	other threads:[~2019-02-18 16:21 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-18 16:21 Igor Opaniuk [this message]
2019-02-18 16:21 ` [U-Boot] [PATCH v3 1/7] cmd: part: Add 'number' sub-command Igor Opaniuk
2019-03-10 22:41   ` Eugeniu Rosca
2019-03-21 15:42     ` Igor Opaniuk
2019-05-20 13:27       ` Igor Opaniuk
2019-05-20 14:12         ` Roman Stratiienko
2019-02-18 16:21 ` [U-Boot] [PATCH v3 2/7] disk: part: Extend API to get partition info Igor Opaniuk
2019-02-18 16:21 ` [U-Boot] [PATCH v3 3/7] common: Implement A/B metadata Igor Opaniuk
2019-03-08 17:28   ` Eugeniu Rosca
2019-03-21 15:39     ` Igor Opaniuk
2019-03-28 16:30       ` Eugeniu Rosca
2019-03-28 19:58         ` Tom Rini
2019-03-29  8:36           ` Eugeniu Rosca
2019-03-10 21:50   ` Simon Glass
2019-03-11 17:27   ` Eugeniu Rosca
2019-03-18 18:04     ` Eugeniu Rosca
2019-03-18 20:21       ` Eugeniu Rosca
2019-03-18 21:20         ` Bajjuri, Praneeth
2019-03-19 10:13           ` Eugeniu Rosca
2019-02-18 16:21 ` [U-Boot] [PATCH v3 4/7] cmd: Add 'ab_select' command Igor Opaniuk
2019-03-10 21:50   ` Simon Glass
2019-02-18 16:21 ` [U-Boot] [PATCH v3 5/7] test/py: Add base test case for A/B updates Igor Opaniuk
2019-02-18 16:21 ` [U-Boot] [PATCH v3 6/7] doc: android: Add simple guide " Igor Opaniuk
2019-02-18 16:21 ` [U-Boot] [PATCH v3 7/7] env: am57xx: Implement A/B boot process Igor Opaniuk
2019-03-10 21:50   ` Simon Glass
2019-02-28 10:28 ` [U-Boot] [PATCH v3 0/7] android: implement " Sam Protsenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1550506917-25547-1-git-send-email-igor.opaniuk@linaro.org \
    --to=igor.opaniuk@linaro.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.