From patchwork Fri Sep 8 12:00:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 720811 Delivered-To: patch@linaro.org Received: by 2002:adf:eec5:0:b0:31d:da82:a3b4 with SMTP id a5csp720833wrp; Fri, 8 Sep 2023 05:01:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFXxcrMzwwQNzEYJ2/NCWhkjoGD0k5pnbgmin2ibWqC1LiqgHovON9fTGHzOoViT1EWmrbA X-Received: by 2002:adf:f14f:0:b0:31f:6e29:df8d with SMTP id y15-20020adff14f000000b0031f6e29df8dmr1563127wro.6.1694174512297; Fri, 08 Sep 2023 05:01:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694174512; cv=none; d=google.com; s=arc-20160816; b=OgN3+oi8gomR/r1/xNshLG/TQfk+aSUrX4vbjrR3SutKqY0LGo8OfCa6KZ/dElRYTS qujH111QcKNzF3xgjWAmj4OqVG9WMreiCFPcNy35GYdosbvu1FMZi85TBF0650EqKGdu lNLtzYqW7vVhvVF9xHKtHrdrpr44NM6Uia8DuyciDDDwDAL4sP29Yk17fpDiC+cHdCLf /qiJkQCQ28qOXZHc+xt9XH3zAaj41/rcIO10rOgQ9Q/QCjqUR94U0InUc/rpAAqYTdFY GGgtxt5Jdy0C/t7nyq4/ljVDhKb8y7EU8Iw97uhnGW2aVtolZOA8LUXY6V86hgTgv/33 ebbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=EK9+wNSGyoLl5i8R2JxFrSkGtZyUehxIu+xcnb+3/ho=; fh=lo2Vjgyv/ggZk8yIty16CtyHjEqk0MugRW6STG9XbrI=; b=BMquLsjMFqbG3LU63JfD74ToWaqczCv1ZgAsV1+6IkXDqE3NHEXK/W5c6G3xPg4cDs 5ejVH2ZpTa6fnKjE4ssIp+IStAhka91L3qa7AGyD+rK9UnZ/e828fPqGg3Um/jMOJIXL LkjTnvsJkHd80puxsxMwJsSOFYSrea+GwmITRfmBn6xDzFwWh/Zg1grf51yg9pKb7lJi PpV+bpeYuvDZC04xEBIKNSDI0kMOgU14I2SYJbRAOjQSSi49r1YJGhi34E75BWX8igJY 4MyXr+YgLujwkgeH9boJbFe1keK2ECSi49p8X1F0b1OmdLbPGp0wGxwp55Ub/q67ZgbN O05g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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 phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id z7-20020adfe547000000b00317774377b7si726781wrm.756.2023.09.08.05.01.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Sep 2023 05:01:52 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D74BE86A5A; Fri, 8 Sep 2023 14:00:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 0D25486A5A; Fri, 8 Sep 2023 14:00:49 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 69FFA86863 for ; Fri, 8 Sep 2023 14:00:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sughosh.ganu@linaro.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DF6BDD75; Fri, 8 Sep 2023 05:01:23 -0700 (PDT) Received: from a076522.blr.arm.com (a076522.blr.arm.com [10.162.46.7]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 792D33F67D; Fri, 8 Sep 2023 05:00:43 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Simon Glass , Takahiro Akashi , Tom Rini , Malte Schmidt , Sughosh Ganu Subject: [PATCH 7/8] btool: mkeficapsule: Add support for EFI empty capsule generation Date: Fri, 8 Sep 2023 17:30:01 +0530 Message-Id: <20230908120002.29851-8-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230908120002.29851-1-sughosh.ganu@linaro.org> References: <20230908120002.29851-1-sughosh.ganu@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Add a method to the mkeficapsule bintool to generate empty capsules. These are capsules needed for the FWU A/B update feature. Signed-off-by: Sughosh Ganu --- tools/binman/btool/mkeficapsule.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tools/binman/btool/mkeficapsule.py b/tools/binman/btool/mkeficapsule.py index b0599aa506..061463418f 100644 --- a/tools/binman/btool/mkeficapsule.py +++ b/tools/binman/btool/mkeficapsule.py @@ -96,6 +96,35 @@ class Bintoolmkeficapsule(bintool.Bintool): self.run_cmd(*args) + def generate_empty_capsule(self, accept, revert, image_guid, + output_fname): + """Generate empty capsules for FWU A/B updates + + Args: + accept (int): Generate an accept capsule + revert (int): Generate a revert capsule + image_guid (str): GUID used for identifying the image + output_fname (str): Path to the output capsule file + + Returns: + str: Tool output + """ + if accept: + args = [ + f'--guid={image_guid}', + '--fw-accept' + ] + elif revert: + args = [ + '--fw-revert' + ] + + args += [ + output_fname + ] + + return self.run_cmd(*args) + def fetch(self, method): """Fetch handler for mkeficapsule