From patchwork Wed Aug 17 09:36:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 597846 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b345:0:0:0:0 with SMTP id w5csp3087592maz; Wed, 17 Aug 2022 02:37:16 -0700 (PDT) X-Google-Smtp-Source: AA6agR7Rk8Jhs9FXzX82QYbjvC57pq8P1EUKdZ4OH0bfJHOjBmV4ehnfsxBt3Pr2HkS8dXTE0J20 X-Received: by 2002:a2e:bc1d:0:b0:25e:67c1:c6c5 with SMTP id b29-20020a2ebc1d000000b0025e67c1c6c5mr8020026ljf.151.1660729036206; Wed, 17 Aug 2022 02:37:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660729036; cv=none; d=google.com; s=arc-20160816; b=E6lJxsyAPXVIcdIpw6JiDw0t/LubVIieohhcrfIcW/R4opKmphyzdRKTDgLuMN6O6u Yu5ZVyA99JW83AnMErSr3D8z3yUfivU7ExtfsDdMbx5DSfV8WLFopYibHGOqv4smgYO/ IgRs9LmjTTmocU+0PMhzxQSt5dSMbsTCwM2cEq9jBtI2q735QHU5B6OVdIDFBhnnVNni +TI30x0zIr1cr3rzd9OlFJF0o9MSwzXQ9BjWkbowH7Go9+I+li1I9Xabt2rZI/AkXsPC zJsKy5zw+4zIn87oTkR5PmoV+ntN9sjyy8jazmWkLH09xnnS4ilesakNh4b4GXNyH6d3 Q7zA== 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:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=pUd+ePSJtY4udK76FusNe0a668i93KjS6Rry/1J6Nkk=; b=GprGjENS0ppDY4+TzM9jZ5USLpSkwU3Ir5RlKe3vkZsqJYf+goo4qPGKaJkuQTE0gF O7qF2M68XYvyzx1zgLgw6hRS+9k20+luAD5kKBwnJqTC7E3B5qLmNJCH7XE6FsuZzj4U DV64CBqxU4heMAOm5rJ05ChbC8l4DOMr65084C5itnQryOltHJ7c783Id3nCr2ydJsQb ralt0bCA6c+Aaf9zt+Uy+boiKWgJ6i4paVIOUoF7QixgD9GChveLOvI5VfxA+lcpmB0N OzXZ06zDSGm/n17fcEB5zeN+akiMdxBDjxQyZV1I61i6eX24qzqp0IZx21MnmRwfv/lC xrWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PnAm5MhF; 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 k22-20020a2e2416000000b0025e59f19067si7305981ljk.544.2022.08.17.02.37.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Aug 2022 02:37:16 -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=PnAm5MhF; 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 56021847EA; Wed, 17 Aug 2022 11: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="PnAm5MhF"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E6303849FA; Wed, 17 Aug 2022 11:36:05 +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-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) (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 D5E2F849F3 for ; Wed, 17 Aug 2022 11:35:59 +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-x631.google.com with SMTP id jm11so9318933plb.13 for ; Wed, 17 Aug 2022 02:35:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc; bh=pUd+ePSJtY4udK76FusNe0a668i93KjS6Rry/1J6Nkk=; b=PnAm5MhFLZoU8QABKjYrGgOOKeKmKdjfkW/84vKesek6TFbD/oJnawCCr5H/0IXz4u reqRFTmeSGw4ApaNw8ZWR44HbvgudbrfQwOaQqdPdmaoo5PebGQvVcDDlF9IC/DRAlLy vxEtiQGZENiAgVKXmSREwHNhkp+RX0YSkIyBU2QDELdw9zVydgGVhvLGoV+PKHI8CCzw vxm7J5li4SYf7vAbAZOJj78Sxx4n2VrTbSfHho4zxIHLimaMf4p/9fcRQ7Pdoq8a20dt Whg1JSek/UZogRzyoP5+9JZWsN3rImgPYTtNyRnp60z7lFy5LvSfBfqtk4OM7UWEHG1R 4MWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc; bh=pUd+ePSJtY4udK76FusNe0a668i93KjS6Rry/1J6Nkk=; b=R5yMtyrZ8Fiex9q9TAkpZ0eP82kPUMCq1ktgOS1N1wU3U/dcQ/PENkU7JzXTujESYf 47J2NrTUpNw4kksqfFJDXe3rO+TSj/nXOGaITILxpSvzTYoKFVHqbFM0YmI2DVt4TrxD DIi0BIe+HAiG4vzResP6HEU55Q6VaSOUMb9M8wZVpfjuz29QpGVpQ6ScFByc2CHBSggq JtHpu9cagPDfpp3JqDanuXrtAKgfoSB8N3yg3TZgb/qg8F6FtSTAB3xe4ZXRnpj6exR/ pTTWjz64KhHECBMUvhovCZjnH0083OB9YKPWTRjYvbhrKofze8VbwWPHDB9s+LfU10TU bP/A== X-Gm-Message-State: ACgBeo2j/KMuMw3PADN9+H9rPApvNYifLN+LXOA0XPFsmyD4Tpw+q/2h BxzY2kqlr/+4MX9oETzPoU80WGBMyfl05A== X-Received: by 2002:a17:90a:c483:b0:1fa:a442:ed8a with SMTP id j3-20020a17090ac48300b001faa442ed8amr2901348pjt.151.1660728957930; Wed, 17 Aug 2022 02:35:57 -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.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Aug 2022 02:35:57 -0700 (PDT) From: Masahisa Kojima To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Simon Glass , Takahiro Akashi , Mark Kettenis , Masahisa Kojima , Bin Meng Subject: [PATCH v11 7/9] doc:bootmenu: add description for UEFI boot support Date: Wed, 17 Aug 2022 18:36:12 +0900 Message-Id: <20220817093614.32266-8-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220817093614.32266-1-masahisa.kojima@linaro.org> References: <20220817093614.32266-1-masahisa.kojima@linaro.org> 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 The bootmenu enumerates the UEFI boot options for boot device selection. This commit adds the description how the UEFI boot work in bootmenu. This commit also adds "Synopsis", "Description" and "Configuration" sections to follow the U-Boot command documentation format. Signed-off-by: Masahisa Kojima Reviewed-by: Ilias Apalodimas --- No update since v10 Changes in v10: - fix typos Changes in v7: - update the description what bootmenu do for uefi-related boot menu - add default behavior when user exits from bootmenu Changes in v6: - remove distro boot related contents because the distro boot support in bootmenu is dropped - update uefi entry example - add [delay] argument of bootmenu command - add description to enable uefi boot entry Changes in v5: - follow the cmd documentation format same as other command, add "Synopsis", "Description" add "Configuration" sections Newly created in v4 doc/usage/cmd/bootmenu.rst | 74 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/doc/usage/cmd/bootmenu.rst b/doc/usage/cmd/bootmenu.rst index 9430f8c9aa..cb3c8d2f93 100644 --- a/doc/usage/cmd/bootmenu.rst +++ b/doc/usage/cmd/bootmenu.rst @@ -4,6 +4,15 @@ bootmenu command ================ +Synopsis +-------- +:: + + bootmenu [delay] + +Description +----------- + The "bootmenu" command uses U-Boot menu interfaces and provides a simple mechanism for creating menus with different boot items. The cursor keys "Up" and "Down" are used for navigation through @@ -79,6 +88,55 @@ The above example will be rendered as below:: The selected menu entry will be highlighted - it will have inverted background and text colors. +UEFI boot variable enumeration +'''''''''''''''''''''''''''''' +If enabled, the bootmenu command will automatically generate and add +UEFI-related boot menu entries for the following items. + + * possible bootable media with default file names + * user-defined UEFI boot options + +The bootmenu automatically enumerates the possible bootable +media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL. +This auto generated entry is named as " :" format. +(e.g. "usb 0:1") + +The bootmenu displays the UEFI-related menu entries in order of "BootOrder". +When the user selects the UEFI boot menu entry, the bootmenu sets +the selected boot variable index to "BootNext" without non-volatile attribute, +then call the uefi boot manager with the command "bootefi bootmgr". + +Example bootmenu is as below:: + + *** U-Boot Boot Menu *** + + mmc 0:1 + mmc 0:2 + debian + nvme 0:1 + ubuntu + nvme 0:2 + usb 0:2 + U-Boot console + +Default behavior when user exits from the bootmenu +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +User can exit from bootmenu by selecting the last entry +"U-Boot console"/"Quit" or ESC/CTRL+C key. + +When the CONFIG_BOOTMENU_DISABLE_UBOOT_CONSOLE is disabled, +user exits from the bootmenu and returns to the U-Boot console. + +When the CONFIG_BOOTMENU_DISABLE_UBOOT_CONSOLE is enabled, user can not +enter the U-Boot console. When the user exits from the bootmenu, +the bootmenu invokes the following default behavior. + + * if CONFIG_CMD_BOOTEFI_BOOTMGR is enabled, execute "bootefi bootmgr" command + * "bootefi bootmgr" fails or is not enabled, then execute "run bootcmd" command. + +Configuration +------------- + The "bootmenu" command is enabled by:: CONFIG_CMD_BOOTMENU=y @@ -88,3 +146,19 @@ To run the bootmenu at startup add these additional settings:: CONFIG_AUTOBOOT_KEYED=y CONFIG_BOOTDELAY=30 CONFIG_AUTOBOOT_MENU_SHOW=y + +UEFI boot variable enumeration is enabled by:: + + CONFIG_CMD_BOOTEFI_BOOTMGR=y + +To improve the product security, entering U-Boot console from bootmenu +can be disabled by:: + + CONFIG_BOOTMENU_DISABLE_UBOOT_CONSOLE=y + +To scan the discoverable devices connected to the buses such as +USB and PCIe prior to bootmenu showing up, CONFIG_PREBOOT can be +used to run the command before showing the bootmenu, i.e.:: + + CONFIG_USE_PREBOOT=y + CONFIG_PREBOOT="pci enum; usb start; scsi scan; nvme scan; virtio scan"