All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v1] fs: do_load: pass device path for efi payload
@ 2019-06-18 13:03 Mian Yousaf Kaukab
  2019-06-18 17:27 ` Heinrich Schuchardt
  0 siblings, 1 reply; 2+ messages in thread
From: Mian Yousaf Kaukab @ 2019-06-18 13:03 UTC (permalink / raw)
  To: u-boot

fatload command can be used to load the EFI payload since EFI system
partition is always a FAT partition. Call into EFI code from do_load()
to set the device path from which the last binary was loaded. An EFI
application like grub2 can’t find its configuration file without the
device path set.

Since device path is now set in do_load() there is no need to set it
in do_load_wrapper() for the load command.

Signed-off-by: Mian Yousaf Kaukab <ykaukab@suse.de>
---
Changes for v1:
- Move efi_set_bootdev() call to do_load()
- Rename patch from "cmd: fat: fatload: pass device path for efi payload"

 cmd/fs.c | 5 -----
 fs/fs.c  | 5 +++++
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/cmd/fs.c b/cmd/fs.c
index aaafbf9b52..db74767b7b 100644
--- a/cmd/fs.c
+++ b/cmd/fs.c
@@ -8,7 +8,6 @@
 #include <common.h>
 #include <command.h>
 #include <fs.h>
-#include <efi_loader.h>
 
 static int do_size_wrapper(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
@@ -26,10 +25,6 @@ U_BOOT_CMD(
 static int do_load_wrapper(cmd_tbl_t *cmdtp, int flag, int argc,
 				char * const argv[])
 {
-#ifdef CONFIG_CMD_BOOTEFI
-	efi_set_bootdev(argv[1], (argc > 2) ? argv[2] : "",
-			(argc > 4) ? argv[4] : "");
-#endif
 	return do_load(cmdtp, flag, argc, argv, FS_TYPE_ANY);
 }
 
diff --git a/fs/fs.c b/fs/fs.c
index 736ebef4a9..48d8f1f6da 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -17,6 +17,7 @@
 #include <asm/io.h>
 #include <div64.h>
 #include <linux/math64.h>
+#include <efi_loader.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -700,6 +701,10 @@ int do_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
 	else
 		pos = 0;
 
+#ifdef CONFIG_CMD_BOOTEFI
+	efi_set_bootdev(argv[1], (argc > 2) ? argv[2] : "",
+			(argc > 4) ? argv[4] : "");
+#endif
 	time = get_timer(0);
 	ret = _fs_read(filename, addr, pos, bytes, 1, &len_read);
 	time = get_timer(time);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCH v1] fs: do_load: pass device path for efi payload
  2019-06-18 13:03 [U-Boot] [PATCH v1] fs: do_load: pass device path for efi payload Mian Yousaf Kaukab
@ 2019-06-18 17:27 ` Heinrich Schuchardt
  0 siblings, 0 replies; 2+ messages in thread
From: Heinrich Schuchardt @ 2019-06-18 17:27 UTC (permalink / raw)
  To: u-boot

On 6/18/19 3:03 PM, Mian Yousaf Kaukab wrote:
> fatload command can be used to load the EFI payload since EFI system
> partition is always a FAT partition. Call into EFI code from do_load()
> to set the device path from which the last binary was loaded. An EFI
> application like grub2 can’t find its configuration file without the
> device path set.
>
> Since device path is now set in do_load() there is no need to set it
> in do_load_wrapper() for the load command.
>
> Signed-off-by: Mian Yousaf Kaukab <ykaukab@suse.de>

Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-18 17:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-18 13:03 [U-Boot] [PATCH v1] fs: do_load: pass device path for efi payload Mian Yousaf Kaukab
2019-06-18 17:27 ` Heinrich Schuchardt

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.