From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0F8A5C433F5 for ; Wed, 18 May 2022 05:28:04 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1A6DD839AA; Wed, 18 May 2022 07:28:02 +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="WM1LLCNK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D669C83C96; Wed, 18 May 2022 07:27:59 +0200 (CEST) Received: from mail-yw1-x1135.google.com (mail-yw1-x1135.google.com [IPv6:2607:f8b0:4864:20::1135]) (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 57F7783922 for ; Wed, 18 May 2022 07:27:56 +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-yw1-x1135.google.com with SMTP id 00721157ae682-2fefb051547so12473807b3.5 for ; Tue, 17 May 2022 22:27:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=rJk4L8m5XXueFYJ0L09+nzz6ite4/sicBlphwA3gC9Y=; b=WM1LLCNKnHgwSlgZzdeSaS+7PbEGiC0qgSwR6/H8OnrUn/VVYlzDl0/aH//BYGygH3 LIcqHEd/gxrVeVN1HLgOV4/S54HeyrsbG++W9NvlMYy75OlYnTbKESHm38hAYcPZxOEH Jq84Han7wWuBKZGaoWDFfxUn0mHlrSe+ck36pbJU1Zjxa6Zo86IjXd80Y3uJQWFZ/QOJ NlxCUtzjKDmRwQ93f2myKilJtYCqlOUrgWzjmPkV0NWYnWm0qIm9bP/lUL2xVgKB38X/ uhD4k62c+ZXxZ2qPbBXbedRF++/W0ccuEblQCqmePNEcOnDB05aCMzwmZC6rsii+NQQc I2+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=rJk4L8m5XXueFYJ0L09+nzz6ite4/sicBlphwA3gC9Y=; b=JpKHfEtM+cgvQGcZ9kBIT6jyBBUzs3UH1rl1nh7IPUHdLlUOEGuuWMgrxbox00PNJh XxilwHGaNS2Oxlodx1Z4bCQGrFlpJ0rDOQKmQkl0hF8Pp6SxGqdiqcYNScq8nlusb1nx YEj6is/WiLqspNnDptlBoq5r+aKdIPZlErereGq6ni9JYsM7lV4dm1kF1ry27yDp7zkO iUUxVZGguVPB9nVPTVi0taOo6qUEm5LPUMB55TEDArQ59bFz8e09FZoaFaH44ZnWDNEw n6sW8IhYNDjkalHcRL0LoXi873x1l2rBijWSsozFZSxEPepfNEe5KOJSgbv14pK9vnd4 OrUA== X-Gm-Message-State: AOAM530Z6Z7UyiqYteV/HejjOBc7ALsB8HgvdhsRgXIWzIp/wWmI7KTG t81yhuoVhN4DC9/kBzPDmG/l2BTkbBTLq05fL83bkQ== X-Google-Smtp-Source: ABdhPJzntrBy2rSxpFXx2+Mv3SYaGtkHsj8K5miSzjZbJtwVlZWYAHGEh4jPE7s60mWt78LjAiwMel1eW4936EpavBI= X-Received: by 2002:a81:3285:0:b0:2ff:166:68d2 with SMTP id y127-20020a813285000000b002ff016668d2mr13718506ywy.9.1652851675051; Tue, 17 May 2022 22:27:55 -0700 (PDT) MIME-Version: 1.0 References: <20220516110043.31480-1-masahisa.kojima@linaro.org> <20220516110043.31480-6-masahisa.kojima@linaro.org> <20220518013120.GA65446@laputa> In-Reply-To: <20220518013120.GA65446@laputa> From: Masahisa Kojima Date: Wed, 18 May 2022 14:27:43 +0900 Message-ID: Subject: Re: [PATCH v6 5/6] doc:bootmenu: add description for UEFI boot support To: Takahiro Akashi , Masahisa Kojima , u-boot@lists.denx.de, Heinrich Schuchardt , Ilias Apalodimas , Simon Glass , Francois Ozog , Mark Kettenis , Bin Meng Content-Type: text/plain; charset="UTF-8" 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 Hi Akashi-san, On Wed, 18 May 2022 at 10:31, Takahiro Akashi wrote: > > Kojima-san, > > On Mon, May 16, 2022 at 08:00:41PM +0900, Masahisa Kojima wrote: > > 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 > > --- > > Changes in v6: > > - remove distro boot related contents because the distro boot > > support in bootmenu is dropped > > ? I rejected it in my comment. > I don't think we have enough consensus yet. I am aware of your comment and discussion in U-Boot ML. In my opinion, I doubt that the distro boot users use "bootmenu" to select the device to invoke "run bootcmd_xxx". I guess no. And my primary goal is disabling the U-Boot console for UEFI based system. Distro boot users can still live without the U-Boot console without bootmenu support. Distro boot support in bootmenu is not planned initially at my side, but it was added during code review process, then it is (temporary) dropped in the end. I don't have a strong opinion about it. Anyway, distro boot support in bootmenu is an individual patch, I am happy to re-send if needed. > > > - 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 | 55 ++++++++++++++++++++++++++++++++++++++ > > 1 file changed, 55 insertions(+) > > > > diff --git a/doc/usage/cmd/bootmenu.rst b/doc/usage/cmd/bootmenu.rst > > index 9430f8c9aa..6b154d9655 100644 > > --- a/doc/usage/cmd/bootmenu.rst > > +++ b/doc/usage/cmd/bootmenu.rst > > @@ -4,6 +4,16 @@ > > 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 +89,35 @@ 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". > > To be strict, the bootmenu command *does not* create UEFI boot variables > (except ones for removable media). > So, I would suggest you to modify the text like: > > If enabled, the bootmenu command will automatically generate and add > UEFI-related boot menu entries for > * possible bootable media with default file names > * user-defined UEFI boot options > > Then, > > > +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") > > + Thank you, I agree. > > > 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". > > + > > +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 > > If I understand your patch correctly, menus are initially sorted out > in the order of > * user-defined bootmenu_xxx variables > * removable bootable media > * user-defined UEFI boot options > > The example above looks odd. The example is intended and same as actual behavior. Sorry for confusing you, the function name and description of prepare_media_device_entry() is wrong. This function just checks the removable bootable media, then updates UEFI boot variables(BOOTXXXX and BootOrder). prepare_uefi_bootorder_entry() enumerates the UEFI related entries in the order of BootOrder. So removable bootable media entries and user-defined UEFI boot option entries are mixed in the bootmenu. > > That said, it would be worth mentioning that users can changes the order > among UEFI-related menus. (Right?) OK. > > In addition, please describe the default action if users do not select > anything. Yes, It should be noted. Thanks, Masahisa Kojima > > -Takahiro Akashi > > > > + > > +Configuration > > +------------- > > + > > The "bootmenu" command is enabled by:: > > > > CONFIG_CMD_BOOTMENU=y > > @@ -88,3 +127,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_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 > > + > > +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" > > -- > > 2.17.1 > >