All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Raymond Mao <raymond.mao@linaro.org>
Cc: u-boot@lists.denx.de, Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Masahisa Kojima <masahisa.kojima@linaro.org>,
	Simon Glass <sjg@chromium.org>
Subject: Re: [PATCH v3 3/3] Load option with short device path for boot vars
Date: Tue, 16 May 2023 08:57:19 +0300	[thread overview]
Message-ID: <ZGMbP6fc+cc7JqEH@hera> (raw)
In-Reply-To: <20230502191218.47109-3-raymond.mao@linaro.org>

Hi Raymond,

On Tue, May 02, 2023 at 12:12:21PM -0700, Raymond Mao wrote:
> The boot variables automatically generated for removable medias
> should be with short form of device path without device nodes.
> This is a requirement for the case that a removable media is
> plugged into a different port but is still able to work with the
> existing boot variables.
>
> Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
> ---
> Changes in v2
> - Ignore EFI_NOT_FOUND returned from
>   efi_bootmgr_update_media_device_boot_option which means no boot
>   options scanned.
> Changes in v3
> - Split the patch into moving and renaming functions and
>   individual patches for each changed functionality
>
>  cmd/bootmenu.c                    |  2 +-
>  cmd/eficonfig.c                   |  2 +-
>  include/efi_loader.h              |  2 +-
>  lib/efi_loader/efi_bootmgr.c      | 16 +++++++++++++---
>  lib/efi_loader/efi_disk.c         |  2 +-
>  lib/efi_loader/efi_variable.c     |  2 +-
>  lib/efi_loader/efi_variable_tee.c |  2 +-
>  7 files changed, 19 insertions(+), 9 deletions(-)

[...]

>   * @count:		number of efi handle
> + * @short_path:		use short form device path for matching
>   * Return:		status code
>   */
>  static efi_status_t efi_bootmgr_enumerate_boot_option(struct eficonfig_media_boot_option *opt,
>  						      efi_handle_t *volume_handles,
> -						      efi_status_t count)
> +						      efi_status_t count,
> +						      bool short_path)

Are there cases where the normal device path is used? If not we can get rid
of the bool option entirely

>  {
>  	u32 i;
>  	struct efi_handler *handler;
> @@ -387,6 +389,13 @@ static efi_status_t efi_bootmgr_enumerate_boot_option(struct eficonfig_media_boo
>  		p = dev_name;
>  		utf8_utf16_strncpy(&p, buf, strlen(buf));
>
> +		/* use short form device path */
> +		if (short_path) {
> +			device_path = efi_dp_shorten(device_path);
> +			if (!device_path)
> +				continue;
> +		}
> +
>  		lo.label = dev_name;
>  		lo.attributes = LOAD_OPTION_ACTIVE;
>  		lo.file_path = device_path;

 [...]

 Thanks
 /Ilias

  reply	other threads:[~2023-05-16  5:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-02 19:12 [PATCH v3 1/3] Move bootorder and bootoption apis to lib Raymond Mao
2023-05-02 19:12 ` [PATCH v3 2/3] Boot var automatic management for removable medias Raymond Mao
2023-05-16  5:59   ` Ilias Apalodimas
2023-05-16 14:17     ` Raymond Mao
2023-05-23  6:22       ` Ilias Apalodimas
2023-05-02 19:12 ` [PATCH v3 3/3] Load option with short device path for boot vars Raymond Mao
2023-05-16  5:57   ` Ilias Apalodimas [this message]
2023-05-16 14:26     ` Raymond Mao
2023-05-16  5:58 ` [PATCH v3 1/3] Move bootorder and bootoption apis to lib Ilias Apalodimas
2023-05-16 14:32   ` Raymond Mao

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=ZGMbP6fc+cc7JqEH@hera \
    --to=ilias.apalodimas@linaro.org \
    --cc=masahisa.kojima@linaro.org \
    --cc=raymond.mao@linaro.org \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.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.