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 45D68C433EF for ; Thu, 28 Apr 2022 07:35:52 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 60661801BD; Thu, 28 Apr 2022 09:35:50 +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="KfXNKYNd"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D515480331; Thu, 28 Apr 2022 09:35:48 +0200 (CEST) Received: from mail-yw1-x1134.google.com (mail-yw1-x1134.google.com [IPv6:2607:f8b0:4864:20::1134]) (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 E378180112 for ; Thu, 28 Apr 2022 09:35:44 +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-x1134.google.com with SMTP id 00721157ae682-2f863469afbso19346667b3.0 for ; Thu, 28 Apr 2022 00:35:44 -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 :cc; bh=vUOrXtrwGl2mFEOb81YxWeW9dUib3QXLYpRcW6dVLm0=; b=KfXNKYNdbvffdg90nlAuVuiYj/UIC2VDSB8OHptfxRxhdqU/jgc3l/18UIDTBssSPH aWbGn5fNc8V2hRs4XzCrCXSaxcwW/ibtbZh4aeobsbe+TcqRZU2LFb1OspPIOIQRNJ1J 83ArodsVI1RYpXasfIBKg73kcKJaL/qeBmgdxd2FIgDnQkGJEa97f8xFnF6r2TGZUFNC jxpyyY/BoHtByMFnW1YmVQsMXj4HPrjHRRTDOonls99jT9+NTcwXccNRzzwOvkO+pgTg eO3hkfNfwnhel2dWvM2J1V0rJnkEHKgOIXkT18I2E9nbl0Q4+KCRn117oIfBWy4z5fbt O5kw== 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:cc; bh=vUOrXtrwGl2mFEOb81YxWeW9dUib3QXLYpRcW6dVLm0=; b=seZ90W078pKwlypYfzxScyZ0mFvg42KwjhKfQfp9NoEMSIz4fItU+XUWghBv4M6VG8 wI4PAJX/4lXBr//bX9YArlhgGNzomcOWgRU14Lm1vhhSU97HNkq9D95xT06pN7EtNe8S YNiaOpyFXRDQv3GueLaYXKfiRXd2mjtGSnNEvaeGzZOhf2mdtuHchNlpf3OE57+yktpG iLAEljVuZgYz3INMx4hk2W9in/umBptUsKUWCwXucwen5a6sD5qzmQ1du8vUaDr/vtlF 2hRKr3gdLDzIKvD/fxMy8YIsp26GMbIc+nQbMmzUNaEknLsfHbNdhpefV+BMbFJaLvFP ka2A== X-Gm-Message-State: AOAM5314s9BZE3a4R20cduaBiQXM4ymNYpf+93k8YPCKPVMtUti7vxwV G7j5929v3gOvFfaosHxJ8nWMHlgCcPixqhUQ/m+4+g== X-Google-Smtp-Source: ABdhPJx0ERQ9gPYT82AT6qzT2AtzBtyykqcp8r/3O21bg/UoYmqxIiAVJCn5h2vMNEXzETfH6eBXxRwlu3spTuj2JmE= X-Received: by 2002:a81:3a57:0:b0:2f1:57ee:c671 with SMTP id h84-20020a813a57000000b002f157eec671mr30982989ywa.104.1651131338479; Thu, 28 Apr 2022 00:35:38 -0700 (PDT) MIME-Version: 1.0 References: <20220324135443.1571-1-masahisa.kojima@linaro.org> <774e373c-6cdb-f03c-45c4-49fa476cc4dc@gmx.de> In-Reply-To: <774e373c-6cdb-f03c-45c4-49fa476cc4dc@gmx.de> From: Masahisa Kojima Date: Thu, 28 Apr 2022 16:35:26 +0900 Message-ID: Subject: Re: [PATCH v4 00/11] enable menu-driven boot device selection To: Heinrich Schuchardt Cc: Ilias Apalodimas , Simon Glass , Takahiro Akashi , Francois Ozog , Mark Kettenis , u-boot@lists.denx.de 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 Heinrich, On Sat, 16 Apr 2022 at 15:46, Heinrich Schuchardt wrote: > > On 3/24/22 14:54, 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. > > > > *** 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 > > > I applied the series to origin/master and added the two config options. > > This is the output if the disk image does not have an EFI partition: > > Found 0 disks > No EFI system partition > Unable to find TPMv2 device > > Even if there is no EFI system partition on virtio 0 I would expect the > menu to be shown. This issue is fixed in the next version. > > When having an image with an EFI system partition I get: > > *** U-Boot Boot Menu *** > > UEFI BOOT0003 : test3 > UEFI BOOT00A0 : hello > UEFI BOOT0000 : virtio0:1 > distro_boot : usb0 > distro_boot : scsi0 > distro_boot : virtio0 > distro_boot : nvme0 > distro_boot : dhcp > UEFI Boot Manager Maintenance > U-Boot console > > The entries usb0, scsi0, nvme0 should not exist as there is no such device. Non-existent devices are filtered out in the next version. > > => lsblk > Block Driver Devices > ----------------------------- > efi_blk : > nvme-blk : > scsi_blk : > usb_storage_blk : > virtio-blk : virtio 0 > > > When I select "U-Boot console" the prompt is written in the middle of > the screen. I would expect the screen to be cleared. > > If I disable networking, I get > > Missing RNG device for EFI_RNG_PROTOCOL > No EFI system partition > Unable to find TPMv2 device > => > > though the disk has an EFI partition. I fixed the issue that no menu appears if networking is disabled. But the issue of no EFI system partition found if networking is disabled seems a fundamental issue of U-Boot, not specific to this series. If networking is disabled, "lsblk" also can not find any block device. o networking disabled => lsblk Block Driver Devices ----------------------------- efi_blk : nvme-blk : scsi_blk : usb_storage_blk : virtio-blk : o networking enabled => lsblk Block Driver Devices ----------------------------- efi_blk : nvme-blk : scsi_blk : usb_storage_blk : virtio-blk : virtio 0 Thanks, Masahisa Kojima > > So this series needs some rework. > > Best regards > > Heinrich > > > > > > > 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 > > >