Commit ee88eacb authored by Mian Yousaf Kaukab's avatar Mian Yousaf Kaukab Committed by Heinrich Schuchardt

fs: do_load: pass device path for efi payload

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: default avatarMian Yousaf Kaukab <ykaukab@suse.de>
Reviewed-by: default avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
parent fa390810
......@@ -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);
}
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment