From patchwork Mon Sep 5 12:47:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 602738 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:4388:0:0:0:0 with SMTP id w8csp3641838mae; Mon, 5 Sep 2022 05:46:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR4pW5oJqfHkzkGVogtjf9EtO6P5TEkuWJN577syRbzO3imeVqMIaq4fgsWfor8weYnrjbFs X-Received: by 2002:a17:906:eec9:b0:73d:c369:690f with SMTP id wu9-20020a170906eec900b0073dc369690fmr36282759ejb.767.1662381970659; Mon, 05 Sep 2022 05:46:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662381970; cv=none; d=google.com; s=arc-20160816; b=mjyZdI3CNiRcCgUNFCa17cC7w7P5v1GFMSrCneh5Yi0Qi/wxchLXuJbdalRJR7w6pH XgivlsERIegRTSbltN/XnApCtbJms+r+53dGhvSyEoOLfOqU7SZ8hAX5nsXX+OCAnRq3 9kcl6dYHf5J+lVpNXAM+3GkFQcZiob2Ik11iJnqZMdQMV/Pe6MEske8Gmz4qEGxG3fbA JUsw+C6549Ko0waBHrPFv5dICajZACIZHfa8i3GJeSNdt3pzG/BH8w6vPSX93YdRibeJ YqopwBk+frETM4iotDdgGgCbrbaSSjNUNbDBdCykEgZe6M50O8AXd9Z37wd9MNN3CRo5 6ppg== 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=8yxg8Z3UEVyxc2Oh4WMICgvmyQqXtdOSN53cc07s7cE=; b=EjTX14aopXvkRP81NEg5Q1dlDFUAGeQh+rAzw3wfQxhRfNXGnO1vgOUWppP/aOjVzU aNAv5Kbp99c+Dt2nIuxEmWUyTBRcnTqeqVLAtxx/zq7i8pkB4OSlcx40PnKSUs+Z0ywG qQ8ivCHx3AxOsDvhtxYSkIBJasuDJnleRDfKCUtvN3nImsfpy8Oa4P8r9QydLAlnLPYc JZHEBI/J6RmP8FU74ZNOKUhAaQzskJKTCWD/jf8mATztulnOrQf7RW/GOiS0ytlXkN3W ntP1xOEbpucsFHCQFARAhITYdgFb+IolCMJDJuS0onU23oD1NDFWvvmR6c919RRBJNWH mgjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hXCZBJ2M; 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=pass (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 h30-20020a0564020e9e00b0044ea2b1c817si989259eda.244.2022.09.05.05.46.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Sep 2022 05:46:10 -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; dkim=pass header.i=@linaro.org header.s=google header.b=hXCZBJ2M; 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=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 79E1C84870; Mon, 5 Sep 2022 14:46:06 +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="hXCZBJ2M"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C81C784899; Mon, 5 Sep 2022 14:46:04 +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-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) (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 420EC8486B for ; Mon, 5 Sep 2022 14:46:01 +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-pf1-x434.google.com with SMTP id y29so8582161pfq.0 for ; Mon, 05 Sep 2022 05:46:01 -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:subject:date; bh=8yxg8Z3UEVyxc2Oh4WMICgvmyQqXtdOSN53cc07s7cE=; b=hXCZBJ2MZpEIhHn1t1w3kyTlPTHmdpN3vuL5yFo3KsteNDOOIg1i3WUHRQlIWBLiBr /pJeIbXtcFyFvoCwGccSv1Qp9rYWV8ePIdCw0wN3CCdAHxkIiRIbHx8Y1297auOaEvIl qhV68tH2k6whbjXJPuCb3cZ965eZN2/6/WD18LTO0hivu4UGSnmGku85JlqMlmU1xqD0 xFFAqwPRyT9+aUb01CRdVaHOsSfpOCvdvsC6FoiaUyrtIFv06fwyf+N0rE9FulwKJGVN YylWVlRNIA1Tx33jUiVG/m7XofssZQfLJDoTNVX7vximQaQ/REpvOfStqefOR4kVV5XZ IJCw== 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 :subject:date; bh=8yxg8Z3UEVyxc2Oh4WMICgvmyQqXtdOSN53cc07s7cE=; b=xnHeW4iCrC4SwrtlbSfaHUaVt/8R60Zogl7st1RbTi03CTNNcgZ4KYd7Fb0b3b9PuA UcCSCnsMjk0etsvs48Q0szyC4OjNq0toxt0n57UMIKmflX4e+0rq61mwjD2mx96zHWIJ hivv+I9APK4w3w1x9IUzfS4gpmibLhXXSvllIn0p67YSNFS1nOJ5xdqSy0YGStDLGIEn tXvB6avNRRtLfGJ6MXf542eyvTIQ7jFsbpoVw679/e8wwjZo7NVnverEdg7cfd+x7d0G OmBx3dHnKhxMvXzIeAMMXnJ7/w8Mdflei3nJCeDyFKQOLjjRLP31xsCTYWKc2yBmb25w 2+HA== X-Gm-Message-State: ACgBeo2FlPqu05fTkm1JmDjKbpGho3vq0v0a17K9FOmUZBPNANd53Y9z hjcOsWKBpAmt2Zd7DTjASg3raoUzjAEt6Q== X-Received: by 2002:a05:6a00:21c2:b0:52b:ff44:666a with SMTP id t2-20020a056a0021c200b0052bff44666amr50623941pfj.83.1662381959394; Mon, 05 Sep 2022 05:45:59 -0700 (PDT) Received: from localhost.localdomain ([240d:1a:cf7:5800:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id y64-20020a623243000000b0053639773ad8sm7660949pfy.119.2022.09.05.05.45.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Sep 2022 05:45:58 -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 v16 00/10] enable menu-driven UEFI variable maintenance Date: Mon, 5 Sep 2022 21:47:52 +0900 Message-Id: <20220905124803.2909-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_v16 [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 | 2458 +++++++++++++++++ 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 | 98 + 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 | 354 +++ 19 files changed, 3393 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