From patchwork Wed Aug 17 09:36:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 597839 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b345:0:0:0:0 with SMTP id w5csp3086931maz; Wed, 17 Aug 2022 02:35:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR7oZkoW8gKHnql4w35LWVkTh0GSltDb5dJub969wu/z9MmqZEdG2R4vk2BW4UDDd5BbXoJ9 X-Received: by 2002:a05:6512:3d8e:b0:48a:eff4:6b03 with SMTP id k14-20020a0565123d8e00b0048aeff46b03mr8174069lfv.49.1660728946541; Wed, 17 Aug 2022 02:35:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660728946; cv=none; d=google.com; s=arc-20160816; b=WBiRj8QS/V93FOotMElOAVWdNiS9sc9YJ8VswLs+qc/MyMexI/xRTxWnIDA3HZcWFu 9oEZfxHH3PaalhbCFuIR+Y3VatuKFIw/w12vu8E+0+rdD+sTT8VYyOY4QMUBUvfJemHJ U8kSNOX1CKdHNfciUz4NP2Q8e2qX+2oUeWOvJZj5bxsmE2bQLxxJhwhqPjxQz/pwH/bd pZXeqDG0rB6mKLIxoLQbgO4EqVw2ngBMaisw4fWwNfnsNjOgkXa29720srukX322wC99 Ss+mHgC9KMzjdk3Zd3ITQQJjGi05821WlJu5rECmkaX6+/QluawbtRoVr88O6jbsfL/n hNpQ== 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=znSE3nUseowzoPIDGB4XTH+/0SitIHyzTLzthTSoMYc=; b=qkDKYQ2JBMdgz+cg/phh3V2trQpAyg0oPT/RLoYp16u4h7tbXNSKMujiON/1ZNpXe8 Oj0S7OwmdmWkrwn77DeuJXmNGNzdIR0BvsnOCwwBMGWJg8dtjzZF5A4NKZ0qa1ub8t/V RR45JQBDBQ8iCzBa2h9m3R9Hf/gWPmEE1dGPUiyZTXaV43PMoKao+/ib/hceM+8zg7Rt gVYKQtzvHh2LhgG/PY/oNF7Xiq8PJvM06bXCTtZCZ4Q3DPdn1Nr+iNwyf2d2fEapZOFl Sq5RNLidnTjVjJZNS6bYxoEMgWD8IF/piOiJZvleU3DaCcUWixc/UVTG+zbv6t9Eivc6 H8Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LddYgSwX; 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 z40-20020a2ebe28000000b0025e4952f5e5si7951104ljq.325.2022.08.17.02.35.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Aug 2022 02:35:46 -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=LddYgSwX; 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 D7047847EA; Wed, 17 Aug 2022 11:35:42 +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="LddYgSwX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 39C7C847EA; Wed, 17 Aug 2022 11:35:40 +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-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) (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 DD17B84242 for ; Wed, 17 Aug 2022 11:35:36 +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-x62f.google.com with SMTP id m2so11557586pls.4 for ; Wed, 17 Aug 2022 02:35:36 -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=znSE3nUseowzoPIDGB4XTH+/0SitIHyzTLzthTSoMYc=; b=LddYgSwXIdiyfUujARloykJb2USsbmj2xbN9TLxOBsbdoLsg0050YA5Gk4TkrUY0zt Ptn9/1FdndZSNhO9eISCQVhXfl4P+AuxvSJ45Vcj6OHuTmqP19edr9pqVR3TFN0VKwT0 5nhW+zr/ve1tOIBivOYGxjUax5zimUn6GvgS0HcMCm6pIXmnJvF4YxEsvHmTttQnyZv3 0L30Ekj+DfwZ9bml+akoYbuWp0JGDT3mBt0M3QtdLAABlOdgxxDEnfa+mQ9Scst48aPf kIJj6hYYaYanUvVYtljYHMjhoRAsC0Gjj1MIQCAABWm09VRlM3wovs1icmyO8xkDmgKY D91Q== 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=znSE3nUseowzoPIDGB4XTH+/0SitIHyzTLzthTSoMYc=; b=k4n6ekka+t48nwlzJgS4XmqsaS5NYHlQd7ocsyRrLSJE/Zpzk+BF8BR9g3mjs47dXn xGgdN0CfrgG7t22i7owG02tbGYld6P/oT8u2drWHp9fBEZzCyNai5xQej+QV84gi9SEZ fwDaBnw30ifJ5zzGpakQcTyhnZsVhS/j4h2xdQ2BdQ0B91+W6mcjCv25lrSGGAMiNyAp rCD3R69bZHzfO5xr2E6VpvmVHHjxogigroD4e+Z5XSk9QFEMdCmyUuKVnNC/NXwXnINI agOt4W1YIwaDovai/XKZ6U8HT2aeqm0I/kES3I3p8dU/rl842RPZpUsChkdHG0JF0cO8 0Ckw== X-Gm-Message-State: ACgBeo3MuvGklMUVoHEyQBcUksgIkBVPHnssvYLKbkUf6gDREtZ6tU2P DYnhYPs/lbk1d5ds2Alo4YincrZWCFqosw== X-Received: by 2002:a17:90b:3a88:b0:1f5:59e0:437 with SMTP id om8-20020a17090b3a8800b001f559e00437mr2900419pjb.199.1660728934918; Wed, 17 Aug 2022 02:35:34 -0700 (PDT) Received: from localhost.localdomain ([240d:1a:cf7:5800:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id q16-20020aa79610000000b00528669a770esm10214285pfg.90.2022.08.17.02.35.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Aug 2022 02:35:34 -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 v11 0/9] enable menu-driven UEFI variable maintenance Date: Wed, 17 Aug 2022 18:36:05 +0900 Message-Id: <20220817093614.32266-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. Initrd file selection and python based unit test are added in v10. Source code can be cloned with: $ git clone https://git.linaro.org/people/masahisa.kojima/u-boot.git -b eficonfig_upstream_v11 [Major Changes] - rebased to efi-2022-10-rc3 merge commit:20d4c6052fe5 - there is detailed changelog in each commit Masahisa Kojima (9): 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 "Change Boot Order" menu entry eficonfig: add "Delete Boot Option" menu entry bootmenu: add removable media entries 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 | 106 +- cmd/eficonfig.c | 2302 +++++++++++++++++ common/menu.c | 9 + configs/sandbox_defconfig | 1 + doc/usage/cmd/bootmenu.rst | 74 + doc/usage/cmd/eficonfig.rst | 63 + doc/usage/index.rst | 1 + include/efi_config.h | 91 + include/efi_loader.h | 63 + 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 | 325 +++ 19 files changed, 3288 insertions(+), 52 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