From patchwork Tue Nov 9 01:32:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 518028 Delivered-To: patch@linaro.org Received: by 2002:ad5:5208:0:0:0:0:0 with SMTP id p8csp1052278iml; Mon, 8 Nov 2021 17:33:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJxRUBfYuZld8ZADblbeCaiojcxvyP6O1QfNkILKTcyqaAK2sCcsZDt/z9wL3A6Qv071WLTm X-Received: by 2002:aa7:cac2:: with SMTP id l2mr4893904edt.168.1636421590778; Mon, 08 Nov 2021 17:33:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636421590; cv=none; d=google.com; s=arc-20160816; b=C/ENugMe4+4FWZZ3kqCP3hMWbOmfRr9Zg7KI/44A0Yq+hYETdJCyUO6Mx6F49xExqg lNFFmyO80U/N53m54vU4p3VkvcgUMAPsG6B9hEHpEZ4ltJb87ftJvigfQwCb8gqDSn8U cbY4CufIJLrjamhSu1JfpeYJLod2maVALiarAX7X9/Hq7GXV8Idmx7l2vL2cDmapNa+r ZNonZ5TNx7jJBgU5FZrNMi+9kjJ0oFINMfhJdAiNUQqYUOf008z+j2wN+GYKJUpZxukB bilkQr3nkSZ1iuu7cBKMlktGCgCP9eQc3rgFpLRp2yq2bNPZZB7RSMH3u6KquLF3i0Ze SXfw== 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:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=SO13/wIXhudeXCzKE5jTGsXSHDBF/1BSiCDIS33+UME=; b=OOHShuU8ejNz+QvTWaHqtO6vF+KqdTMfY9Nc68ji2SuCBcI0HFd5pZNgC4iiIfq3sD 21+W7bPh39lbcBSaG6N0KwRtRgWJSFMPbzkmqhZkBYK2bOKLzxZz5rNmNOupHj1OzaHO 9PebgWsZwtlLI2vsHLYSmKDfOr9+VoOcGQi/AP3MIFl+7so0D6DOfdAQPiHeEZTJznMi b/zWGAI2f++wV5RZkVYsOrudzSkiNtTcOLUY8Wk/gw2gWRhRI4Ld7bYN+LHHvzPtgBxF CWkdxlUt4F8KIMGkcx91/T3aSo4H2b+wZpnvY608oNC2MrBZ8BQuION6nhFFM00i8vwt bNlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ne3hjLo4; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id qb2si20131456ejc.155.2021.11.08.17.33.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Nov 2021 17:33:10 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ne3hjLo4; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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 0ED3B83830; Tue, 9 Nov 2021 02:33:07 +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="Ne3hjLo4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D8F8183877; Tue, 9 Nov 2021 02:33:04 +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 autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) (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 9DCF38364E for ; Tue, 9 Nov 2021 02:33: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=takahiro.akashi@linaro.org Received: by mail-pl1-x62e.google.com with SMTP id o14so17928314plg.5 for ; Mon, 08 Nov 2021 17:33:00 -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:mime-version :content-transfer-encoding; bh=SO13/wIXhudeXCzKE5jTGsXSHDBF/1BSiCDIS33+UME=; b=Ne3hjLo4Wp3XY8cGMOCPf+t/YfMMh4ihNfmG9b9vAENrUDeuaEyfqCkmXNT8LzLuTc 1ZNH7uhHRq9PaVejcQyuYplXV44+3X2qk7FDeg82Qgg4E0OPHeMbneOaeToJ2iPWhhjm ITjVX2kKIb669HJVpx6hn71VZXfYbgXIaYbElipEN22u8L5GbEyb/8gKUKRRh/6xhXOx 2aTQ8nt4svPGmGXchSOl/wOSEblO5vvPvU27KkUyAlcSSL5K6tSIdSwnJZiQyETITm3y H2lBXJLBQM6v/n7ZVAm1pEcnxDrn+u1EM6uGLXjVQSFPi1mTIZVRYb7b62oKOEJB1+yS 3ozQ== 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:mime-version :content-transfer-encoding; bh=SO13/wIXhudeXCzKE5jTGsXSHDBF/1BSiCDIS33+UME=; b=TSep+ZPn2hYtjZTUqhtA2ZAHbJQ3NvuqGB473uc1ZAXQ0nscBZFGPJXA84cuhFLaH/ fUm0LLOd3c3jibi/7lKBSgU5OhefTba7b4xzhVc1BSx+g3fLxdxwTEtId6luOTls5cUw TEBDMftJpN6/lCBH9mp9LFMtq9XIS5/vFuuaEI4FsLoTBbdIJRM5K93YijjVrJVyu7u8 EPKNmUUvT9+4bIscn5MOc8KEnCPmZ7PFNB+PA4WKyKgukXlF7hUvZaS5RwejQ6Vl8Q5T mMUQOU8qRun+A3wmWZ+bF3r4xO70kwWSBqohQG8cyLxWUMlzaZLdP18K00WKip5tqima O8Gw== X-Gm-Message-State: AOAM533pDbKtwIzgA6xUGyfywc3r+DuG6hMSj2JJTAA213bRnjzml5Tq K6BGnsE2c5Zg4+iQQjfDCGj0Fg== X-Received: by 2002:a17:90b:1a86:: with SMTP id ng6mr3049159pjb.142.1636421578641; Mon, 08 Nov 2021 17:32:58 -0800 (PST) Received: from localhost.localdomain ([2400:4050:c3e1:100:e857:cfcb:a6ed:9a8]) by smtp.gmail.com with ESMTPSA id v10sm4946589pfg.162.2021.11.08.17.32.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Nov 2021 17:32:58 -0800 (PST) From: AKASHI Takahiro To: xypron.glpk@gmx.de, agraf@csgraf.de Cc: sjg@chromium.org, ilias.apalodimas@linaro.org, u-boot@lists.denx.de, AKASHI Takahiro Subject: [RFC 0/3] efi_loader: bootmgr itself should support removable media Date: Tue, 9 Nov 2021 10:32:30 +0900 Message-Id: <20211109013233.72902-1-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean # This task is a bit motivated by Simon's discussion about bootflow[1]. Booting UEFI system from removable media is currently supported by distro_bootcmd script. But the behavior should be best implemented in UEFI Boot Manager. (Historically, the boot manager was added later than the support for removable media boot. So it is a matter of integration.) Here, "removable media" support means: 3.5.1.1 Removable Media Boot Behavior To generate a file name when none is present in the FilePath, the firmware must append a default file name in the form \EFI\BOOT\BOOT{machine type short-name}.EFI where machine type short-name defines a PE32+ image format architecture. With this patch set applied, the boot media order can also be defined by "BooOrder" variable, which the UEFI specification expects. You can find an example command usage in patch#3. Please note that this ehnancement improves the compliance to the specification and that it won't hurt any backward compatibility, if you don't want to use this feature, as long as a removable-related script in distro_bootcmd remains unchanged. The restriction (or drawback?) here is that we need to run all the "scan" commands before invoking the boot manager. [1] https://lists.denx.de/pipermail/u-boot/2021-August/458384.html RFC (Nov 09, 2021) * initial proposal AKASHI Takahiro (3): efi_loader: export efi_locate_device_handle() efi_loader: bootmgr: add booting from removable media cmd: efidebug: handle booting from removable media cmd/efidebug.c | 46 +++++++++++++++++++++---- include/efi_loader.h | 4 +++ lib/efi_loader/efi_bootmgr.c | 65 ++++++++++++++++++++++++++++++++++- lib/efi_loader/efi_boottime.c | 7 ++-- 4 files changed, 111 insertions(+), 11 deletions(-)