From patchwork Fri Jul 22 02:39:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 592455 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b811:0:0:0:0 with SMTP id fc17csp100198mab; Thu, 21 Jul 2022 19:38:01 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sRg3FxE/0yULUi5R/yU3CDD5LTXhOqhuba//WEjTqWY8qgFGms3ffysQ5skwQtzGYLWb0f X-Received: by 2002:a05:6e02:1b89:b0:2dc:9e66:e98e with SMTP id h9-20020a056e021b8900b002dc9e66e98emr572072ili.218.1658457481027; Thu, 21 Jul 2022 19:38:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658457481; cv=none; d=google.com; s=arc-20160816; b=0c1c9rRzTWDt3d5XtOcPHEVrDjMyij08xRM13Fvu83tCPwdUDkJENr46sSVuEKr1TO QQjRgSL4KKqVHje3FihTbwSQsmnJkPoBzTdNNZ/bICZkRlXO4lW+aLDpqI8pnqjtbYub DxinAUxVELrqni+m59LbiJGUgvgdn2vPGXFUUzeInO/EUY311EUHYMuEDY/37MMcQMsx yo5/t81XoBUXBJ23yp5/CZfAX4iT7646DOF/OqSRJU3X8QvbeIBYZqXhLG79FEliCog9 Epa66l3qBw6ba3gNV7QuHRQtt7nEcfh5VFL18dTdu/aK6fJ/SoLa3S9DSJlp/DJDBxJT ta9Q== 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=Ib0FutADgYo87yLoBH2t10ebF/NaOSQhgBQdueaN0ao=; b=OReuMrBvx1V9V8kGWv3+zTZsm+FeJ6IrL5JbccgBzQ9xSYFOM4HJmxoOi4Hj8+4UjI M7CLzyOjPGtLkPjWIr+J2xolvI2MEGfw+EQIHNfHrUrugyYAt0d2W/cvhXiR83fI7Qum rimGziTpKHnjTKA45IxasZ37/+OFx3+v4QyG+7DB/KsoO+xlHzHOuYBDOCGjYQlObEe4 0E3E8cGDyBbRdF+QGMDXe5sd3vO/7bsp/X+7Y3Tw9oWz+300xMuZvnubhxhVqBZweIix hVpAI1196oVJj6jZwhGjgDYz5T1d1fCRntjYLoIpvIcUgOrhmUEh6Qx4kTmrC8hNZCFh 2t1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OS+39VBd; 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 s12-20020a056e0218cc00b002ca96391aa1si3211956ilu.142.2022.07.21.19.37.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jul 2022 19:38:01 -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=OS+39VBd; 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 5A7878413A; Fri, 22 Jul 2022 04:36:49 +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="OS+39VBd"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DEBA0840FC; Fri, 22 Jul 2022 04:36:41 +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 autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) (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 D408784110 for ; Fri, 22 Jul 2022 04:36:37 +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-pj1-x1032.google.com with SMTP id b7-20020a17090a12c700b001f20eb82a08so6988248pjg.3 for ; Thu, 21 Jul 2022 19:36:37 -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=Ib0FutADgYo87yLoBH2t10ebF/NaOSQhgBQdueaN0ao=; b=OS+39VBd7cR7NGLo+bHqPAIPcrC1S3I9YhdiwKXOqvYAhSXbprUo2mwPYdjajh7qLV y2jNIyTBKC5DohIgo7JXgsMd1HsAGnd4HFRN8a2Op9stMddBd3G0KAzYNpWhXH7pI4mo ueyo4ecUa9nVzVOfjgxoTU8nKZ72YdFeibj5myVnIsqgIkfh1PLUvktjKWFmf9RJylmt 3xPOE4gGxlAZRjOi3gBPC2dYB5K5BUwa2+bybqcEohNRavY0SefnCJ1hYmL0lWf17hNZ fa9X6yeXEwg1xYWua+ogjjIUqiWwtfCT4avJ8ordGxNcc+nZSr4EY8nE1opJO7hlgvWv Pd1w== 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=Ib0FutADgYo87yLoBH2t10ebF/NaOSQhgBQdueaN0ao=; b=I6jY6nmw3jUbMHT7gEKcSFmVtq3fE9PXKFX+69IeNmPAjRlQGLPAdkkmhMkskJuhJW Zn39R5AgCj9j8ht9IuTBpAf+LjVPKja4XUfbZBvE13IEyZU66DTB7TpymfBIhjqFTuWA k6g8MwrEAftOZ+oqwySmdMko5LG8tmDO8885/WqLMoK2a0/YeuWS7yt90TIy/myPaYRa lKf17dEFs4kPjwb9k+7Cbye1tiIG0zhHbPFWiGbU0N+BsHPefrF0bG7WbeKJiSNw6Wiw uybc01yGaO4pnHO33gq72dejKzfmD2+oqMB5gq5kRgT7SQe+fMkQXfbI9RjkjN82hUUz xQng== X-Gm-Message-State: AJIora83OpM3Jv95SWlMo/3B8Uh9zYhJAYk25ZXCRYfkBDTpwk/76TYi 6hJh7bHGw/lFQ3zmZDXAqppeMR+l2NlSkQ== X-Received: by 2002:a17:902:ea0a:b0:168:d8ce:4a63 with SMTP id s10-20020a170902ea0a00b00168d8ce4a63mr1442187plg.57.1658457395577; Thu, 21 Jul 2022 19:36:35 -0700 (PDT) Received: from localhost.localdomain ([240d:1a:cf7:5800:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id k21-20020aa79735000000b0051c758a3957sm2509896pfg.149.2022.07.21.19.36.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jul 2022 19:36:35 -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 v10 08/10] doc:bootmenu: add description for UEFI boot support Date: Fri, 22 Jul 2022 11:39:17 +0900 Message-Id: <20220722023919.19676-9-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220722023919.19676-1-masahisa.kojima@linaro.org> References: <20220722023919.19676-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 --- 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"