[PATCH 2/2] efi_loader: create boot options without file path

AKASHI Takahiro takahiro.akashi at linaro.org
Sun Jun 12 03:21:55 CEST 2022


On Sat, Jun 11, 2022 at 05:22:08AM +0000, Heinrich Schuchardt wrote:
> Allow creating boot options without file path, e.g.
> 
>     efidebug boot add -b 0001 'short dev only' host 0:1 ''
>     efidebug boot add -B 0002 'long dev only' host 0:1 ''

So the "subject" is a bit misleading.
Your intension is to expand "efidebug", not uefi functionality.

> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
> ---
>  lib/efi_loader/efi_device_path.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c
> index 50a988c561..c511abcd5e 100644
> --- a/lib/efi_loader/efi_device_path.c
> +++ b/lib/efi_loader/efi_device_path.c
> @@ -1002,12 +1002,14 @@ struct efi_device_path *efi_dp_from_file(struct blk_desc *desc, int part,
>  		buf = dp_part_fill(buf, desc, part);
> 
>  	/* add file-path: */
> -	fp = buf;
> -	fp->dp.type = DEVICE_PATH_TYPE_MEDIA_DEVICE;
> -	fp->dp.sub_type = DEVICE_PATH_SUB_TYPE_FILE_PATH;
> -	fp->dp.length = (u16)fpsize;
> -	path_to_uefi(fp->str, path);
> -	buf += fpsize;
> +	if (*path) {
> +		fp = buf;
> +		fp->dp.type = DEVICE_PATH_TYPE_MEDIA_DEVICE;
> +		fp->dp.sub_type = DEVICE_PATH_SUB_TYPE_FILE_PATH;
> +		fp->dp.length = (u16)fpsize;
> +		path_to_uefi(fp->str, path);
> +		buf += fpsize;
> +	}

Please update the function description, too.
With your change, the current is no more enough.

-Takahiro Akashi


>  	*((struct efi_device_path *)buf) = END;
> 
> --
> 2.36.1
> 


More information about the U-Boot mailing list