From patchwork Thu Mar 24 13:54:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 553921 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:1248:0:0:0:0 with SMTP id z8csp4439417mag; Thu, 24 Mar 2022 06:56:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6VR8qYg/holZjOmHejBHc5rvXGopuWFXqgBVfxrdHkm6/Kmbp1XMra9eJAehyF8jHC3gH X-Received: by 2002:a17:906:2991:b0:6cf:6b24:e92f with SMTP id x17-20020a170906299100b006cf6b24e92fmr5830000eje.748.1648130215477; Thu, 24 Mar 2022 06:56:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648130215; cv=none; d=google.com; s=arc-20160816; b=kDD8PZFo1xBdVUGgScrkF4o4J2RZHRnw7cJ9c5uqc+edQ10Y8CpAF4MMduAXpb7VJZ yQrlwhK5O/6F2EHsUE6Znh3qoT1XiJdROC/KunGSv//3SR4jYZL3dydXUPvVnBzoCntV 0fdXLCaIQQNeYxmJ/fCtFlWPv7YoeHwNo18Xnqq19g2I7O797F5QAY+751LkmLm1ZjWL on/bPR5bHFavNkr4JLJCC4COf/pgI49vxnQ7BjjXdeAawx4r/BjjBEwRi+A/TFrQlwcq 8Arp374pZCfST9Xy9U3OjOR0HzNgtaivDnftte2OWOU5CD7w2cqA+KdA2tlT4LAE3inz +VSA== 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=rl8GREhCACmisHRJxBZCyWw8xh2tt89HWErYawvvy/w=; b=xgtRYy+g2RjNaDehIIJg28FAH9l8qM5vwbEfv600XoDWT/+WHz9Ue3HSoUlVmyecyu a5xaqp8WFBqiXN5NHpRnCH+jLmJ4hZuMYD4nPXzFW5kSqGFN4uVu9ziOw1Pf9AtdYBGp Jw/2uA9V/zXs0XIM3t0XZBS3apA8+L5TjY6JEKLd5AjYEg0txi2vBfoNSI0v6A5K7Arm zA4b8VKOK5mXZJ6dxTyP9cTQBBow1tPr1oO4UGW5CQj6BIvV5LajeNUNbL1PRLjbuC1a Fi1s59pogZTowF1w1QAZQDA9zg9l6xtuYm4kVRaleDW6tjo6T88tw1IsN2sDIOp33NaN 2Q6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bkvmrEwc; 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 f23-20020a170906391700b006df76385f07si6919673eje.935.2022.03.24.06.56.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Mar 2022 06:56:55 -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=bkvmrEwc; 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 9EC24840E2; Thu, 24 Mar 2022 14:55:34 +0100 (CET) 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="bkvmrEwc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 81C6F840C3; Thu, 24 Mar 2022 14:55:17 +0100 (CET) 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-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) (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 80D1D840D6 for ; Thu, 24 Mar 2022 14:55:12 +0100 (CET) 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-x530.google.com with SMTP id q19so3899807pgm.6 for ; Thu, 24 Mar 2022 06:55:12 -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=rl8GREhCACmisHRJxBZCyWw8xh2tt89HWErYawvvy/w=; b=bkvmrEwce04U2qtocaZb+a79Pz1CUtPDeHUMBNgDEKQfTiZ6+2XfUsN1UHMkX+7y6y Sx8//911Fd67PKpuNIX+rlFAhmmDu8MMUROaSgO3lq7rT9XjbtT+bmhXkGTGeqx2Fn39 cugRh37jD/HMMKa3MSURvEk8IUtrpjCvdf3xj2pKEYjg0FeXXFWLhV/vZrmhOoqocG3z CVrpqaeCq8GoBqnqbfFZySAjAgK1S+99M0Pi9m2LCBSzi5c3iaMEp4h88Q+mhf0+kK4x wRQwpVPZgqd/L+XwJ0phMVtCE/p+YkYz3a2dqKPHiDtTE+2KfzA3q+xkzMTrFvf19Pkn VQ2w== 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=rl8GREhCACmisHRJxBZCyWw8xh2tt89HWErYawvvy/w=; b=LiQV5Lbz2bR+4VzkQii30kLYNNUyB5RAvGEXOWzHM3WVTjUWOpj2JMMCE3jLH30eZ0 AXn817P6dB/sLlIgja461la69WAZ2zVYi3ONSewvIlAr6JqDikFd7CM69VvtSQvdvy0/ iha+2aPmVs5MXCI9h6p2p9muXaOsz3RqZQ5xkcWiU4nEc0HrMs/8wEqmNjteW2VyROC5 qA1N5DFoJ/Clo72k9CVxzvaSXe5fmj7nfxaQFHS/AHUR1dXmQdyku5Mhp/cHdRZ2w9UM 16hIZmE78ntbkhbTlwkGY6s7tgO/Qywz7R3fwcCCIfjfWM3GSgWSByvc7S0aARiy89S7 daOw== X-Gm-Message-State: AOAM530Q8ymkSTV1gtdePYqP1U2SaWFVqKq4LL63O1sTAsHJHXAvi3jx WhoxdrDfCltGZVHoa/eBV/bss9HaeEpdVw== X-Received: by 2002:a05:6a00:2485:b0:4f6:b5c5:ee8e with SMTP id c5-20020a056a00248500b004f6b5c5ee8emr5132637pfv.21.1648130110782; Thu, 24 Mar 2022 06:55:10 -0700 (PDT) Received: from localhost.localdomain ([240d:1a:cf7:5800:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id p15-20020a056a000a0f00b004f7c63cba5asm3974609pfh.21.2022.03.24.06.55.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Mar 2022 06:55:10 -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 Subject: [PATCH v4 11/11] doc:bootmenu: add UEFI boot variable and distro boot support Date: Thu, 24 Mar 2022 22:54:43 +0900 Message-Id: <20220324135443.1571-12-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220324135443.1571-1-masahisa.kojima@linaro.org> References: <20220324135443.1571-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 variable and distro boot (boot_targets) for boot device selection. Signed-off-by: Masahisa Kojima --- Newly created in v4 doc/usage/bootmenu.rst | 65 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/doc/usage/bootmenu.rst b/doc/usage/bootmenu.rst index 1f094ad6ed..dc1d22062b 100644 --- a/doc/usage/bootmenu.rst +++ b/doc/usage/bootmenu.rst @@ -93,3 +93,68 @@ When you intend to use the bootmenu on a color frame buffer console, make sure to additionally define:: CONFIG_CFB_CONSOLE_ANSI=y + +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 + +Disable to enter the U-Boot console +=================================== + +To improve the product security, U-Boot console can be disabled by:: + + CONFIG_CMD_BOOTMENU_ENTER_UBOOT_CONSOLE=n