Commit 78ab7a07 authored by longpanda's avatar longpanda
Browse files

1.0.26 release

parent 3ebd58c9
...@@ -52,6 +52,12 @@ ...@@ -52,6 +52,12 @@
#define VTOY_WARNING "!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!" #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 typedef struct ventoy_initrd_ctx
{ {
const char *path_prefix; const char *path_prefix;
......
...@@ -1184,11 +1184,6 @@ static plugin_entry g_plugin_entries[] = ...@@ -1184,11 +1184,6 @@ static plugin_entry g_plugin_entries[] =
{ {
{ "control", ventoy_plugin_control_entry, ventoy_plugin_control_check }, { "control", ventoy_plugin_control_entry, ventoy_plugin_control_check },
{ "theme", ventoy_plugin_theme_entry, ventoy_plugin_theme_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 }, { "auto_install", ventoy_plugin_auto_install_entry, ventoy_plugin_auto_install_check },
{ "persistence", ventoy_plugin_persistence_entry, ventoy_plugin_persistence_check }, { "persistence", ventoy_plugin_persistence_entry, ventoy_plugin_persistence_check },
{ "menu_alias", ventoy_plugin_menualias_entry, ventoy_plugin_menualias_check }, { "menu_alias", ventoy_plugin_menualias_entry, ventoy_plugin_menualias_check },
...@@ -1201,6 +1196,7 @@ static plugin_entry g_plugin_entries[] = ...@@ -1201,6 +1196,7 @@ static plugin_entry g_plugin_entries[] =
static int ventoy_parse_plugin_config(VTOY_JSON *json, const char *isodisk) static int ventoy_parse_plugin_config(VTOY_JSON *json, const char *isodisk)
{ {
int i; int i;
char key[128];
VTOY_JSON *cur = json; VTOY_JSON *cur = json;
grub_snprintf(g_iso_disk_name, sizeof(g_iso_disk_name), "%s", isodisk); 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) ...@@ -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++) 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); debug("Plugin entry for %s\n", g_plugin_entries[i].key);
g_plugin_entries[i].entryfunc(cur, isodisk); g_plugin_entries[i].entryfunc(cur, isodisk);
...@@ -1263,6 +1260,9 @@ grub_err_t ventoy_cmd_load_plugin(grub_extcmd_context_t ctxt, int argc, char **a ...@@ -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); ret = vtoy_json_parse(json, buf);
if (ret) 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); debug("Failed to parse json string %d\n", ret);
grub_free(buf); grub_free(buf);
return 1; return 1;
...@@ -1601,6 +1601,7 @@ grub_err_t ventoy_cmd_plugin_check_json(grub_extcmd_context_t ctxt, int argc, ch ...@@ -1601,6 +1601,7 @@ grub_err_t ventoy_cmd_plugin_check_json(grub_extcmd_context_t ctxt, int argc, ch
int i = 0; int i = 0;
int ret = 0; int ret = 0;
char *buf = NULL; char *buf = NULL;
char key[128];
grub_file_t file; grub_file_t file;
VTOY_JSON *node = NULL; VTOY_JSON *node = NULL;
VTOY_JSON *json = 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 ...@@ -1643,9 +1644,10 @@ grub_err_t ventoy_cmd_plugin_check_json(grub_extcmd_context_t ctxt, int argc, ch
goto end; goto end;
} }
grub_snprintf(key, sizeof(key), "%s_%s", args[1], VTOY_DUAL_MODE_SUFFIX);
for (node = json->pstChild; node; node = node->pstNext) 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; break;
} }
......
...@@ -19,27 +19,6 @@ submenu 'Check plugin json configuration (ventoy.json)' --class=debug_json { ...@@ -19,27 +19,6 @@ submenu 'Check plugin json configuration (ventoy.json)' --class=debug_json {
unset pager 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 { menuentry 'Check auto install plugin configuration' --class=debug_autoinstall {
set pager=1 set pager=1
vt_check_plugin_json $vt_plugin_path auto_install $vtoy_iso_part vt_check_plugin_json $vt_plugin_path auto_install $vtoy_iso_part
......
...@@ -1344,7 +1344,7 @@ function img_unsupport_menuentry { ...@@ -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 #ACPI not compatible with Window7/8, so disable by default
set VTOY_PARAM_NO_ACPI=1 set VTOY_PARAM_NO_ACPI=1
...@@ -1471,6 +1471,15 @@ else ...@@ -1471,6 +1471,15 @@ else
terminal_output gfxterm terminal_output gfxterm
fi 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 necessary variable
export theme export theme
export gfxmode export gfxmode
......
...@@ -63,7 +63,11 @@ if ! [ -b "$DISK" ]; then ...@@ -63,7 +63,11 @@ if ! [ -b "$DISK" ]; then
fi fi
if [ -e /sys/class/block/${DISK#/dev/}/start ]; then 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 exit 1
fi fi
......
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment