summaryrefslogtreecommitdiff
path: root/cmd/bootefi.c
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2017-07-24 07:59:09 -0400
committerAlexander Graf <agraf@suse.de>2017-07-24 14:33:32 +0200
commit3e433e960887a480f520d4b82ff8d3df3e037ffb (patch)
tree3fbae1a192ab01f2a70d23545de0a4b679be128c /cmd/bootefi.c
parent8787b02e32dc8bcf7ed432adcb0d246c5c844985 (diff)
efi_loader: EFI file paths should be DOS style
shim.efi, for example, actually tries to parse this, but is expecting backslashes. Signed-off-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'cmd/bootefi.c')
-rw-r--r--cmd/bootefi.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index e9f14d54af..954245740b 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -339,7 +339,7 @@ void efi_set_bootdev(const char *dev, const char *devnr, const char *path)
{
__maybe_unused struct blk_desc *desc;
char devname[32] = { 0 }; /* dp->str is u16[32] long */
- char *colon;
+ char *colon, *s;
#if defined(CONFIG_BLK) || CONFIG_IS_ENABLED(ISO_PARTITION)
desc = blk_get_dev(dev, simple_strtol(devnr, NULL, 10));
@@ -384,5 +384,9 @@ void efi_set_bootdev(const char *dev, const char *devnr, const char *path)
} else {
snprintf(devname, sizeof(devname), "%s", path);
}
+ /* DOS style file path: */
+ s = devname;
+ while ((s = strchr(s, '/')))
+ *s++ = '\\';
ascii2unicode(bootefi_image_path[0].str, devname);
}