From patchwork Fri Jul 22 02:39:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 592447 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b811:0:0:0:0 with SMTP id fc17csp99439mab; Thu, 21 Jul 2022 19:36:21 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tl7G5YqmEDaUC6tIOgaSt+VD6pIe+llZ/0TNU9S/MsAkZA/IwbNAIIa3CYGaePoCorBEp9 X-Received: by 2002:a05:6602:27cd:b0:669:3d8d:4d77 with SMTP id l13-20020a05660227cd00b006693d8d4d77mr556825ios.216.1658457381052; Thu, 21 Jul 2022 19:36:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658457381; cv=none; d=google.com; s=arc-20160816; b=TKJ8WLhouKSO1E4R5hZF2VEI4/pduIE3NP4V/JxPnGePlfq2+i29NhjzqEbZ37Lp84 AXeFf/QSaYCnDl1LixTLEoubbYZWwbfJSgrEJj3mcn5nwL2XR0qq+nOxXbrRcPNLidNL KEj0bvA6ePVGQp9MlVcFR0BKWow2jvIX17JAdYsAcpCJIpghLeJbb1ecSOQMgWOYprYT FSqO5RVueZW8ZTss6e0goNjaS0DvrGj2I+06g4fHcGZy3CKBnixKQzWrfJAE0SlbaPN8 10WM0v6d3k/wn3BUge+qRZCH1sKZ0p+8yW2Ux6+Tqbl2PoofzsMYu2wGN9ExT+CeS1r0 Zpvw== 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=O0NeMpf7zjp8AbrpYa4VzhN4q5h4GS9p9SLTUbj1G8M=; b=lTo4iSAzDGbW34rPmH6YA3Ua/b1QTRQPkntRqDi++h/MSihQRO1iyuX3QBh1Qw+gDW kBoU8TkdGTrgh4fMbcJTni+tWmOf98ffUZ/etUJih7eukK9U3ecn/Nrf8AHk62msVjeH 9hejlp1nIGPoC8JUOdnCx7LaKGL4qSHUoiY/GtdC6mTqL8IR7cbmhZE4pBdY/Ufg9OTQ EtZox0i2c1eHuj+vgJU3GH/TV0OK8NiePH3tVwrAJtMmqLEb1E7vuhpfFVItyCGUagXr gjyL36TMCA8ubPDhR6A/t2DrbfnWM6NNpFa1qyBLMpstFc9T8vITCC101A/oLIhQYuwB kYaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ya0I5MnD; 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 t14-20020a056638348e00b003418222fda6si3830580jal.1.2022.07.21.19.36.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jul 2022 19:36:21 -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=ya0I5MnD; 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 5608383D7F; Fri, 22 Jul 2022 04:36:16 +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="ya0I5MnD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 36206840A6; Fri, 22 Jul 2022 04:36:15 +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 autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) (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 BD5C38300F for ; Fri, 22 Jul 2022 04:36:11 +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-x635.google.com with SMTP id c6so3479181pla.6 for ; Thu, 21 Jul 2022 19:36:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=O0NeMpf7zjp8AbrpYa4VzhN4q5h4GS9p9SLTUbj1G8M=; b=ya0I5MnDNuHthwYtLYJ38n9J54oLRQRniQp2PAyUcN5BE9S7k5EARfBoaOiN3jBWgl gUsSWDijFgm4FvI+E3j6xKDly/kss0BdRLt7NCrSBESZs5JDGxyzn5ysfNBI2OsfXoWH qpxmxzKzbJvDfdcZwWNSn9JevPaT9SqJXmgK6pb+xyvksC95i9OymSVvw5Gd85t4nuZt Ta6bZX5fIggmO7t3xjCF49cbvab8TnwMbyJAsLEaqjHv8l5uS3n1n0oLDfvAO4+6eDwQ 3Lhorr717ZtiTx0XftIclHUUA2V8/2d7/S5Yto5clDAUCyRKwATg75sxcoBi/JOFEfLo zfUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=O0NeMpf7zjp8AbrpYa4VzhN4q5h4GS9p9SLTUbj1G8M=; b=2MdA2geFGXdcpupnkQMkIo1j8V6PjxAVgHgqtnncknaqzGqiElzpcY/gc8q9uIEF9L voj4W/Zj1XbNxwJKx8RoONsG7oQkc7t9QK3M2jNnV7cEW35tZrVnCN4fg0UC4NX1UIiH aCl4BKFUCl5+eJ8DN69Sx66fRkivqd49ZoKDenVykBMbDY8EVdXR80CbPgqqiCbrMhEm AlhRcqI0OFf7c4HUkBMAzRFvCLVQP1L3WmbbwuPmCV8o9BLZq01qvUMFs1E2CdSwCbfz LbwzLNgGV2j6bmaibGl1mu+s/pQ/SxVyTriLKE1hJv6kKgTYm2m+AHrZ6duxpIPUz+an hHSA== X-Gm-Message-State: AJIora/dxWzZNGBtiC1EggrO4XCEBpbpB4GQ2omaJJVXKbpvo2iG3l5G oAYQtKkR0VZ2we+kRcRGHFbQ727zG4jNzA== X-Received: by 2002:a17:902:bcca:b0:16d:3e8a:bb5a with SMTP id o10-20020a170902bcca00b0016d3e8abb5amr1248943pls.94.1658457369774; Thu, 21 Jul 2022 19:36:09 -0700 (PDT) Received: from localhost.localdomain ([240d:1a:cf7:5800:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id k21-20020aa79735000000b0051c758a3957sm2509896pfg.149.2022.07.21.19.36.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jul 2022 19:36:09 -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 v10 00/10] enable menu-driven UEFI variable maintenance Date: Fri, 22 Jul 2022 11:39:09 +0900 Message-Id: <20220722023919.19676-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_v10 [Major Changes] - rebased v2022.07 - add initrd file selection - add python based unit test - there is detailed changelog in each commit Masahisa Kojima (10): efi_loader: move udevice pointer into struct efi_object eficonfig: menu-driven addition of UEFI boot option eficonfig: add "Edit Boot Option" menu entry menu: add KEY_PLUS and KEY_MINUS 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 | 2103 +++++++++++++++++ common/menu.c | 6 + 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 | 67 + include/menu.h | 2 + lib/efi_driver/efi_block_device.c | 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 | 65 +- lib/efi_loader/efi_file.c | 75 +- lib/efi_loader/efi_helper.c | 13 + test/py/tests/test_eficonfig/conftest.py | 40 + .../py/tests/test_eficonfig/test_eficonfig.py | 325 +++ 21 files changed, 3109 insertions(+), 63 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