From patchwork Wed Dec 30 15:07:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 355272 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp11403249jai; Wed, 30 Dec 2020 07:07:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJzlSFwDWgF9C2JO1E36Q8ABQAE8Zl8GV/yi0u2gN6PetdDkg8hDqpsF2HaSBD3tp+Sbf6DF X-Received: by 2002:a05:6402:40e:: with SMTP id q14mr50822109edv.85.1609340879385; Wed, 30 Dec 2020 07:07:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609340879; cv=none; d=google.com; s=arc-20160816; b=iV2BPesHscwLBFLXrDhWUWo1cKtDK5Ke/xlVBGICXtWC61gHX+HwfYA/q0GQeZhEEy m+riGt3UuCO1HtR21NJ8Pw9eB3nZYMgX706anda6fr2ggCAsje0smiXfCg+kLRPblAlp EKzmIjfljH9fSfR3YwDeoA0IFKxWSey/goTgcMe+nXZZCsrfYDxGRAjB9ZrJhy7nnISp /0ZVqyD/VGnN7ViUkj0Abhh/qaF25pCes1jfAt/+sGob+1Dno7OJdmjAOkxKTZ711UpM /PPwMJ2minivdqR5UKQvuwFfZz4JSEJyntxpoij7gEwdL9woUZES4N+fXtyO3CDs7lw9 ijzQ== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=o8CxNN6z9S6qCMV4F25SQ5mR/YH8CYxBTHwuJKsM48E=; b=GRH8ikTcHhs5Qb/t0BiB9QY+LVZT4bDAK+ha/sZEvlbXaEPpikHE75YNIyDiJvmhnj cU8W/JQZ0OiellfptAef5DXXgylPOYm+nPC9ghsx/oiKELvQ64IPKMkT+6bRheni4dpk 7BCVobceZTAiqhlrFIpw/hz2SPupxUVYixtdwmTsnTmppmTGZdSlM4QvRYFKaANuRQDq L8J970mJS63N+cocOZ+Expz87KF07r76rEur7LFfb4ZhFY3O2CGE6j7RAh7aEhNsSpy2 6W37usOWxKBagS07NUo/KuIVZ27MoaYXFpfoH4ct5N7JQafnwhI3Q4Gt8+ZvT+f+56QY Csdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X4qUw21S; 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 ak15si21549042ejc.654.2020.12.30.07.07.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Dec 2020 07:07:59 -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=X4qUw21S; 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 1B45E8260A; Wed, 30 Dec 2020 16:07:43 +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="X4qUw21S"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 66564825DC; Wed, 30 Dec 2020 16:07:36 +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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) (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 ECBD08257D for ; Wed, 30 Dec 2020 16:07:31 +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=ilias.apalodimas@linaro.org Received: by mail-wr1-x434.google.com with SMTP id c5so17674466wrp.6 for ; Wed, 30 Dec 2020 07:07:31 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=o8CxNN6z9S6qCMV4F25SQ5mR/YH8CYxBTHwuJKsM48E=; b=X4qUw21SGcak3axj5xz4ZDj2PMbMJfQWJJhB/1nEy3OQGUH9mAEEemyLvx9YGQ2an4 t/h3wLrU6eNY5gSwwypTWUQfDBikG/GobI0L92BgYypkIwjGdSM1uUDEkaEWGsKvUs2W dNcmP3k15sZuuJQAYFhwkO300VQa9HmGix1ZDGPe9yCEZc1Udw5Y0w0Le27rSeTxxk4S 2+Ck22FHW0HPSf+kXLIos91/VdQohwmSLk17ASzNXpRmTQvAzuwMAI4fUIwHZcv+2dzF FAcbXlW+0+fC49jIeNXn+HevYE+s7QtDLSxkduJ9a5oJB8QiwOoawccI2I8154Kr0xu7 6D/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=o8CxNN6z9S6qCMV4F25SQ5mR/YH8CYxBTHwuJKsM48E=; b=kJQMdrplMbZE776aHNnDdniCDm3gkclHl8QEgrKEfzHMuqb/bT5/rlzj1SCW0OCKPl k5b6R4+JKP/FyQ3E/TRR/RnCHuFSnspeICAuX7WwXr9PNEXz8p0nXUz1gKGN8vPYv4tp XHopGXfT+9BRXCWhXoLi+/hygeHm14P1uzrlx/5ahRV7RslU/m5uamkYXWZ1gvSA7roi WONZOCas+NwQQ3nHkg917Gq27r3hyXaV+MgyTAR2dhbpTfqH1Su8nYi0yrQUDm2jSTpr 17y342xEfs2DqBL9bvsiKAlSUYBt1ZtrQOJwsz3mVrPgAHa5hkZ7Pc4L9pECprtIUyRr unAQ== X-Gm-Message-State: AOAM530OvLpCKPoQcqrFznkt1WsARGQxyaCZUU4bs21qAFgsZqcYQLO3 /8Y22u0vTlmkHPP1juBuu90UTUEg7UgA06Ut X-Received: by 2002:adf:a1d5:: with SMTP id v21mr60707607wrv.24.1609340851567; Wed, 30 Dec 2020 07:07:31 -0800 (PST) Received: from localhost.localdomain (athedsl-4484548.home.otenet.gr. [94.71.57.204]) by smtp.gmail.com with ESMTPSA id k10sm62062721wrq.38.2020.12.30.07.07.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Dec 2020 07:07:31 -0800 (PST) From: Ilias Apalodimas To: xypron.glpk@gmx.de Cc: takahiro.akashi@linaro.org, ard.biesheuvel@arm.com, Ilias Apalodimas , Alexander Graf , u-boot@lists.denx.de Subject: [PATCH 2/8 v2] efi_loader: Remove unconditional installation of file2 protocol for initrd Date: Wed, 30 Dec 2020 17:07:14 +0200 Message-Id: <20201230150722.154663-3-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20201230150722.154663-1-ilias.apalodimas@linaro.org> References: <20201230150722.154663-1-ilias.apalodimas@linaro.org> 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.102.3 at phobos.denx.de X-Virus-Status: Clean Up to now we install the EFI_LOAD_FILE2_PROTOCOL to load an initrd unconditionally. Although we correctly return various EFI exit codes depending on the file status (i.e EFI_NO_MEDIA, EFI_NOT_FOUND etc), the kernel loader only falls back to the cmdline interpreted initrd if the protocol is not installed. This creates a problem for EFI installers, since they won't be able to load their own initrd and start the installation. A following patch introduces a different logic where we search for an initrd path defined in an EFI variable named 'Initrd####'. If the bootmgr is used to launch the EFI payload, we'll will try to match the BootCurrent value and find the corresponding initrd (i.e Boot0000 -> Initrd0000 etc). If the file is found, we'll install the required protocol which the kernel's efi-stub can use and load our initrd. Signed-off-by: Ilias Apalodimas --- lib/efi_loader/efi_setup.c | 5 ----- 1 file changed, 5 deletions(-) -- 2.30.0 Reviewed-by: Heinrich Schuchardt diff --git a/lib/efi_loader/efi_setup.c b/lib/efi_loader/efi_setup.c index e206b60bb82c..d7f880921268 100644 --- a/lib/efi_loader/efi_setup.c +++ b/lib/efi_loader/efi_setup.c @@ -209,11 +209,6 @@ efi_status_t efi_init_obj_list(void) if (ret != EFI_SUCCESS) goto out; #endif -#ifdef CONFIG_EFI_LOAD_FILE2_INITRD - ret = efi_initrd_register(); - if (ret != EFI_SUCCESS) - goto out; -#endif #ifdef CONFIG_NET ret = efi_net_register(); if (ret != EFI_SUCCESS)