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 D9317C433F5 for ; Thu, 24 Mar 2022 13:54:47 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 428FC840AA; Thu, 24 Mar 2022 14:54:45 +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="AMVOqfJ3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 53853840AB; Thu, 24 Mar 2022 14:54:43 +0100 (CET) Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) (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 9AF7E84091 for ; Thu, 24 Mar 2022 14:54:39 +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-pj1-x1036.google.com with SMTP id g9-20020a17090ace8900b001c7cce3c0aeso727088pju.2 for ; Thu, 24 Mar 2022 06:54:39 -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; bh=geKcZ+1l9R6HlapMNZf4x0spFLyCKMY+fQz11/4cI0o=; b=AMVOqfJ3VHJS3rgy8q4fIWsml6Hd13Wu0LQlnl80L+BVNOAFyGwNgX6Xd2NCSLccEA EH83DTgBFwaPWyE/6kKTxHeJ//SKIATg3H9rKn4CFiBujvldZ3pCGUdSXjVEMChrSp+Q cshsnlqcGO8aKQHEb0J45MFr9akYw4WvpLBzsDR+MxTjV1hfK/pdPG55hNgp+oL2GQ+c MO7x0Aj7v4wG8OhzfMEUhVBVIJmkXb8jIxVNWewNd1bCb91d/h9En1+1J5rRzIoCkrkD mk8UrpLLNhmqQb0OIStDCn9N3T9VUgdvBrnKUmGeIKAgGkIgkfxsIxysCqqwRPSQwY7N z3vg== 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; bh=geKcZ+1l9R6HlapMNZf4x0spFLyCKMY+fQz11/4cI0o=; b=oqqdTwvmLcp4LVL+IM4rIHGdqZdh66c0Mo7HbfAhgJ5dXw0cqF9PgoeFjHNG6J9MNK OtgnfbU0wWVfjk3P0pegf7k5voZO+TS0GBNQUUCFafpT6UUB+c2Ba7mTR0SLnp7VBlZZ AZI2zDQvmys0r6FCxPrBI30Pt85b2x81mtbITRV6Tn7MsUpetRBSTIrZ4eZkfMChSTUP txHS4IEDblW6fcFcBxjSCFLKPNNyCXbGEtU3FfuUGvt0jZupEr+BQ+UW2zH8WzDGsONQ QHrDhHhSX2n01E51/m1p1E5Q5i9o4zgz3xzefu7/rAN07Fe5zQ/+ZRkXSU0/BWCb3nQ3 DvRA== X-Gm-Message-State: AOAM531qfzwO1xNSqKeyqQPwU4LUPQyzuc2J9GnJIhKEsaFCrXu3nlIV jIKZp7MIvrdJ04cwH7Sjfk3YY9E587uwgA== X-Google-Smtp-Source: ABdhPJxU7ijyK6oesz/depKxt9irTsXIsKMYK747Et26Xcmv6+IX7IpMD8T6S/j3/kCVkN9xg8ACkA== X-Received: by 2002:a17:902:7207:b0:153:d860:5c8d with SMTP id ba7-20020a170902720700b00153d8605c8dmr5830881plb.40.1648130077839; Thu, 24 Mar 2022 06:54:37 -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.54.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Mar 2022 06:54:37 -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 00/11] enable menu-driven boot device selection Date: Thu, 24 Mar 2022 22:54:32 +0900 Message-Id: <20220324135443.1571-1-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 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 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 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