]> git.sur5r.net Git - u-boot/commitdiff
efi_loader: EFI file paths should be DOS style
authorRob Clark <robdclark@gmail.com>
Mon, 24 Jul 2017 11:59:09 +0000 (07:59 -0400)
committerAlexander Graf <agraf@suse.de>
Mon, 24 Jul 2017 12:33:32 +0000 (14:33 +0200)
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>
cmd/bootefi.c

index e9f14d54af381fa3b9c33b8931090d11d3156bb7..954245740b8d06b3c5ed612f43f42a6b18fd3253 100644 (file)
@@ -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);
 }