From patchwork Fri Jul 15 14:27:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 590840 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5817:0:0:0:0 with SMTP id j23csp552289max; Fri, 15 Jul 2022 07:26:23 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u2d+SeSsDC/4AyXZsjhBfyLJBVFgD5oWCZDwArTXpMHI3l92nKYERpWa42TCbVhv5kpxzD X-Received: by 2002:a05:6e02:1583:b0:2d7:a75d:888f with SMTP id m3-20020a056e02158300b002d7a75d888fmr7256996ilu.13.1657895183149; Fri, 15 Jul 2022 07:26:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657895183; cv=none; d=google.com; s=arc-20160816; b=dMH+IU/16NdSioTwNljIhWuGyWWYqaGm3GBdcUSv/Ikce1Uz/9scfVXVjz7ZdFq0SV OklXnAJAhBIMxMLmEe7r6b38JXfgCmKgICOHYUG47CXwX5HXcI/CoUWHLJVOvWMfmYrX xbopECagw1miVkNC7yJAfMxNO7/zutQuuugeMhnXHm55fGMKQpm2fuU4cb5lWWjlV1Eo xk1RYCE8rpEqM2SgWalQMlf0kGBwaiXPDKsltNhl8X+iLD2RDrlhV/y4sBoYbWVEuXFy MMqfOo9qWqe2JRrWzeP0Xo47/ff+OxpGQmaozkfFYkqTm4hUdK2Lb+MsarTnBgP0KbJJ 3c8w== 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=wrdys3/dbUUfK+3BxRJnxUf8rBAvOa2YOd7ils7QECc=; b=LVURB6U10+yoYJdCDL1+nbckHm+7Vw4FHehlhb8PhcW4jnpqljWUN05ufrCXXiumq+ 2IIG4NtgecJacpTWGtR01KQZqzwteTYi7+tdSe3mVUzD5gj385OGJJ0RlQ1CA+c2XW+o ybGwhMvfF0XV9iMOZEv/w5sFEtu3iArAoTXvFRmdpr+hK5lyzudpzmq7mK41wa823wFI 1OdTJjL3xfsmdPCus9NBE6TQP9LAUoGrW4a0w0iQ7/rmhW9Dx04T5F1myPQaTvhrG71k QB6vlKhrhmIqr9H2U61j7ko7Pc3GxmLmb05OS1j89uwbu9Tz/zKm8IXXJIpC4TGfpThM 1wlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UGgiU1D2; 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 u2-20020a5ec002000000b0067b957cdf4csi4062148iol.14.2022.07.15.07.26.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Jul 2022 07:26:23 -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=UGgiU1D2; 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 CCE06819FC; Fri, 15 Jul 2022 16:25:34 +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="UGgiU1D2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8CA7C8171B; Fri, 15 Jul 2022 16:25:25 +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-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) (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 57CBC81877 for ; Fri, 15 Jul 2022 16:25:21 +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-pf1-x430.google.com with SMTP id b133so1004852pfb.6 for ; Fri, 15 Jul 2022 07:25:21 -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=wrdys3/dbUUfK+3BxRJnxUf8rBAvOa2YOd7ils7QECc=; b=UGgiU1D2rUI1Kl4rHU+pr5iUbuC/FLF6Z4Sv7NUSUXHGlg0pdQIHMOu2R/C0bQXGJ3 ARv9x+DUiaWMUwLsypdL9EP82J/SU5RCjTuVcD9RdW47gLCmBulOy7AyJJ4Rvhm9irx7 ObREL45EqZibj0sOnKqslN/ZKXbOvWF9RWKMNGLzTEAYaUy5lIxAb1ovpn0wdgiYJ9YS d0p5D02g4oworHV74Et/ZBGFzr+c6OEm9D+d4nL9Vir+99hku4ldTiODjhiBgDyJWlvx kKcGSZaXBcENgjsWduYxw2opthB07InlPkC1x/AoqPpx4MVfgn3bOES7VJCGcyjjc96H eT9g== 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=wrdys3/dbUUfK+3BxRJnxUf8rBAvOa2YOd7ils7QECc=; b=iWf2BgN+RgzsTzV3oMwp2mDb2thQ0TWJDSYk5zij/LgZeYcVgHhalFDT7pqedq2WJi f331ELBoFT+lvn2AMp26Gmm51J7zW32ITaz6/srup+xyuN/1s1oYCPwcE3tqHfcHsC/+ lzhB9fJmW7HWPXfKnw9z1gSfqz1gQVp42Bxfa0mCWPr5ntyqbeXSo+YN/xEuf/yXmi8v x7yF5EMawB0lLoy5BcUOewaGQD55wiiI0tVOuB0hrMobG0qp5SRMyCY5vadwHv+1TW+e yTaxCJyjwnNCEes782ornE6KlD1LJyPH4f6hb7e/5OZu6HPJmQCs4fd1AE8Tby8biG5O iy+Q== X-Gm-Message-State: AJIora9YL0CxVmH6LcMV+mlRDcF3x+cPUcooxcHnDJLsKDtnh3WJkOTx +XvWCE6iQysC3RR4KWtqiJPGkybiqeRqyg== X-Received: by 2002:a05:6a00:2410:b0:528:be6e:8c2e with SMTP id z16-20020a056a00241000b00528be6e8c2emr14243972pfh.31.1657895119466; Fri, 15 Jul 2022 07:25:19 -0700 (PDT) Received: from localhost.localdomain ([240d:1a:cf7:5800:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id d22-20020aa797b6000000b0051c49fb62b7sm3891174pfq.165.2022.07.15.07.25.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Jul 2022 07:25:19 -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 8/9] doc:bootmenu: add description for UEFI boot support Date: Fri, 15 Jul 2022 23:27:42 +0900 Message-Id: <20220715142743.30137-9-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220715142743.30137-1-masahisa.kojima@linaro.org> References: <20220715142743.30137-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 --- No change since v7 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"