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 0/6] Change logic of EFI LoadFile2 protocol for initrd loading
Date: Mon, 28 Dec 2020 14:24:32 +0200	[thread overview]
Message-ID: <20201228122440.316403-1-ilias.apalodimas@linaro.org> (raw)

Right now in U-Boot, we unconditionally register the EFI LoadFile2 protocol
and the initrd file path is a U-boot .config option.

This imposes a number of limitations. Using multiple initrd's implies you'd
have to concatenate them into one big file. Alternatively you'd have to
recompile U-Boot or overwrite your initrd with a newer one in order to use
it.  Since linux efi-stub only falls back to the cmdline interpreted initrd
if the protocol is not registered, this also creates a problem for EFI
installers, since they won't be able to load their own initrd and start the
installation if the option is enabled.

This patchset is trying to address all of the above, by changing the logic
of the protocol registration and initrd discovery.
It introduces a new EFI variable 'Initrd####', which we try to match on the
BootCurrent value the bootmanager sets up.
For example Boot0010 will search for Initrd0010, which should include the
full initrd path i.e 'mmc 0:0 initrd'. If the file is present, the protocol
will be registered, so the efi-stub can use it.

This opens up another path using U-Boot and defines a new boot flow.
A user will be able to control the kernel/initrd pairs without explicit
cmdline args or GRUB, just by setting the correct 'Initrd####' variable.

Ilias Apalodimas (6):
  efi_loader: remove unconditional initialization of file2 protocol for
    initrd
  efi_loader: Introduce helper functions for EFI
  efi_loader: Replace config option with EFI variable for initrd loading
  efi_loader: Remove unused headers from efi_load_initrd.c
  efi_selftest: Modify self-tests for initrd loading
  efi_loader: bootmgr: use get_var from efi_helper file

 include/efi_helper.h                        |  29 +++
 lib/efi_loader/Kconfig                      |  12 +-
 lib/efi_loader/Makefile                     |   4 +-
 lib/efi_loader/efi_bootmgr.c                |  39 +---
 lib/efi_loader/efi_helper.c                 | 189 ++++++++++++++++++++
 lib/efi_loader/efi_load_initrd.c            |  88 +++------
 lib/efi_loader/efi_setup.c                  |   5 -
 lib/efi_selftest/efi_selftest_load_initrd.c |  90 +++++++++-
 8 files changed, 341 insertions(+), 115 deletions(-)
 create mode 100644 include/efi_helper.h
 create mode 100644 lib/efi_loader/efi_helper.c

-- 
2.30.0.rc2

             reply	other threads:[~2020-12-28 12:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-28 12:24 Ilias Apalodimas [this message]
2020-12-28 12:24 ` [PATCH 1/6] efi_loader: remove unconditional initialization of file2 protocol for initrd Ilias Apalodimas
2020-12-28 12:24 ` [PATCH 2/6] efi_loader: Introduce helper functions for EFI Ilias Apalodimas
2020-12-28 14:49   ` Heinrich Schuchardt
2020-12-28 22:06     ` Ilias Apalodimas
2020-12-28 12:24 ` [PATCH 3/6] efi_loader: Replace config option with EFI variable for initrd loading Ilias Apalodimas
2020-12-28 13:10   ` Ilias Apalodimas
2020-12-28 14:55   ` Heinrich Schuchardt
2020-12-28 22:03     ` Ilias Apalodimas
2020-12-28 12:24 ` [PATCH 4/6] efi_loader: Remove unused headers from efi_load_initrd.c Ilias Apalodimas
2020-12-28 15:06   ` Heinrich Schuchardt
2020-12-28 15:08   ` [PATCH] " Heinrich Schuchardt
2020-12-28 12:24 ` [PATCH 5/6] efi_selftest: Modify self-tests for initrd loading Ilias Apalodimas
2020-12-28 12:24 ` [PATCH 6/6] efi_loader: bootmgr: use get_var from efi_helper file 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=20201228122440.316403-1-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.