public inbox for u-boot@lists.denx.de
 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>,
	Simon Glass <sjg@chromium.org>,
	Masahisa Kojima <masahisa.kojima@linaro.org>
Subject: Re: [PATCH v4 3/3] Load option with short device path for boot vars
Date: Thu, 25 May 2023 10:12:58 +0300	[thread overview]
Message-ID: <ZG8KekUzM3Es3lQE@hera> (raw)
In-Reply-To: <20230523191819.80258-3-raymond.mao@linaro.org>

Hi Raymond,

On Tue, May 23, 2023 at 12:18:22PM -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
> Changes in v4
> - Revert the change of introducing a bool parameter when updating
>   the boot option. Use short-form of device path by default
>
>  lib/efi_loader/efi_bootmgr.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c
> index c329428973..336b9d2d8f 100644
> --- a/lib/efi_loader/efi_bootmgr.c
> +++ b/lib/efi_loader/efi_bootmgr.c
> @@ -387,6 +387,11 @@ 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 */
> +		device_path = efi_dp_shorten(device_path);
> +		if (!device_path)

One nit here.  I think we should print a warning if shortening the path
fails.  Heinrich are you ok with this?  I think not falling back and adding
the long form DP is fine.

Thanks
/Ilias
> +			continue;
> +
>  		lo.label = dev_name;
>  		lo.attributes = LOAD_OPTION_ACTIVE;
>  		lo.file_path = device_path;
> --
> 2.25.1
>

  reply	other threads:[~2023-05-25  7:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-23 19:18 [PATCH v4 1/3] Move bootorder and bootoption apis to lib Raymond Mao
2023-05-23 19:18 ` [PATCH v4 2/3] Boot var automatic management for removable medias Raymond Mao
2023-05-25 13:55   ` Ilias Apalodimas
2023-05-25 16:42     ` Raymond Mao
2023-05-25 19:07       ` Ilias Apalodimas
2023-05-23 19:18 ` [PATCH v4 3/3] Load option with short device path for boot vars Raymond Mao
2023-05-25  7:12   ` Ilias Apalodimas [this message]
2023-05-26  6:25     ` Heinrich Schuchardt
2023-05-26  8:18       ` Ilias Apalodimas
2023-05-26  7:02 ` [PATCH v4 1/3] Move bootorder and bootoption apis to lib Heinrich Schuchardt
2023-05-26 15:41   ` 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=ZG8KekUzM3Es3lQE@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox