From patchwork Fri Sep 8 11:59:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 720804 Delivered-To: patch@linaro.org Received: by 2002:adf:eec5:0:b0:31d:da82:a3b4 with SMTP id a5csp719923wrp; Fri, 8 Sep 2023 05:00:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGC8s3INV4zS4w789vd6XYKMoejLU4cWfFXB+qrhJ0YF1r+qYHCv0qHSPl55n6gHHLVLUsB X-Received: by 2002:a5d:6441:0:b0:319:8bd0:d18c with SMTP id d1-20020a5d6441000000b003198bd0d18cmr1787987wrw.52.1694174430650; Fri, 08 Sep 2023 05:00:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694174430; cv=none; d=google.com; s=arc-20160816; b=fgVhDCa8E4TowV0ul76SS13igA3Dfx47XSZZv+K6WWSDYEOSHMfRa0KDj5cbFOP/sa 9xAumxEnQXt9gYnWsbT3CgiK/ktzAgJHE3EcUf51CylED1LDuTqfjMV9Fi2dKGQ7rZQN SK500C2W8zTHhHGs8wvtM+lFxd67Gya/DRp2AazlX2uQiM4L7PT2GH7S5tOGD/FfzYnu ywRkZF3Lsoott/5cNkhwQdw+9P0uvHhTfmyDsjg8KSqpW9omM4hKrpKDCOrKD81e/8MJ scbr15tagTAKJ2TcEUrzwIY7RuXRL93POdtMZFUU9kvirzGFZl7M0oZy1/AkfZTb3kHq q1Tw== 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:message-id:date:subject:cc:to:from; bh=TGbge3A2oisFeC+VzI3RZTgNJ6pePHAImKtcjj2JKls=; fh=0atEs6MDHTghhRhS6JCU//KDs2Pya43kAnBLY+wA7nA=; b=iLE/P1kdx3qvX7U5HUg5tYDXc9QV1QP4Z8AfXrOjbkxNzHDzXLy3Arv2T4b52NMgrA 6M4cPEX/1K7nST0p2NMIdPcB22On3Q43/ndWwj494gPpqiMhKrefMoJ0fVNmfdOP0m/1 /JFthaZXUHAIofcmSL2etSX00FVPZys7WVkqpM8shFZE4sGpCAtnIdWKl+DtQ4upTmBp 7vsz5zcLLdzVx9qtU9u2wAeP7xT5ZNFcvm4HsdYpXl3q3elB+W5Llz4pSBDfLaOKDQ+Y NKFQJ+izPayJmPkCuFllY9gy9Y6Rot+QFjzj3BZHYIoaVqI+BTbmDlvt7Gjn1SoU33xs qwUw== 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 c8-20020adfef48000000b0031de820dc26si730178wrp.205.2023.09.08.05.00.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Sep 2023 05:00:30 -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 8245286A04; Fri, 8 Sep 2023 14:00:29 +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 AB02F869F9; Fri, 8 Sep 2023 14:00:28 +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 C700286863 for ; Fri, 8 Sep 2023 14:00:25 +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 EC9BFD75; Fri, 8 Sep 2023 05:01:02 -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 BFA923F67D; Fri, 8 Sep 2023 05:00:22 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Simon Glass , Takahiro Akashi , Tom Rini , Malte Schmidt Subject: [PATCH 0/8] Add some more EFI capsule tooling support Date: Fri, 8 Sep 2023 17:29:54 +0530 Message-Id: <20230908120002.29851-1-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 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 Recently, a set of patches were merged in next, which were adding support for generating capsules as part of the U-Boot build. Mid way through the review of those patches, it was decided to drop the patches for generating capsules through a config file. That was primarily due to the use of absolute paths in binman for testing the capsule genertion through config file. Now that the base set of patches have been merged, this series is picking up the remaining patches for review. This series addresses the concern that Simon Glass had with the use of absolute paths. The first set of patches are adding support for generating capsules by parsing the capsule parameters through a config file, and adding a binman entry type for this. These are patches 1-5. The other set of patches is for generating empty accept and revert capsules through binman. These capsules are needed for the FWU A/B update functionality. Sughosh Ganu (8): tools: mkeficapsule: Add support for parsing capsule params from config file btool: mkeficapsule: Generate capsule through a config file binman: capsule: Generate capsules through config file doc: Document capsule generation through a config file sandbox: capsule: Add a config file for generating capsules test: capsule: Generate capsules through config file btool: mkeficapsule: Add support for EFI empty capsule generation binman: capsule: Add support for generating EFI empty capsules configs/sandbox_defconfig | 2 + doc/develop/uefi/uefi.rst | 70 ++++ .../test_efi_capsule/capsule_gen_binman.dts | 8 + test/py/tests/test_efi_capsule/conftest.py | 18 +- .../test_efi_capsule/sandbox_capsule_cfg.txt | 162 ++++++++ tools/Kconfig | 16 + tools/Makefile | 1 + tools/binman/btool/mkeficapsule.py | 45 +++ tools/binman/entries.rst | 35 ++ tools/binman/etype/efi_capsule_cfg_file.py | 66 ++++ tools/binman/etype/efi_empty_capsule.py | 91 +++++ tools/binman/ftest.py | 81 ++++ tools/binman/test/319_capsule_cfg.dts | 15 + tools/binman/test/320_capsule_accept.dts | 16 + tools/binman/test/321_capsule_revert.dts | 14 + .../test/322_capsule_accept_missing_guid.dts | 14 + .../binman/test/323_capsule_accept_revert.dts | 17 + tools/eficapsule.h | 115 ++++++ tools/mkeficapsule.c | 87 +++-- tools/mkeficapsule_parse.c | 352 ++++++++++++++++++ 20 files changed, 1190 insertions(+), 35 deletions(-) create mode 100644 test/py/tests/test_efi_capsule/sandbox_capsule_cfg.txt create mode 100644 tools/binman/etype/efi_capsule_cfg_file.py create mode 100644 tools/binman/etype/efi_empty_capsule.py create mode 100644 tools/binman/test/319_capsule_cfg.dts create mode 100644 tools/binman/test/320_capsule_accept.dts create mode 100644 tools/binman/test/321_capsule_revert.dts create mode 100644 tools/binman/test/322_capsule_accept_missing_guid.dts create mode 100644 tools/binman/test/323_capsule_accept_revert.dts create mode 100644 tools/mkeficapsule_parse.c