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 4E118C433F5 for ; Fri, 25 Mar 2022 01:20:34 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B9D2B8396B; Fri, 25 Mar 2022 02:20:31 +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="seR2FHZZ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 253E283970; Fri, 25 Mar 2022 02:20:30 +0100 (CET) Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) (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 CD03A8394D for ; Fri, 25 Mar 2022 02:20:26 +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=takahiro.akashi@linaro.org Received: by mail-pj1-x102b.google.com with SMTP id m22so6242290pja.0 for ; Thu, 24 Mar 2022 18:20:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=//AI9l4dl0iHYAPmahxiDMpeSYqU28H8Q2Fxa42yihg=; b=seR2FHZZdqcE5erVkF3aFEeIKcHWWiZoUYw59KQij3ybj9c1vMqx7n7pQiH65h7qLG GCXbUb7ECrrFYNuOJVp2+dMM66gBoiOSg70cTIbWPcv+bwvOLOI3uipNujtajIAM/90D E+rsT833Z0qoGG6gvLniEjgN6czzRssJQN9y1ezSbvoP9Ud6god8i7VETGIPbppzhG6w dLDeGzoqH3nHzqY65XydS271+ofQcohvquAUXM/WEHqG0SugoBU5cidZyO36ODZ4WfRQ 86zL/lqtDlb3s7Yb933nC6b5OT3Tn6hzL/ZAaE9UsdFxo4wKssmqCXT3CBoAjnFOvjPU bm4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=//AI9l4dl0iHYAPmahxiDMpeSYqU28H8Q2Fxa42yihg=; b=Ahb0W9ZqrPAvorBibaXJGfDx9N0bhbnuSqfKESdHYmIyZiczw26YGV8FFiMWJ5dwe5 hC31dJHVCL9ZGMl3bKVK2huplY9T6olq4UFfTyYzreMs/ezAOEfM5BSL0he0kzngASxJ IoPIbX/DKuD+I0MEKguI3TT1+C0VdFp/7LbAmp6fZPDYaedbQXUhNV4gcpttwVnEz4lF Z6KgQ83OvBmQ8z5KMu3gSxO1/qPcl7Wk3OAFVksZ8UXOv96DXBp4yeoQ2GLZr6qK6w7P KrO70tOVUAEpo+x8pUVRSyIytUAYTxhK5Shmv4pY/EobJuGX6YyDZ519kqymNB+X1+km EaVg== X-Gm-Message-State: AOAM531Dt+B6P7DaTY5SG6iIkj0Mo4I+y8dFX3OeTILSTtNn8bB+/K6q 2dXHZYO9cHvt/duNtn1JjgaTGA== X-Google-Smtp-Source: ABdhPJyLJVwrtqK1qYL1n1vMDAKi+3p9K9QPKgEC8a+pO1K2dDYbFWWZA5cwxslTVY1SFHAEd3PYNA== X-Received: by 2002:a17:902:f607:b0:14c:d9cf:a463 with SMTP id n7-20020a170902f60700b0014cd9cfa463mr9413429plg.32.1648171225012; Thu, 24 Mar 2022 18:20:25 -0700 (PDT) Received: from laputa ([2400:4050:c3e1:100:15a6:15e9:1820:73]) by smtp.gmail.com with ESMTPSA id k20-20020aa788d4000000b004fb07f819c1sm687411pff.50.2022.03.24.18.20.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Mar 2022 18:20:24 -0700 (PDT) Date: Fri, 25 Mar 2022 10:20:20 +0900 From: Takahiro Akashi To: Masahisa Kojima Cc: u-boot@lists.denx.de, Heinrich Schuchardt , Ilias Apalodimas , Simon Glass , Francois Ozog , Mark Kettenis Subject: Re: [PATCH v4 00/11] enable menu-driven boot device selection Message-ID: <20220325012020.GA42849@laputa> Mail-Followup-To: Takahiro Akashi , Masahisa Kojima , u-boot@lists.denx.de, Heinrich Schuchardt , Ilias Apalodimas , Simon Glass , Francois Ozog , Mark Kettenis References: <20220324135443.1571-1-masahisa.kojima@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <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 Kojima-san, On Thu, Mar 24, 2022 at 10:54:32PM +0900, Masahisa Kojima wrote: > This patch series adds the menu-driven boot device selection, > by extending the existing "bootmenu" to include UEFI and distro_boot > related entries, and supports menu-driven UEFI boot variable > maintenance. > > This patch series also includes the removable media support > that UEFI specification requires to support. > > The menu example is as follows. Good job done, Kojima-san. I like it. Before reviewing each commit, I would suggest a couple of improvements on the menu itself. They are more or less my opinion and other people may have their own preference, though. 1) Top menu (U-Boot Boot Menu) - In general, it's a bit difficult to understand from where each menu item comes and what it means. For instance, > UEFI BOOT0000 : debian is a user-defined boot option, while > UEFI BOOT0002 : mmc0:1 is an option for removable media. Correct? - I'd prefer to categorize items into sub-menus, particularly, UEFI items. bootmenu_... distro_boot ... UEFI Boot UEFI Boot Manager Maintenance and "UEFI Boot" sub-menu shows > UEFI BOOT0000 : debian > UEFI BOOT0001 : ubuntu in an order of "BootOrder", and /* not selectable */ > UEFI BOOT0002 : mmc0:1 > UEFI BOOT0003 : mmc0:2 - For UEFI items, I want to do "e" (edit/modify) directly here to change the option. - When "U-Boot console" is selected, the prompt ("=>") is displayed like UEFI Boot Manager Maintenance U-Boot console=> It should be output at the beginning of the next line or the screen be cleaned up before showing the prompt. - What not have "Quit" here? 2) UEFI Boot Manager Maintenance - The title should be "UEFI Boot Manager Maintenance". - I want to have "Edit(Modify) Boot Option" - "Add Boot Option" - The menu titles should be "Select a device" and "Select a file". - Some devices are shown, some are not. Why? Do we have to run, say, "scsi rescan" beforehand? - How can we specify "removable media" without a file path? - At "file selection" menu, "Esc" should let us go back to the "device selection" menu rather than the top, "Add Boot Option". - We should be able to specify initrd path, i.e. the second device path in a boot option. - We should be able to specify "optional data" in a boot option. - "Change Boot Order" - I like a more intuitive operation here. Say, select an item with "Enter" and then use "Up" and "Down" to move it around. - Probably, it would be better to have the final confirmation, like "Do you want to save the change?" Thanks, -Takahiro Akashi > *** U-Boot Boot Menu *** > > bootmenu_00 : Boot 1. kernel > bootmenu_01 : Boot 2. kernel > bootmenu_02 : Reset board > UEFI BOOT0000 : debian > UEFI BOOT0001 : ubuntu > UEFI BOOT0002 : mmc0:1 > UEFI BOOT0003 : mmc0:2 > UEFI BOOT0004 : nvme0:1 > UEFI BOOT0005 : nvme0:2 > UEFI BOOT0006 : usb0:2 > UEFI BOOT0007 : usb1:1 > UEFI BOOT0008 : usb1:2 > distro_boot : usb0 > distro_boot : scsi0 > distro_boot : virtio0 > distro_boot : dhcp > > Press UP/DOWN to move, ENTER to select, ESC/CTRL+C to quit > > [Major changes from RFC v3] > - add Kconfig option to disable U-Boot console > - add UEFI boot variable maintenance feature > - support removable media support and user selection > - app bootmenu enhancement documentation > > [How to run on QEMU(arm64)] > 1) clone source code > $ git clone https://git.linaro.org/people/masahisa.kojima/u-boot.git \ > -b kojima/bootmenu_v4_upstream_0324 --depth 1 > > 2) prepare U-Boot .config > $ make qemu_arm64_menuconfig > then, enable CONFIG_CMD_BOOTMENU and CONFIG_AUTOBOOT_MENU_SHOW > > 3) run on QEMU(arm64) example > $ qemu-system-aarch64 -machine virt,gic-version=3 -cpu cortex-a57 -m 4G -nographic \ > -no-acpi -bios ./u-boot.bin -hda xxx.img > > > AKASHI Takahiro (2): > efi_loader: export efi_locate_device_handle() > efi_loader: bootmgr: add booting from removable media > > Masahisa Kojima (9): > bootmenu: fix menu API error handling > lib/charset: add u16_strlcat() function > test: unit test for u16_strlcat() > menu: always show the menu regardless of the number or entry > bootmenu: add UEFI and disto_boot entries > bootmenu: factor out the user input handling > efi_loader: add menu-driven UEFI Boot Variable maintenance > bootmenu: add removable media entries > doc:bootmenu: add UEFI boot variable and distro boot support > > cmd/Kconfig | 10 + > cmd/bootmenu.c | 678 +++++++---- > common/menu.c | 139 ++- > doc/usage/bootmenu.rst | 65 ++ > include/charset.h | 15 + > include/config_distro_bootcmd.h | 14 +- > include/efi_default_filename.h | 26 + > include/efi_loader.h | 63 ++ > include/menu.h | 20 + > lib/charset.c | 21 + > lib/efi_loader/Makefile | 1 + > lib/efi_loader/efi_bootmenu_maintenance.c | 1244 +++++++++++++++++++++ > lib/efi_loader/efi_bootmgr.c | 50 +- > lib/efi_loader/efi_boottime.c | 59 +- > lib/efi_loader/efi_console.c | 81 ++ > lib/efi_loader/efi_disk.c | 11 + > lib/efi_loader/efi_file.c | 75 +- > test/unicode_ut.c | 45 + > 18 files changed, 2357 insertions(+), 260 deletions(-) > create mode 100644 include/efi_default_filename.h > create mode 100644 lib/efi_loader/efi_bootmenu_maintenance.c > > -- > 2.17.1 >