All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: 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	[thread overview]
Message-ID: <20201230150722.154663-3-ilias.apalodimas@linaro.org> (raw)
In-Reply-To: <20201230150722.154663-1-ilias.apalodimas@linaro.org>

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 <ilias.apalodimas@linaro.org>
---
 lib/efi_loader/efi_setup.c | 5 -----
 1 file changed, 5 deletions(-)

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)
-- 
2.30.0

  parent reply	other threads:[~2020-12-30 15:07 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-30 15:07 [PATCH 0/8 v2] Change logic of EFI LoadFile2 protocol for initrd loading Ilias Apalodimas
2020-12-30 15:07 ` [PATCH 1/8 v2] efi_loader: Remove unused headers from efi_load_initrd.c Ilias Apalodimas
2020-12-30 18:21   ` Heinrich Schuchardt
2020-12-30 15:07 ` Ilias Apalodimas [this message]
2020-12-30 18:15   ` [PATCH 2/8 v2] efi_loader: Remove unconditional installation of file2 protocol for initrd Heinrich Schuchardt
2020-12-30 15:07 ` [PATCH 3/8 v2] efi_loader: Add size checks to efi_create_indexed_name() Ilias Apalodimas
2020-12-30 18:34   ` Heinrich Schuchardt
2020-12-30 21:23     ` Ilias Apalodimas
2020-12-30 15:07 ` [PATCH 4/8 v2] efi_loader: Introduce helper functions for EFI Ilias Apalodimas
2020-12-30 19:29   ` Heinrich Schuchardt
2020-12-30 21:21     ` Ilias Apalodimas
2020-12-30 15:07 ` [PATCH 5/8 v2] efi_loader: bootmgr: Use get_var from efi_helper file Ilias Apalodimas
2020-12-30 19:32   ` Heinrich Schuchardt
2020-12-30 15:07 ` [PATCH 6/8 v2] efi_loader: Replace config option with EFI variable for initrd loading Ilias Apalodimas
2020-12-30 19:38   ` Heinrich Schuchardt
2021-01-05  2:42   ` AKASHI Takahiro
2021-01-05  8:50     ` Ilias Apalodimas
2021-01-06 10:43       ` Ilias Apalodimas
2021-01-06 11:07         ` Heinrich Schuchardt
2021-01-06 12:53           ` Ilias Apalodimas
2020-12-30 15:07 ` [PATCH 7/8 v2] efi_selftest: Modify self-tests for initrd loading via Loadfile2 Ilias Apalodimas
2020-12-30 20:29   ` Heinrich Schuchardt
2020-12-30 15:07 ` [PATCH 8/8 v2] doc: uefi: Add instruction for initrd loading Ilias Apalodimas
2020-12-30 20:17   ` Heinrich Schuchardt
2020-12-30 20:44 ` [PATCH 0/8 v2] Change logic of EFI LoadFile2 protocol " Heinrich Schuchardt
2020-12-30 21:17   ` Ilias Apalodimas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201230150722.154663-3-ilias.apalodimas@linaro.org \
    --to=ilias.apalodimas@linaro.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.