public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 03/14] efi_loader: bootmgr: allow for running a given load option
Date: Mon, 3 Dec 2018 12:20:21 +0900	[thread overview]
Message-ID: <20181203032020.GB28995@linaro.org> (raw)
In-Reply-To: <f1fa54fd-5b72-f082-aa1e-a2a4bcaa597b@suse.de>

On Mon, Dec 03, 2018 at 12:22:37AM +0100, Alexander Graf wrote:
> 
> 
> On 05.11.18 10:06, AKASHI Takahiro wrote:
> > With an extra argument, efi_bootmgr_load() can now load an efi binary
> > based on a "BootXXXX" variable specified.
> > 
> > Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> 
> I don't see you changing the caller, so this hunk won't compile on its own?

You're correct.

> Please make sure that every single step in your patch set compiles.

I will try to double-check in the future.

> > ---
> >  include/efi_loader.h         | 3 ++-
> >  lib/efi_loader/efi_bootmgr.c | 8 +++++++-
> >  2 files changed, 9 insertions(+), 2 deletions(-)
> > 
> > diff --git a/include/efi_loader.h b/include/efi_loader.h
> > index d83de906fbce..ce0f420b5004 100644
> > --- a/include/efi_loader.h
> > +++ b/include/efi_loader.h
> > @@ -540,7 +540,8 @@ struct efi_load_option {
> >  
> >  void efi_deserialize_load_option(struct efi_load_option *lo, u8 *data);
> >  unsigned long efi_serialize_load_option(struct efi_load_option *lo, u8 **data);
> > -void *efi_bootmgr_load(struct efi_device_path **device_path,
> > +void *efi_bootmgr_load(int boot_id,
> > +		       struct efi_device_path **device_path,
> >  		       struct efi_device_path **file_path);
> >  
> >  #else /* CONFIG_IS_ENABLED(EFI_LOADER) */
> > diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c
> > index a095df3f540b..74eb832a8c92 100644
> > --- a/lib/efi_loader/efi_bootmgr.c
> > +++ b/lib/efi_loader/efi_bootmgr.c
> > @@ -170,7 +170,8 @@ error:
> >   * available load-options, finding and returning the first one that can
> >   * be loaded successfully.
> >   */
> > -void *efi_bootmgr_load(struct efi_device_path **device_path,
> > +void *efi_bootmgr_load(int boot_id,
> > +		       struct efi_device_path **device_path,
> >  		       struct efi_device_path **file_path)
> >  {
> >  	uint16_t *bootorder;
> > @@ -183,6 +184,11 @@ void *efi_bootmgr_load(struct efi_device_path **device_path,
> >  	bs = systab.boottime;
> >  	rs = systab.runtime;
> >  
> > +	if (boot_id != -1) {
> > +		image = try_load_entry(boot_id, device_path, file_path);
> > +		goto error;
> 
> I think at this point it might be better to split the function, no?

It's one way to fix, but I want simply to fix the issue by
modifying the caller, do_bootefi_bootmgr_exec() because

> You're not actually reusing any code from efi_bootmgr_load with the 2
> instantiation types (explicit boot id, loop through boot order).

I will add "BootNext" support to efi_bootmgr_load() so that it will be
a single point of loading. See my relevant patch:
https://lists.denx.de/pipermail/u-boot/2018-November/349281.html

Thanks,
-Takahiro Akashi


> 
> Alex
> 
> > +	}
> > +
> >  	bootorder = get_var(L"BootOrder", &efi_global_variable_guid, &size);
> >  	if (!bootorder)
> >  		goto error;
> > 

  reply	other threads:[~2018-12-03  3:20 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-05  9:06 [U-Boot] [PATCH v2 00/14] efi: make efi and bootmgr more usable AKASHI Takahiro
2018-11-05  9:06 ` [U-Boot] [PATCH v2 01/14] efi_loader: allow device == NULL in efi_dp_from_name() AKASHI Takahiro
2018-11-05  9:06 ` [U-Boot] [PATCH v2 02/14] efi_loader: bootmgr: add load option helper functions AKASHI Takahiro
2018-11-05  9:06 ` [U-Boot] [PATCH v2 03/14] efi_loader: bootmgr: allow for running a given load option AKASHI Takahiro
2018-12-02 23:22   ` Alexander Graf
2018-12-03  3:20     ` AKASHI Takahiro [this message]
2018-12-03 13:54       ` Alexander Graf
2018-11-05  9:06 ` [U-Boot] [PATCH v2 04/14] cmd: add efishell command AKASHI Takahiro
2018-12-02 23:42   ` Alexander Graf
2018-12-03  6:42     ` AKASHI Takahiro
2018-12-03 14:01       ` Alexander Graf
2018-11-05  9:06 ` [U-Boot] [PATCH v2 05/14] cmd: efishell: add devices command AKASHI Takahiro
2018-12-02 23:46   ` Alexander Graf
2018-12-03  7:02     ` AKASHI Takahiro
2018-12-23  3:11       ` Alexander Graf
2018-12-25 12:00         ` AKASHI Takahiro
2018-12-26  8:00           ` Alexander Graf
2019-01-07  8:22             ` AKASHI Takahiro
2018-11-05  9:06 ` [U-Boot] [PATCH v2 06/14] cmd: efishell: add drivers command AKASHI Takahiro
2018-11-05  9:06 ` [U-Boot] [PATCH v2 07/14] cmd: efishell: add images command AKASHI Takahiro
2018-11-05  9:06 ` [U-Boot] [PATCH v2 08/14] cmd: efishell: add memmap command AKASHI Takahiro
2018-12-02 23:48   ` Alexander Graf
2018-12-03  7:10     ` AKASHI Takahiro
2018-11-05  9:06 ` [U-Boot] [PATCH v2 09/14] cmd: efishell: add dh command AKASHI Takahiro
2018-11-05  9:06 ` [U-Boot] [PATCH v2 10/14] cmd: bootefi: carve out fdt parameter handling AKASHI Takahiro
2018-12-02 23:50   ` Alexander Graf
2018-12-03  7:33     ` AKASHI Takahiro
2018-12-23  3:11       ` Alexander Graf
2018-12-25 12:05         ` AKASHI Takahiro
2018-11-05  9:06 ` [U-Boot] [PATCH v2 11/14] cmd: bootefi: run an EFI application of a specific load option AKASHI Takahiro
2018-11-05  9:06 ` [U-Boot] [PATCH v2 12/14] cmd: run: add "-e" option to run an EFI application AKASHI Takahiro
2018-12-02 23:53   ` Alexander Graf
2018-12-03  7:57     ` AKASHI Takahiro
2018-11-05  9:06 ` [U-Boot] [PATCH v2 13/14] cmd: efishell: export uefi variable helper functions AKASHI Takahiro
2018-12-02 23:54   ` Alexander Graf
2018-12-03  8:08     ` AKASHI Takahiro
2018-12-23  3:13       ` Alexander Graf
2018-12-25 12:14         ` AKASHI Takahiro
2018-11-05  9:06 ` [U-Boot] [PATCH v2 14/14] cmd: env: add "-e" option for handling UEFI variables AKASHI Takahiro

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=20181203032020.GB28995@linaro.org \
    --to=takahiro.akashi@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox