From patchwork Fri Aug 26 06:42:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 600259 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:4388:0:0:0:0 with SMTP id w8csp230752mae; Thu, 25 Aug 2022 23:41:25 -0700 (PDT) X-Google-Smtp-Source: AA6agR7ZFh9awUc7NLeg9iVXzVzjnqstcPLBfDVI6Rh6Gzr/vL5IDpH8IKQKcA6pH7uCSaMo2O/8 X-Received: by 2002:a17:907:7d90:b0:738:2f9b:9869 with SMTP id oz16-20020a1709077d9000b007382f9b9869mr4744729ejc.186.1661496085633; Thu, 25 Aug 2022 23:41:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661496085; cv=none; d=google.com; s=arc-20160816; b=I+LAPZLoQX8lup70BgfP94qLiJVO5KaWD45eo2RVKFSY7ah3XWBHQ98c2zAljOLe6G doLS0kOcHSpESFCIqutB/WZ6U99HYmbMf39ajb2qWRjmy3jbEQBxEClt1Hv3jXP110NS XwOMOmNLI8HfnYkUBkMjtWpXFCCaIcMaubGrOt9wAeAN+en9MeQ6IJKDysvBbU74aOCd m+CoW1+utjAPkFeo524JdHqo3IB4mO6aQOgrB/MhTgRvA+YHZAGZSXHuvOd2gGUB5b64 9mWhXo5WRiXLqjjJK11B8Lxa4Yl3Lm2Ua72+0ETCa8jKFIpOOlY8+sa4Bc6cVV018Zuh 8ojg== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=X9tNqbS7a54aXoBH75f4qduM3b+IXWFNS7CMlpWVsRw=; b=BjM65dCe+RYgdsRl3Co+yS1G+/VtmSrDJxESfpZ6fSUgzBA/lGV6stE4HytbjFAvii 9WwmhV8CVoNofvn8A1eiBrcrhgZyEi/0aXS7sMvh/N+gFRKq6CMul0CIGoSNW8U0NJPv /RXKLfxE40Fgd42J9SNI+5hO7B42k6W1UoQXYpM9ZLQrhv/FfNIpZiahBv46V0utfaeY g9oJza58TH2ZfZlpA2Ushek8o3Q5Q3dRKANO4z8e8B26tq4x2gginA3sgyUbbGuko06k FTXNg1XWQYg4ggqFL3PfILgHhz1iU/o3RU2w1BdtAM6UvaQ8Hjw2Z+f/Lo+REZ7ZsNbH CjqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bPFJrSBA; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id gs12-20020a1709072d0c00b0073e484d9d91si843145ejc.586.2022.08.25.23.41.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Aug 2022 23:41:25 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bPFJrSBA; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (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 850698489C; Fri, 26 Aug 2022 08:41:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="bPFJrSBA"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 036A68489E; Fri, 26 Aug 2022 08:41:21 +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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0256F84895 for ; Fri, 26 Aug 2022 08:41:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masahisa.kojima@linaro.org Received: by mail-pl1-x62c.google.com with SMTP id x19so811546plc.5 for ; Thu, 25 Aug 2022 23:41:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=message-id:date:subject:cc:to:from:from:to:cc; bh=X9tNqbS7a54aXoBH75f4qduM3b+IXWFNS7CMlpWVsRw=; b=bPFJrSBAxMdWLgCGvyDKsWFtdF1PPZOwGjQiKO8SNpu+/eh4sL/SfwIyLuih8vgSPp vAQRJwbhCaLAtyeYsOibAWmJAreBaTEdBKM/rrlh9frD+Dci7+JKPkPci/erSdY7CATv uflzlo28gnwCMyq/JWWc8Qoiuju+odcET5H//PVuIQjISHq7m+f+9m/A6tWNkrSh2ejG luranT1d0ie0cBfc/Bg/Kp2+IWwp9Oy2saKn56+qkpDW8mwYl3GAkzTaA96ce17o/ehv aFplZJ4VyFM3qbqk3objdcV404aaibYyEH+NElhUYvRtZ2ZpIbq67It9vcTQQ4u63b87 XyKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=X9tNqbS7a54aXoBH75f4qduM3b+IXWFNS7CMlpWVsRw=; b=7HqvljAhBRVObLupeYOGxImIxR2VxdTRBTsUKC9z/QPlhedSLtsPnT36CP+9vLA01s 4RRB7Ex8j2qFb95rL9zUrihjsSMZ4zGECCfmW8qKjmCJ6NHr9ZUiWYqsA3E+pzautPkl HCQySR5HjKY4xC8P6DR3c0yD3G/wnk11LadfaOD2LC/phyr/3EllblNZtePZSAoOTY30 zaA+C5ZL1fPGxVEod9ew4NW0p2HQ03Pc8rgTZ2OYbN3jPaHXgF2InfvopSHRPN00deqL fdGesTfN+IEHmf6hSA1n5qExQ1ATaN1dsRomalLAMazwEgCqr6aKHG6Agvg7POTmRofa 0t9A== X-Gm-Message-State: ACgBeo2TkGsgyIlT0I0gqnhzMxN0N77ceJCmod3xkU2al5MLGYH9/jvg aj83t4u2BRpdLf5qPPRrCqVx4p14WBYTkA== X-Received: by 2002:a17:90b:180e:b0:1fb:25ce:f77e with SMTP id lw14-20020a17090b180e00b001fb25cef77emr2802432pjb.75.1661496076048; Thu, 25 Aug 2022 23:41:16 -0700 (PDT) Received: from localhost.localdomain ([240d:1a:cf7:5800:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id f8-20020a170902ce8800b0016d62ba5665sm694641plg.254.2022.08.25.23.41.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Aug 2022 23:41:15 -0700 (PDT) From: Masahisa Kojima To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Simon Glass , Takahiro Akashi , Mark Kettenis , Masahisa Kojima Subject: [PATCH v14 00/10] enable menu-driven UEFI variable maintenance Date: Fri, 26 Aug 2022 15:42:13 +0900 Message-Id: <20220826064223.23288-1-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 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.6 at phobos.denx.de X-Virus-Status: Clean This series adds the menu-driven UEFI boot variable maintenance through the "eficonfig" new command. This series also adds the removable media support in bootmenu. Source code can be cloned with: $ git clone https://git.linaro.org/people/masahisa.kojima/u-boot.git -b kojima/eficonfig_upstream_v14 [Major Changes] - there is detailed changelog in each commit Masahisa Kojima (10): eficonfig: menu-driven addition of UEFI boot option eficonfig: add "Edit Boot Option" menu entry menu: add KEY_PLUS, KEY_MINUS and KEY_SPACE handling eficonfig: add "Delete Boot Option" menu entry bootmenu: add removable media entries eficonfig: scan media device in eficonfig startup eficonfig: add "Change Boot Order" menu entry doc:bootmenu: add description for UEFI boot support doc:eficonfig: add documentation for eficonfig command test: unit test for eficonfig cmd/Kconfig | 7 + cmd/Makefile | 1 + cmd/bootmenu.c | 22 +- cmd/eficonfig.c | 2432 +++++++++++++++++ common/menu.c | 9 + configs/sandbox_defconfig | 1 + doc/usage/cmd/bootmenu.rst | 74 + doc/usage/cmd/eficonfig.rst | 71 + doc/usage/index.rst | 1 + include/efi_config.h | 97 + include/efi_loader.h | 53 + include/menu.h | 3 + lib/efi_loader/efi_bootmgr.c | 7 + lib/efi_loader/efi_boottime.c | 52 +- lib/efi_loader/efi_console.c | 70 + lib/efi_loader/efi_disk.c | 50 + lib/efi_loader/efi_file.c | 75 +- test/py/tests/test_eficonfig/conftest.py | 40 + .../py/tests/test_eficonfig/test_eficonfig.py | 351 +++ 19 files changed, 3363 insertions(+), 53 deletions(-) create mode 100644 cmd/eficonfig.c create mode 100644 doc/usage/cmd/eficonfig.rst create mode 100644 include/efi_config.h create mode 100644 test/py/tests/test_eficonfig/conftest.py create mode 100644 test/py/tests/test_eficonfig/test_eficonfig.py