From patchwork Thu Apr 28 08:09:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 567142 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6886:0:0:0:0 with SMTP id m6csp5234141map; Thu, 28 Apr 2022 01:14:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2qTowF5X5oSX2aC/bOJ+jJKb3HPTH+QjdSLexxRrxZNM3gpsoHGv+MbRJO2BP6Id1UE3j X-Received: by 2002:a17:907:60cc:b0:6e0:dab3:ca76 with SMTP id hv12-20020a17090760cc00b006e0dab3ca76mr30840046ejc.154.1651133665929; Thu, 28 Apr 2022 01:14:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651133665; cv=none; d=google.com; s=arc-20160816; b=maqK86bUWq7ceBr4vzAcyD+ZaHMl/wFtPQ/r7oFO/O3/iYFpGQHcsWJ139WzkJ7CM6 R1xWomMJHp2daRM7qEG4s85pXzDVkof8tucfgIn3mALzrL1FCVNBPUM9/dphksAepo1e QstcDpaAHMyCkwZ8G8n16dMEssOZasypUGdihXsLmvYCSXSiNG7xmX10Y8ssPJhzmWwi hJvVRZ8aF8WqQ8GXV8IVSxXGqGxylkQfnceaxwxp7HXy3OjF/QaNpGMsbTCmp+p8gtL8 BIfyD0J4noPTsMzJFesqwhesYUcCgZ6P34cMSEKyBkBYzsV+aiKNvWwWkKZtkRU1T4QW xgow== 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=j4+xFl2NCt+5DKN4t2mKZg+8zPhPf9la8CGdTf5s7H8=; b=elhOPb0uZw48JorjW1MY2GudU+1qb1QDjIQAfjomZxGhw5jCm9+SMfQv4W33FJG4KF uIm+I+sqkfUR3qC71nWrRlG54GZPvOAFFpvrpU41+MhTk4NPGOjCn/wse6wx/Cr5699S aQ8sZH3gZe4lfvyksYmPt5QbgcviXR7gF2NVT7xZj4AgEUaMS7C2bxJ4DRBbESovaUDu ghKWvERQBylw6SsDvuncj0nMNeDAxUb1rfF6ld/D3Dvyg9pSKQfEnwDiYBVgf3pe6oct OXO/k0x6EQkdd2uYn3+Q12E/5J5yw3d83zaMMBFdJBN5sjJWqhpZCpBnMSRshsEMskaL TFxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YHWhcdiI; 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 ec12-20020a170906b6cc00b006f35c423230si3414682ejb.239.2022.04.28.01.14.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Apr 2022 01:14:25 -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=YHWhcdiI; 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 EF20583F1C; Thu, 28 Apr 2022 10:13:07 +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="YHWhcdiI"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EF8D483EE2; Thu, 28 Apr 2022 10:11:40 +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-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) (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 C339483EED for ; Thu, 28 Apr 2022 10:11:28 +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-x52e.google.com with SMTP id k14so3421478pga.0 for ; Thu, 28 Apr 2022 01:11:28 -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=j4+xFl2NCt+5DKN4t2mKZg+8zPhPf9la8CGdTf5s7H8=; b=YHWhcdiIi/1eIXCPhblfQxPJ4IaqEJ3c2QQDxirkcCUpzu+6WuAqXmJpRmcez4aXjk JP3ou+xt5RCYwTIRUqqwuw4jw7Twh32gIbV37/xxdYSUrPZ95jAflOnrz0sqqCNq/nsO dMB8UlMxVM/niX1JXQQeyiu9WJzF7SqRf9zTC1gpMFvrcrqKuN5dZ7nmcxTeBZvKrEa4 E8skGCFgv7EDBPz74XeP59EJrl2BHdB0UwqCNinIwrWh3vFq5mo8ckLwVLqvdPzPEHAx afM7IcBz1/99DJ7t0Zw1p3JCTOe+AhcUumJtm3odX3kikcdf+ohPfJPGe9UGBq0YzHhC tpMQ== 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=j4+xFl2NCt+5DKN4t2mKZg+8zPhPf9la8CGdTf5s7H8=; b=mliV6uYUvdQ0rQCVMy2tE45Hr5+8FDQqwyvY0D5uyyCZo9iKLCYnRwrdfOMFNoeEFp K/zFwor7M3gv9LqkMgVYntL2F4rTeeMStRoc3MwSRX5VJafLB5NS0D3iFKMNUlatC/6b V3oFikwJqfbkQ0aWVI4C+y7DF5pZ2XxPazI+hookT4MfcLs18w5tVESVlzLTA5sEKAnr Qora+yd7a59ONId7NS20k++Yk68UczzVoHsU+NqkQtB1ojwxuJl0wEcUiVEIzQMNLl8c f0bQv3hjehF2HxzyUMS7zDyrw4f3PCPdvuked6nKyluQMGVfL+5l0mDbme6OCQaUys0S jEHw== X-Gm-Message-State: AOAM532UNg5Kd7mQoTJfbDZ3zJSsNLBI/6C5ydD5kUlfIHmBmgi622It PFGkon60f+hJSMhHP4HwYcL0rBRte0r7bg== X-Received: by 2002:a65:460d:0:b0:39d:13e0:d571 with SMTP id v13-20020a65460d000000b0039d13e0d571mr27046238pgq.596.1651133485084; Thu, 28 Apr 2022 01:11:25 -0700 (PDT) Received: from localhost.localdomain ([240d:1a:cf7:5800:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id b15-20020a17090a7acf00b001cd4989ff5fsm5684259pjl.38.2022.04.28.01.11.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Apr 2022 01:11:24 -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 v5 17/17] doc:bootmenu: add UEFI boot and distro boot support description Date: Thu, 28 Apr 2022 17:09:50 +0900 Message-Id: <20220428080950.23509-18-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220428080950.23509-1-masahisa.kojima@linaro.org> References: <20220428080950.23509-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 and distro boot (boot_targets) for boot device selection. This commit adds the description how the UEFI boot and distro 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 --- 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 | 78 +++++++++++++++++++++++++++++++++++++- 1 file changed, 77 insertions(+), 1 deletion(-) diff --git a/doc/usage/cmd/bootmenu.rst b/doc/usage/cmd/bootmenu.rst index 1016ac8ceb..48f76a82a3 100644 --- a/doc/usage/cmd/bootmenu.rst +++ b/doc/usage/cmd/bootmenu.rst @@ -4,7 +4,17 @@ bootmenu command ================ -The "bootmenu" command uses U-Boot menu interfaces and provides +Synopsis +-------- + +:: + + bootmenu + +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 the items. Current active menu item is highlighted and can be @@ -79,6 +89,67 @@ 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 +'''''''''''''''''''''''''''''' + +The bootmenu automatically generates the UEFI boot variable("BOOT####") +in order of "BootOrder". When the user selects the UEFI boot +variable entry, bootmenu sets the selected boot variable index +to "BootNext", then call the uefi boot manager with the command +"bootefi bootmgr". + +The bootmenu automatically enumerates the possible bootable +media devices supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL. + +The bootmenu prints the EFI_LOAD_OPTION.Description[] as title +of the entry together with "UEFI" prefix and BOOT#### variable name. + +Example bootmenu is as below:: + + *** U-Boot Boot Menu *** + + UEFI BOOT0000 : mmc0:1 + UEFI BOOT0001 : mmc0:2 + UEFI BOOT0002 : debian + UEFI BOOT0003 : nvme0:1 + UEFI BOOT0004 : ubuntu + UEFI BOOT0005 : nvme0:2 + UEFI BOOT0006 : usb0:2 + +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" + +distro boot command enumeration +''''''''''''''''''''''''''''''' + +The bootmenu also automatically generates the entries for +distro boot command. The bootmenu shows the devices in boot_targets +environment variable. +When the user selects the distro boot command entry, the bootmenu +runs the command defined in "bootcmd_xxx" environment variable. +As an example, if user selects "usb0" entry, bootmenu runs the +command defined in "bootcmd_usb0". + +Example boot_targets:: + + usb0, scsi0, nvme0, dhcp + +Example bootmenu is as below:: + + *** U-Boot Boot Menu *** + + distro_boot : usb0 + distro_boot : scsi0 + distro_boot : nvme0 + distro_boot : dhcp + +Configuration +------------- + The "bootmenu" cammand is enabled by:: CONFIG_CMD_BOOTMENU=y @@ -88,3 +159,8 @@ To run the bootmenu at startup add these additional settings:: CONFIG_AUTOBOOT_KEYED=y CONFIG_BOOTDELAY=30 CONFIG_AUTOBOOT_MENU_SHOW=y + +To improve the product security, entering U-Boot console from bootmenu +can be disabled by:: + + CONFIG_CMD_BOOTMENU_ENTER_UBOOT_CONSOLE=n