]> glassweightruler.freedombox.rocks Git - Ventoy.git/commitdiff
1.0.26 release v1.0.26
authorlongpanda <admin@ventoy.net>
Fri, 23 Oct 2020 22:26:57 +0000 (06:26 +0800)
committerlongpanda <admin@ventoy.net>
Fri, 23 Oct 2020 22:26:57 +0000 (06:26 +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
INSTALL/EFI/BOOT/grubx64_real.efi
INSTALL/grub/debug.cfg
INSTALL/grub/grub.cfg
INSTALL/grub/i386-pc/core.img
INSTALL/tool/VentoyWorker.sh
INSTALL/ventoy/ventoy.cpio
INSTALL/ventoy/vtloopex.cpio
LANGUAGES/languages.ini

index 387bda2f0c39a5affd207d37a02781428c2d4d48..b3512843d496fefb6d9dd12c3a3e4c2583a218eb 100644 (file)
 
 #define VTOY_WARNING  "!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!"
 
+#ifdef GRUB_MACHINE_EFI
+#define VTOY_DUAL_MODE_SUFFIX "uefi"
+#else
+#define VTOY_DUAL_MODE_SUFFIX "legacy"
+#endif
+
 typedef struct ventoy_initrd_ctx
 {
     const char *path_prefix;
index 098505c713ed78e8398bee6a60fd05fd0d454d90..bf9f75c8904aa74ae43357d2debb17e799579c60 100644 (file)
@@ -1184,11 +1184,6 @@ static plugin_entry g_plugin_entries[] =
 {
     { "control", ventoy_plugin_control_entry, ventoy_plugin_control_check },
     { "theme", ventoy_plugin_theme_entry, ventoy_plugin_theme_check },
-#ifdef GRUB_MACHINE_EFI
-    { "theme_uefi", ventoy_plugin_theme_entry, ventoy_plugin_theme_check },
-#else
-    { "theme_legacy", ventoy_plugin_theme_entry, ventoy_plugin_theme_check },
-#endif
     { "auto_install", ventoy_plugin_auto_install_entry, ventoy_plugin_auto_install_check },
     { "persistence", ventoy_plugin_persistence_entry, ventoy_plugin_persistence_check },
     { "menu_alias", ventoy_plugin_menualias_entry, ventoy_plugin_menualias_check },
@@ -1201,6 +1196,7 @@ static plugin_entry g_plugin_entries[] =
 static int ventoy_parse_plugin_config(VTOY_JSON *json, const char *isodisk)
 {
     int i;
+    char key[128];
     VTOY_JSON *cur = json;
 
     grub_snprintf(g_iso_disk_name, sizeof(g_iso_disk_name), "%s", isodisk);
@@ -1209,7 +1205,8 @@ static int ventoy_parse_plugin_config(VTOY_JSON *json, const char *isodisk)
     {
         for (i = 0; i < (int)ARRAY_SIZE(g_plugin_entries); i++)
         {
-            if (grub_strcmp(g_plugin_entries[i].key, cur->pcName) == 0)
+            grub_snprintf(key, sizeof(key), "%s_%s", g_plugin_entries[i].key, VTOY_DUAL_MODE_SUFFIX);
+            if (grub_strcmp(g_plugin_entries[i].key, cur->pcName) == 0 || grub_strcmp(key, cur->pcName) == 0)
             {
                 debug("Plugin entry for %s\n", g_plugin_entries[i].key);
                 g_plugin_entries[i].entryfunc(cur, isodisk);
@@ -1240,7 +1237,7 @@ grub_err_t ventoy_cmd_load_plugin(grub_extcmd_context_t ctxt, int argc, char **a
     }
 
     debug("json configuration file size %d\n", (int)file->size);
-    
+
     buf = grub_malloc(file->size + 1);
     if (!buf)
     {
@@ -1263,6 +1260,9 @@ grub_err_t ventoy_cmd_load_plugin(grub_extcmd_context_t ctxt, int argc, char **a
     ret = vtoy_json_parse(json, buf);
     if (ret)
     {
+        grub_env_set("VTOY_PLUGIN_SYNTAX_ERROR", "1");
+        grub_env_export("VTOY_PLUGIN_SYNTAX_ERROR");
+        
         debug("Failed to parse json string %d\n", ret);
         grub_free(buf);
         return 1;
@@ -1601,6 +1601,7 @@ grub_err_t ventoy_cmd_plugin_check_json(grub_extcmd_context_t ctxt, int argc, ch
     int i = 0;
     int ret = 0;
     char *buf = NULL;
+    char key[128];
     grub_file_t file;
     VTOY_JSON *node = NULL;
     VTOY_JSON *json = NULL;
@@ -1643,9 +1644,10 @@ grub_err_t ventoy_cmd_plugin_check_json(grub_extcmd_context_t ctxt, int argc, ch
         goto end;
     }
 
+    grub_snprintf(key, sizeof(key), "%s_%s", args[1], VTOY_DUAL_MODE_SUFFIX);
     for (node = json->pstChild; node; node = node->pstNext)
     {
-        if (grub_strcmp(node->pcName, args[1]) == 0)
+        if (grub_strcmp(node->pcName, args[1]) == 0 || grub_strcmp(node->pcName, key) == 0)
         {
             break;
         }
index 0be55d55b1e48a860a1e073f30a08622bfd4a95c..75bd8999cad9882185efe2ffb014d4ae895441bb 100644 (file)
Binary files a/INSTALL/EFI/BOOT/grubx64_real.efi and b/INSTALL/EFI/BOOT/grubx64_real.efi differ
index 44d0bb8c0b0723872628c5af0142f28dc65610a9..46ee3956d4598c91484f20123a5cff3fde6a851b 100644 (file)
@@ -19,27 +19,6 @@ submenu 'Check plugin json configuration (ventoy.json)' --class=debug_json {
         unset pager
     }
     
-    if [ "$grub_platform" = "pc" ]; then
-        menuentry 'Check legacy theme plugin configuration' --class=debug_theme_legacy {
-            set pager=1
-            vt_check_plugin_json $vt_plugin_path theme_legacy $vtoy_iso_part
-            
-            echo -e "\npress ENTER to exit ..."
-            read vtInputKey
-            unset pager
-        }
-    else
-        menuentry 'Check uefi theme plugin configuration' --class=debug_theme_uefi {
-            set pager=1
-            vt_check_plugin_json $vt_plugin_path theme_uefi $vtoy_iso_part
-            
-            echo -e "\npress ENTER to exit ..."
-            read vtInputKey
-            unset pager
-        }
-    fi
-    
-    
     menuentry 'Check auto install plugin configuration' --class=debug_autoinstall {
         set pager=1
         vt_check_plugin_json $vt_plugin_path auto_install $vtoy_iso_part
index a263996a964f05237291abdebe13a96fbc973253..ed372d04c944eab395325377ef9cc3ad827bc20d 100644 (file)
@@ -1344,7 +1344,7 @@ function img_unsupport_menuentry {
 #############################################################
 #############################################################
 
-set VENTOY_VERSION="1.0.25"
+set VENTOY_VERSION="1.0.26"
 
 #ACPI not compatible with Window7/8, so disable by default
 set VTOY_PARAM_NO_ACPI=1
@@ -1384,7 +1384,7 @@ if [ "$vtoy_dev" = "tftp" ]; then
     loadfont ascii
 
     if [ -f $vtoy_iso_part/ventoy/ventoy.json ]; then
-       set vt_plugin_path=$vtoy_iso_part
+        set vt_plugin_path=$vtoy_iso_part
     else
         set vt_plugin_path=$prefix
         vt_load_plugin $vt_plugin_path
@@ -1471,6 +1471,15 @@ else
     terminal_output  gfxterm
 fi
 
+
+if [ -n "$VTOY_PLUGIN_SYNTAX_ERROR" ]; then
+    clear
+    echo -e "\n Syntax error detected in ventoy.json, please check! \n"
+    echo -e " ventoy.json 文件中有语法错误,所有配置都不会生效,请检查!\n"
+    echo -e "\n press ENTER to continue (请按 回车 键继续) ..."
+    read vtInputKey 
+fi
+
 #export necessary variable
 export theme
 export gfxmode
index 4d77285ddb4a36c4bfc3239a6efa2db3ff2380c9..239f89fcbba35704e820c15c11994362ce1bbb34 100644 (file)
Binary files a/INSTALL/grub/i386-pc/core.img and b/INSTALL/grub/i386-pc/core.img differ
index 4b4fc300b999074bd39be9c0f97a074204fbd3ea..f1d4066386f11d8f4b52f4fd39cc1dc1fc1acd81 100644 (file)
@@ -63,7 +63,11 @@ if ! [ -b "$DISK" ]; then
 fi
 
 if [ -e /sys/class/block/${DISK#/dev/}/start ]; then
-    vterr "$DISK is a partition, please use the whole disk"
+    vterr  "$DISK is a partition, please use the whole disk."
+    echo   "For example:"
+    vterr  "    sudo sh Ventoy2Disk.sh -i /dev/sdX1 <=== This is wrong"
+    vtinfo "    sudo sh Ventoy2Disk.sh -i /dev/sdX  <=== This is right"
+    echo ""
     exit 1
 fi
 
index 93169fd16003e6218eba89160955eef992d343a6..bddd5d7fc7173340c8f258ac818432c3e4fc6f80 100644 (file)
Binary files a/INSTALL/ventoy/ventoy.cpio and b/INSTALL/ventoy/ventoy.cpio differ
index 7b8546e57c8ddf0f4feca7ffcd92a2bc2f1278ac..3e99a086a6bc72c02d263c5bc2cbbee13b137d59 100644 (file)
Binary files a/INSTALL/ventoy/vtloopex.cpio and b/INSTALL/ventoy/vtloopex.cpio differ
index a28c233039d58092df2d528dff37e2694d35d14b..974889221002d79f2acefe924a956c27b725f3aa 100644 (file)
Binary files a/LANGUAGES/languages.ini and b/LANGUAGES/languages.ini differ