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 E9693C001DE for ; Fri, 14 Jul 2023 19:56:12 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AB9C984768; Fri, 14 Jul 2023 21:56:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=openbsd.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=kpnmail.nl header.i=@kpnmail.nl header.b="dQ0L0w19"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A3C7F84773; Fri, 14 Jul 2023 21:56:08 +0200 (CEST) Received: from ewsoutbound.kpnmail.nl (ewsoutbound.kpnmail.nl [195.121.94.185]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6D8D6846B6 for ; Fri, 14 Jul 2023 21:56:06 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=openbsd.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=kettenis@openbsd.org X-KPN-MessageId: 65ac3053-2280-11ee-8605-005056999439 Received: from smtp.kpnmail.nl (unknown [10.31.155.6]) by ewsoutbound.so.kpn.org (Halon) with ESMTPS id 65ac3053-2280-11ee-8605-005056999439; Fri, 14 Jul 2023 21:55:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kpnmail.nl; s=kpnmail01; h=mime-version:message-id:date:subject:to:from; bh=1PUoxszKtF5FkZWNZk3lVf2u0wckN+QUTaKiLIOhRjQ=; b=dQ0L0w19NjiIGAPlT39AKaWQfI4+BXcu1dLta+NcUBq4HZ4FBpb3licU3RXHCPCTuVFZffb5VwFHH 2/tTjYsM7VHvkClpBwpbLsQ1xe3cIcl4P3HOOvBTADJ8HewJ2HUGDcc9VnJIsd3K2cgZPk/s2W/jj6 c1p18WEbP6FJAjok= X-KPN-MID: 33|l0x3XdddvkzN0RdRkUnSjkR1Gubs0qoLkFdFKw8UnAHe/FIzKrdS1DevlzQ1Gaj BFVd7RV+V94mlzEMK3w+aW4n1HTLPeeZo8Ti3lWPAMu8= X-KPN-VerifiedSender: No X-CMASSUN: 33|XKsFWksFdWSY3kGRCud8wTtY/nIpZy7yC9T1E18udcq610RCdCuWz24rlky8h3r ZDiGpB3TrQFWfbAsGwrSh8w== X-Originating-IP: 80.61.163.207 Received: from copland.sibelius.xs4all.nl (80-61-163-207.fixed.kpn.net [80.61.163.207]) by smtp.xs4all.nl (Halon) with ESMTPSA id 778ae326-2280-11ee-b743-00505699772e; Fri, 14 Jul 2023 21:56:05 +0200 (CEST) From: Mark Kettenis To: u-boot@lists.denx.de Cc: sjg@chromium.org, xypron.glpk@gmx.de, Mark Kettenis Subject: [PATCH] bootstd: Make efi_mgr bootmeth work for non-sandbox setups Date: Fri, 14 Jul 2023 21:56:02 +0200 Message-ID: <20230714195602.99374-1-kettenis@openbsd.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.8 at phobos.denx.de X-Virus-Status: Clean Enable the bootflow based on this bootmeth if the BootOrder EFI variable is set. Signed-off-by: Mark Kettenis --- boot/bootmeth_efi_mgr.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/boot/bootmeth_efi_mgr.c b/boot/bootmeth_efi_mgr.c index e9d973429f..db650861ff 100644 --- a/boot/bootmeth_efi_mgr.c +++ b/boot/bootmeth_efi_mgr.c @@ -14,6 +14,8 @@ #include #include #include +#include +#include /** * struct efi_mgr_priv - private info for the efi-mgr driver @@ -46,13 +48,21 @@ static int efi_mgr_check(struct udevice *dev, struct bootflow_iter *iter) static int efi_mgr_read_bootflow(struct udevice *dev, struct bootflow *bflow) { struct efi_mgr_priv *priv = dev_get_priv(dev); + efi_uintn_t size; + u16 *bootorder; if (priv->fake_dev) { bflow->state = BOOTFLOWST_READY; return 0; } - /* To be implemented */ + /* Enable this method if the "BootOrder" UEFI exists. */ + bootorder = efi_get_var(u"BootOrder", &efi_global_variable_guid, + &size); + if (bootorder) { + bflow->state = BOOTFLOWST_READY; + return 0; + } return -EINVAL; } -- 2.41.0