From patchwork Tue Jul 2 08:51:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Opaniuk X-Patchwork-Id: 1126078 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hem9bkBk"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45dJ2k1Z1Lz9s00 for ; Tue, 2 Jul 2019 18:54:38 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id CD133C21C93; Tue, 2 Jul 2019 08:53:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 1F9C1C21DD3; Tue, 2 Jul 2019 08:52:11 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 577F6C21E13; Tue, 2 Jul 2019 08:51:44 +0000 (UTC) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by lists.denx.de (Postfix) with ESMTPS id 77877C21DDC for ; Tue, 2 Jul 2019 08:51:40 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id e3so7251195wrs.11 for ; Tue, 02 Jul 2019 01:51:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MnLgBBXvgUms/kFsZi6WCJBEpdt/3JNa2dOn90uA3lQ=; b=hem9bkBkfeTidNloZqsIq0zNgtPfpQnkEwFagLjg4rSGngYcjdIOxOLA66hp5JSlPw NJyd+mBiJ7BSuynMcG6amFNI0L+LIZIZhVAGGlT8v8EF+zVWsUwGS+1Tlxmn/bPy0wIY 4sDAtxN1VyMMVTG8kSvx35B2LyQk5sXsyQZsQh0pJygJJMBkZzRLgLeTzF6Wedb5IXaX cYt359sUrJaFu5yWyzKr9rNzVmbnIsfvXiTCAL/lVQi9B+JnQj3gjPX5vHQvQ8seydO6 adzdFqfWnude/OdsESZ9WfbdutsxlNSY1+VuuZietP1+33Z6GqnNXah5gljRbLUAE+M8 SWrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=MnLgBBXvgUms/kFsZi6WCJBEpdt/3JNa2dOn90uA3lQ=; b=DWWvQFMxy4Wuw+0fYNYsbh5WuNWBlH7j+CtQMo9M4Juv01KmAv3FnqG2zVoHyzfU3X yPpUTwwmcz5kz/Rs9AyFkzfNBTSIEGhIgekdcIIsofd9SIeXuM/rH5R1hBmBZLdV3RSD wbnVd5TWB7yza9IeyTJhhudzEBLKkxY/ZodgbzVT92MMLTA4AzkN0ihW/brl7x+GOGRr kIm8aEBLBAUmnOyqzt28cDNSzPfs/+svCnYA+Vo3zr/HQm1Tl91sURlPH9P68XiD1DBJ Ai2rvxT4BPpgDeQnfyQYo9N7vbDa9J/GgnJeQq7Srq+dI8fl8FnnfoMHnZggSquQxiXs 3V+g== X-Gm-Message-State: APjAAAWhooKmDdht8TCO0iCbSfEBNEoA09urkCJvSpMKDd1PsYJNqkRh GtC9Rhph5yBagJ/MDEvWfEsRGpMi X-Google-Smtp-Source: APXvYqweTEnT7PpZXJ2hyb9t1HKsLdcFfgPcS/Wfx0w6Fizgo9Gfgi/RIABmri7kg3liY1HH6jwnIg== X-Received: by 2002:adf:e84d:: with SMTP id d13mr19035443wrn.88.1562057499940; Tue, 02 Jul 2019 01:51:39 -0700 (PDT) Received: from localhost ([194.105.145.90]) by smtp.gmail.com with ESMTPSA id s3sm2358683wmh.27.2019.07.02.01.51.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 Jul 2019 01:51:39 -0700 (PDT) From: Igor Opaniuk To: u-boot@lists.denx.de Date: Tue, 2 Jul 2019 11:51:02 +0300 Message-Id: <20190702085103.9428-6-igor.opaniuk@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190702085103.9428-1-igor.opaniuk@gmail.com> References: <20190702085103.9428-1-igor.opaniuk@gmail.com> Cc: Alex Deymo , Praneeth Bajjuri , astrachan@google.com, Ruslan Trofymenko , Eugeniu Rosca Subject: [U-Boot] [PATCH v4 5/6] doc: android: Add simple guide for A/B updates X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Ruslan Trofymenko Add a short documentation for A/B enablement and 'ab_select' command usage. Signed-off-by: Ruslan Trofymenko Signed-off-by: Igor Opaniuk Reviewed-by: Alistair Strachan Reviewed-by: Sam Protsenko Reviewed-by: Simon Glass --- Changes in v4: None Changes in v3: None Changes in v2: * Changes related to command renaming 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 0000000000..9f37ed5c58 --- /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_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 '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 +------------- + + ab_select + +for example: + + => ab_select slot_name mmc 1:4 + +or + + => 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