From patchwork Tue Nov 27 19:57:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ruslan Trofymenko X-Patchwork-Id: 152167 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp220721ljp; Tue, 27 Nov 2018 12:15:15 -0800 (PST) X-Google-Smtp-Source: AFSGD/W24EyicAe/FdRN57Sj4PXPZPd04TL5nhct+qjeKvY/U9v+6EmUiD642T8iBoB5s76W9kOg X-Received: by 2002:a50:b2e1:: with SMTP id p88mr17226153edd.254.1543349715706; Tue, 27 Nov 2018 12:15:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543349715; cv=none; d=google.com; s=arc-20160816; b=0sIM0xgKJRF4ZHbiyl8of6d/t42ON675FNMrekTqhp8VVKZulzAE4bAzMI9lHRUFzz Li8zA/LGhWPqWEeOSyx/O95IxpDH6sOBF/09RHugFMkVqCA+BcilOHwe94WpRa6iTIJ7 MCDGId4Yesq20lCwSfmvWOXKFOhI3/DhOuXdMuwiuXspwW4ZbkQu9FQMPdPj1C8KjKbn zpvZpoU6JX3ndL4xmtUcE8k2WJ7HAXbjl5iyMdmdtWj798Ez+NjIw708SpszjUKqKZpo Jhf6LgLJNIBoY+M+s1FWUEqHhMVlI0LxN4/dKC9iHOpY1tD5mJynasdmEa7Q22TxebPK obNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature; bh=aTQlXZII2j8kWJ+MqmbdZmzR1AMbNry5rSv1MyWm8Gc=; b=ACM53BSGxagbt/s1+Q4vn3ncMJ/37HasI7GmeDP56jDmmRXQ1W73nwVtavJdg5Edh8 XvNmycLHBSDgGgJSls+qDR5F3oyXJzAe6OCYgGHBG8/5uvDYji4ROIt6fBq9EVnSrffw RIRkKMpd144Celh5WCJP/m88IDsQvzX7NlB9meeGEPAUYcNiPp01XZ/cfnP7zGu7N92X zZssfLAKvYFyqV15/yOev3JRKJLXxATIBOprBPP+qSFU3+P43P3T0WTKVYuCtbrqbmdI f9VIH6kQDE/KK9L1zRcLPtppz1yyYf9f/HIpM+flP0MokW/W8xXr07K+U1ODWs+amPXj DonQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=RO9syJp4; 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 12-v6si202910ejh.281.2018.11.27.12.15.15; Tue, 27 Nov 2018 12:15:15 -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=RO9syJp4; 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 3FD3AC22275; Tue, 27 Nov 2018 20:12:59 +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 51816C222C8; Tue, 27 Nov 2018 20:10:37 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 59597C21DD7; Tue, 27 Nov 2018 19:57:33 +0000 (UTC) Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) by lists.denx.de (Postfix) with ESMTPS id EC7F3C2213D for ; Tue, 27 Nov 2018 19:57:32 +0000 (UTC) Received: by mail-lj1-f193.google.com with SMTP id e5-v6so21215116lja.4 for ; Tue, 27 Nov 2018 11:57:32 -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=XYw6i1Y6fVC5N1eyTU8b/QtuL77IyS6jVFxXRtbtlw8=; b=RO9syJp4qBGGEGYvvKRE3+2foZ2/hzk/n5rPTIkHFXtI95WUBtXjvdLU7ZYi7U9ytP iRhMsEC3owulBbIdpakUiRJXQ0vVnKpKqFWioyrqE6Rb+TuLCNL5wxnArDBU1HHkoEmv sdRBijIe5vsZw+7BKP3ta6h4BUw5iyQ2hfxh0= 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=XYw6i1Y6fVC5N1eyTU8b/QtuL77IyS6jVFxXRtbtlw8=; b=CSqoBRAQCuIkBmRhV/4rv1ADt8u0fUcTndUI7iJIaXygtOCWjz6i5QwpBp3Jl211p/ xlnZWN4cUPx0alJhXs+nWUcXqdsrWKIOGsRNFV/NpSRfz3jJWcbgQe5cI60Lt5XobdAV Kufx9cp7R9a0f6ESkkOeYX5W7gCIl2NLsemYl788+TJL+pwXFl3t8Qm9t7RMKNv2vfV+ rj49p7J+WtIZ5eAJZDkKR1ubcWGXe21cfs8IuKWE7wiHNer71YSnkBL8IPu66eeAvro3 6+Iz8931LU3UWy0Zq2k0zLAJzQR7XNnqE8TqusE/PSmvYxef8e9dZYvR+pV75IJOUekW WWJQ== X-Gm-Message-State: AA+aEWb+pNgOsM7bUHu7UMd16x7JodRezmf3QeBnojLLLfwpKQwiKHfm wwBZTPHWossfec7fnjnuliCNMBbZeNI= X-Received: by 2002:a2e:5152:: with SMTP id b18-v6mr18251462lje.88.1543348652197; Tue, 27 Nov 2018 11:57:32 -0800 (PST) Received: from kbp1-dhp-f54913.synapse.com ([195.238.92.132]) by smtp.gmail.com with ESMTPSA id g12-v6sm738725lja.74.2018.11.27.11.57.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 27 Nov 2018 11:57:31 -0800 (PST) From: Ruslan Trofymenko To: u-boot@lists.denx.de Date: Tue, 27 Nov 2018 21:57:21 +0200 Message-Id: <1543348642-31045-7-git-send-email-ruslan.trofymenko@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1543348642-31045-1-git-send-email-ruslan.trofymenko@linaro.org> References: <1543348642-31045-1-git-send-email-ruslan.trofymenko@linaro.org> X-Mailman-Approved-At: Tue, 27 Nov 2018 20:10:30 +0000 Cc: Tom Rini , Praneeth Bajjuri , Alistair Strachan Subject: [U-Boot] [PATCH 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" Add a short documentation for A/B enablement and 'android_ab_select' command usage. Signed-off-by: Ruslan Trofymenko --- 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 + +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