[U-Boot] [PATCH 1/1] efi_loader: do not add \ in efi_fs_from_name()

Alexander Graf agraf at suse.de
Sat Feb 23 13:37:59 UTC 2019



> Am 23.02.2019 um 02:20 schrieb Heinrich Schuchardt <xypron.glpk at gmx.de>:
> 
> In the `efidebug boot add` command we do not want a unsollicitated leading
> backslash added to the file name.
> 
> There is no good reason to mark a loaded file with a backslash as absolute.
> Anyway when reading files the file name will be interpreted as relative to
> root directory of the device.
> 
> So let's get rid of this backslash.
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
> ---
> lib/efi_loader/efi_device_path.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c
> index 98c36e798f5..53b40c8c3c2 100644
> --- a/lib/efi_loader/efi_device_path.c
> +++ b/lib/efi_loader/efi_device_path.c
> @@ -985,12 +985,7 @@ efi_status_t efi_dp_from_name(const char *dev, const char *devnr,
>    if (!path)
>        return EFI_SUCCESS;
> 
> -    if (!is_net) {
> -        /* Add leading / to fs paths, because they're absolute */
> -        snprintf(filename, sizeof(filename), "/%s", path);
> -    } else {
> -        snprintf(filename, sizeof(filename), "%s", path);
> -    }
> +    snprintf(filename, sizeof(filename), "%s", path);

I'm pretty sure that code was there for a reason. Without, grub would not find its config file iirc.

Alex

>    /* DOS style file path: */
>    s = filename;
>    while ((s = strchr(s, '/')))
> -- 
> 2.20.1
> 



More information about the U-Boot mailing list