From patchwork Wed Aug 24 06:37:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 599728 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:4388:0:0:0:0 with SMTP id w8csp2943310mae; Tue, 23 Aug 2022 23:38:20 -0700 (PDT) X-Google-Smtp-Source: AA6agR4HxQcRGzUr6KtJmTuPU7wEcksimJr8f1Q7oq2rctsmkDYAGZmAhsIm7jGSNsd9/PJdWdNW X-Received: by 2002:a05:6402:274e:b0:447:4e9d:69e8 with SMTP id z14-20020a056402274e00b004474e9d69e8mr3167700edd.295.1661323100126; Tue, 23 Aug 2022 23:38:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661323100; cv=none; d=google.com; s=arc-20160816; b=co4OLu4/LLAlvSgOEIbknwUlFCkrVzRiEOvakJtB0ZKV2KB8giiwLJT6D7OPPZBsyT qSqv3HLIckOgkVlLmgmyAoCdG+3rUtElIQ6gHfq4bogGrLoWRBP8baNmb/cde9X0X04Q BrAKA8d/CMBAdsvAS0bEB6Z3lOgu/tMAtSH28gTuwlqL0xiRcSLdsanBYk5knDSlyy3I xpS5ywZZCliVsushXw2kgCI+IR8Bt76v7PKtWB72FaJYIcM2iRb/61zSDIMU9pE0IMzJ BVVU9HzDs4MsDJqywT48ZCsiK1hARLW6oyiPENBQ9nAwE96fUheFUtYlG7ZhIkghfV2x 2NvA== 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=p0DhSu7vKJ73JpwmIXUC77guLnEDjybi/EIo+lTiJRDzSzBw6Va1wGeMXs2VIa8lzz arM0rMYrclsZXH5SXV4PsZ/8ku9sD7FZWX69quis17tTr0/gHQZe/auBMj/zw6h42END ZD1gAwJkybp3BZcoOk2VYRxm+94mcZPbD5Dp9wCAs8U1ToPYvNnTYw/gg5IyXMohtWbM 60ubxkujGgVxyr+EsX70gzgD9kCrNkjYC0AFMFWAfAlupSZ+EZ4r2gueHAzT5W/V586n FX8bSeADnUABswagXa8z5Sw4f7RDM1Ryq2yXhRg5pcKTHWTT3WAQL9mKrLkBA69jXzRn Twcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gqyhhOTb; 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 sc14-20020a1709078a0e00b0073d865138fesi1459450ejc.645.2022.08.23.23.38.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Aug 2022 23:38:20 -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=gqyhhOTb; 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 CD7C684873; Wed, 24 Aug 2022 08:37:25 +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="gqyhhOTb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 629FD84852; Wed, 24 Aug 2022 08:37:10 +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-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) (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 428318484B for ; Wed, 24 Aug 2022 08:37:04 +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-pg1-x535.google.com with SMTP id v4so14182781pgi.10 for ; Tue, 23 Aug 2022 23:37:04 -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=gqyhhOTbTfZ6tWSzyNNA1HB6K+pqHWaUWTWQs2Kd51WX4e/BSDo3/sXbGPb8W+cbYi Xs9rmBrYqJbTm9zhXnspBE5Ed3abhrDVkpt5J3qa2PuopMpMrJMLvcQ8/+Lng4MFFRmX nExr3HuOS2wpl3OdpO3aFejo1RLpAixMo9nmTzl7vfMet7/wP6lQIlWcN20VYd9Wpp0y G8tA5O4so9qWJHoQPwteZA9zSwLrxB3d6lUcFpjzanqANRkZKNyIjtlUr6L+/r41rS/f DrfuTQIon/Sk5xsBictUC9eWo8Z70sArolIyOiHa2WlK2Wyp5Z08UAX3Jj+1fj+8dLj+ Aqog== 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=feyoM7zqkgYROzc2CI8JULzLscfWyntsLgXN02a2WiC18LyzTvWemJJteXhBYvy9gz JsHByW+AG5koHTukxZKq33tb5pcfrcZJS8oVlsh1cwcM+XHVEw1xdtW1Rs3Rw5LH172G UvmNPAbFfC6Jv3X8/vOnHmpOfgKqJvNOtm+EEniJnV8Esh45KMsmzl/h6E+IgvChdVq0 tlt2C4cRiJW4FSMFJVQix0u85QnKyxeKEUa199fTbD9xlqVSjD05HcqpQ0A8i2dRvsGO 8yVYH7rg1xIR0FVyz6/gyu+6UsoDUN3SopljfSPkRWJ0DAXphOs9e728kTdZAWlnXE2z 45Pg== X-Gm-Message-State: ACgBeo0zxPo/4kt9bgGRFQXT3Nv/dCsHyj1qwDLUR5/eL5p8EfDzlfOb k1VWGP6XnL8CpZuLt353PCLuPNbyy0wBng== X-Received: by 2002:a05:6a00:23c5:b0:535:5c24:68df with SMTP id g5-20020a056a0023c500b005355c2468dfmr28471234pfc.62.1661323022246; Tue, 23 Aug 2022 23:37:02 -0700 (PDT) Received: from localhost.localdomain ([240d:1a:cf7:5800:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id a26-20020aa7971a000000b0052d40c4c06esm6958761pfg.39.2022.08.23.23.37.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Aug 2022 23:37:01 -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 v13 7/9] doc:bootmenu: add description for UEFI boot support Date: Wed, 24 Aug 2022 15:37:38 +0900 Message-Id: <20220824063740.5760-8-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220824063740.5760-1-masahisa.kojima@linaro.org> References: <20220824063740.5760-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"