From patchwork Mon Sep 12 08:33:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 604988 Delivered-To: patch@linaro.org Received: by 2002:a05:6504:2213:b0:1da:4c02:b5e7 with SMTP id z19csp2444195ltw; Mon, 12 Sep 2022 01:35:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR7dEtZ6bHPFGbWklTv7NwLqbHMwB5VcYQix8mcvw/G5lC3gkbUEml0XwSqeMTkx9dCLcGmw X-Received: by 2002:a17:907:7625:b0:779:e6f7:a669 with SMTP id jy5-20020a170907762500b00779e6f7a669mr9927053ejc.472.1662971750359; Mon, 12 Sep 2022 01:35:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662971750; cv=none; d=google.com; s=arc-20160816; b=vSM8ky+DELYCQ8VPYS9/ZYRXMJ9ct1VaenfIiYXe6jOTnVC2vCX+hreSUv33uTguIb aFDcvlOf+HJ4BNlR17EuSuE8tpwRtKcjD8soaaapyRphX1CtgepAbWsn2pz/Gygipzz9 4EEcXwy45c9rd4UAX8A26D1P3XeqCKwbkwT/YENTCLQN/AEEAt4lY9RrZ1Pm9ZC/uROZ HwQ0/v8exu3nCsN9tWucNIzwRJeAQLYwvncdwEHv2DHIyE1xHP/bRSVEHvHuih/xDFFZ lFttDWnYvwoc/GeuAq8PIE1fxyEPYnKRdoXJ7lGYY/NWCuTDWACtJjTyoVx/sdi9RaxC c8Bg== 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=PrstQTOcIEN5qMUhd8O2mrj+u2PChvZja2MuYxslSJ/TRbiyVe42FAlLX75vF6f7Rp YJUvf6t+uNvyQxjDuy8IjkP9fpiUSBepI17Qs0dpRohjppWilBekq0BW0HTklEohPpDI bZPfuq2Tx4Et7RPQKz4nN74G6EcmuHq4yGl0AXIyUbmxsLMQmt0OvenqYI6ib6iMN2FA 5I0HiDoqdugy/RDV6pjiKaysAOPpTd+ivoj+MdNWHw1KWupTNZ9ycpDzY+KWP3eOZyzk ERzlUTNnPqRw9EmGeZUjiPS+AuyGCirjvmmNuldKl4aOhz+b0YZHC8eBL7WQTONgX8dA 2ncA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mNESGVhr; 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 q7-20020a1709066ac700b00730b0fef595si5413080ejs.857.2022.09.12.01.35.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Sep 2022 01:35:50 -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=mNESGVhr; 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 A9AD784B92; Mon, 12 Sep 2022 10:35:48 +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="mNESGVhr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4EC0C84B89; Mon, 12 Sep 2022 10:32:38 +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-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) (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 B318984B95 for ; Mon, 12 Sep 2022 10:32:13 +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-x62c.google.com with SMTP id s18so1934588plr.4 for ; Mon, 12 Sep 2022 01:32:13 -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:subject:date; bh=pUd+ePSJtY4udK76FusNe0a668i93KjS6Rry/1J6Nkk=; b=mNESGVhrB9uq2PzKiJGdsth1W35z07q6Vs150d7E0zQD7fZ5B5Ir7g41d2e4Ffvayk 2bClomPvl8xz+XBccqGjkMInslf51Ow8ptnKrhDuaNu4LwjS0v6E1WSOiwp4Z8XnrvoM X1CqbLrr4D6g4Q+HwSndYdZN/BpLOVzOpnFTojN7PW11OtVeGxpBjh/37Wtb/9omYvaL otSmfmyFJjgtkW71s8ry0ObsTbRrk6bBNAJaYBI8ErlQbT3NAk+rNV0UcypJTBoQwPNR Us5ZUK02XYYny02/5QidwVacZve6tgvGqM/w72eLmD47mPoC36Fy1Ikp9SfDI9KSnjAW 1uOw== 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:subject:date; bh=pUd+ePSJtY4udK76FusNe0a668i93KjS6Rry/1J6Nkk=; b=g97aqtHkHd8S4IHujH257BDtwpKx93Wgf8bAZpaCTHsxlmATHKezx0LLCAropGM1wR qtnIwar6k/pGvjdL3haM0KDrKUXOFA+5/JQSPsWichhRoJzNIMBftRvzd2MhbdfnFyaQ 24KbfMpVSNFBs3GwpadVihk+f4FoVjObSmMIw1RfaLF11CAPrCgwHHn3h/Mj0Ko9HxE6 cTgkR08LNnSgugzNbEKNywUrsH2mGdBd5aF1jxZnEKtweSemwkydEms2aYdV+wrK44Mu /jaGKqrRXZqPFY6P8MjmFcJC9HzaqJYZ2ty9AuSFYEB3kqo6yHUjU/kiSoJOKqd4NHBP h6RA== X-Gm-Message-State: ACgBeo13S84b+EdoRF42QGN1Y2ln45suL7xIKeCxJFlYBIf1rXRZ9JyQ KeHvyc29RGVMQWztlgBdg+Fr2Yxyy9ARwg== X-Received: by 2002:a17:902:ccd1:b0:176:6eb8:37b2 with SMTP id z17-20020a170902ccd100b001766eb837b2mr26352799ple.69.1662971531385; Mon, 12 Sep 2022 01:32:11 -0700 (PDT) Received: from localhost.localdomain ([240d:1a:cf7:5800:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id d15-20020a621d0f000000b00540ad46bc1dsm4698506pfd.157.2022.09.12.01.32.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Sep 2022 01:32:10 -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 v17 08/10] doc:bootmenu: add description for UEFI boot support Date: Mon, 12 Sep 2022 17:33:57 +0900 Message-Id: <20220912083359.24510-9-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220912083359.24510-1-masahisa.kojima@linaro.org> References: <20220912083359.24510-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"