From patchwork Mon Feb 18 16:21:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Opaniuk X-Patchwork-Id: 1044162 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=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="xZR28dez"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 4438Nz6Gs8z9s1l for ; Tue, 19 Feb 2019 03:25:39 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 2430DC21F7D; Mon, 18 Feb 2019 16:24:23 +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=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 84B56C21F9E; Mon, 18 Feb 2019 16:22:28 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 7CBADC21FB5; Mon, 18 Feb 2019 16:22:17 +0000 (UTC) Received: from mail-lf1-f67.google.com (mail-lf1-f67.google.com [209.85.167.67]) by lists.denx.de (Postfix) with ESMTPS id 8FBBAC21F4F for ; Mon, 18 Feb 2019 16:22:12 +0000 (UTC) Received: by mail-lf1-f67.google.com with SMTP id n15so12726722lfe.5 for ; Mon, 18 Feb 2019 08:22:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=h+Y1NymN5vJ4WXVdtoGrITz3/0TZoDtDx7apPFlR4no=; b=xZR28dezxi6/LXtMDg7kL2yXO8+62H16bTWfcpXI/WrZWiMBCUsUMFUfCh19ZTmH8J fPVb61HJTSzVgNPzSp0XRVq9N6kTGnFh2VDHpEczmCvdnSNrMq0OSbBS4xLxu6seg2rb kmtuu48exjqdmOzKo4kRgWfv6CFXMGxfaUJC0G5FAMkZQi1a4sm/vWdZ+YJUEhvTs/KS 2DIsKo/T0XmXZTqNe+i226zN5P/7fMHUdk7+A/mCUNMQGw8xK8Z367uTs1OIoY5W641/ te3mC1m3jqkOjm1jpdeqUVVzARtzcTeplzsBNVpTdz152OtA4sMBBnb6dtUP+4BzC/PK NDqg== 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=h+Y1NymN5vJ4WXVdtoGrITz3/0TZoDtDx7apPFlR4no=; b=T3rVGrYBkAvO8jE+Dt3NLxum0z428L5NMxsBkRQ9LJYLJxW5Xuj9SwimzZw0wWrQaK kBqLz+sNAlICafSP907lppt7qXo32sbn+NKgIeJJ9wtRkb8TOb1/h9FqDh8rgMmpuPZg YuWGfIqjmoqmXC1x4/AsWKcfSLl+Rma1Yvfzrsj2GroWDu3Uu64VB5goIlhLrPaIM/vf IZ2Q9f9HQCmGuNo6oQkcXsZl1RFulm8mWMVOQ9mNH7CHieNONFrj7YugVoXtWr9eCVJP +W4PCblRZlQgRjn/2mX4o92yDmb7zopT4FuzqdfTJ8mzAdKXEAhzPzuRQdGQuMTKuOk5 MPdg== X-Gm-Message-State: AHQUAuYFEHvRKjwSRSSqXobWsDadwG/OwTTr8GHTkOtcet7AO4ixhRui 4K4z/Sj+7boZC5FdquqF1oRj+TwRp+k= X-Google-Smtp-Source: AHgI3IZoHXICqggpoJ1PczT9HAhYhKPVhwGDkimDFWoef3LZ3h1iZGzHGo2tCr+HFQjJOh7/t6aS3A== X-Received: by 2002:a19:e346:: with SMTP id c6mr13863231lfk.120.1550506931647; Mon, 18 Feb 2019 08:22:11 -0800 (PST) Received: from localhost ([195.238.92.223]) by smtp.gmail.com with ESMTPSA id k11-v6sm3568528ljk.40.2019.02.18.08.22.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Feb 2019 08:22:10 -0800 (PST) From: Igor Opaniuk To: u-boot@lists.denx.de Date: Mon, 18 Feb 2019 18:21:56 +0200 Message-Id: <1550506917-25547-7-git-send-email-igor.opaniuk@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550506917-25547-1-git-send-email-igor.opaniuk@linaro.org> References: <1550506917-25547-1-git-send-email-igor.opaniuk@linaro.org> Cc: trini@konsulko.com, deymo@google.com, praneeth@ti.com, astrachan@google.com, semen.protsenko@linaro.org Subject: [U-Boot] [PATCH v3 6/7] 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 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 0000000..9f37ed5 --- /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