From patchwork Wed Dec 12 17:12:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ruslan Trofymenko X-Patchwork-Id: 153585 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2056334ljp; Wed, 12 Dec 2018 09:17:24 -0800 (PST) X-Google-Smtp-Source: AFSGD/UxtPY7AdJNUpU8pI/gSPJpYOrLYNKPIQ3uPfghEcdpu5rYqHtbiErDGGW/96g6TMjXOuvr X-Received: by 2002:a50:95ce:: with SMTP id x14mr19504434eda.204.1544635044852; Wed, 12 Dec 2018 09:17:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544635044; cv=none; d=google.com; s=arc-20160816; b=Dey/jCqQ+ps90CTb4hr81DE6abSPlQcjZD2sav73jf0NSteeoxllREqN2NLKYZ7BOf wdBsDkVv4OP/epv+FPjHyh6WTEDiF/N0beMQm3CkK0DKTAb/t7feSBfNNdjM0yB4nAia UUT1Rr7iZy0D45UBJtyU3itzyrNVrvrTP0U93WVyxKuU0rR62VeY2qdGwRm5WFPFHsT2 5FeEHNsdXC55Zq/pbxWssOuK0RaNCMPEt5QS9kB2i6fH1DczWVfIh14Wh064yLt+Wdc3 kN13li9htF19VGswxf5xbJInNbVa7JVl/9jKqOOCQyKyZK8p0uj8W5ImciVTlX4m3lnK T6Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature; bh=jvur939V/vm5BC6N+D/gwmhQv58K40fIeKERM87N3Fw=; b=is2KeLDZDQRZxQswGyLZwY627G+Z7eGRu/1UMxghv5oPO1yjNJZ/qTG4yqfdaqGQ5f Ab3/Tq3Wd8vVwpe9hnZWJTkaRjgn87o56B4ztQtNElWacsBetffS/5amlgPt+mSIQLmP QfbrtjEaMsMIZLWCyBxhCoZQUm9swS3t3Vkb8icZt+GYL+TfqqBpL8887rvWTo9h3i87 arMz6zSVMga8nTznyJR8hArpuETyuhimuOxetzZ6jZc1kmJnoBeuta+k6PJvUtKRN3lQ wUFGEqHtsX29ridS8BTmG+KCax4a+eScZMecntJTliee/mWkg3YBLYszbbvowro3c1Ju maBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=PRhJ2aM1; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id c2si2548160edl.50.2018.12.12.09.17.24; Wed, 12 Dec 2018 09:17:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=PRhJ2aM1; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id 6B310C2298D; Wed, 12 Dec 2018 17:15:22 +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 A8799C2276C; Wed, 12 Dec 2018 17:13:03 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id E61A1C22757; Wed, 12 Dec 2018 17:12:49 +0000 (UTC) Received: from mail-lf1-f66.google.com (mail-lf1-f66.google.com [209.85.167.66]) by lists.denx.de (Postfix) with ESMTPS id 05BACC2299A for ; Wed, 12 Dec 2018 17:12:45 +0000 (UTC) Received: by mail-lf1-f66.google.com with SMTP id v5so14123213lfe.7 for ; Wed, 12 Dec 2018 09:12:45 -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 :mime-version:content-transfer-encoding; bh=e/enG2uvEGD/wycTPqUap5iR8CRALykv2bHfgUNiEBY=; b=PRhJ2aM1Im+7CSq48gl4LX7rQ0Bw49upCEBEZPv41iDuZnFB6mPDwsOE/0DcG6At3h ISlAxVWCu44hbqNU0/hFQUzJ30iqpfeVd0OiMbPl8CJPNaszf9xpfMhzAujZVVrecrRA NlhqfLg++naw7/Q2zvEa8ykzCV3QzCR8u1ANI= 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:mime-version:content-transfer-encoding; bh=e/enG2uvEGD/wycTPqUap5iR8CRALykv2bHfgUNiEBY=; b=aP5BAfbzs3tcbVu4aiIasfsmEWWnnwU5pMkjPvu6ZtQ2gVFT15sM9698bXAQ8SifRB ljb4m+oJ/G9lFb8YvrSpG7li0O90TuLAESpsOD9C2Varr7H9oiilkv5I7Sesqqq44W9q 1mdnhsv8CgIMHx7sdJ7tdFIZFXP8R/VtYpBKcl5gjWcSNV3ACoooqs7t29ugGKspR88T vmExHoCct4IMQJI7Vz52fkkf/D7qtNn94znCKzvB9+EWmVUQ+E4eGBr9co6o1tp2Ei2U 0wOyVjiR1XTFXUwnEn0FIk7daI6QI5nSG0vX9uxnm0cuSZglTCrLLIZ/0yWSmi1j6ZTd yJvA== X-Gm-Message-State: AA+aEWbDCT2cIcmo39Xx62oS7S2aQ8NbR/03Nb7HssCT8ENXkSfZycur Jq37/9JCV1s+TbRMDKTOZDr+TN/VZC4= X-Received: by 2002:a19:a7c1:: with SMTP id q184mr11537578lfe.4.1544634764312; Wed, 12 Dec 2018 09:12:44 -0800 (PST) Received: from kbp1-dhp-f54913.synapse.com ([195.238.92.132]) by smtp.gmail.com with ESMTPSA id t81sm3358020lfe.84.2018.12.12.09.12.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Dec 2018 09:12:43 -0800 (PST) From: Ruslan Trofymenko To: u-boot@lists.denx.de Date: Wed, 12 Dec 2018 19:12:33 +0200 Message-Id: <1544634754-3435-7-git-send-email-ruslan.trofymenko@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544634754-3435-1-git-send-email-ruslan.trofymenko@linaro.org> References: <1544634754-3435-1-git-send-email-ruslan.trofymenko@linaro.org> MIME-Version: 1.0 Cc: Tom Rini , Praneeth Bajjuri , Alistair Strachan Subject: [U-Boot] [PATCH v2 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add a short documentation for A/B enablement and 'ab_select' command usage. Signed-off-by: Ruslan Trofymenko Reviewed-by: Alistair Strachan Reviewed-by: Sam Protsenko Reviewed-by: Simon Glass Reviewed-by: Igor Opaniuk --- Changes in v2: * Сhanges related to command renaming (android_ab_select -> ab_select) 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