From aa033e1fb6666f8d504ecd57b13bebef2ce2a6bd Mon Sep 17 00:00:00 2001 From: longpanda Date: Tue, 12 Oct 2021 19:20:02 +0800 Subject: [PATCH] 1.0.54 release --- .../grub-2.04/grub-core/ventoy/ventoy_def.h | 2 + .../grub-core/ventoy/ventoy_windows.c | 79 +++++++++++-------- INSTALL/grub/grub.cfg | 2 +- LANGUAGES/languages.json | 8 +- LiveCDGUI/VTOY/autostart | 2 +- 5 files changed, 52 insertions(+), 41 deletions(-) diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_def.h b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_def.h index 470b0f88..d7171bc0 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_def.h +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_def.h @@ -1102,5 +1102,7 @@ int ventoy_chain_file_read(const char *path, int offset, int len, void *buf); grub_env_export(env);\ } +#define ret_goto_end(a) ret = a; goto end; + #endif /* __VENTOY_DEF_H__ */ diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_windows.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_windows.c index 654eaebd..a35680aa 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_windows.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_windows.c @@ -687,6 +687,7 @@ static int parse_registry_setup_cmdline ) { char c; + int ret = 0; grub_uint32_t i = 0; grub_uint32_t reglen = 0; wim_hash zerohash; @@ -726,7 +727,7 @@ static int parse_registry_setup_cmdline if (grub_strncmp(decompress_data + 0x1000, "hbin", 4)) { - return 5; + ret_goto_end(5); } for (i = 0x1000; i + sizeof(reg_vk) < reglen; i += 8) @@ -746,18 +747,18 @@ static int parse_registry_setup_cmdline if (i + sizeof(reg_vk) >= reglen || regvk == NULL) { - return 6; + ret_goto_end(6); } if (regvk->datasize == 0 || (regvk->datasize & 0x80000000) > 0 || regvk->dataoffset == 0 || regvk->dataoffset == 0xFFFFFFFF) { - return 7; + ret_goto_end(7); } if (regvk->datasize / 2 >= buflen) { - return 8; + ret_goto_end(8); } debug("start offset is 0x%x(%u)\n", 0x1000 + regvk->dataoffset + 4, 0x1000 + regvk->dataoffset + 4); @@ -768,8 +769,11 @@ static int parse_registry_setup_cmdline *buf++ = c; } - grub_free(decompress_data); - return 0; + ret = 0; + +end: + grub_check_free(decompress_data); + return ret; } static wim_directory_entry * search_replace_wim_dirent @@ -784,44 +788,49 @@ static wim_directory_entry * search_replace_wim_dirent int ret; char cmdline[256] = {0}; wim_directory_entry *wim_dirent = NULL; + wim_directory_entry *pecmd_dirent = NULL; const char *peset_path[] = { "Windows", "System32", "peset.exe", NULL }; const char *pecmd_path[] = { "Windows", "System32", "pecmd.exe", NULL }; const char *winpeshl_path[] = { "Windows", "System32", "winpeshl.exe", NULL }; - ret = parse_registry_setup_cmdline(file, head, lookup, meta_data, dir, cmdline, sizeof(cmdline)); - if (0 == ret) - { - debug("registry setup cmdline:<%s>\n", cmdline); - ventoy_str_toupper(cmdline); - - if (grub_strncmp(cmdline, "PECMD", 5) == 0) - { - wim_dirent = search_full_wim_dirent(meta_data, dir, pecmd_path); - debug("search pecmd.exe %p\n", wim_dirent); - } - else if (grub_strncmp(cmdline, "PESET", 5) == 0) - { - wim_dirent = search_full_wim_dirent(meta_data, dir, peset_path); - debug("search peset.exe %p\n", wim_dirent); - } - else if (grub_strncmp(cmdline, "WINPESHL", 8) == 0) - { - wim_dirent = search_full_wim_dirent(meta_data, dir, winpeshl_path); - debug("search winpeshl.exe %p\n", wim_dirent); - } + pecmd_dirent = search_full_wim_dirent(meta_data, dir, pecmd_path); + debug("search pecmd.exe %p\n", pecmd_dirent); - if (wim_dirent) + if (pecmd_dirent) + { + ret = parse_registry_setup_cmdline(file, head, lookup, meta_data, dir, cmdline, sizeof(cmdline)); + if (0 == ret) { - return wim_dirent; + debug("registry setup cmdline:<%s>\n", cmdline); + ventoy_str_toupper(cmdline); + + if (grub_strncmp(cmdline, "PECMD", 5) == 0) + { + wim_dirent = pecmd_dirent; + } + else if (grub_strncmp(cmdline, "PESET", 5) == 0) + { + wim_dirent = search_full_wim_dirent(meta_data, dir, peset_path); + debug("search peset.exe %p\n", wim_dirent); + } + else if (grub_strncmp(cmdline, "WINPESHL", 8) == 0) + { + wim_dirent = search_full_wim_dirent(meta_data, dir, winpeshl_path); + debug("search winpeshl.exe %p\n", wim_dirent); + } + + if (wim_dirent) + { + return wim_dirent; + } + } + else + { + debug("registry setup cmdline failed : %d\n", ret); } } - else - { - debug("registry setup cmdline failed : %d\n", ret); - } - wim_dirent = search_full_wim_dirent(meta_data, dir, pecmd_path); - debug("search pecmd.exe %p\n", wim_dirent); + wim_dirent = pecmd_dirent; if (wim_dirent) { return wim_dirent; diff --git a/INSTALL/grub/grub.cfg b/INSTALL/grub/grub.cfg index cb538c9a..f180475e 100644 --- a/INSTALL/grub/grub.cfg +++ b/INSTALL/grub/grub.cfg @@ -1963,7 +1963,7 @@ function img_unsupport_menuentry { ############################################################# ############################################################# -set VENTOY_VERSION="1.0.53" +set VENTOY_VERSION="1.0.54" #ACPI not compatible with Window7/8, so disable by default set VTOY_PARAM_NO_ACPI=1 diff --git a/LANGUAGES/languages.json b/LANGUAGES/languages.json index eb0f4522..d7c2cd89 100644 --- a/LANGUAGES/languages.json +++ b/LANGUAGES/languages.json @@ -122,9 +122,9 @@ "STR_INSTALL_TIP":"磁盘会被格式化, 所有数据都会丢失!#@是否继续?", "STR_INSTALL_TIP2":"磁盘会被格式化, 所有数据都会丢失!#@再次确认是否继续?", "STR_INSTALL_SUCCESS":"恭喜你! Ventoy 已经成功安装到此设备中.", - "STR_INSTALL_FAILED":"安装 Ventoy 过程中发生错误. 你可以重新拔插一下U盘然后重试一次, 详细信息请查阅 log.txt 文件.", + "STR_INSTALL_FAILED":"安装 Ventoy 过程中发生错误. 你可以重新拔插一下U盘然后重试一次, 详细信息请查阅 log.txt 文件. 如果一直出错,请参考官网常见问题说明.", "STR_UPDATE_SUCCESS":"恭喜你! 新版本的 Ventoy 已经成功更新到此设备中.", - "STR_UPDATE_FAILED":"更新 Ventoy 过程中遇到错误. 你可以重新拔插一下U盘然后重试一次, 详细信息请查阅 log.txt 文件.", + "STR_UPDATE_FAILED":"更新 Ventoy 过程中遇到错误. 你可以重新拔插一下U盘然后重试一次, 详细信息请查阅 log.txt 文件. 如果一直出错,请参考官网常见问题说明.", "STR_WAIT_PROCESS":"当前有任务正在运行, 请等待...", "STR_MENU_OPTION":"配置选项", "STR_MENU_SECURE_BOOT":"安全启动支持", @@ -173,9 +173,9 @@ "STR_INSTALL_TIP":"The device will be formatted and all the data will be lost.#@Continue?", "STR_INSTALL_TIP2":"The device will be formatted and all the data will be lost.#@Continue? (Double Check)", "STR_INSTALL_SUCCESS":"Congratulations!#@Ventoy has been successfully installed to the device.", - "STR_INSTALL_FAILED":"An error occurred during the installation. You can replug the USB device and try again. Check log.txt for detail.", + "STR_INSTALL_FAILED":"An error occurred during the installation. You can replug the USB device and try again. Check log.txt for detail. If it always fail, please refer the FAQ in the official website.", "STR_UPDATE_SUCCESS":"Congratulations!#@Ventoy has been successfully updated to the device.", - "STR_UPDATE_FAILED":"An error occurred during the update. You can replug the USB device and try again. Check log.txt for detail.", + "STR_UPDATE_FAILED":"An error occurred during the update. You can replug the USB device and try again. Check log.txt for detail. If it always fail, please refer the FAQ in the official website.", "STR_WAIT_PROCESS":"A thread is running, please wait...", "STR_MENU_OPTION":"Option", "STR_MENU_SECURE_BOOT":"Secure Boot Support", diff --git a/LiveCDGUI/VTOY/autostart b/LiveCDGUI/VTOY/autostart index 6c6c202c..f52bc8c4 100644 --- a/LiveCDGUI/VTOY/autostart +++ b/LiveCDGUI/VTOY/autostart @@ -26,4 +26,4 @@ tar xf /usr/local/sbin/ntfs-3g.tar.gz -C / /ventoy/tool/x86_64/Ventoy2Disk.gtk3 --kiosk -reboot +reboot -f