* [U-Boot] [PATCH] efi_loader: Make exposed image loader path absolute
@ 2016-07-20 23:44 Alexander Graf
2016-07-26 2:32 ` [U-Boot] " Tom Rini
0 siblings, 1 reply; 2+ messages in thread
From: Alexander Graf @ 2016-07-20 23:44 UTC (permalink / raw)
To: u-boot
When loading an efi image, we pass it the location it was loaded from.
On file system backends, there are no relative paths, so we should always
pass in absolute ones. For network paths, we may be relative.
This fixes distro booting with grub2 for me when it fetches the grub2 config
file from the loader partition.
Reported-by: york sun <york.sun@nxp.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
cmd/bootefi.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index 011f62c..d66892e 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -290,6 +290,11 @@ void efi_set_bootdev(const char *dev, const char *devnr, const char *path)
/* Patch bootefi_image_path to the target file path */
memset(bootefi_image_path[0].str, 0, sizeof(bootefi_image_path[0].str));
- snprintf(devname, sizeof(devname), "%s", path);
+ if (strcmp(dev, "Net")) {
+ /* Add leading / to fs paths, because they're absolute */
+ snprintf(devname, sizeof(devname), "/%s", path);
+ } else {
+ snprintf(devname, sizeof(devname), "%s", path);
+ }
ascii2unicode(bootefi_image_path[0].str, devname);
}
--
1.8.5.6
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [U-Boot] efi_loader: Make exposed image loader path absolute
2016-07-20 23:44 [U-Boot] [PATCH] efi_loader: Make exposed image loader path absolute Alexander Graf
@ 2016-07-26 2:32 ` Tom Rini
0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2016-07-26 2:32 UTC (permalink / raw)
To: u-boot
On Thu, Jul 21, 2016 at 01:44:46AM +0200, Alexander Graf wrote:
> When loading an efi image, we pass it the location it was loaded from.
>
> On file system backends, there are no relative paths, so we should always
> pass in absolute ones. For network paths, we may be relative.
>
> This fixes distro booting with grub2 for me when it fetches the grub2 config
> file from the loader partition.
>
> Reported-by: york sun <york.sun@nxp.com>
> Signed-off-by: Alexander Graf <agraf@suse.de>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160725/a08d0e40/attachment.sig>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-07-26 2:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-20 23:44 [U-Boot] [PATCH] efi_loader: Make exposed image loader path absolute Alexander Graf
2016-07-26 2:32 ` [U-Boot] " Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox