diff mbox series

[6/7] doc: android: Add simple guide for A/B updates

Message ID 1543348642-31045-7-git-send-email-ruslan.trofymenko@linaro.org
State Superseded
Headers show
Series android: Implement A/B boot process | expand

Commit Message

Ruslan Trofymenko Nov. 27, 2018, 7:57 p.m. UTC
Add a short documentation for A/B enablement and 'android_ab_select'
command usage.

Signed-off-by: Ruslan Trofymenko <ruslan.trofymenko@linaro.org>
---
 doc/README.android-ab | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 67 insertions(+)
 create mode 100644 doc/README.android-ab

Comments

Simon Glass Dec. 6, 2018, 1:31 a.m. UTC | #1
Hi,

On Tue, 27 Nov 2018 at 12:57, Ruslan Trofymenko
<ruslan.trofymenko@linaro.org> wrote:
>
> Add a short documentation for A/B enablement and 'android_ab_select'
> command usage.
>
> Signed-off-by: Ruslan Trofymenko <ruslan.trofymenko@linaro.org>
> ---
>  doc/README.android-ab | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 67 insertions(+)
>  create mode 100644 doc/README.android-ab
>
> diff --git a/doc/README.android-ab b/doc/README.android-ab
> new file mode 100644
> index 0000000..230088c
> --- /dev/null
> +++ b/doc/README.android-ab
> @@ -0,0 +1,67 @@
> +Android A/B updates
> +===================
> +
> +Overview
> +--------
> +
> +A/B system updates ensures modern approach for system update. This feature
> +allows one to use two sets (or more) of partitions referred to as slots
> +(normally slot A and slot B). The system runs from the current slot while the
> +partitions in the unused slot can be updated [1].
> +
> +A/B enablement
> +--------------
> +
> +The A/B updates support can be activated by specifying next options in
> +your board configuration file:
> +
> +    CONFIG_ANDROID_AB=y
> +    CONFIG_CMD_ANDROID_AB_SELECT=y
> +
> +The disk space on target device must be partitioned in a way so that each
> +partition which needs to be updated has two or more instances. The name of
> +each instance must be formed by adding suffixes: _a, _b, _c, etc.
> +For example: boot_a, boot_b, system_a, system_b, vendor_a, vendor_b.
> +
> +As a result you can use 'android_ab_select' command to ensure A/B boot process
> +in your boot script. This command analyzes and processes A/B metadata stored
> +on a special partition (e.g. "misc") and determines which slot should be used
> +for booting up.
> +
> +Command usage
> +-------------
> +
> +    android_ab_select <slot_var_name> <interface> <dev[:part_number|#part_name]>

Can we have a shorter command?

Perhaps we need a new 'android' command with an 'ab_select'
subcommand? Then the automatica abbreviation will work.

> +
> +for example:
> +
> +    => android_ab_select slot_name mmc 1:4
> +
> +or
> +
> +    => android_ab_select slot_name mmc 1#misc
> +
> +Result:
> +
> +    => printenv slot_name
> +    slot_name=a
> +
> +Based on this slot information, the current boot partition should be defined,
> +and next kernel command line parameters should be generated:
> +
> + - androidboot.slot_suffix=
> + - root=
> +
> +For example:
> +
> +    androidboot.slot_suffix=_a root=/dev/mmcblk1p12
> +
> +A/B metadata is organized according to AOSP reference [2]. On the first system
> +start with A/B enabled, when 'misc' partition doesn't contain required data,
> +the default A/B metadata will be created and written to 'misc' partition.
> +
> +References
> +----------
> +
> +[1] https://source.android.com/devices/tech/ota/ab
> +[2] bootable/recovery/bootloader_message/include/bootloader_message/bootloader_message.h
> --
> 2.7.4
>

Regards,
Simon
Ruslan Trofymenko Dec. 10, 2018, 7:10 p.m. UTC | #2
Hi Simon,

On Thu, 6 Dec 2018 at 03:31, Simon Glass <sjg@chromium.org> wrote:
>
> Hi,
>
> On Tue, 27 Nov 2018 at 12:57, Ruslan Trofymenko
> <ruslan.trofymenko@linaro.org> wrote:
> >
> > Add a short documentation for A/B enablement and 'android_ab_select'
> > command usage.
> >
> > Signed-off-by: Ruslan Trofymenko <ruslan.trofymenko@linaro.org>
> > ---
> >  doc/README.android-ab | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 67 insertions(+)
> >  create mode 100644 doc/README.android-ab
> >
> > diff --git a/doc/README.android-ab b/doc/README.android-ab
> > new file mode 100644
> > index 0000000..230088c
> > --- /dev/null
> > +++ b/doc/README.android-ab
> > @@ -0,0 +1,67 @@
> > +Android A/B updates
> > +===================
> > +
> > +Overview
> > +--------
> > +
> > +A/B system updates ensures modern approach for system update. This feature
> > +allows one to use two sets (or more) of partitions referred to as slots
> > +(normally slot A and slot B). The system runs from the current slot while the
> > +partitions in the unused slot can be updated [1].
> > +
> > +A/B enablement
> > +--------------
> > +
> > +The A/B updates support can be activated by specifying next options in
> > +your board configuration file:
> > +
> > +    CONFIG_ANDROID_AB=y
> > +    CONFIG_CMD_ANDROID_AB_SELECT=y
> > +
> > +The disk space on target device must be partitioned in a way so that each
> > +partition which needs to be updated has two or more instances. The name of
> > +each instance must be formed by adding suffixes: _a, _b, _c, etc.
> > +For example: boot_a, boot_b, system_a, system_b, vendor_a, vendor_b.
> > +
> > +As a result you can use 'android_ab_select' command to ensure A/B boot process
> > +in your boot script. This command analyzes and processes A/B metadata stored
> > +on a special partition (e.g. "misc") and determines which slot should be used
> > +for booting up.
> > +
> > +Command usage
> > +-------------
> > +
> > +    android_ab_select <slot_var_name> <interface> <dev[:part_number|#part_name]>
>
> Can we have a shorter command?
>
> Perhaps we need a new 'android' command with an 'ab_select'
> subcommand? Then the automatica abbreviation will work.
>

Agree with all your previous comments, will send v2 shortly. But this
one I'd like to leave as is (I will drop android_ prefix though). I
think adding "android" command may lead to unneeded architecture
complexity in future, e.g.:
  - we will need to re-work next commands as sub-commands of "android"
command: fastboot, dtimg, mmc_swrite (which can be hard as ab_select
command file has BSD license and other commands have GPL license)
 - we will need to implement sub-sub-commands (e.g. for "android dtimg
dump ..." etc.)
 - having "android" command can be inconvenient for users and may
break existing API (e.g. it will force users to use "android fastboot"
instead of just "fastboot" command)
 - actually I don't see any namespace issues that can be solved by
adding "android" command

Also, in subsequent patch, I will add the dedicated menu option for
Android-related commands and will pull all existing Android commands
(along with ab_select) to that menu entry.

So I hope it's fine with you if I leave this command as "ab_select"?

Thanks.

> > +
> > +for example:
> > +
> > +    => android_ab_select slot_name mmc 1:4
> > +
> > +or
> > +
> > +    => android_ab_select slot_name mmc 1#misc
> > +
> > +Result:
> > +
> > +    => printenv slot_name
> > +    slot_name=a
> > +
> > +Based on this slot information, the current boot partition should be defined,
> > +and next kernel command line parameters should be generated:
> > +
> > + - androidboot.slot_suffix=
> > + - root=
> > +
> > +For example:
> > +
> > +    androidboot.slot_suffix=_a root=/dev/mmcblk1p12
> > +
> > +A/B metadata is organized according to AOSP reference [2]. On the first system
> > +start with A/B enabled, when 'misc' partition doesn't contain required data,
> > +the default A/B metadata will be created and written to 'misc' partition.
> > +
> > +References
> > +----------
> > +
> > +[1] https://source.android.com/devices/tech/ota/ab
> > +[2] bootable/recovery/bootloader_message/include/bootloader_message/bootloader_message.h
> > --
> > 2.7.4
> >
>
> Regards,
> Simon
Simon Glass Dec. 11, 2018, midnight UTC | #3
Hi,

On Mon, 10 Dec 2018 at 12:11, Ruslan Trofymenko
<ruslan.trofymenko@linaro.org> wrote:
>
> Hi Simon,
>
> On Thu, 6 Dec 2018 at 03:31, Simon Glass <sjg@chromium.org> wrote:
> >
> > Hi,
> >
> > On Tue, 27 Nov 2018 at 12:57, Ruslan Trofymenko
> > <ruslan.trofymenko@linaro.org> wrote:
> > >
> > > Add a short documentation for A/B enablement and 'android_ab_select'
> > > command usage.
> > >
> > > Signed-off-by: Ruslan Trofymenko <ruslan.trofymenko@linaro.org>
> > > ---
> > >  doc/README.android-ab | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++
> > >  1 file changed, 67 insertions(+)
> > >  create mode 100644 doc/README.android-ab
> > >
> > > diff --git a/doc/README.android-ab b/doc/README.android-ab
> > > new file mode 100644
> > > index 0000000..230088c
> > > --- /dev/null
> > > +++ b/doc/README.android-ab
> > > @@ -0,0 +1,67 @@
> > > +Android A/B updates
> > > +===================
> > > +
> > > +Overview
> > > +--------
> > > +
> > > +A/B system updates ensures modern approach for system update. This feature
> > > +allows one to use two sets (or more) of partitions referred to as slots
> > > +(normally slot A and slot B). The system runs from the current slot while the
> > > +partitions in the unused slot can be updated [1].
> > > +
> > > +A/B enablement
> > > +--------------
> > > +
> > > +The A/B updates support can be activated by specifying next options in
> > > +your board configuration file:
> > > +
> > > +    CONFIG_ANDROID_AB=y
> > > +    CONFIG_CMD_ANDROID_AB_SELECT=y
> > > +
> > > +The disk space on target device must be partitioned in a way so that each
> > > +partition which needs to be updated has two or more instances. The name of
> > > +each instance must be formed by adding suffixes: _a, _b, _c, etc.
> > > +For example: boot_a, boot_b, system_a, system_b, vendor_a, vendor_b.
> > > +
> > > +As a result you can use 'android_ab_select' command to ensure A/B boot process
> > > +in your boot script. This command analyzes and processes A/B metadata stored
> > > +on a special partition (e.g. "misc") and determines which slot should be used
> > > +for booting up.
> > > +
> > > +Command usage
> > > +-------------
> > > +
> > > +    android_ab_select <slot_var_name> <interface> <dev[:part_number|#part_name]>
> >
> > Can we have a shorter command?
> >
> > Perhaps we need a new 'android' command with an 'ab_select'
> > subcommand? Then the automatica abbreviation will work.
> >
>
> Agree with all your previous comments, will send v2 shortly. But this
> one I'd like to leave as is (I will drop android_ prefix though). I
> think adding "android" command may lead to unneeded architecture
> complexity in future, e.g.:
>   - we will need to re-work next commands as sub-commands of "android"
> command: fastboot, dtimg, mmc_swrite (which can be hard as ab_select
> command file has BSD license and other commands have GPL license)
>  - we will need to implement sub-sub-commands (e.g. for "android dtimg
> dump ..." etc.)
>  - having "android" command can be inconvenient for users and may
> break existing API (e.g. it will force users to use "android fastboot"
> instead of just "fastboot" command)
>  - actually I don't see any namespace issues that can be solved by
> adding "android" command
>
> Also, in subsequent patch, I will add the dedicated menu option for
> Android-related commands and will pull all existing Android commands
> (along with ab_select) to that menu entry.
>
> So I hope it's fine with you if I leave this command as "ab_select"?

Yes I think that is OK.

Regards,
Simon
diff mbox series

Patch

diff --git a/doc/README.android-ab b/doc/README.android-ab
new file mode 100644
index 0000000..230088c
--- /dev/null
+++ b/doc/README.android-ab
@@ -0,0 +1,67 @@ 
+Android A/B updates
+===================
+
+Overview
+--------
+
+A/B system updates ensures modern approach for system update. This feature
+allows one to use two sets (or more) of partitions referred to as slots
+(normally slot A and slot B). The system runs from the current slot while the
+partitions in the unused slot can be updated [1].
+
+A/B enablement
+--------------
+
+The A/B updates support can be activated by specifying next options in
+your board configuration file:
+
+    CONFIG_ANDROID_AB=y
+    CONFIG_CMD_ANDROID_AB_SELECT=y
+
+The disk space on target device must be partitioned in a way so that each
+partition which needs to be updated has two or more instances. The name of
+each instance must be formed by adding suffixes: _a, _b, _c, etc.
+For example: boot_a, boot_b, system_a, system_b, vendor_a, vendor_b.
+
+As a result you can use 'android_ab_select' command to ensure A/B boot process
+in your boot script. This command analyzes and processes A/B metadata stored
+on a special partition (e.g. "misc") and determines which slot should be used
+for booting up.
+
+Command usage
+-------------
+
+    android_ab_select <slot_var_name> <interface> <dev[:part_number|#part_name]>
+
+for example:
+
+    => android_ab_select slot_name mmc 1:4
+
+or
+
+    => android_ab_select slot_name mmc 1#misc
+
+Result:
+
+    => printenv slot_name
+    slot_name=a
+
+Based on this slot information, the current boot partition should be defined,
+and next kernel command line parameters should be generated:
+
+ - androidboot.slot_suffix=
+ - root=
+
+For example:
+
+    androidboot.slot_suffix=_a root=/dev/mmcblk1p12
+
+A/B metadata is organized according to AOSP reference [2]. On the first system
+start with A/B enabled, when 'misc' partition doesn't contain required data,
+the default A/B metadata will be created and written to 'misc' partition.
+
+References
+----------
+
+[1] https://source.android.com/devices/tech/ota/ab
+[2] bootable/recovery/bootloader_message/include/bootloader_message/bootloader_message.h