From patchwork Sun Jun 19 04:56:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 582998 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:7814:0:0:0:0 with SMTP id b20csp748018mav; Sat, 18 Jun 2022 21:56:48 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vcx5sNixVpkd9L5V7rSsSqki4DpFlynkmGUHlv03w/ZA6e3YOsY6Z6R+rQkLywPVsoqUS1 X-Received: by 2002:a17:906:6a26:b0:718:e1a9:b86b with SMTP id qw38-20020a1709066a2600b00718e1a9b86bmr15423718ejc.271.1655614608544; Sat, 18 Jun 2022 21:56:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655614608; cv=none; d=google.com; s=arc-20160816; b=fxoHFfQknv9UFatLYI61RYSQYGNy+73o2y4ckqiVLKBr3Hcq9qzb8YvwUN2NV455XJ e0y9N++q70aVfb3fvqdm7LyLfts/IzCS+DvFPZjXNSP8VvDkC1T1eSeEJ+tzxpVsBSQt QdLwp78iH4Bs0uuhNT0E0GhU3yIu7/p5JRjhh5jvDvHnbvNrjY171FCUjh/XZa2GUHah RXrbFZh2TwfD2zLOS3AJ0E24Yyc/atuSay9VZQFy4Mok4ZLIhEnxXh/VMLmeN5o/ykC9 ua0KCXCSgJao/ZHpWItmIOQB2oIlpAh7gnF/qPCUzwpgGSczV0ZmGb6sFG743W3T+lfX FxWw== 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=EukiBs851NPSRHrvq1HxR29QEPHc03UA7I255m3KpHU=; b=CLvOU1sBtzEcKfnXIzxa+eD/Yivm0OEss9DBIOqLmLN5rQWyytLjza6sJ950fYPhHc 26wbMrH9ewZD5kJXUQEaNW9qjC+cG0dOxcRdWNiT/wlRsY8MBGXJ0xzkutSSxXRTkany vnu5KsYN3dgtiXy7GSH1mLMCKA2fU7V38D7mTtZAtRtZsanUW1ubX4RJcTBGHWj+VOOY 0DoZncHyBcX6T9vOwjs8aC36VZkHtRAoyOSvyGA0irmfLmvQxdcZhmVndbIxYQyFi+yq Q/ffA3rEorlxvGp33gQxavXnlxUyEMyf7F3ivssUpEuUJO+Mi+WPU/1aZ6RTngTQB6xQ /lUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I3K4n1Dk; 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 ga11-20020a1709070c0b00b006ff49b183e9si7227190ejc.971.2022.06.18.21.56.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Jun 2022 21:56:48 -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=I3K4n1Dk; 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 827C98445C; Sun, 19 Jun 2022 06:55:50 +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="I3K4n1Dk"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C96C38445A; Sun, 19 Jun 2022 06:55:46 +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-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 27BBA84453 for ; Sun, 19 Jun 2022 06:55:44 +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 d5so7039676plo.12 for ; Sat, 18 Jun 2022 21:55:44 -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:in-reply-to:references; bh=EukiBs851NPSRHrvq1HxR29QEPHc03UA7I255m3KpHU=; b=I3K4n1DkLzLBv+H1OJnfhrA5CnDSQDtwQ71+4HBSrMFnoQhR4rbEF+CWisYqqdYy7D fpvXy+KabTwtjue8EIyFt8Q0Ukr5aGk1a1RcWHte028kCEMRbgprQVYCtnvHNL5zai9A i9ZfL21x+imSqtFxcf5qKRQQaYfGh7g4Qmyof4gRwS2u0jsX9AxIzpZAJ55kA7GCwxED v6AvxLwFat47xZa6cCm6RyaaKybId9QEkycbbrODqUYmtIHDr1P58RcsAx2tZ6FiIero 7mIrHAp/j09CCuM+mb+8T7xNWVccRKg5+zkXhe/gG0syqTqxuibRrP40GbiSA+k7k7mx 9aUw== 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:in-reply-to :references; bh=EukiBs851NPSRHrvq1HxR29QEPHc03UA7I255m3KpHU=; b=Pu7Jly/A4nVnhr4Qs5X8DhXl6czOatrv4HDya9KKN1l5KhrucifHUvJHF2F99+9SC5 9yTWuSMoj+viylmgSVG1zsvwmXT1MSDRj2TCz7aA/PtqCubjknDiuJ5vgdILLVyKWEVK gLHLQs0KGOczlUKDLANX7teobMMNGULvfwdD2nxKeLgUVTgPSeJ7sZgaFnZDPdzc8EBy SXokgSSypBVlOT8Gt/poDysf+kq1d7PzhR/Iqkh5CMeUzzsygaYDlDtdQjbGUc3/vJhe joPmDK5dXbA/WKEmkHl0/5JLBL0gb2ugH3ZVWeNrXL4/E4cVNVU4ulvjybwzFPc4Hv+u Q/Hw== X-Gm-Message-State: AJIora9b6I0IiKh9YfyRM3m2ZgkVIJJ0hF8pvk8wTyzFT/DHtPSsTu4q E+O0t7lC/VG5NL3iGJqLQe/tYPXBhwKTBg== X-Received: by 2002:a17:90b:682:b0:1e3:142:a562 with SMTP id m2-20020a17090b068200b001e30142a562mr29792033pjz.91.1655614542274; Sat, 18 Jun 2022 21:55:42 -0700 (PDT) Received: from localhost.localdomain ([240d:1a:cf7:5800:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id 9-20020aa79149000000b00518424f8922sm6381848pfi.77.2022.06.18.21.55.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Jun 2022 21:55:42 -0700 (PDT) From: Masahisa Kojima To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Simon Glass , Takahiro Akashi , Francois Ozog , Mark Kettenis , Masahisa Kojima , Bin Meng Subject: [PATCH v8 8/9] doc:bootmenu: add description for UEFI boot support Date: Sun, 19 Jun 2022 13:56:06 +0900 Message-Id: <20220619045607.1669-9-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220619045607.1669-1-masahisa.kojima@linaro.org> References: <20220619045607.1669-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.5 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 --- No change in v8 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..69435090a2 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 behabior. + + * if CONFIG_CMD_BOOTEFI_BOOTMGR is enabled, execute "bootefi bootmgr" command + * "bootefi bootmgr" fails or is not enabled, then execute "run bootcmt" 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"