]> glassweightruler.freedombox.rocks Git - Ventoy.git/commitdiff
Fix a bug about ventoy version message position when VTOY_DEFAULT_IMG is set to F6>xxx
authorlongpanda <admin@ventoy.net>
Wed, 9 Jun 2021 12:55:45 +0000 (20:55 +0800)
committerlongpanda <admin@ventoy.net>
Wed, 9 Jun 2021 12:55:45 +0000 (20:55 +0800)
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_def.h
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_plugin.c

index 600198409021e7fb8546a292ad7da0f9cad02be1..4c3497070f8f2a39db063cc0d9cdc24195a09b8d 100644 (file)
@@ -1047,5 +1047,11 @@ int ventoy_chain_file_read(const char *path, int offset, int len, void *buf);
 #define vtoy_theme_random_boot_day     1
 #define vtoy_theme_random_boot_month   2
 
 #define vtoy_theme_random_boot_day     1
 #define vtoy_theme_random_boot_month   2
 
+#define ventoy_env_export(env, name) \
+{\
+    grub_env_set((env), (name));\
+    grub_env_export(env);\
+}
+
 #endif /* __VENTOY_DEF_H__ */
 
 #endif /* __VENTOY_DEF_H__ */
 
index 8b3ecd7fce4f1bed6d8e83794c8e3fd2119346fa..c41d96493e8f4de3e5f0c2014ca352eb730a08ec 100644 (file)
@@ -304,7 +304,7 @@ static int ventoy_plugin_theme_entry(VTOY_JSON *json, const char *isodisk)
         }
 
         debug("vtoy_theme %s\n", filepath);
         }
 
         debug("vtoy_theme %s\n", filepath);
-        grub_env_set("vtoy_theme", filepath);
+        ventoy_env_export("vtoy_theme", filepath);
         grub_snprintf(g_theme_single_file, sizeof(g_theme_single_file), "%s", filepath);
     }
     else
         grub_snprintf(g_theme_single_file, sizeof(g_theme_single_file), "%s", filepath);
     }
     else
@@ -346,7 +346,7 @@ static int ventoy_plugin_theme_entry(VTOY_JSON *json, const char *isodisk)
                 }
             }
 
                 }
             }
 
-            grub_env_set("vtoy_theme", "random");
+            ventoy_env_export("vtoy_theme", "random");
             value = vtoy_json_get_string_ex(json->pstChild, "random");
             if (value)
             {
             value = vtoy_json_get_string_ex(json->pstChild, "random");
             if (value)
             {
@@ -370,39 +370,39 @@ static int ventoy_plugin_theme_entry(VTOY_JSON *json, const char *isodisk)
     if (value)
     {
         debug("vtoy_gfxmode %s\n", value);
     if (value)
     {
         debug("vtoy_gfxmode %s\n", value);
-        grub_env_set("vtoy_gfxmode", value);
+        ventoy_env_export("vtoy_gfxmode", value);
     }
     
     value = vtoy_json_get_string_ex(json->pstChild, "display_mode");
     if (value)
     {
         debug("display_mode %s\n", value);
     }
     
     value = vtoy_json_get_string_ex(json->pstChild, "display_mode");
     if (value)
     {
         debug("display_mode %s\n", value);
-        grub_env_set("vtoy_display_mode", value);
+        ventoy_env_export("vtoy_display_mode", value);
     }
     
     value = vtoy_json_get_string_ex(json->pstChild, "serial_param");
     if (value)
     {
         debug("serial_param %s\n", value);
     }
     
     value = vtoy_json_get_string_ex(json->pstChild, "serial_param");
     if (value)
     {
         debug("serial_param %s\n", value);
-        grub_env_set("vtoy_serial_param", value);
+        ventoy_env_export("vtoy_serial_param", value);
     }
 
     value = vtoy_json_get_string_ex(json->pstChild, "ventoy_left");
     if (value)
     {
     }
 
     value = vtoy_json_get_string_ex(json->pstChild, "ventoy_left");
     if (value)
     {
-        grub_env_set("VTLE_LFT", value);
+        ventoy_env_export("VTLE_LFT", value);
     }
     
     value = vtoy_json_get_string_ex(json->pstChild, "ventoy_top");
     if (value)
     {
     }
     
     value = vtoy_json_get_string_ex(json->pstChild, "ventoy_top");
     if (value)
     {
-        grub_env_set("VTLE_TOP", value);
+        ventoy_env_export("VTLE_TOP", value);
     }
     
     value = vtoy_json_get_string_ex(json->pstChild, "ventoy_color");
     if (value)
     {
     }
     
     value = vtoy_json_get_string_ex(json->pstChild, "ventoy_color");
     if (value)
     {
-        grub_env_set("VTLE_CLR", value);
+        ventoy_env_export("VTLE_CLR", value);
     }
 
     node = vtoy_json_find_item(json->pstChild, JSON_TYPE_ARRAY, "fonts");
     }
 
     node = vtoy_json_find_item(json->pstChild, JSON_TYPE_ARRAY, "fonts");