]> glassweightruler.freedombox.rocks Git - Ventoy.git/commitdiff
Fixed the boot issue for "StorageCraft Recovery Environment CrossPlatform" in UEFI...
authorlongpanda <admin@ventoy.net>
Mon, 2 Aug 2021 14:50:38 +0000 (22:50 +0800)
committerlongpanda <admin@ventoy.net>
Mon, 2 Aug 2021 14:50:38 +0000 (22:50 +0800)
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_linux.c

index 8c7a8ff9b5a82bf05677f697a056f3fa391a0b94..16878fe4792aba6463882f8d08e902fc857414a7 100644 (file)
@@ -333,7 +333,9 @@ end:
 static grub_err_t ventoy_grub_cfg_initrd_collect(const char *fileName)
 {
     int i = 0;
+    int len = 0;
     int dollar = 0;
+    int quotation = 0;
     grub_file_t file = NULL;
     char *buf = NULL;
     char *start = NULL;
@@ -382,6 +384,12 @@ static grub_err_t ventoy_grub_cfg_initrd_collect(const char *fileName)
             start++;
         }
 
+        if (*start == '"')
+        {
+            quotation = 1;
+            start++;
+        }
+
         while (*start)
         {
             img = grub_zalloc(sizeof(initrd_info));
@@ -400,6 +408,16 @@ static grub_err_t ventoy_grub_cfg_initrd_collect(const char *fileName)
                 }
             }
 
+            if (quotation)
+            {
+                len = (int)grub_strlen(img->name);
+                if (len > 2 && img->name[len - 1] == '"')
+                {
+                    img->name[len - 1] = 0;
+                }
+                debug("Remove quotation <%s>\n", img->name);
+            }
+
             if (dollar == 1 || ventoy_find_initrd_by_name(g_initrd_img_list, img->name))
             {
                 grub_free(img);