From patchwork Tue Mar 8 14:07: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: 549286 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6713:0:0:0:0 with SMTP id u19csp2655693mag; Tue, 8 Mar 2022 06:08:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJzoNCGmgOAH8Nh9Zz0hkImJN6k7QCceJ4EC08KqdHOcUYRyWnMBTSXGP2JGCEYM/DRx46mA X-Received: by 2002:a17:907:3f22:b0:6d7:8257:b27d with SMTP id hq34-20020a1709073f2200b006d78257b27dmr12878434ejc.190.1646748495332; Tue, 08 Mar 2022 06:08:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646748495; cv=none; d=google.com; s=arc-20160816; b=YrwELm3nunowhCJ9IWMgGZfC7pdXFzYS9TDpSiZKhPIlfyQwRhzJkMYLhJdSmDFoR7 7RMqaBVm2bhbJejtUwGQfDj7uyTGiGKIfk+fYfaiJ97x8SU2N+6xkkpjoK9xlOH+CbpY gQxkIt/h2SCKaeIhwQJZZrDiabwtI24RetU+fCJNkhTMK+gZ7uGOVHzFy6NAuKkJpMvN ilLM5v4S58LPdUTilU6mbG3hA2bbOviUKNcRd2VgZEMIJoPQdFPiMFTAKgwWGwX1IgSu CqRDFBKFO1td9aJRCL3Mux4alsylsrm1KiwONW5PdzFeI1q7lQFGepWdGEuJ6retNdbf wRwA== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=RDOFhHRLmwoKMe/vJkH60qjg5rS4UN9V3Za9SbIM94w=; b=Ym6FJUyzyjwusYbhGaVytEoFa0XMPpUU6f++yenqbeYaRtlmD5YgDDG+tQgUMMEDUV JamwKYHkV0h0MdsCABP0VWNif520SZ1GGeeZP+i3jfVpEQtQNim92g9v71vD05H3TxuQ tcggyFtxMfhT4hvNIvOBilL14AhAZ4feSjVX4SdOP7hj/q7ggHOzVD7n9MmQS+nZ6lhE jNfoWRAmoos4hMmVfxX0xOIlRnnUv9EIb4QkcYYLv3pWfnNZN1nq+N01uRMP62mQR6PE Sw+8mKTwH2bywHXx2K7V1g+ZzVQn/myOfU4OFxfCBAbHjhKLnwIKYxqwI6f2FRfIySUG nHyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qa9WLaE+; 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 j7-20020a05640211c700b00416799b824dsi803474edw.183.2022.03.08.06.08.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 06:08:15 -0800 (PST) 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=qa9WLaE+; 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 2B5E983970; Tue, 8 Mar 2022 15:08:00 +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="qa9WLaE+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CB4E683932; Tue, 8 Mar 2022 15:07:57 +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-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) (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 9FBC6836A9 for ; Tue, 8 Mar 2022 15:07:53 +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-pf1-x42f.google.com with SMTP id z16so17423182pfh.3 for ; Tue, 08 Mar 2022 06:07:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=RDOFhHRLmwoKMe/vJkH60qjg5rS4UN9V3Za9SbIM94w=; b=qa9WLaE+HvxB8bTVlnh5HEDzsJ5F7Ecke1iJbAEYaEYwjvo63IjXcL2vxvwMuURQGm 8jiT0yIJYwRQuGHvD098UaUaWsf5Dsksh/mSpFSUrqX3b2E2BYuO5QaGJY4MlGwhcA76 1cf8Y7Jr9vu2OaF2R6JsGTptn3qUwaTZrUqirNWjvdNRUCG0oXTrq7tgBsYnkV1oeMDP UYhYMd7mMnFlDi1wZ7qmnzionexRQaK2VNFQMfLiOLA4IBQzgujgvfYYIRfO3v5mFV2R AJJP8U4qRjlVoNG9OWDkowQU+SGjsItqE1NYvPg5qNB/Pgq5ThgfZIHqFNoYd05iGyi1 VynQ== 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=RDOFhHRLmwoKMe/vJkH60qjg5rS4UN9V3Za9SbIM94w=; b=BdMOr6QXfQ79SwfB8yjBdQSeAz2raw/69U9qYtHUJ+zSvlSb1Rqa4JeR+HN6btXurY pLyyWO56Z1B+wHS9TiBEGX8MTNhYBt/GQxusQt2yfjxhvsUXJgJt0TNm3/2XJ4J5k1Zd sEBmDZ6dsN3ItV6a7qCmDV+9sIR3ByDovuszuaud4bkrGnKMp3J5NP2+82usa2R03ual Xn2ULz5aE/ik/GPMK5ubC0vryE94btaZIW9UdcfcAaIep/Va9OBAdHRwEqtBQaNKunO7 XC8LzF8LcJv0SzMwBBQRfXwFlu1jRaQJ2htFnZgERWlP/xJWWAwoKM4XZghL2QkeG9gT Pq5w== X-Gm-Message-State: AOAM530FagIKdqXXNBipMJVKXx7uGPxbpJIsukh0qbhsWHqPcSG2MAww HGY0YOixTeOt4+QagzqwirjKLIWwjv5Ldg== X-Received: by 2002:a63:1a54:0:b0:375:82eb:7449 with SMTP id a20-20020a631a54000000b0037582eb7449mr14463433pgm.341.1646748471671; Tue, 08 Mar 2022 06:07:51 -0800 (PST) Received: from localhost.localdomain ([240d:1a:cf7:5800:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id k62-20020a17090a4cc400b001bf0d92e1c7sm3142989pjh.41.2022.03.08.06.07.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 06:07:51 -0800 (PST) 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: [RFC PATCH v3 0/2] enable menu-driven boot device selection Date: Tue, 8 Mar 2022 23:07:43 +0900 Message-Id: <20220308140745.26180-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. The menu example shown with this patch series is as follows. *** U-Boot Boot Menu *** Boot 1. kernel (bootmenu_0) Boot 2. kernel (bootmenu_1) Reset board (bootmenu_2) debian (BOOT0000) ubuntu (BOOT0001) UEFI Boot Manager usb0 scsi0 virtio0 dhcp UEFI Boot Manager Maintenance U-Boot console Press UP/DOWN to move, ENTER to select, ESC/CTRL+C to quit This example shows three "bootmenu_0..2" entries, UEFI "Boot0000" and "Boot0001" entries, distro_boot "boot_targets" entries(usb0, scici0, virtio0 and dhcp) and some pre-defined entries(UEFI Boot Manager, UEFI Boot Manager Maintenance and U-Boot console). Note that this patch series aims to propose the above menu structure, the code quality is very low and requires much cleanup/refactoring. [How to run on QEMU(arm64)] 1) clone source code $ git clone https://git.linaro.org/people/masahisa.kojima/u-boot.git \ -b kojima/efibootmenu_v3_upstream --depth 2 2) update 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 [Changes in v3] - Major difference from previous version is that this version extends the existing bootmenu capability instead of updating efi bootmgr. - include distro_boot entries - "bootefi bootindex" command is newly added Masahisa Kojima (2): efi_loader: introduce "bootefi bootindex" command bootmenu: add UEFI and disto_boot entries cmd/bootefi.c | 42 ++++++ cmd/bootmenu.c | 268 +++++++++++++++++++++++++++++++++-- include/efi_loader.h | 1 + lib/efi_loader/efi_bootmgr.c | 7 +- 4 files changed, 305 insertions(+), 13 deletions(-)