Compare commits

...

53 Commits

Author SHA1 Message Date
longpanda
68a9cebe19 1.0.82 release 2022-11-17 17:56:11 +08:00
wiz64
cc77c74bf4 Update Russian, Hindi, Bengali (languages.json) (#1959) 2022-11-17 17:15:29 +08:00
Tayfun Akkoyun
ee952e3f69 Turkish update.json (#1960) 2022-11-17 17:15:01 +08:00
longpanda
b11a499939 Update BOOT/BOOTX64.EFI and mm efi files from Fedora 37. 2022-11-16 22:34:37 +08:00
longpanda
fdf4693433 Ventoy2Disk.exe update.
1. Add exFAT/NTFS/FAT32 option when install Ventoy
2. Display Ventoy partition file system in physical disk
3. String "Status x%" is missing for translations (#1667)
2022-11-16 20:33:14 +08:00
VenusGirl❤
ac65c0fb24 Update languages.json (#1957) 2022-11-16 19:45:15 +08:00
wiz64
ea0afe7c8b Update Bengali Translation (#1956) 2022-11-16 19:44:58 +08:00
wiz64
f8ca8b13d3 Update Hindi Translation (#1941) 2022-11-16 17:56:04 +08:00
longpanda
678a2abdf1 Fix the disk display error when pCloud virtual disk is installed in Windows OS. 2022-11-13 19:29:49 +08:00
longpanda
e645301713 Optimization for Windows unattended install process. 2022-11-10 10:10:10 +08:00
longpanda
43b415c032 Fix an issue that CGI backup tool can not open in WePE. 2022-11-08 15:27:08 +08:00
longpanda
311d2961ca Fix the issue that help line disappears when auto-going to a submenu. (#1939) 2022-11-02 20:13:12 +08:00
longpanda
1d66584190 Change Ventoy LiveCD GUI default language to English (#1938) 2022-10-31 09:40:10 +08:00
longpanda
553c853865 Fix the issue that Linux WEB/GUI does not restore MBR when updating. (#1935) 2022-10-30 13:39:19 +08:00
longpanda
7d90912a09 Add VTOY_SHOW_PASSWORD_ASTERISK option in global control plugon. (#1931) 2022-10-26 15:27:51 +08:00
longpanda
c2336f555a 1.0.81 release 2022-10-25 19:58:10 +08:00
longpanda
87391e8b32 Update BOOTX64.EFI MMX64.EFI 2022-10-23 21:41:05 +08:00
longpanda
f9c56c6686 update vtoyjump 2022-10-22 19:54:54 +08:00
longpanda
1ab1799b72 Code Optimization 2022-10-22 16:13:03 +08:00
longpanda
4a42bdfce7 Add support for easyOS easy-4.4.2-amd64.img. (#1926) 2022-10-22 15:28:16 +08:00
longpanda
3f09fb9a23 VentoyPlugson Update:
1. Add preview json feature
2. Add reset button
3. Add configuration active identifier for each tab
4. Bug fix
2022-10-21 16:06:13 +08:00
longpanda
c87ad1d734 Fix VentoyPlugson issue when ISO partition has a drive label with a space. (#1901) 2022-10-09 09:24:16 +08:00
longpanda
5590208885 Fix the issue that rockcluster, part of config missing during install. (#1900) 2022-10-08 10:07:39 +08:00
longpanda
09a6d33d62 Add _VTNORMAL identifier. 2022-10-07 17:28:31 +08:00
longpanda
9852252aba Merge branch 'master' of https://github.com/ventoy/Ventoy 2022-10-07 11:18:04 +08:00
longpanda
0585d83a8f Fix the issue that VTOY_LINUX_REMOUNT=1 does not work with Batocera 35 (#1878) 2022-10-07 11:16:45 +08:00
A1ive
ebe0b7d282 show asterisks ('*') when typing password (#1868)
* show asterisks ('*') when typing password

* add function ventoy_password_get
2022-09-25 12:31:32 +08:00
MELERIX
261ddcef45 added Spanish (Latinoamérica) translation (#1865)
* added Spanish (Latinoamérica) translation

* Update languages.json
2022-09-25 10:14:02 +08:00
longpanda
ebc5e2e993 1. Disable Fn hotkey during secondary boot menu.
2. Recover boot mode after boot fail from secondary boot menu.
2022-09-24 21:06:29 +08:00
longpanda
d58bd8c3f7 update README.md 2022-09-23 11:32:39 +08:00
longpanda
17f9e2fd09 1.0.80 release 2022-09-21 19:41:51 +08:00
longpanda
6b22a6200e upate issue template 2022-09-21 11:27:51 +08:00
longpanda
860dce6683 Fix languages.json syntax error 2022-09-19 23:00:57 +08:00
longpanda
7fc72d5ce6 Fix a bug when ISO contains a ks=file:/xxx boot parameter. 2022-09-19 22:35:02 +08:00
K.B.Dharun Krishna
b7c3cbd23b languages.json: Add Tamil Language (#1848)
Adding Tamil Language translation to languages.json.

Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>

Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
2022-09-19 21:40:31 +08:00
K.B.Dharun Krishna
3de97bdf44 Fix typo in GitHub Issue Templates (#1852) 2022-09-19 21:39:32 +08:00
longpanda
e79dc57ebe wimboot mode support Bob.Ombs.Modified.Win10PEx64 (#1842) 2022-09-16 01:05:58 +08:00
longpanda
7bf85a1ef8 Add 'i' 'u' hotkey. 2022-09-14 09:27:17 +08:00
crim50n
a5e0641226 Update to support a future version of MiniOS. (#1841)
* Update minios-hook.sh

* Update minios-disk.sh
2022-09-14 09:25:24 +08:00
longpanda
2c65eec9ec [update] Make injection plugin available in WIMBOOT mode. (#1834) 2022-09-13 22:04:19 +08:00
longpanda
0c310c5bd8 Make injection plugin available in WIMBOOT mode. (#1834) 2022-09-13 21:32:35 +08:00
Kamil Aronowski
c81b49807b Mention EuroLinux support (#1832) 2022-09-12 23:18:55 +08:00
shulkalala
085e20f64d Update languages.json - Spanish (#1827) 2022-09-12 23:18:30 +08:00
Henrique
ff3ce4da66 Fix Issue #1825 (#1826)
the modifications verify user privilege and prevent improper script execution.
2022-09-12 23:18:12 +08:00
longpanda
81d3492a61 Make injection plugin available in WIMBOOT mode. (#1834) 2022-09-12 22:40:00 +08:00
longpanda
635b1a1c6c Fix the 'overflow is detected' error in WIMBOOT mode for large ISO file. 2022-09-12 21:33:47 +08:00
longpanda
10b80f2690 Add w and r hotkey for WIMBOOT and GRUB2 mode. (#1837) 2022-09-12 11:24:57 +08:00
longpanda
36c21a21e4 Always use /bin/bash to launch VentoyPlugson.sh (#1809) 2022-08-23 20:50:18 +08:00
longpanda
13eb9829fa ALT Linux multiple initrd (#1784) 2022-08-14 23:10:46 +08:00
longpanda
88f77c01e4 bug fix 2022-08-13 22:12:00 +08:00
longpanda
11b30dab5f Fix typo in VentoyPlugson web page. (#1782) 2022-08-13 15:03:09 +08:00
longpanda
fb729146de Fix the issue when booting latest Gentoo live. (#1770) 2022-08-11 17:43:15 +08:00
longpanda
92bd6733dd Update MIPS GCC 7.3 download link. (#1757) 2022-07-29 13:50:11 +08:00
131 changed files with 4032 additions and 1321 deletions

View File

@@ -21,7 +21,7 @@ body:
attributes:
label: Ventoy Version
description: What version of ventoy are you running?
placeholder: 1.0.79
placeholder: 1.0.82
validations:
required: true
- type: dropdown
@@ -34,6 +34,16 @@ body:
- No. I didn't try the latest release.
validations:
required: true
- type: dropdown
id: alternativemode
attributes:
label: Try alternative boot mode
description: Have you tried alternative boot mode? (wimboot mode for Windows/WinPE, grub2 mode for linux)
options:
- Yes. I have tried them, but the bug still exist.
- No. I didn't try these alternative boot modes.
validations:
required: true
- type: dropdown
id: bios
attributes:

View File

@@ -85,7 +85,7 @@ body:
- type: input
id: testenv
attributes:
label: Test envrionment
label: Test environment
description: The manufacturer/model and other details about your computer (or VM).
placeholder: Lenovo Thinkpad T420 laptop
validations:

View File

@@ -34,7 +34,7 @@
https://codeload.github.com/libfuse/libfuse/zip/fuse-2.9.9 ===> /home/Ventoy-master/ExFAT/libfuse-fuse-2.9.9.zip
https://releases.linaro.org/components/toolchain/binaries/7.4-2019.02/aarch64-linux-gnu/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu.tar.xz ===> /opt/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu.tar.xz
https://toolchains.bootlin.com/downloads/releases/toolchains/aarch64/tarballs/aarch64--uclibc--stable-2020.08-1.tar.bz2 ===> /opt/aarch64--uclibc--stable-2020.08-1.tar.bz2
http://ftp.loongnix.org/toolchain/gcc/release/mips-loongson-gcc7.3-2019.06-29-linux-gnu.tar.gz ===> /opt/mips-loongson-gcc7.3-2019.06-29-linux-gnu.tar.gz
http://ftp.loongnix.cn/toolchain/gcc/release/mips/gcc7/mips-loongson-gcc7.3-2019.06-29-linux-gnu.tar.gz ===> /opt/mips-loongson-gcc7.3-2019.06-29-linux-gnu.tar.gz
https://github.com/ventoy/musl-cross-make/releases/download/latest/output.tar.bz2 ===> /opt/output.tar.bz2

View File

@@ -229,6 +229,13 @@ test_parse (char **args, int *argn, int argc)
(*argn) += 3;
continue;
}
if (grub_strcmp (args[*argn + 1], "-EQ") == 0)
{
update_val (grub_strtoull (args[*argn], 0, 0)
== grub_strtoull (args[*argn + 2], 0, 0), &ctx);
(*argn) += 3;
continue;
}
if (grub_strcmp (args[*argn + 1], "-ge") == 0)
{
@@ -237,6 +244,13 @@ test_parse (char **args, int *argn, int argc)
(*argn) += 3;
continue;
}
if (grub_strcmp (args[*argn + 1], "-GE") == 0)
{
update_val (grub_strtoull (args[*argn], 0, 0)
>= grub_strtoull (args[*argn + 2], 0, 0), &ctx);
(*argn) += 3;
continue;
}
if (grub_strcmp (args[*argn + 1], "-gt") == 0)
{
@@ -245,6 +259,13 @@ test_parse (char **args, int *argn, int argc)
(*argn) += 3;
continue;
}
if (grub_strcmp (args[*argn + 1], "-GT") == 0)
{
update_val (grub_strtoull (args[*argn], 0, 0)
> grub_strtoull (args[*argn + 2], 0, 0), &ctx);
(*argn) += 3;
continue;
}
if (grub_strcmp (args[*argn + 1], "-le") == 0)
{
@@ -253,6 +274,13 @@ test_parse (char **args, int *argn, int argc)
(*argn) += 3;
continue;
}
if (grub_strcmp (args[*argn + 1], "-LE") == 0)
{
update_val (grub_strtoull (args[*argn], 0, 0)
<= grub_strtoull (args[*argn + 2], 0, 0), &ctx);
(*argn) += 3;
continue;
}
if (grub_strcmp (args[*argn + 1], "-lt") == 0)
{
@@ -261,6 +289,13 @@ test_parse (char **args, int *argn, int argc)
(*argn) += 3;
continue;
}
if (grub_strcmp (args[*argn + 1], "-LT") == 0)
{
update_val (grub_strtoull (args[*argn], 0, 0)
< grub_strtoull (args[*argn + 2], 0, 0), &ctx);
(*argn) += 3;
continue;
}
if (grub_strcmp (args[*argn + 1], "-ne") == 0)
{
@@ -269,6 +304,13 @@ test_parse (char **args, int *argn, int argc)
(*argn) += 3;
continue;
}
if (grub_strcmp (args[*argn + 1], "-NE") == 0)
{
update_val (grub_strtoull (args[*argn], 0, 0)
!= grub_strtoull (args[*argn + 2], 0, 0), &ctx);
(*argn) += 3;
continue;
}
/* GRUB extension: compare numbers skipping prefixes.
Useful for comparing versions. E.g. vmlinuz-2 -plt vmlinuz-11. */

View File

@@ -48,10 +48,11 @@ int g_ventoy_suppress_esc = 0;
int g_ventoy_suppress_esc_default = 1;
int g_ventoy_menu_esc = 0;
int g_ventoy_fn_mutex = 0;
int g_ventoy_secondary_menu_on = 0;
int g_ventoy_terminal_output = 0;
#define VTOY_COMM_HOTKEY(cmdkey) \
if (0 == g_ventoy_fn_mutex) { \
if (0 == g_ventoy_fn_mutex && 0 == g_ventoy_secondary_menu_on) { \
cmdstr = grub_env_get(cmdkey); \
if (cmdstr) \
{ \
@@ -933,66 +934,91 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot)
goto refresh;
case GRUB_TERM_KEY_F1:
case '1':
menu_fini ();
g_ventoy_memdisk_mode = 1 - g_ventoy_memdisk_mode;
g_ventoy_menu_refresh = 1;
goto refresh;
if (0 == g_ventoy_secondary_menu_on)
{
menu_fini ();
g_ventoy_memdisk_mode = 1 - g_ventoy_memdisk_mode;
g_ventoy_menu_refresh = 1;
goto refresh;
}
break;
case (GRUB_TERM_CTRL | 'i'):
menu_fini ();
g_ventoy_iso_raw = 1 - g_ventoy_iso_raw;
g_ventoy_menu_refresh = 1;
goto refresh;
case 'i':
if (0 == g_ventoy_secondary_menu_on)
{
menu_fini ();
g_ventoy_iso_raw = 1 - g_ventoy_iso_raw;
g_ventoy_menu_refresh = 1;
goto refresh;
}
break;
case (GRUB_TERM_CTRL | 'r'):
menu_fini ();
g_ventoy_grub2_mode = 1 - g_ventoy_grub2_mode;
g_ventoy_menu_refresh = 1;
goto refresh;
case 'r':
if (0 == g_ventoy_secondary_menu_on)
{
menu_fini ();
g_ventoy_grub2_mode = 1 - g_ventoy_grub2_mode;
g_ventoy_menu_refresh = 1;
goto refresh;
}
break;
case (GRUB_TERM_CTRL | 'w'):
menu_fini ();
g_ventoy_wimboot_mode = 1 - g_ventoy_wimboot_mode;
g_ventoy_menu_refresh = 1;
goto refresh;
case 'w':
if (0 == g_ventoy_secondary_menu_on)
{
menu_fini ();
g_ventoy_wimboot_mode = 1 - g_ventoy_wimboot_mode;
g_ventoy_menu_refresh = 1;
goto refresh;
}
break;
case (GRUB_TERM_CTRL | 'u'):
menu_fini ();
g_ventoy_iso_uefi_drv = 1 - g_ventoy_iso_uefi_drv;
g_ventoy_menu_refresh = 1;
goto refresh;
case 'u':
if (0 == g_ventoy_secondary_menu_on)
{
menu_fini ();
g_ventoy_iso_uefi_drv = 1 - g_ventoy_iso_uefi_drv;
g_ventoy_menu_refresh = 1;
goto refresh;
}
break;
case (GRUB_TERM_CTRL | 'h'):
case 'h':
{
cmdstr = grub_env_get("VTOY_HELP_CMD");
if (cmdstr)
if (0 == g_ventoy_secondary_menu_on)
{
grub_script_execute_sourcecode(cmdstr);
while (grub_getkey() != GRUB_TERM_ESC)
;
menu_fini ();
goto refresh;
cmdstr = grub_env_get("VTOY_HELP_CMD");
if (cmdstr)
{
grub_script_execute_sourcecode(cmdstr);
while (grub_getkey() != GRUB_TERM_ESC)
;
menu_fini ();
goto refresh;
}
}
break;
}
case (GRUB_TERM_CTRL | 'm'):
case 'm':
{
if (g_ventoy_cur_img_path)
{
grub_env_set("VTOY_CHKSUM_FILE_PATH", g_ventoy_cur_img_path);
cmdstr = grub_env_get("VTOY_CHKSUM_CMD");
if (cmdstr)
if (0 == g_ventoy_secondary_menu_on)
{
if (g_ventoy_cur_img_path)
{
menu_fini();
grub_script_execute_sourcecode(cmdstr);
goto refresh;
grub_env_set("VTOY_CHKSUM_FILE_PATH", g_ventoy_cur_img_path);
cmdstr = grub_env_get("VTOY_CHKSUM_CMD");
if (cmdstr)
{
menu_fini();
grub_script_execute_sourcecode(cmdstr);
goto refresh;
}
}
else
{
grub_env_set("VTOY_CHKSUM_FILE_PATH", "X");
}
}
else
{
grub_env_set("VTOY_CHKSUM_FILE_PATH", "X");
}
break;
}

View File

@@ -188,6 +188,21 @@ void * ventoy_alloc_chain(grub_size_t size)
return p;
}
void ventoy_memfile_env_set(const char *prefix, const void *buf, unsigned long long len)
{
char name[128];
char val[64];
grub_snprintf(name, sizeof(name), "%s_addr", prefix);
grub_snprintf(val, sizeof(val), "0x%llx", (ulonglong)(ulong)buf);
grub_env_set(name, val);
grub_snprintf(name, sizeof(name), "%s_size", prefix);
grub_snprintf(val, sizeof(val), "%llu", len);
grub_env_set(name, val);
return;
}
static int ventoy_arch_mode_init(void)
{

View File

@@ -148,8 +148,6 @@ static char g_iso_vd_id_application[130];
static int g_pager_flag = 0;
static char g_old_pager[32];
static const char *g_vtoy_winpeshl_ini = "[LaunchApps]\r\nvtoyjump.exe";
const char *g_menu_class[img_type_max] =
{
"vtoyiso", "vtoywim", "vtoyefi", "vtoyimg", "vtoyvhd", "vtoyvtoy"
@@ -160,6 +158,8 @@ const char *g_menu_prefix[img_type_max] =
"iso", "wim", "efi", "img", "vhd", "vtoy"
};
static int g_vtoy_secondary_need_recover = 0;
static int g_vtoy_load_prompt = 0;
static char g_vtoy_prompt_msg[64];
@@ -1036,8 +1036,6 @@ static grub_err_t ventoy_cmd_concat_efi_iso(grub_extcmd_context_t ctxt, int argc
int totlen = 0;
int offset = 0;
grub_file_t file;
char name[32];
char value[32];
char *buf = NULL;
char *data = NULL;
ventoy_iso9660_override *dirent;
@@ -1097,13 +1095,7 @@ static grub_err_t ventoy_cmd_concat_efi_iso(grub_extcmd_context_t ctxt, int argc
grub_file_read(file, data + sizeof(ventoy_chain_head) + len, file->size);
grub_file_close(file);
grub_snprintf(name, sizeof(name), "%s_addr", args[1]);
grub_snprintf(value, sizeof(value), "0x%llx", (ulonglong)(ulong)data);
grub_env_set(name, value);
grub_snprintf(name, sizeof(name), "%s_size", args[1]);
grub_snprintf(value, sizeof(value), "%d", (int)(totlen));
grub_env_set(name, value);
ventoy_memfile_env_set(args[1], data, (ulonglong)totlen);
return 0;
}
@@ -1148,6 +1140,10 @@ grub_ssize_t ventoy_load_file_with_prompt(grub_file_t file, void *buf, grub_ssiz
left -= VTOY_SIZE_2MB;
div = grub_divmod64((grub_uint64_t)((size - left) * 100), (grub_uint64_t)size, &ro);
if (div < 1)
{
div = 1;
}
grub_printf("\r%s %d%% ", g_vtoy_prompt_msg, (int)div);
grub_refresh();
}
@@ -1166,8 +1162,6 @@ grub_ssize_t ventoy_load_file_with_prompt(grub_file_t file, void *buf, grub_ssiz
static grub_err_t ventoy_cmd_load_file_to_mem(grub_extcmd_context_t ctxt, int argc, char **args)
{
int rc = 1;
char name[32];
char value[32];
char *buf = NULL;
grub_file_t file;
enum grub_file_type type;
@@ -1218,13 +1212,7 @@ static grub_err_t ventoy_cmd_load_file_to_mem(grub_extcmd_context_t ctxt, int ar
grub_file_read(file, buf, file->size);
}
grub_snprintf(name, sizeof(name), "%s_addr", args[2]);
grub_snprintf(value, sizeof(value), "0x%llx", (unsigned long long)(unsigned long)buf);
grub_env_set(name, value);
grub_snprintf(name, sizeof(name), "%s_size", args[2]);
grub_snprintf(value, sizeof(value), "%llu", (unsigned long long)file->size);
grub_env_set(name, value);
ventoy_memfile_env_set(args[2], buf, (ulonglong)(file->size));
grub_file_close(file);
rc = 0;
@@ -1236,8 +1224,6 @@ static grub_err_t ventoy_cmd_load_img_memdisk(grub_extcmd_context_t ctxt, int ar
{
int rc = 1;
int headlen;
char name[32];
char value[32];
char *buf = NULL;
grub_file_t file;
@@ -1269,13 +1255,7 @@ static grub_err_t ventoy_cmd_load_img_memdisk(grub_extcmd_context_t ctxt, int ar
grub_file_read(file, buf + headlen, file->size);
grub_snprintf(name, sizeof(name), "%s_addr", args[1]);
grub_snprintf(value, sizeof(value), "0x%llx", (unsigned long long)(unsigned long)buf);
grub_env_set(name, value);
grub_snprintf(name, sizeof(name), "%s_size", args[1]);
grub_snprintf(value, sizeof(value), "%llu", (unsigned long long)file->size);
grub_env_set(name, value);
ventoy_memfile_env_set(args[1], buf, (ulonglong)(file->size));
grub_file_close(file);
rc = 0;
@@ -2179,6 +2159,74 @@ int ventoy_fill_data(grub_uint32_t buflen, char *buffer)
return len;
}
static int
ventoy_password_get (char buf[], unsigned buf_size)
{
unsigned i, cur_len = 0;
int key;
struct grub_term_coordinate *pos = grub_term_save_pos ();
while (1)
{
key = grub_getkey ();
if (key == '\n' || key == '\r')
break;
if (key == GRUB_TERM_ESC)
{
cur_len = 0;
break;
}
if (key == '\b')
{
if (cur_len)
{
grub_term_restore_pos (pos);
for (i = 0; i < cur_len; i++)
grub_xputs (" ");
grub_term_restore_pos (pos);
cur_len--;
for (i = 0; i < cur_len; i++)
grub_xputs ("*");
grub_refresh ();
}
continue;
}
if (!grub_isprint (key))
continue;
if (cur_len + 2 < buf_size)
buf[cur_len++] = key;
grub_xputs ("*");
grub_refresh ();
}
grub_memset (buf + cur_len, 0, buf_size - cur_len);
grub_xputs ("\n");
grub_refresh ();
grub_free (pos);
return (key != GRUB_TERM_ESC);
}
static int ventoy_get_password(char buf[], unsigned buf_size)
{
const char *env = NULL;
env = grub_env_get("VTOY_SHOW_PASSWORD_ASTERISK");
if (env && env[0] == '0' && env[1] == 0)
{
return grub_password_get(buf, buf_size);
}
else
{
return ventoy_password_get(buf, buf_size);
}
}
int ventoy_check_password(const vtoy_password *pwd, int retry)
{
int offset;
@@ -2194,7 +2242,7 @@ int ventoy_check_password(const vtoy_password *pwd, int retry)
if (pwd->type == VTOY_PASSWORD_TXT)
{
grub_password_get(input, 128);
ventoy_get_password(input, 128);
if (grub_strcmp(pwd->text, input) == 0)
{
return 0;
@@ -2202,7 +2250,7 @@ int ventoy_check_password(const vtoy_password *pwd, int retry)
}
else if (pwd->type == VTOY_PASSWORD_MD5)
{
grub_password_get(input, 128);
ventoy_get_password(input, 128);
grub_crypto_hash(GRUB_MD_MD5, md5, input, grub_strlen(input));
if (grub_memcmp(pwd->md5, md5, 16) == 0)
{
@@ -2212,7 +2260,7 @@ int ventoy_check_password(const vtoy_password *pwd, int retry)
else if (pwd->type == VTOY_PASSWORD_SALT_MD5)
{
offset = (int)grub_snprintf(input, 128, "%s", pwd->salt);
grub_password_get(input + offset, 128);
ventoy_get_password(input + offset, 128);
grub_crypto_hash(GRUB_MD_MD5, md5, input, grub_strlen(input));
if (grub_memcmp(pwd->md5, md5, 16) == 0)
@@ -3657,12 +3705,12 @@ static grub_err_t ventoy_cmd_sel_auto_install(grub_extcmd_context_t ctxt, int ar
vtoy_ssprintf(buf, pos, "set timeout=%d\n", node->timeout);
}
vtoy_ssprintf(buf, pos, "menuentry \"Boot without auto installation template\" {\n"
vtoy_ssprintf(buf, pos, "menuentry \"Boot without auto installation template\" --class=\"sel_auto_install\" {\n"
" echo %s\n}\n", "");
for (i = 0; i < node->templatenum; i++)
{
vtoy_ssprintf(buf, pos, "menuentry \"Boot with %s\"{\n"
vtoy_ssprintf(buf, pos, "menuentry \"Boot with %s\" --class=\"sel_auto_install\" {\n"
" echo \"\"\n}\n",
node->templatepath[i].path);
}
@@ -3763,12 +3811,12 @@ static grub_err_t ventoy_cmd_sel_persistence(grub_extcmd_context_t ctxt, int arg
vtoy_ssprintf(buf, pos, "set timeout=%d\n", node->timeout);
}
vtoy_ssprintf(buf, pos, "menuentry \"Boot without persistence\" {\n"
vtoy_ssprintf(buf, pos, "menuentry \"Boot without persistence\" --class=\"sel_persistence\" {\n"
" echo %s\n}\n", "");
for (i = 0; i < node->backendnum; i++)
{
vtoy_ssprintf(buf, pos, "menuentry \"Boot with %s\" {\n"
vtoy_ssprintf(buf, pos, "menuentry \"Boot with %s\" --class=\"sel_persistence\" {\n"
" echo \"\"\n}\n",
node->backendpath[i].path);
@@ -5956,6 +6004,177 @@ static grub_err_t ventoy_cmd_dump_rsv_page(grub_extcmd_context_t ctxt, int argc,
VENTOY_CMD_RETURN(GRUB_ERR_NONE);
}
static grub_err_t ventoy_cmd_need_secondary_menu(grub_extcmd_context_t ctxt, int argc, char **args)
{
const char *env = NULL;
(void)ctxt;
(void)argc;
if (g_ventoy_memdisk_mode || g_ventoy_grub2_mode || g_ventoy_wimboot_mode || g_ventoy_iso_raw)
{
return 1;
}
if (ventoy_check_mode_by_name(args[0], "vtgrub2") ||
ventoy_check_mode_by_name(args[0], "vtwimboot") ||
ventoy_check_mode_by_name(args[0], "vtmemdisk") ||
ventoy_check_mode_by_name(args[0], "vtnormal")
)
{
return 1;
}
env = grub_env_get("VTOY_SECONDARY_BOOT_MENU");
if (env && env[0] == '0' && env[1] == 0)
{
return 1;
}
return 0;
}
static grub_err_t ventoy_cmd_show_secondary_menu(grub_extcmd_context_t ctxt, int argc, char **args)
{
int n = 0;
int pos = 0;
int len = 0;
int select = 0;
int timeout = 0;
char *cmd = NULL;
const char *env = NULL;
ulonglong fsize = 0;
char cfgfile[128];
int seldata[16] = {0};
(void)ctxt;
(void)argc;
len = 8 * VTOY_SIZE_1KB;
cmd = (char *)grub_malloc(len);
if (!cmd)
{
return 1;
}
g_vtoy_secondary_need_recover = 0;
grub_env_unset("VTOY_CHKSUM_FILE_PATH");
env = grub_env_get("VTOY_SECONDARY_TIMEOUT");
if (env)
{
timeout = (int)grub_strtol(env, NULL, 10);
}
if (timeout > 0)
{
vtoy_len_ssprintf(cmd, pos, len, "set timeout=%d\n", timeout);
}
fsize = grub_strtoull(args[2], NULL, 10);
vtoy_dummy_menuentry(cmd, pos, len, "Boot in normal mode", "second_normal"); seldata[n++] = 1;
if (grub_strcmp(args[1], "Unix") != 0)
{
if (grub_strcmp(args[1], "Windows") == 0)
{
vtoy_dummy_menuentry(cmd, pos, len, "Boot in wimboot mode", "second_wimboot"); seldata[n++] = 2;
}
else
{
vtoy_dummy_menuentry(cmd, pos, len, "Boot in grub2 mode", "second_grub2"); seldata[n++] = 3;
}
if (fsize <= VTOY_SIZE_1GB)
{
vtoy_dummy_menuentry(cmd, pos, len, "Boot in memdisk mode", "second_memdisk"); seldata[n++] = 4;
}
}
vtoy_dummy_menuentry(cmd, pos, len, "File checksum", "second_checksum"); seldata[n++] = 5;
do {
g_ventoy_menu_esc = 1;
g_ventoy_suppress_esc = 1;
g_ventoy_suppress_esc_default = 0;
g_ventoy_secondary_menu_on = 1;
grub_snprintf(cfgfile, sizeof(cfgfile), "configfile mem:0x%llx:size:%d", (ulonglong)(ulong)cmd, pos);
grub_script_execute_sourcecode(cfgfile);
g_ventoy_menu_esc = 0;
g_ventoy_suppress_esc = 0;
g_ventoy_suppress_esc_default = 1;
g_ventoy_secondary_menu_on = 0;
select = seldata[g_ventoy_last_entry];
if (select == 2)
{
g_ventoy_wimboot_mode = 1;
g_vtoy_secondary_need_recover = 1;
}
else if (select == 3)
{
g_ventoy_grub2_mode = 1;
g_vtoy_secondary_need_recover = 2;
}
else if (select == 4)
{
g_ventoy_memdisk_mode = 1;
g_vtoy_secondary_need_recover = 3;
}
else if (select == 5)
{
grub_env_set("VTOY_CHKSUM_FILE_PATH", args[0]);
grub_script_execute_sourcecode("configfile $vtoy_efi_part/grub/checksum.cfg");
}
}while (select == 5);
grub_free(cmd);
return 0;
}
static grub_err_t ventoy_cmd_secondary_recover_mode(grub_extcmd_context_t ctxt, int argc, char **args)
{
(void)ctxt;
(void)argc;
(void)args;
if (g_vtoy_secondary_need_recover == 1)
{
g_ventoy_wimboot_mode = 0;
}
else if (g_vtoy_secondary_need_recover == 2)
{
g_ventoy_grub2_mode = 0;
}
else if (g_vtoy_secondary_need_recover == 3)
{
g_ventoy_memdisk_mode = 0;
}
g_vtoy_secondary_need_recover = 0;
VENTOY_CMD_RETURN(GRUB_ERR_NONE);
}
static grub_err_t ventoy_cmd_fs_ignore_case(grub_extcmd_context_t ctxt, int argc, char **args)
{
(void)ctxt;
(void)argc;
if (args[0][0] == '0')
{
g_ventoy_case_insensitive = 0;
}
else
{
g_ventoy_case_insensitive = 1;
}
return 0;
}
int ventoy_env_init(void)
{
int i;
@@ -5987,12 +6206,6 @@ int ventoy_env_init(void)
grub_env_export("ventoy_env_param");
}
grub_snprintf(buf, sizeof(buf), "0x%lx", (ulong)g_vtoy_winpeshl_ini);
grub_env_set("vtoy_winpeshl_ini_addr", buf);
grub_snprintf(buf, sizeof(buf), "%d", (int)grub_strlen(g_vtoy_winpeshl_ini));
grub_env_set("vtoy_winpeshl_ini_size", buf);
grub_env_export("vtoy_winpeshl_ini_addr");
grub_env_export("vtoy_winpeshl_ini_size");
@@ -6162,6 +6375,14 @@ static cmd_para ventoy_cmds[] =
{ "vt_iso_vd_id_begin", ventoy_cmd_iso_vd_id_begin, 0, NULL, "", "", NULL },
{ "vt_fn_mutex_lock", ventoy_cmd_fn_mutex_lock, 0, NULL, "", "", NULL },
{ "vt_efi_dump_rsv_page", ventoy_cmd_dump_rsv_page, 0, NULL, "", "", NULL },
{ "vt_is_standard_winiso", ventoy_cmd_is_standard_winiso, 0, NULL, "", "", NULL },
{ "vt_sel_winpe_wim", ventoy_cmd_sel_winpe_wim, 0, NULL, "", "", NULL },
{ "vt_need_secondary_menu", ventoy_cmd_need_secondary_menu, 0, NULL, "", "", NULL },
{ "vt_show_secondary_menu", ventoy_cmd_show_secondary_menu, 0, NULL, "", "", NULL },
{ "vt_fs_ignore_case", ventoy_cmd_fs_ignore_case, 0, NULL, "", "", NULL },
{ "vt_systemd_menu", ventoy_cmd_linux_systemd_menu, 0, NULL, "", "", NULL },
{ "vt_limine_menu", ventoy_cmd_linux_limine_menu, 0, NULL, "", "", NULL },
{ "vt_secondary_recover_mode", ventoy_cmd_secondary_recover_mode, 0, NULL, "", "", NULL },
};
int ventoy_register_all_cmd(void)

View File

@@ -29,6 +29,8 @@
#define VTOY_FILT_MIN_FILE_SIZE 32768
#define VTOY_LINUX_SYSTEMD_MENU_MAX_BUF 16384
#define VTOY_SIZE_1GB 1073741824
#define VTOY_SIZE_1MB (1024 * 1024)
#define VTOY_SIZE_2MB (2 * 1024 * 1024)
@@ -329,9 +331,16 @@ void ventoy_debug(const char *fmt, ...);
#define vtoy_ssprintf(buf, pos, fmt, args...) \
pos += grub_snprintf(buf + pos, VTOY_MAX_SCRIPT_BUF - pos, fmt, ##args)
#define vtoy_len_ssprintf(buf, pos, len, fmt, args...) \
pos += grub_snprintf(buf + pos, len - pos, fmt, ##args)
#define browser_ssprintf(mbuf, fmt, args...) \
(mbuf)->pos += grub_snprintf((mbuf)->buf + (mbuf)->pos, (mbuf)->max - (mbuf)->pos, fmt, ##args)
#define vtoy_dummy_menuentry(buf, pos, len, title, class) \
vtoy_len_ssprintf(buf, pos, len, "menuentry \"%s\" --class=\"%s\" {\n echo \"\"\n}\n", title, class)
#define FLAG_HEADER_RESERVED 0x00000001
#define FLAG_HEADER_COMPRESSION 0x00000002
#define FLAG_HEADER_READONLY 0x00000004
@@ -613,6 +622,8 @@ grub_err_t ventoy_cmd_clear_initrd_list(grub_extcmd_context_t ctxt, int argc, ch
grub_uint32_t ventoy_get_iso_boot_catlog(grub_file_t file);
int ventoy_has_efi_eltorito(grub_file_t file, grub_uint32_t sector);
grub_err_t ventoy_cmd_linux_chain_data(grub_extcmd_context_t ctxt, int argc, char **args);
grub_err_t ventoy_cmd_linux_systemd_menu(grub_extcmd_context_t ctxt, int argc, char **args);
grub_err_t ventoy_cmd_linux_limine_menu(grub_extcmd_context_t ctxt, int argc, char **args);
grub_err_t ventoy_cmd_linux_locate_initrd(grub_extcmd_context_t ctxt, int argc, char **args);
grub_err_t ventoy_cmd_initrd_count(grub_extcmd_context_t ctxt, int argc, char **args);
grub_err_t ventoy_cmd_valid_initrd_count(grub_extcmd_context_t ctxt, int argc, char **args);
@@ -633,6 +644,7 @@ grub_err_t ventoy_cmd_windows_chain_data(grub_extcmd_context_t ctxt, int argc, c
grub_err_t ventoy_cmd_windows_wimboot_data(grub_extcmd_context_t ctxt, int argc, char **args);
grub_err_t ventoy_cmd_wim_chain_data(grub_extcmd_context_t ctxt, int argc, char **args);
grub_err_t ventoy_cmd_wim_check_bootable(grub_extcmd_context_t ctxt, int argc, char **args);
grub_err_t ventoy_cmd_is_standard_winiso(grub_extcmd_context_t ctxt, int argc, char **args);
grub_err_t ventoy_cmd_dump_wim_patch(grub_extcmd_context_t ctxt, int argc, char **args);
grub_err_t ventoy_cmd_sel_wimboot(grub_extcmd_context_t ctxt, int argc, char **args);
grub_err_t ventoy_cmd_set_wim_prompt(grub_extcmd_context_t ctxt, int argc, char **args);
@@ -1028,6 +1040,7 @@ typedef struct menu_password
}menu_password;
extern int g_ventoy_menu_esc;
extern int g_ventoy_secondary_menu_on;
extern int g_ventoy_suppress_esc;
extern int g_ventoy_suppress_esc_default;
extern int g_ventoy_last_entry;
@@ -1111,6 +1124,7 @@ grub_err_t ventoy_cmd_linux_get_main_initrd_index(grub_extcmd_context_t ctxt, in
grub_err_t ventoy_cmd_collect_wim_patch(grub_extcmd_context_t ctxt, int argc, char **args);
grub_err_t ventoy_cmd_wim_patch_count(grub_extcmd_context_t ctxt, int argc, char **args);
grub_err_t ventoy_cmd_locate_wim_patch(grub_extcmd_context_t ctxt, int argc, char **args);
grub_err_t ventoy_cmd_sel_winpe_wim(grub_extcmd_context_t ctxt, int argc, char **args);
grub_err_t ventoy_cmd_unix_chain_data(grub_extcmd_context_t ctxt, int argc, char **args);
int ventoy_get_disk_guid(const char *filename, grub_uint8_t *guid, grub_uint8_t *signature);
grub_err_t ventoy_cmd_unix_reset(grub_extcmd_context_t ctxt, int argc, char **args);
@@ -1218,6 +1232,16 @@ typedef struct var_node
struct var_node *next;
}var_node;
typedef struct systemd_menu_ctx
{
char *dev;
char *buf;
int pos;
int len;
}systemd_menu_ctx;
#define vtoy_check_goto_out(p) if (!p) goto out
extern char *g_tree_script_buf;
extern int g_tree_script_pos;
extern int g_tree_script_pre;

View File

@@ -333,12 +333,84 @@ end:
VENTOY_CMD_RETURN(GRUB_ERR_NONE);
}
static int ventoy_linux_initrd_collect_hook(const char *filename, const struct grub_dirhook_info *info, void *data)
{
int len;
initrd_info *img = NULL;
(void)data;
if (0 == info->dir)
{
if (grub_strncmp(filename, "initrd", 6) == 0)
{
len = (int)grub_strlen(filename);
if (grub_strcmp(filename + len - 4, ".img") == 0)
{
img = grub_zalloc(sizeof(initrd_info));
if (img)
{
grub_snprintf(img->name, sizeof(img->name), "/boot/%s", filename);
if (ventoy_find_initrd_by_name(g_initrd_img_list, img->name))
{
grub_free(img);
}
else
{
if (g_initrd_img_list)
{
img->prev = g_initrd_img_tail;
g_initrd_img_tail->next = img;
}
else
{
g_initrd_img_list = img;
}
g_initrd_img_tail = img;
g_initrd_img_count++;
}
}
}
}
}
return 0;
}
static int ventoy_linux_collect_boot_initrds(void)
{
grub_fs_t fs;
grub_device_t dev = NULL;
dev = grub_device_open("loop");
if (!dev)
{
debug("failed to open device loop\n");
goto end;
}
fs = grub_fs_probe(dev);
if (!fs)
{
debug("failed to probe fs %d\n", grub_errno);
goto end;
}
fs->fs_dir(dev, "/boot", ventoy_linux_initrd_collect_hook, NULL);
end:
return 0;
}
static grub_err_t ventoy_grub_cfg_initrd_collect(const char *fileName)
{
int i = 0;
int len = 0;
int dollar = 0;
int quotation = 0;
int initrd_dollar = 0;
grub_file_t file = NULL;
char *buf = NULL;
char *start = NULL;
@@ -421,6 +493,19 @@ static grub_err_t ventoy_grub_cfg_initrd_collect(const char *fileName)
debug("Remove quotation <%s>\n", img->name);
}
/* special process for /boot/initrd$XXX.img */
if (dollar == 1)
{
if (grub_strncmp(img->name, "/boot/initrd$", 13) == 0)
{
len = (int)grub_strlen(img->name);
if (grub_strcmp(img->name + len - 4, ".img") == 0)
{
initrd_dollar++;
}
}
}
if (dollar == 1 || ventoy_find_initrd_by_name(g_initrd_img_list, img->name))
{
grub_free(img);
@@ -458,6 +543,12 @@ static grub_err_t ventoy_grub_cfg_initrd_collect(const char *fileName)
grub_free(buf);
grub_file_close(file);
if (initrd_dollar > 0 && grub_strncmp(fileName, "(loop)/", 7) == 0)
{
debug("collect initrd variable %d\n", initrd_dollar);
ventoy_linux_collect_boot_initrds();
}
VENTOY_CMD_RETURN(GRUB_ERR_NONE);
}
@@ -1481,7 +1572,6 @@ grub_err_t ventoy_cmd_trailer_cpio(grub_extcmd_context_t ctxt, int argc, char **
grub_uint8_t *bufend;
cpio_newc_header *head;
grub_file_t file;
char value[64];
const grub_uint8_t trailler[124] = {
0x30, 0x37, 0x30, 0x37, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
@@ -1552,11 +1642,8 @@ grub_err_t ventoy_cmd_trailer_cpio(grub_extcmd_context_t ctxt, int argc, char **
name = (char *)(head + 1);
}
}
grub_snprintf(value, sizeof(value), "0x%llx", (ulonglong)(ulong)g_ventoy_cpio_buf);
ventoy_set_env("ventoy_cpio_addr", value);
grub_snprintf(value, sizeof(value), "%d", bufsize);
ventoy_set_env("ventoy_cpio_size", value);
ventoy_memfile_env_set("ventoy_cpio", g_ventoy_cpio_buf, (ulonglong)bufsize);
VENTOY_CMD_RETURN(GRUB_ERR_NONE);
}
@@ -1578,7 +1665,6 @@ grub_err_t ventoy_cmd_linux_chain_data(grub_extcmd_context_t ctxt, int argc, cha
const char *pLastChain = NULL;
const char *compatible;
ventoy_chain_head *chain;
char envbuf[64];
(void)ctxt;
(void)argc;
@@ -1666,10 +1752,7 @@ grub_err_t ventoy_cmd_linux_chain_data(grub_extcmd_context_t ctxt, int argc, cha
return 1;
}
grub_snprintf(envbuf, sizeof(envbuf), "0x%lx", (unsigned long)chain);
grub_env_set("vtoy_chain_mem_addr", envbuf);
grub_snprintf(envbuf, sizeof(envbuf), "%u", size);
grub_env_set("vtoy_chain_mem_size", envbuf);
ventoy_memfile_env_set("vtoy_chain_mem", chain, (ulonglong)size);
grub_memset(chain, 0, sizeof(ventoy_chain_head));
@@ -1720,3 +1803,309 @@ grub_err_t ventoy_cmd_linux_chain_data(grub_extcmd_context_t ctxt, int argc, cha
VENTOY_CMD_RETURN(GRUB_ERR_NONE);
}
static char *ventoy_systemd_conf_tag(char *buf, const char *tag, int optional)
{
int taglen = 0;
char *start = NULL;
char *nextline = NULL;
taglen = grub_strlen(tag);
for (start = buf; start; start = nextline)
{
nextline = ventoy_get_line(start);
while (ventoy_isspace(*start))
{
start++;
}
if (grub_strncmp(start, tag, taglen) == 0 && (start[taglen] == ' ' || start[taglen] == '\t'))
{
start += taglen;
while (ventoy_isspace(*start))
{
start++;
}
return start;
}
}
if (optional == 0)
{
debug("tag<%s> NOT found\n", tag);
}
return NULL;
}
static int ventoy_systemd_conf_hook(const char *filename, const struct grub_dirhook_info *info, void *data)
{
int oldpos = 0;
char *tag = NULL;
char *bkbuf = NULL;
char *filebuf = NULL;
grub_file_t file = NULL;
systemd_menu_ctx *ctx = (systemd_menu_ctx *)data;
debug("ventoy_systemd_conf_hook %s\n", filename);
if (info->dir || NULL == grub_strstr(filename, ".conf"))
{
return 0;
}
file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s/loader/entries/%s", ctx->dev, filename);
if (!file)
{
return 0;
}
filebuf = grub_zalloc(2 * file->size + 8);
if (!filebuf)
{
goto out;
}
bkbuf = filebuf + file->size + 4;
grub_file_read(file, bkbuf, file->size);
oldpos = ctx->pos;
/* title --> menuentry */
grub_memcpy(filebuf, bkbuf, file->size);
tag = ventoy_systemd_conf_tag(filebuf, "title", 0);
vtoy_check_goto_out(tag);
vtoy_len_ssprintf(ctx->buf, ctx->pos, ctx->len, "menuentry \"%s\" {\n", tag);
/* linux xxx */
grub_memcpy(filebuf, bkbuf, file->size);
tag = ventoy_systemd_conf_tag(filebuf, "linux", 0);
if (!tag)
{
ctx->pos = oldpos;
goto out;
}
vtoy_len_ssprintf(ctx->buf, ctx->pos, ctx->len, " echo \"Downloading kernel ...\"\n linux %s ", tag);
/* kernel options */
grub_memcpy(filebuf, bkbuf, file->size);
tag = ventoy_systemd_conf_tag(filebuf, "options", 0);
vtoy_len_ssprintf(ctx->buf, ctx->pos, ctx->len, "%s \n", tag ? tag : "");
/* initrd xxx xxx xxx */
vtoy_len_ssprintf(ctx->buf, ctx->pos, ctx->len, " echo \"Downloading initrd ...\"\n initrd ");
grub_memcpy(filebuf, bkbuf, file->size);
tag = ventoy_systemd_conf_tag(filebuf, "initrd", 1);
while (tag)
{
vtoy_len_ssprintf(ctx->buf, ctx->pos, ctx->len, "%s ", tag);
tag = ventoy_systemd_conf_tag(tag + grub_strlen(tag) + 1, "initrd", 1);
}
vtoy_len_ssprintf(ctx->buf, ctx->pos, ctx->len, "\n boot\n}\n");
out:
grub_check_free(filebuf);
grub_file_close(file);
return 0;
}
grub_err_t ventoy_cmd_linux_systemd_menu(grub_extcmd_context_t ctxt, int argc, char **args)
{
static char *buf = NULL;
grub_fs_t fs;
char *device_name = NULL;
grub_device_t dev = NULL;
systemd_menu_ctx ctx;
(void)ctxt;
(void)argc;
if (!buf)
{
buf = grub_malloc(VTOY_LINUX_SYSTEMD_MENU_MAX_BUF);
if (!buf)
{
goto end;
}
}
device_name = grub_file_get_device_name(args[0]);
if (!device_name)
{
debug("failed to get device name %s\n", args[0]);
goto end;
}
dev = grub_device_open(device_name);
if (!dev)
{
debug("failed to open device %s\n", device_name);
goto end;
}
fs = grub_fs_probe(dev);
if (!fs)
{
debug("failed to probe fs %d\n", grub_errno);
goto end;
}
ctx.dev = args[0];
ctx.buf = buf;
ctx.pos = 0;
ctx.len = VTOY_LINUX_SYSTEMD_MENU_MAX_BUF;
fs->fs_dir(dev, "/loader/entries", ventoy_systemd_conf_hook, &ctx);
ventoy_memfile_env_set(args[1], buf, (ulonglong)(ctx.pos));
end:
grub_check_free(device_name);
check_free(dev, grub_device_close);
VENTOY_CMD_RETURN(GRUB_ERR_NONE);
}
static int ventoy_limine_path_convert(char *path)
{
char newpath[256] = {0};
if (grub_strncmp(path, "boot://2/", 9) == 0)
{
grub_snprintf(newpath, sizeof(newpath), "(vtimghd,2)/%s", path + 9);
}
else if (grub_strncmp(path, "boot://1/", 9) == 0)
{
grub_snprintf(newpath, sizeof(newpath), "(vtimghd,1)/%s", path + 9);
}
if (newpath[0])
{
grub_snprintf(path, 1024, "%s", newpath);
}
return 0;
}
grub_err_t ventoy_cmd_linux_limine_menu(grub_extcmd_context_t ctxt, int argc, char **args)
{
int pos = 0;
int sub = 0;
int len = VTOY_LINUX_SYSTEMD_MENU_MAX_BUF;
char *filebuf = NULL;
char *start = NULL;
char *nextline = NULL;
grub_file_t file = NULL;
char *title = NULL;
char *kernel = NULL;
char *initrd = NULL;
char *param = NULL;
static char *buf = NULL;
(void)ctxt;
(void)argc;
if (!buf)
{
buf = grub_malloc(len + 4 * 1024);
if (!buf)
{
goto end;
}
}
title = buf + len;
kernel = title + 1024;
initrd = kernel + 1024;
param = initrd + 1024;
file = ventoy_grub_file_open(VENTOY_FILE_TYPE, args[0]);
if (!file)
{
return 0;
}
filebuf = grub_zalloc(file->size + 8);
if (!filebuf)
{
goto end;
}
grub_file_read(file, filebuf, file->size);
grub_file_close(file);
title[0] = kernel[0] = initrd[0] = param[0] = 0;
for (start = filebuf; start; start = nextline)
{
nextline = ventoy_get_line(start);
while (ventoy_isspace(*start))
{
start++;
}
if (start[0] == ':')
{
if (start[1] == ':')
{
grub_snprintf(title, 1024, "%s", start + 2);
}
else
{
if (sub)
{
vtoy_len_ssprintf(buf, pos, len, "}\n");
sub = 0;
}
if (nextline && nextline[0] == ':' && nextline[1] == ':')
{
vtoy_len_ssprintf(buf, pos, len, "submenu \"[+] %s\" {\n", start + 2);
sub = 1;
title[0] = 0;
}
else
{
grub_snprintf(title, 1024, "%s", start + 1);
}
}
}
else if (grub_strncmp(start, "KERNEL_PATH=", 12) == 0)
{
grub_snprintf(kernel, 1024, "%s", start + 12);
}
else if (grub_strncmp(start, "MODULE_PATH=", 12) == 0)
{
grub_snprintf(initrd, 1024, "%s", start + 12);
}
else if (grub_strncmp(start, "KERNEL_CMDLINE=", 15) == 0)
{
grub_snprintf(param, 1024, "%s", start + 15);
}
if (title[0] && kernel[0] && initrd[0] && param[0])
{
ventoy_limine_path_convert(kernel);
ventoy_limine_path_convert(initrd);
vtoy_len_ssprintf(buf, pos, len, "menuentry \"%s\" {\n", title);
vtoy_len_ssprintf(buf, pos, len, " echo \"Downloading kernel ...\"\n linux %s %s\n", kernel, param);
vtoy_len_ssprintf(buf, pos, len, " echo \"Downloading initrd ...\"\n initrd %s\n", initrd);
vtoy_len_ssprintf(buf, pos, len, "}\n");
title[0] = kernel[0] = initrd[0] = param[0] = 0;
}
}
if (sub)
{
vtoy_len_ssprintf(buf, pos, len, "}\n");
sub = 0;
}
ventoy_memfile_env_set(args[1], buf, (ulonglong)pos);
end:
grub_check_free(filebuf);
VENTOY_CMD_RETURN(GRUB_ERR_NONE);
}

View File

@@ -1118,7 +1118,6 @@ grub_err_t ventoy_cmd_unix_chain_data(grub_extcmd_context_t ctxt, int argc, char
const char *pLastChain = NULL;
const char *compatible;
ventoy_chain_head *chain;
char envbuf[64];
(void)ctxt;
(void)argc;
@@ -1197,10 +1196,7 @@ grub_err_t ventoy_cmd_unix_chain_data(grub_extcmd_context_t ctxt, int argc, char
return 1;
}
grub_snprintf(envbuf, sizeof(envbuf), "0x%lx", (unsigned long)chain);
grub_env_set("vtoy_chain_mem_addr", envbuf);
grub_snprintf(envbuf, sizeof(envbuf), "%u", size);
grub_env_set("vtoy_chain_mem_size", envbuf);
ventoy_memfile_env_set("vtoy_chain_mem", chain, (ulonglong)size);
grub_memset(chain, 0, sizeof(ventoy_chain_head));

View File

@@ -305,7 +305,6 @@ grub_err_t ventoy_cmd_patch_vhdboot(grub_extcmd_context_t ctxt, int argc, char *
int patchoffset[2];
ventoy_patch_vhd *patch1;
ventoy_patch_vhd *patch2;
char envbuf[64];
(void)ctxt;
(void)argc;
@@ -356,15 +355,9 @@ grub_err_t ventoy_cmd_patch_vhdboot(grub_extcmd_context_t ctxt, int argc, char *
/* set buffer and size */
#ifdef GRUB_MACHINE_EFI
grub_snprintf(envbuf, sizeof(envbuf), "0x%lx", (ulong)g_vhdboot_totbuf);
grub_env_set("vtoy_vhd_buf_addr", envbuf);
grub_snprintf(envbuf, sizeof(envbuf), "%d", (int)(g_vhdboot_isolen + sizeof(ventoy_chain_head)));
grub_env_set("vtoy_vhd_buf_size", envbuf);
ventoy_memfile_env_set("vtoy_vhd_buf", g_vhdboot_totbuf, (ulonglong)(g_vhdboot_isolen + sizeof(ventoy_chain_head)));
#else
grub_snprintf(envbuf, sizeof(envbuf), "0x%lx", (ulong)g_vhdboot_isobuf);
grub_env_set("vtoy_vhd_buf_addr", envbuf);
grub_snprintf(envbuf, sizeof(envbuf), "%d", g_vhdboot_isolen);
grub_env_set("vtoy_vhd_buf_size", envbuf);
ventoy_memfile_env_set("vtoy_vhd_buf", g_vhdboot_isobuf, (ulonglong)g_vhdboot_isolen);
#endif
VENTOY_CMD_RETURN(GRUB_ERR_NONE);
@@ -645,7 +638,6 @@ grub_err_t ventoy_cmd_raw_chain_data(grub_extcmd_context_t ctxt, int argc, char
grub_disk_t disk;
const char *pLastChain = NULL;
ventoy_chain_head *chain;
char envbuf[64];
(void)ctxt;
(void)argc;
@@ -695,10 +687,7 @@ grub_err_t ventoy_cmd_raw_chain_data(grub_extcmd_context_t ctxt, int argc, char
return 1;
}
grub_snprintf(envbuf, sizeof(envbuf), "0x%lx", (unsigned long)chain);
grub_env_set("vtoy_chain_mem_addr", envbuf);
grub_snprintf(envbuf, sizeof(envbuf), "%u", size);
grub_env_set("vtoy_chain_mem_size", envbuf);
ventoy_memfile_env_set("vtoy_chain_mem", chain, (ulonglong)size);
grub_env_export("vtoy_chain_mem_addr");
grub_env_export("vtoy_chain_mem_size");

View File

@@ -1364,6 +1364,110 @@ static int ventoy_wimdows_locate_wim(const char *disk, wim_patch *patch, int win
return 0;
}
grub_err_t ventoy_cmd_sel_winpe_wim(grub_extcmd_context_t ctxt, int argc, char **args)
{
int i = 0;
int pos = 0;
int len = 0;
int find = 0;
char *cmd = NULL;
wim_patch *node = NULL;
wim_patch *tmp = NULL;
grub_file_t file = NULL;
wim_header *head = NULL;
char cfgfile[128];
(void)ctxt;
(void)argc;
len = 8 * VTOY_SIZE_1KB;
cmd = (char *)grub_malloc(len + sizeof(wim_header));
if (!cmd)
{
return 1;
}
head = (wim_header *)(cmd + len);
grub_env_unset("vtoy_pe_wim_path");
for (node = g_wim_patch_head; node; node = node->next)
{
find = 0;
for (tmp = g_wim_patch_head; tmp != node; tmp = tmp->next)
{
if (tmp->valid && grub_strcasecmp(tmp->path, node->path) == 0)
{
find = 1;
break;
}
}
if (find)
{
continue;
}
g_ventoy_case_insensitive = 1;
file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s%s", args[0], node->path);
g_ventoy_case_insensitive = 0;
if (!file)
{
debug("File %s%s NOT exist\n", args[0], node->path);
continue;
}
grub_file_read(file, head, sizeof(wim_header));
if (grub_memcmp(head->signature, WIM_HEAD_SIGNATURE, sizeof(head->signature)))
{
debug("Not a valid wim file %s\n", (char *)head->signature);
grub_file_close(file);
continue;
}
if (head->flags & FLAG_HEADER_COMPRESS_LZMS)
{
debug("LZMS compress is not supported 0x%x\n", head->flags);
grub_file_close(file);
continue;
}
grub_file_close(file);
node->valid = 1;
vtoy_len_ssprintf(cmd, pos, len, "menuentry \"%s\" --class=\"sel_wim\" {\n echo \"\"\n}\n", node->path);
}
if (pos > 0)
{
g_ventoy_menu_esc = 1;
g_ventoy_suppress_esc = 1;
g_ventoy_suppress_esc_default = 0;
grub_snprintf(cfgfile, sizeof(cfgfile), "configfile mem:0x%llx:size:%d", (ulonglong)(ulong)cmd, pos);
grub_script_execute_sourcecode(cfgfile);
g_ventoy_menu_esc = 0;
g_ventoy_suppress_esc = 0;
g_ventoy_suppress_esc_default = 1;
for (node = g_wim_patch_head; node; node = node->next)
{
if (node->valid)
{
if (i == g_ventoy_last_entry)
{
grub_env_set("vtoy_pe_wim_path", node->path);
break;
}
i++;
}
}
}
grub_free(cmd);
return 0;
}
grub_err_t ventoy_cmd_locate_wim_patch(grub_extcmd_context_t ctxt, int argc, char **args)
{
int datalen = 0;
@@ -1790,19 +1894,150 @@ end:
return rc;
}
static int ventoy_extract_init_exe(char *wimfile, grub_uint8_t **pexe_data, grub_uint32_t *pexe_len, char *exe_name)
{
int rc;
int ret = 1;
grub_uint16_t i;
grub_file_t file = NULL;
grub_uint32_t exe_len = 0;
wim_header *head = NULL;
grub_uint16_t *uname = NULL;
grub_uint8_t *exe_data = NULL;
grub_uint8_t *decompress_data = NULL;
wim_lookup_entry *lookup = NULL;
wim_security_header *security = NULL;
wim_directory_entry *rootdir = NULL;
wim_directory_entry *search = NULL;
wim_stream_entry *stream = NULL;
wim_lookup_entry *replace_look = NULL;
wim_header wimhdr;
wim_hash hashdata;
head = &wimhdr;
file = grub_file_open(wimfile, VENTOY_FILE_TYPE);
if (!file)
{
goto out;
}
grub_file_read(file, head, sizeof(wim_header));
rc = ventoy_read_resource(file, head, &head->metadata, (void **)&decompress_data);
if (rc)
{
grub_printf("failed to read meta data %d\n", rc);
goto out;
}
security = (wim_security_header *)decompress_data;
if (security->len > 0)
{
rootdir = (wim_directory_entry *)(decompress_data + ((security->len + 7) & 0xFFFFFFF8U));
}
else
{
rootdir = (wim_directory_entry *)(decompress_data + 8);
}
debug("read lookup offset:%llu size:%llu\n", (ulonglong)head->lookup.offset, (ulonglong)head->lookup.raw_size);
lookup = grub_malloc(head->lookup.raw_size);
grub_file_seek(file, head->lookup.offset);
grub_file_read(file, lookup, head->lookup.raw_size);
/* search winpeshl.exe dirent entry */
search = search_replace_wim_dirent(file, head, lookup, decompress_data, rootdir);
if (!search)
{
debug("Failed to find replace file %p\n", search);
goto out;
}
uname = (grub_uint16_t *)(search + 1);
for (i = 0; i < search->name_len / 2 && i < 200; i++)
{
exe_name[i] = (char)uname[i];
}
exe_name[i] = 0;
debug("find replace file at %p <%s>\n", search, exe_name);
grub_memset(&hashdata, 0, sizeof(wim_hash));
if (grub_memcmp(&hashdata, search->hash.sha1, sizeof(wim_hash)) == 0)
{
debug("search hash all 0, now do deep search\n");
stream = (wim_stream_entry *)((char *)search + search->len);
for (i = 0; i < search->streams; i++)
{
if (stream->name_len == 0)
{
grub_memcpy(&hashdata, stream->hash.sha1, sizeof(wim_hash));
debug("new search hash: %02x %02x %02x %02x %02x %02x %02x %02x\n",
ventoy_varg_8(hashdata.sha1));
break;
}
stream = (wim_stream_entry *)((char *)stream + stream->len);
}
}
else
{
grub_memcpy(&hashdata, search->hash.sha1, sizeof(wim_hash));
}
/* find and extact winpeshl.exe */
replace_look = ventoy_find_look_entry(head, lookup, &hashdata);
if (replace_look)
{
exe_len = (grub_uint32_t)replace_look->resource.raw_size;
debug("find replace lookup entry_id:%ld raw_size:%u\n",
((long)replace_look - (long)lookup) / sizeof(wim_lookup_entry), exe_len);
if (0 != ventoy_read_resource(file, head, &(replace_look->resource), (void **)&(exe_data)))
{
exe_len = 0;
exe_data = NULL;
debug("failed to read replace file meta data %u\n", exe_len);
}
}
else
{
debug("failed to find lookup entry for replace file %02x %02x %02x %02x\n",
ventoy_varg_4(hashdata.sha1));
}
if (exe_data)
{
ret = 0;
*pexe_data = exe_data;
*pexe_len = exe_len;
}
out:
grub_check_free(lookup);
grub_check_free(decompress_data);
check_free(file, grub_file_close);
return ret;
}
grub_err_t ventoy_cmd_windows_wimboot_data(grub_extcmd_context_t ctxt, int argc, char **args)
{
int rc = 0;
int wim64 = 0;
int datalen = 0;
int dataflag = 0;
grub_uint32_t size = 0;
grub_uint32_t exe_len = 0;
grub_uint32_t jump_align = 0;
const char *addr = NULL;
ventoy_chain_head *chain = NULL;
ventoy_os_param *param = NULL;
char envbuf[64];
grub_uint8_t *param = NULL;
grub_uint8_t *exe_data = NULL;
ventoy_windows_data *rtdata = NULL;
char exename[128] = {0};
wim_tail wim_data;
(void)ctxt;
(void)argc;
(void)args;
addr = grub_env_get("vtoy_chain_mem_addr");
if (!addr)
@@ -1821,24 +2056,30 @@ grub_err_t ventoy_cmd_windows_wimboot_data(grub_extcmd_context_t ctxt, int argc,
datalen = ventoy_get_windows_rtdata_len(chain->os_param.vtoy_img_path, &dataflag);
size = sizeof(ventoy_os_param) + datalen;
param = (ventoy_os_param *)grub_zalloc(size);
if (!param)
rc = ventoy_extract_init_exe(args[0], &exe_data, &exe_len, exename);
if (rc)
{
return 1;
}
wim64 = ventoy_is_pe64(exe_data);
grub_memcpy(param, &chain->os_param, sizeof(ventoy_os_param));
ventoy_fill_windows_rtdata(param + 1, param->vtoy_img_path, dataflag);
grub_memset(&wim_data, 0, sizeof(wim_data));
ventoy_cat_exe_file_data(&wim_data, exe_len, exe_data, datalen);
grub_check_free(exe_data);
jump_align = ventoy_align(wim_data.jump_exe_len, 16);
param = wim_data.jump_bin_data;
grub_memcpy(param + jump_align, &chain->os_param, sizeof(ventoy_os_param));
rtdata = (ventoy_windows_data *)(param + jump_align + sizeof(ventoy_os_param));
ventoy_fill_windows_rtdata(rtdata, chain->os_param.vtoy_img_path, dataflag);
ventoy_memfile_env_set("vtoy_wimboot_mem", param, (ulonglong)(wim_data.bin_align_len));
grub_env_set(args[1], exename);
grub_env_set(args[2], wim64 ? "64" : "32");
grub_snprintf(envbuf, sizeof(envbuf), "0x%lx", (unsigned long)param);
grub_env_set("vtoy_wimboot_mem_addr", envbuf);
debug("vtoy_wimboot_mem_addr: %s\n", envbuf);
grub_snprintf(envbuf, sizeof(envbuf), "%u", size);
grub_env_set("vtoy_wimboot_mem_size", envbuf);
debug("vtoy_wimboot_mem_size: %s\n", envbuf);
VENTOY_CMD_RETURN(GRUB_ERR_NONE);
}
@@ -1857,7 +2098,6 @@ grub_err_t ventoy_cmd_windows_chain_data(grub_extcmd_context_t ctxt, int argc, c
const char *pLastChain = NULL;
const char *compatible;
ventoy_chain_head *chain;
char envbuf[64];
(void)ctxt;
(void)argc;
@@ -1879,7 +2119,10 @@ grub_err_t ventoy_cmd_windows_chain_data(grub_extcmd_context_t ctxt, int argc, c
if (0 == ventoy_compatible && g_wim_valid_patch_count == 0)
{
unknown_image = 1;
debug("Warning: %s was not recognized by Ventoy\n", args[0]);
if (!g_ventoy_wimboot_mode)
{
debug("Warning: %s was not recognized by Ventoy\n", args[0]);
}
}
file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s", args[0]);
@@ -1949,10 +2192,7 @@ grub_err_t ventoy_cmd_windows_chain_data(grub_extcmd_context_t ctxt, int argc, c
return 1;
}
grub_snprintf(envbuf, sizeof(envbuf), "0x%lx", (unsigned long)chain);
grub_env_set("vtoy_chain_mem_addr", envbuf);
grub_snprintf(envbuf, sizeof(envbuf), "%u", size);
grub_env_set("vtoy_chain_mem_size", envbuf);
ventoy_memfile_env_set("vtoy_chain_mem", chain, (ulonglong)size);
grub_memset(chain, 0, sizeof(ventoy_chain_head));
@@ -2071,6 +2311,67 @@ static int ventoy_get_wim_chunklist(grub_file_t wimfile, ventoy_img_chunk_list *
return 0;
}
grub_err_t ventoy_cmd_is_standard_winiso(grub_extcmd_context_t ctxt, int argc, char **args)
{
int i;
int ret = 1;
char prefix[32] = {0};
const char *chkfile[] =
{
"boot/bcd", "boot/boot.sdi", NULL
};
(void)ctxt;
(void)argc;
if (ventoy_check_file_exist("%s/sources/boot.wim", args[0]))
{
prefix[0] = 0;
}
else if (ventoy_check_file_exist("%s/x86/sources/boot.wim", args[0]))
{
grub_snprintf(prefix, sizeof(prefix), "/x86");
}
else if (ventoy_check_file_exist("%s/x64/sources/boot.wim", args[0]))
{
grub_snprintf(prefix, sizeof(prefix), "/x64");
}
else
{
debug("No boot.wim found.\n");
goto out;
}
for (i = 0; chkfile[i]; i++)
{
if (!ventoy_check_file_exist("%s%s/%s", args[0], prefix, chkfile[i]))
{
debug("%s not found.\n", chkfile[i]);
goto out;
}
}
if ((!ventoy_check_file_exist("%s%s/sources/install.wim", args[0], prefix)) &&
(!ventoy_check_file_exist("%s%s/sources/install.esd", args[0], prefix)))
{
debug("No install.wim(esd) found.\n");
goto out;
}
if (!ventoy_check_file_exist("%s/setup.exe", args[0]))
{
debug("No setup.exe found.\n");
goto out;
}
ret = 0;
debug("This is standard Windows ISO.\n");
out:
return ret;
}
grub_err_t ventoy_cmd_wim_check_bootable(grub_extcmd_context_t ctxt, int argc, char **args)
{
grub_uint32_t boot_index;
@@ -2125,7 +2426,6 @@ static grub_err_t ventoy_vlnk_wim_chain_data(grub_file_t wimfile)
ventoy_img_chunk *chunknode;
ventoy_override_chunk *override;
ventoy_img_chunk_list wimchunk;
char envbuf[128];
debug("vlnk wim chain data begin <%s> ...\n", wimfile->name);
@@ -2182,10 +2482,7 @@ static grub_err_t ventoy_vlnk_wim_chain_data(grub_file_t wimfile)
return 1;
}
grub_snprintf(envbuf, sizeof(envbuf), "0x%lx", (unsigned long)chain);
grub_env_set("vtoy_chain_mem_addr", envbuf);
grub_snprintf(envbuf, sizeof(envbuf), "%u", size);
grub_env_set("vtoy_chain_mem_size", envbuf);
ventoy_memfile_env_set("vtoy_chain_mem", chain, (ulonglong)size);
grub_memset(chain, 0, sizeof(ventoy_chain_head));
@@ -2290,7 +2587,6 @@ static grub_err_t ventoy_normal_wim_chain_data(grub_file_t wimfile)
ventoy_img_chunk *chunknode;
ventoy_override_chunk *override;
ventoy_img_chunk_list wimchunk;
char envbuf[128];
debug("normal wim chain data begin <%s> ...\n", wimfile->name);
@@ -2347,10 +2643,7 @@ static grub_err_t ventoy_normal_wim_chain_data(grub_file_t wimfile)
return 1;
}
grub_snprintf(envbuf, sizeof(envbuf), "0x%lx", (unsigned long)chain);
grub_env_set("vtoy_chain_mem_addr", envbuf);
grub_snprintf(envbuf, sizeof(envbuf), "%u", size);
grub_env_set("vtoy_chain_mem_size", envbuf);
ventoy_memfile_env_set("vtoy_chain_mem", chain, (ulonglong)size);
grub_memset(chain, 0, sizeof(ventoy_chain_head));

View File

@@ -141,7 +141,7 @@ typedef struct ventoy_windows_data
grub_uint8_t windows11_bypass_check;
grub_uint32_t auto_install_len;
grub_uint8_t reserved[255 - 4];
/* auto_intall file buf */
@@ -304,6 +304,7 @@ grub_uint64_t grub_udf_get_last_file_attr_offset
grub_uint64_t *fe_entry_size_offset
);
int ventoy_is_efi_os(void);
void ventoy_memfile_env_set(const char *prefix, const void *buf, unsigned long long len);
#endif /* __VENTOY_H__ */

View File

@@ -33,7 +33,7 @@ ventoy_os_install_dmsetup_by_fuse() {
vtoy_fuse_iso -f $VTOY_PATH/ventoy_dm_table -m $VTOY_PATH/mnt/fuse
mount -t iso9660 $VTOY_PATH/mnt/fuse/ventoy.iso $VTOY_PATH/mnt/iso
mount -t squashfs $VTOY_PATH/mnt/iso/minios/01-core*.sb $VTOY_PATH/mnt/squashfs
mount -t squashfs $VTOY_PATH/mnt/iso/minios/0*-core*.sb $VTOY_PATH/mnt/squashfs
KoName=$(ls $VTOY_PATH/mnt/squashfs/lib/modules/$2/kernel/drivers/md/dm-mod.ko*)
vtlog "insmod $KoName"

View File

@@ -20,5 +20,5 @@
if [ -f /lib/livekitlib ] && $GREP -q 'debug_log.*find_data_try' /lib/livekitlib; then
$SED "/debug_log.*find_data_try/a\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/minios-disk.sh" -i /lib/livekitlib
else
$SED "/find_data/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/minios-disk.sh" -i /init
$SED "/find_data/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/minios-disk.sh" -i /init
fi

View File

@@ -24,6 +24,9 @@ if $GREP -q kaspersky /proc/version; then
if [ -f /ventoy/ventoy_persistent_map ]; then
$SED "/sysresccd_parsecmdline[^(]*$/a\ BACKSTORE_CMD='LABEL=casper-rw,noloop'" -i /init
fi
elif $GREP -q 'setting up the root filesystem' /init; then
$SED "/setting up the root filesystem/a\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/gentoo/disk_hook.sh" -i /init
$SED "/setting up the root filesystem/a\ export CDROOT_DEV=/dev/mapper/ventoy" -i /init
elif [ -d /etc/udev/rules.d ] || [ -d /lib/udev/rules.d ]; then
ventoy_systemd_udevd_work_around
ventoy_add_udev_rule "$VTOY_PATH/hook/default/udev_disk_hook.sh %k noreplace"

View File

@@ -51,6 +51,9 @@ if is_inotify_ventoy_part $3; then
if [ -e /sbin/anaconda-diskroot ]; then
vtlog "set anaconda-diskroot ..."
#busybox cp doesn't support -t option (issue 1900)
/bin/cp -a /bin/cp $BUSYBOX_PATH/cp
/sbin/anaconda-diskroot /dev/ventoy
fi

View File

@@ -39,6 +39,9 @@ fi
if [ -e /sbin/anaconda-diskroot ]; then
vtlog "set anaconda-diskroot /dev/ventoy ..."
#busybox cp doesn't support -t option (issue 1900)
/bin/cp -a /bin/cp $BUSYBOX_PATH/cp
/sbin/anaconda-diskroot /dev/ventoy
fi

View File

@@ -26,6 +26,10 @@ if [ -f $VTOY_PATH/autoinstall ]; then
VTKS="inst.ks=file:$VTOY_PATH/autoinstall"
else
for vtParam in $($CAT /proc/cmdline); do
if echo $vtParam | $GREP -q 'ks=file:/'; then
continue
fi
if echo $vtParam | $GREP -q 'inst.ks=hd:LABEL='; then
vtRawKsFull="$vtParam"
vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}')

View File

@@ -70,6 +70,9 @@ if is_inotify_ventoy_part $3; then
if [ -e /sbin/anaconda-diskroot ]; then
vtlog "set anaconda-diskroot ..."
#busybox cp doesn't support -t option (issue 1900)
/bin/cp -a /bin/cp $BUSYBOX_PATH/cp
/sbin/anaconda-diskroot /dev/ventoy
fi

View File

@@ -39,6 +39,9 @@ fi
if [ -e /sbin/anaconda-diskroot ]; then
vtlog "set anaconda-diskroot /dev/ventoy ..."
#busybox cp doesn't support -t option (issue 1900)
/bin/cp -a /bin/cp $BUSYBOX_PATH/cp
/sbin/anaconda-diskroot /dev/ventoy
fi

View File

@@ -37,9 +37,38 @@ if [ "$vtdiskname" = "unknown" ]; then
fi
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
ventoy_create_dev_ventoy_part
if ventoy_need_dm_patch; then
vtlog "extract a ko file"
mkdir -p /ventoy/tmpmnt1 /ventoy/tmpmnt2
mount /dev/ventoy1 /ventoy/tmpmnt1
mount /ventoy/tmpmnt1/boot/batocera /ventoy/tmpmnt2
vtKV=$(uname -r)
mkdir -p /lib/modules/$vtKV/kernel/
vtKO=$(find "/ventoy/tmpmnt2/lib/modules/$vtKV/kernel/fs/" -name "*.ko*" | head -n1)
cp -a $vtKO /lib/modules/$vtKV/kernel/
vtlog "vtKV=$vtKV vtKO=$vtKO"
umount /ventoy/tmpmnt2
umount /ventoy/tmpmnt1
vtPartid=1
cat /vtoy_dm_table | while read vtline; do
dmsetup remove ventoy$vtPartid
vtPartid=$(expr $vtPartid + 1)
done
dmsetup remove ventoy
vtlog "Recreate device-mapper"
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
ventoy_create_dev_ventoy_part
fi
PATH=$VTPATH_OLD
set_ventoy_hook_finish

View File

@@ -23,6 +23,9 @@ $SED "/find drives/i $BUSYBOX_PATH/sh $VTOY_PATH/loop/easyos/ventoy-disk.sh; vtD
$SED "1a boot_dev=ventoy1;wkg_dev=ventoy2" -i /init
$SED 's#\(dd *if=/dev/.*WKG_DRV.* *of=/dev/null.*skip\)=[0-9]*#\1=1048576#' -i /init
$SED "s#WKG_DEV=\"\"#WKG_DEV=ventoy2#g" -i /init
#check for ssd will read /sys/block/ventoy, will no exist, need a workaround
$SED "s#/sys/block/\${WKG_DRV}/#/sys/block/\$vtDM/#g" -i /init

View File

@@ -75,6 +75,10 @@ ventoy_get_os_type() {
echo 'openwrt'; return
fi
if $GREP -q 'easyos' /proc/cmdline; then
echo 'easyos'; return
fi
if [ -e /BOOT_SPECS ]; then
if $GREP -q 'easyos' /BOOT_SPECS; then
echo 'easyos'; return

View File

@@ -18,6 +18,18 @@ print_usage() {
echo ''
}
print_err() {
echo ""
echo "$*"
echo ""
}
uid=$(id -u)
if [ $uid -ne 0 ]; then
print_err "Please use sudo or run the script as root."
exit 1
fi
while [ -n "$1" ]; do
if [ "$1" = "-s" ]; then
shift

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
print_usage() {
echo 'Usage: ExtendPersistentImg.sh file size'
@@ -19,6 +19,18 @@ if [ -z "$2" ]; then
exit 1
fi
if [ "$1" = "__vbash__" ]; then
shift
else
if readlink /bin/sh | grep -q bash; then
:
else
exec /bin/bash $0 "__vbash__" "$@"
fi
fi
file=$1
size=$2

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,9 +1,9 @@
#!/bin/sh
#!/bin/bash
. ./tool/ventoy_lib.sh
print_usage() {
echo 'Usage: sudo sh VentoyPlugson.sh [OPTION] /dev/sdX'
echo 'Usage: sudo bash VentoyPlugson.sh [OPTION] /dev/sdX'
echo ' OPTION: (optional)'
echo ' -H x.x.x.x http server IP address (default is 127.0.0.1)'
echo ' -P PORT http server PORT (default is 24681)'
@@ -17,6 +17,15 @@ if [ $uid -ne 0 ]; then
exit 1
fi
if [ "$1" = "__vbash__" ]; then
shift
else
if readlink /bin/sh | grep -q bash; then
:
else
exec /bin/bash $0 "__vbash__" "$@"
fi
fi
OLDDIR=$(pwd)
@@ -154,7 +163,7 @@ fi
PART1=$(get_disk_part_name $DISK 1)
if grep -q "^$PART1 " /proc/mounts; then
mtpnt=$(grep "^$PART1 " /proc/mounts | awk '{print $2}')
mtpnt=$(grep "^$PART1 " /proc/mounts | awk '{print $2}' | sed 's/\\040/ /g')
fstype=$(grep "^$PART1 " /proc/mounts | awk '{print $3}')
if echo $fstype | grep -q -i 'fuse'; then

View File

@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
print_usage() {
echo 'Usage: VentoyWeb.sh [ OPTION ]'

Binary file not shown.

View File

@@ -158,7 +158,7 @@ function get_os_type {
function vt_check_compatible_pe {
#Check for PE without external tools
#set compatible if ISO file is less than 80MB
if [ $vt_chosen_size -gt 33554432 -a $vt_chosen_size -le 83886080 ]; then
if [ $vt_chosen_size -GT 33554432 -a $vt_chosen_size -LE 83886080 ]; then
set ventoy_compatible=YES
fi
@@ -599,8 +599,12 @@ function ventoy_unix_comm_proc {
function uefi_windows_menu_func {
vt_windows_reset
if [ "$ventoy_compatible" = "NO" ]; then
unset vt_cur_wimboot_mode
if vt_check_mode 4 "$vt_chosen_name"; then
set vt_cur_wimboot_mode=1
fi
if [ "$ventoy_compatible" = "NO" -o "$vt_cur_wimboot_mode" = "1" ]; then
if [ "$ventoy_fs_probe" = "iso9660" ]; then
loopback -d loop
vt_iso9660_nojoliet 1
@@ -619,14 +623,14 @@ function uefi_windows_menu_func {
ventoy_debug_pause
locate_wim "${chosen_path}"
fi
vt_windows_chain_data "${1}${chosen_path}"
ventoy_debug_pause
if vt_check_mode 4 "$vt_chosen_name"; then
vtoy_windows_wimboot_func
if [ "$vt_cur_wimboot_mode" = "1" ]; then
vtoy_wimboot_func
fi
if [ -n "$vtoy_chain_mem_addr" ]; then
ventoy_acpi_param ${vtoy_chain_mem_addr} 2048
ventoy_cli_console
@@ -770,7 +774,7 @@ function uefi_linux_menu_func {
vt_linux_chain_data "${1}${chosen_path}"
if [ -n "$LoadIsoEfiDriver" -a $vt_chosen_size -lt 104857600 ]; then
if [ -n "$LoadIsoEfiDriver" -a $vt_chosen_size -LT 104857600 ]; then
if [ -f (loop)/efi/clover/cloverx64.efi ]; then
unset LoadIsoEfiDriver
fi
@@ -783,6 +787,10 @@ function uefi_linux_menu_func {
unset vtGrub2Mode
if vt_check_mode 3 "$vt_chosen_name"; then
set vtGrub2Mode=1
elif vt_str_begin "$vt_volume_id" "HOLO_"; then
if [ -d (loop)/loader/entries ]; then
set vtGrub2Mode=1
fi
elif vt_str_begin "$vt_volume_id" "KRD"; then
if [ -f (loop)/boot/grub/grub.cfg.sig ]; then
set vtGrub2Mode=1
@@ -816,6 +824,18 @@ function uefi_linux_menu_func {
break
fi
done
if [ $vtback_cfg_find -eq 0 ]; then
if [ -f (loop)/loader/loader.conf -a -d (loop)/loader/entries ]; then
if vt_str_begin "$vt_volume_id" "HOLO_"; then
set root=(loop,2)
vt_systemd_menu (loop,2) vt_sys_menu_mem
else
vt_systemd_menu (loop) vt_sys_menu_mem
fi
set vtback_cfg_find=1
configfile "mem:${vt_sys_menu_mem_addr}:size:${vt_sys_menu_mem_size}"
fi
fi
if [ "$vtback_cfg_find" = "0" ]; then
echo " "
@@ -912,6 +932,15 @@ function uefi_iso_menu_func {
vt_check_compatible (loop)
fi
if vt_need_secondary_menu "$vt_chosen_name"; then
vt_show_secondary_menu "$vt_chosen_path" "$vtoy_os" $vt_chosen_size
if vt_check_mode 0 "$vt_chosen_name"; then
uefi_iso_memdisk $vtoy_iso_part "$vt_chosen_path"
vt_secondary_recover_mode
return
fi
fi
vt_img_sector "${1}${chosen_path}"
if [ "$ventoy_fs_probe" = "iso9660" ]; then
@@ -929,6 +958,7 @@ function uefi_iso_menu_func {
fi
ventoy_gui_console
vt_secondary_recover_mode
}
function uefi_iso_memdisk {
@@ -942,8 +972,7 @@ function uefi_iso_memdisk {
ventoy_gui_console
}
function vtoy_windows_wimboot_func {
function vtoy_windows_wimboot {
if [ -f (loop)/x86/sources/boot.wim -a -f (loop)/x64/sources/boot.wim ]; then
vt_sel_wimboot vtoy_wimboot_bit
if [ "$vtoy_wimboot_bit" = "32" ]; then
@@ -961,43 +990,24 @@ function vtoy_windows_wimboot_func {
fi
if [ -n "${vtdebug_flag}" ]; then
echo vtoy_wimboot_prefix=$vtoy_wimboot_prefix vtoy_wimboot_bit=$vtoy_wimboot_bit
echo vtoy_wimboot_prefix=$vtoy_wimboot_prefix vtoy_wimboot_bit=$vtoy_wimboot_bit vt_wimkernel=$vt_wimkernel
fi
for wmfile in sources/boot.wim boot/bcd boot/boot.sdi; do
if [ ! -f $vtoy_wimboot_prefix/$wmfile ]; then
return
fi
done
if [ -f $vtoy_wimboot_prefix/sources/install.wim -o -f $vtoy_wimboot_prefix/sources/install.esd ]; then
vt_windows_wimboot_data
else
return
fi
vt_windows_wimboot_data "$vtoy_wimboot_prefix/sources/boot.wim" vtoy_init_exe vtoy_wim_bit
if [ "$grub_platform" = "pc" ]; then
set vt_wimkernel=wimboot.x86_64.xz
linux16 "$vtoy_path/$vt_wimkernel" quiet
ventoy_debug_pause
vt_set_wim_load_prompt 1 "Loading files......"
initrd16 newc:vtoyjump.exe:$vtoy_path/vtoyjump${vtoy_wimboot_bit}.exe \
newc:wimboot.data:mem:${vtoy_wimboot_mem_addr}:size:${vtoy_wimboot_mem_size} \
newc:winpeshl.ini:mem:${vtoy_winpeshl_ini_addr}:size:${vtoy_winpeshl_ini_size} \
initrd16 newc:winpeshl.exe:mem:${vtoy_wimboot_mem_addr}:size:${vtoy_wimboot_mem_size} \
newc:vtoy_wimboot:$vtoy_wimboot_prefix/boot/bcd \
newc:bcd:$vtoy_wimboot_prefix/boot/bcd \
newc:boot.sdi:$vtoy_wimboot_prefix/boot/boot.sdi \
newc:boot.wim:$vtoy_wimboot_prefix/sources/boot.wim
vt_set_wim_load_prompt 0
boot
else
if [ "$grub_cpu" = "i386" ]; then
set vt_wimkernel=wimboot.i386.efi.xz
else
set vt_wimkernel=wimboot.x86_64.xz
fi
vt_set_wim_load_prompt 1 "Loading files......"
vt_load_file_to_mem "nodecompress" $vtoy_wimboot_prefix/sources/boot.wim vtoy_wimfile_mem
vt_set_wim_load_prompt 0
@@ -1010,9 +1020,8 @@ function vtoy_windows_wimboot_func {
ventoy_cli_console
chainloader "$vtoy_path/$vt_wimkernel" quiet \
"vf=wimboot.data:mem:${vtoy_wimboot_mem_addr}:size:${vtoy_wimboot_mem_size}" \
"vf=winpeshl.ini:mem:${vtoy_winpeshl_ini_addr}:size:${vtoy_winpeshl_ini_size}" \
"vf=vtoyjump.exe:$vtoy_path/vtoyjump${vtoy_wimboot_bit}.exe" \
"vf=winpeshl.exe:mem:${vtoy_wimboot_mem_addr}:size:${vtoy_wimboot_mem_size}" \
"vf=vtoy_wimboot:$vtoy_wimboot_prefix/boot/bcd" \
"vf=bcd:$vtoy_wimboot_prefix/boot/bcd" \
"vf=boot.sdi:$vtoy_wimboot_prefix/boot/boot.sdi" \
"vf=boot.wim:$vtoy_wimfile_path" \
@@ -1023,11 +1032,125 @@ function vtoy_windows_wimboot_func {
fi
}
function vtoy_winpe_wimboot {
unset vtoy_boot_sdi_legacy
unset vtoy_boot_sdi_efi
set vtoy_wimboot_prefix=(loop)
set vtoy_wim_path="$1"
if [ -n "${vtdebug_flag}" ]; then
echo "winpe_wimboot $1 $2 $3"
fi
if [ "$2" != "0" ]; then
set vtoy_boot_sdi_legacy="newc:boot.sdi:$vtoy_wimboot_prefix/$2"
set vtoy_boot_sdi_efi="vf=boot.sdi:$vtoy_wimboot_prefix/$2"
fi
vt_windows_wimboot_data $vtoy_wimboot_prefix/$vtoy_wim_path vtoy_init_exe vtoy_wim_bit
if [ "$grub_platform" = "pc" ]; then
linux16 "$vtoy_path/$vt_wimkernel" quiet
ventoy_debug_pause
vt_set_wim_load_prompt 1 "Loading files......"
initrd16 newc:$vtoy_init_exe:mem:${vtoy_wimboot_mem_addr}:size:${vtoy_wimboot_mem_size} \
newc:vtoy_wimboot:$vtoy_path/$vt_wimkernel \
newc:bootmgr.exe:mem:${vtoy_pe_bootmgr_mem_addr}:size:${vtoy_pe_bootmgr_mem_size} \
newc:bcd:mem:${vtoy_pe_bcd_mem_addr}:size:${vtoy_pe_bcd_mem_size} \
$vtoy_boot_sdi_legacy \
newc:boot.wim:$vtoy_wimboot_prefix/$vtoy_wim_path
vt_set_wim_load_prompt 0
boot
else
if [ "$VTOY_EFI_ARCH" = "x64" -a "$vtoy_wim_bit" = "32" ]; then
echo -e "\nThis is 32bit Windows and does NOT support x86_64 UEFI firmware.\n"
echo -e "这是32位的 Windows 系统不支持当前的64位 UEFI 环境。\n"
fi
vt_set_wim_load_prompt 1 "Loading files......"
vt_load_file_to_mem "nodecompress" $vtoy_wimboot_prefix/$vtoy_wim_path vtoy_wimfile_mem
vt_set_wim_load_prompt 0
if [ $? -eq 0 ]; then
set vtoy_wimfile_path=mem:${vtoy_wimfile_mem_addr}:size:${vtoy_wimfile_mem_size}
else
set vtoy_wimfile_path=$vtoy_wimboot_prefix/$vtoy_wim_path
fi
unset vtoy_boot_efi_path
if [ -F (loop)/efi/boot/boot${VTOY_EFI_ARCH}.efi ]; then
set vtoy_boot_efi_path="vf=bootx64.efi:(loop)/efi/boot/boot${VTOY_EFI_ARCH}.efi"
fi
ventoy_cli_console
chainloader "$vtoy_path/$vt_wimkernel" quiet \
"vf=$vtoy_init_exe:mem:${vtoy_wimboot_mem_addr}:size:${vtoy_wimboot_mem_size}" \
"vf=vtoy_wimboot:$vtoy_path/$vt_wimkernel" \
"vf=bcd:mem:${vtoy_pe_bcd_mem_addr}:size:${vtoy_pe_bcd_mem_size}" \
"$vtoy_boot_sdi_efi" \
"$vtoy_boot_efi_path" \
"vf=boot.wim:$vtoy_wimfile_path" \
pfsize=$vtoy_chain_file_size \
pfread=$vtoy_chain_file_read
boot
ventoy_gui_console
fi
}
function vtoy_wimboot_func {
if [ "$grub_platform" = "pc" ]; then
set vt_wimkernel=wimboot.x86_64.xz
else
if [ "$grub_cpu" = "i386" ]; then
set vt_wimkernel=wimboot.i386.efi.xz
else
set vt_wimkernel=wimboot.x86_64.xz
fi
fi
if vt_is_standard_winiso (loop); then
echo -e "\n==================== VENTOY WIMBOOT ==================\n"
vtoy_windows_wimboot
else
vt_sel_winpe_wim (loop)
if [ -n "$vtoy_pe_wim_path" ]; then
echo -e "\n==================== VENTOY WIMBOOT ==================\n"
vt_fs_ignore_case 1
vt_load_file_to_mem "auto" $vtoy_path/common_bcd.xz vtoy_pe_bcd_mem
set vt_sdi_path=0
for vsdi in "boot/boot.sdi" "2K10/FONTS/boot.sdi" "SSTR/boot.sdi" "ISPE/BOOT.SDI" \
"boot/uqi.sdi" "ISYL/boot.sdi" "WEPE/WEPE.SDI" ; do
if [ -F "(loop)/$vsdi" ]; then
set vt_sdi_path=$vsdi
break
fi
done
if [ "$grub_platform" = "pc" ]; then
vt_load_file_to_mem "auto" $vtoy_path/common_bootmgr.xz vtoy_pe_bootmgr_mem
vtoy_winpe_wimboot "$vtoy_pe_wim_path" "$vt_sdi_path" 1
else
vtoy_winpe_wimboot "$vtoy_pe_wim_path" "$vt_sdi_path" 0
fi
vt_fs_ignore_case 0
fi
fi
}
function legacy_windows_menu_func {
vt_windows_reset
if [ "$ventoy_compatible" = "NO" ]; then
unset vt_cur_wimboot_mode
if vt_check_mode 4 "$vt_chosen_name"; then
set vt_cur_wimboot_mode=1
fi
if [ "$ventoy_compatible" = "NO" -o "$vt_cur_wimboot_mode" = "1" ]; then
if [ "$ventoy_fs_probe" = "iso9660" ]; then
loopback -d loop
vt_iso9660_nojoliet 1
@@ -1045,15 +1168,17 @@ function legacy_windows_menu_func {
distro_specify_wim_patch_phase2
fi
ventoy_debug_pause
locate_wim "${chosen_path}"
ventoy_debug_pause
if [ -z "$vt_cur_wimboot_mode" ]; then
locate_wim "${chosen_path}"
fi
fi
vt_windows_chain_data "${1}${chosen_path}"
ventoy_debug_pause
if vt_check_mode 4 "$vt_chosen_name"; then
vtoy_windows_wimboot_func
ventoy_debug_pause
if [ "$vt_cur_wimboot_mode" = "1" ]; then
vtoy_wimboot_func
fi
if [ -n "$vtoy_chain_mem_addr" ]; then
@@ -1135,10 +1260,19 @@ function legacy_linux_menu_func {
ventoy_debug_pause
if [ -n "$vtoy_chain_mem_addr" ]; then
unset vtGrub2Mode
if vt_check_mode 3 "$vt_chosen_name"; then
set vtGrub2Mode=1
elif vt_str_begin "$vt_volume_id" "HOLO_"; then
if [ -d (loop)/loader/entries ]; then
set vtGrub2Mode=1
fi
fi
if [ -n "$vtGrub2Mode" ]; then
ventoy_acpi_param ${vtoy_chain_mem_addr} 2048
ventoy_cli_console
# fallback
set vtback_root=$root
vt_push_last_entry
@@ -1157,6 +1291,18 @@ function legacy_linux_menu_func {
break
fi
done
if [ $vtback_cfg_find -eq 0 ]; then
if [ -f (loop)/loader/loader.conf -a -d (loop)/loader/entries ]; then
if vt_str_begin "$vt_volume_id" "HOLO_"; then
set root=(loop,2)
vt_systemd_menu (loop,2) vt_sys_menu_mem
else
vt_systemd_menu (loop) vt_sys_menu_mem
fi
set vtback_cfg_find=1
configfile "mem:${vt_sys_menu_mem_addr}:size:${vt_sys_menu_mem_size}"
fi
fi
vt_unset_boot_opt
set root=$vtback_root
@@ -1220,6 +1366,15 @@ function legacy_iso_menu_func {
vt_check_compatible (loop)
fi
if vt_need_secondary_menu "$vt_chosen_name"; then
vt_show_secondary_menu "$vt_chosen_path" "$vtoy_os" $vt_chosen_size
if vt_check_mode 0 "$vt_chosen_name"; then
legacy_iso_memdisk $vtoy_iso_part "$vt_chosen_path"
vt_secondary_recover_mode
return
fi
fi
vt_img_sector "${1}${chosen_path}"
if [ "$ventoy_fs_probe" = "iso9660" ]; then
@@ -1235,6 +1390,7 @@ function legacy_iso_menu_func {
vt_check_compatible_linux (loop)
legacy_linux_menu_func "$1" "${chosen_path}"
fi
vt_secondary_recover_mode
}
function legacy_iso_memdisk {
@@ -1309,7 +1465,7 @@ function iso_common_menuentry {
vt_chosen_img_path vt_chosen_path vt_chosen_size vt_chosen_name
vt_parse_iso_volume "${vtoy_iso_part}${vt_chosen_path}" vt_system_id vt_volume_id vt_volume_space
if [ $vt_volume_space -ne $vt_chosen_size ]; then
if [ $vt_volume_space -NE $vt_chosen_size ]; then
vt_mod $vt_chosen_size 2048 vt_chosen_size_mod
if [ $vt_chosen_size_mod -ne 0 ]; then
echo -e "\n $vt_volume_space $vt_chosen_size $vt_chosen_size_mod\n"
@@ -1357,7 +1513,7 @@ function iso_common_menuentry {
fi
#For iKuai8 (<64MB)
if [ $vt_chosen_size -le 67108864 ]; then
if [ $vt_chosen_size -LE 67108864 ]; then
if vt_str_begin "$vt_chosen_name" "iKuai"; then
set vtMemDiskBoot=1
fi
@@ -1691,6 +1847,41 @@ function ventoy_img_easyos {
loopback -d easysfs
}
function ventoy_img_easyos2 {
vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit
if [ -e (vtimghd,2)/easyos/easy.sfs ]; then
loopback easysfs (vtimghd,2)/easyos/easy.sfs
elif [ -d (vtimghd,2)/easyos/releases ]; then
vt_fs_enum_1st_dir (vtimghd,2) /easyos/releases/ vt_dir_name
loopback easysfs (vtimghd,2)/easyos/releases/$vt_dir_name/easy.sfs
fi
vt_get_lib_module_ver (easysfs) /lib/modules/ vt_module_ver
if [ -n "$vt_module_ver" ]; then
for mod in "kernel/drivers/md/dm-mod.ko" "kernel/drivers/dax/dax.ko"; do
if [ -e (easysfs)/lib/modules/$vt_module_ver/$mod ]; then
vt_img_extra_initrd_append (easysfs)/lib/modules/$vt_module_ver/$mod
fi
done
fi
ventoy_debug_pause
#boot image file
vt_set_boot_opt rdinit=/vtoy/vtoy
vt_img_hook_root
vt_limine_menu (vtimghd,1)/limine.cfg vt_sys_menu_mem
configfile "mem:${vt_sys_menu_mem_addr}:size:${vt_sys_menu_mem_size}"
vt_img_unhook_root
vt_unset_boot_opt
loopback -d easysfs
}
function ventoy_img_volumio {
vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit
@@ -1799,7 +1990,7 @@ function ventoy_img_ubos {
}
function ventoy_img_recalbox {
if [ $vtoy_img_max_part_end -gt $vt_chosen_size ]; then
if [ $vtoy_img_max_part_end -GT $vt_chosen_size ]; then
echo -e "\nPlease extend the img file size before boot it. \n"
ventoy_pause
return
@@ -2078,11 +2269,15 @@ function img_common_menuentry {
if vt_str_begin "$vtImgHd3Label" "ROOT-"; then
if [ -f (vtimghd,3)/etc/os-release.d/ID ]; then
vt_1st_line (vtimghd,3)/etc/os-release.d/ID vt_release_line1
if [ vt_str_begin "$vt_release_line1" "FydeOS" ]; then
if vt_str_begin "$vt_release_line1" "FydeOS"; then
ventoy_img_fydeos
else
ventoy_img_cloudready
fi
elif [ -f (vtimghd,3)/etc/cloudready-release ]; then
ventoy_img_cloudready
elif [ -f (vtimghd,3)/etc/chrome_dev.conf ]; then
ventoy_img_cloudready
fi
elif vt_str_begin "$vtImgHd1Label" "LAKKA"; then
ventoy_img_openelec lakka
@@ -2102,6 +2297,8 @@ function img_common_menuentry {
ventoy_img_esysrescue
elif [ -e (vtimghd,1)/easy.sfs ]; then
ventoy_img_easyos
elif [ -d (vtimghd,2)/easyos ]; then
ventoy_img_easyos2
elif [ -e (vtimghd,1)/volumio.initrd ]; then
ventoy_img_volumio
elif [ -f (vtimghd,2)/loader/entries/ubos.conf ]; then
@@ -2147,7 +2344,7 @@ function img_unsupport_menuentry {
#############################################################
#############################################################
set VENTOY_VERSION="1.0.79"
set VENTOY_VERSION="1.0.82"
#ACPI not compatible with Window7/8, so disable by default
set VTOY_PARAM_NO_ACPI=1
@@ -2205,6 +2402,11 @@ if [ "$vtoy_dev" = "tftp" ]; then
done
loadfont ascii
if [ -n "$vtoy_efi_part" ]; then
vt_load_file_to_mem "auto" $vtoy_efi_part/grub/fonts/unicode.pf2 vtoy_font_mem
loadfont mem:${vtoy_font_mem_addr}:size:${vtoy_font_mem_size}
fi
if [ -f $vtoy_iso_part/ventoy/ventoy.json ]; then
set vt_plugin_path=$vtoy_iso_part
else
@@ -2373,6 +2575,7 @@ export VTOY_HELP_CMD
export VTOY_CHKSUM_CMD
export VTOY_HELP_TXT_LANGUAGE
export VTOY_CHKSUM_FILE_PATH
export VTOY_HOTKEY_TIP
#colect all image files (iso files)

View File

@@ -8,10 +8,10 @@ F6 - Benutzerdefiniertes Grub2-Menü laden
F7 - Wechseln zwischen GUI-Modus <-> TEXT-Modus
m - Prüfsummencheck Image Dateien (md5/sha1/sha256/sha512)
Ctrl+w - WIMBOOT Modus (Nur für Standard Windows ISO)
Ctrl+r - Grub2 Modus (Nur für einige Linux distros)
Ctrl+i - Kompatibilitäts Modus (Nur für Fehleranalyse)
Ctrl+u - Lade ISO efi Treiber (Nur für Fehleranalyse, darf nicht offiziel benutzt werden)
w/Ctrl+w - WIMBOOT Modus (Nur für Standard Windows ISO)
r/Ctrl+r - Grub2 Modus (Nur für einige Linux distros)
i/Ctrl+i - Kompatibilitäts Modus (Nur für Fehleranalyse)
u/Ctrl+u - Lade ISO efi Treiber (Nur für Fehleranalyse, darf nicht offiziel benutzt werden)

View File

@@ -8,10 +8,10 @@ F6 - Load Custom Grub2 Menu
F7 - Switch between GUI Mode <-> TEXT Mode
m - Checksum image files (md5/sha1/sha256/sha512)
Ctrl+w - WIMBOOT Mode (Only for standard Windows ISO)
Ctrl+r - Grub2 Mode (Only for some Linux distros)
Ctrl+i - Compatible Mode (Just only for debug)
Ctrl+u - Load ISO efi driver (Just only for debug, can not be used officially)
w/Ctrl+w - WIMBOOT Mode (Only for standard Windows ISO)
r/Ctrl+r - Grub2 Mode (Only for some Linux distros)
i/Ctrl+i - Compatible Mode (Just only for debug)
u/Ctrl+u - Load ISO efi driver (Just only for debug, can not be used officially)

View File

@@ -8,9 +8,9 @@ F6 - Charger le menu Grub2 personnalisé
F7 - Basculer entre le mode graphique <-> mode texte
m - Somme de contrôle des images (md5/sha1/sha256/sha512)
Ctrl+w - Mode WIMBOOT (seulement pour les images standards Windows)
Ctrl+r - Mode Grub2 (seulement pour quelques Linux)
Ctrl+i - Mode Compatible (seulement à fins de tests)
Ctrl+u - Load ISO efi driver (Just only for debug, can not be used officially)
w/Ctrl+w - Mode WIMBOOT (seulement pour les images standards Windows)
r/Ctrl+r - Mode Grub2 (seulement pour quelques Linux)
i/Ctrl+i - Mode Compatible (seulement à fins de tests)
u/Ctrl+u - Load ISO efi driver (Just only for debug, can not be used officially)
Appuyer sur Echap pour sortir ......

View File

@@ -8,10 +8,10 @@ F6 - Učitava prilagođen GRUB2 meni
F7 - Mijenja između GUI <-> TEXT načina rada
m - Generira heš odabranog imidž fajla (md5/sha1/sha256/sha512)
Ctrl+w - WIMBOOT način rada (samo za standardne Windows imidž fajlove)
Ctrl+r - GRUB2 način rada (samo za neke Linux distribucije)
Ctrl+i - Kompatibilni način rada (samo za testiranje)
Ctrl+u - Učitava EFI drajver za imidž fajlove (samo za testiranje)
w/Ctrl+w - WIMBOOT način rada (samo za standardne Windows imidž fajlove)
r/Ctrl+r - GRUB2 način rada (samo za neke Linux distribucije)
i/Ctrl+i - Kompatibilni način rada (samo za testiranje)
u/Ctrl+u - Učitava EFI drajver za imidž fajlove (samo za testiranje)

View File

@@ -8,10 +8,10 @@ F6 - Memuat ubah suai Grub2 Menu
F7 - Beralih antara mode GUI <-> Mode TEXT
m - Periksa berkas files (md5/sha1/sha256/sha512)
Ctrl+w - Mode WIMBOOT (Hanya untuk berkas ISO Windows standar)
Ctrl+r - Mode Grub2 (Hanya untuk distro Linux tertentu)
Ctrl+i - Mode Kompatibel/Compatible (Hanya untuk debug saja)
Ctrl+u - Memuat ISO efi driver (Hanya untuk debug saja, tidak dapat dipakai secara umum)
w/Ctrl+w - Mode WIMBOOT (Hanya untuk berkas ISO Windows standar)
r/Ctrl+r - Mode Grub2 (Hanya untuk distro Linux tertentu)
i/Ctrl+i - Mode Kompatibel/Compatible (Hanya untuk debug saja)
u/Ctrl+u - Memuat ISO efi driver (Hanya untuk debug saja, tidak dapat dipakai secara umum)

View File

@@ -8,10 +8,10 @@ F6 - Grub2の構成を読み込む
F7 - 操作形式を切り替えるGUI ↔ CUI
m - イメージの検査合計を計算する (md5/sha1/sha256/sha512)
Ctrl+w - WIMBOOTモード標準的なWindows ISO専用
Ctrl+r - Grub2モード一部のLinuxディストリビューション専用
Ctrl+i - 互換モード(開発用)
Ctrl+u - ISO efiドライバーを読み取る開発用非公式
w/Ctrl+w - WIMBOOTモード標準的なWindows ISO専用
r/Ctrl+r - Grub2モード一部のLinuxディストリビューション専用
i/Ctrl+i - 互換モード(開発用)
u/Ctrl+u - ISO efiドライバーを読み取る開発用非公式

View File

@@ -8,10 +8,10 @@ F6 - 사용자 지정 Grub2 메뉴 로드
F7 - GUI 모드 <-> TEXT 모드 간에 전환
m - 체크섬 이미지 파일 (md5/sha1/sha256/sha512)
Ctrl+w - WIMBOOT 모드 (표준 Windows ISO 전용)
Ctrl+r - Grub2 모드 (일부 Linux 배포판에만 해당)
Ctrl+i - 호환 모드 (디버그 전용)
Ctrl+u - ISO eFi 드라이버 로드 (디버그 전용, 공식적으로 사용할 수 없음)
w/Ctrl+w - WIMBOOT 모드 (표준 Windows ISO 전용)
r/Ctrl+r - Grub2 모드 (일부 Linux 배포판에만 해당)
i/Ctrl+i - 호환 모드 (디버그 전용)
u/Ctrl+u - ISO eFi 드라이버 로드 (디버그 전용, 공식적으로 사용할 수 없음)

View File

@@ -8,10 +8,10 @@ F6 - Carregar menu Grub2 personalizado
F7 - Alternar entre Modo GUI <-> Modo TEXTO
m - Checksum ficheiros de imagem (md5/sha1/sha256/sha512)
Ctrl+w - Modo WIMBOOT (Apenas para Windows ISO padrão)
Ctrl+r - Modo Grub2 (Apenas para algumas distros Linux)
Ctrl+i - Modo Compatível (Apenas para depuração)
Ctrl+u - Carregar o controlador ISO efi (Apenas para depuração, não pode ser utilizado oficialmente)
w/Ctrl+w - Modo WIMBOOT (Apenas para Windows ISO padrão)
r/Ctrl+r - Modo Grub2 (Apenas para algumas distros Linux)
i/Ctrl+i - Modo Compatível (Apenas para depuração)
u/Ctrl+u - Carregar o controlador ISO efi (Apenas para depuração, não pode ser utilizado oficialmente)
Prima ESC para voltar ......

View File

@@ -8,10 +8,10 @@ F6 - Учитава прилагођен GRUB2 мени
F7 - Мења између GUI <-> TEXT начина рада
m - Генерира хеш одабраног имиџ фајла (md5/sha1/sha256/sha512)
Ctrl+w - WIMBOOT начин рада (само за стандардне Windows имиџ фајлове)
Ctrl+r - GRUB2 начин рада (само за неке Linux дистрибуције)
Ctrl+i - Компатибилни начин рада (само за тестирање)
Ctrl+u - Учитава EFI драјвер за имиџ фајлове (само за тестирање)
w/Ctrl+w - WIMBOOT начин рада (само за стандардне Windows имиџ фајлове)
r/Ctrl+r - GRUB2 начин рада (само за неке Linux дистрибуције)
i/Ctrl+i - Компатибилни начин рада (само за тестирање)
u/Ctrl+u - Учитава EFI драјвер за имиџ фајлове (само за тестирање)

View File

@@ -8,10 +8,10 @@ F6 - Özelleştirilmiş Grub2 menüsünü yükler
F7 - Grafik Modu(GUI Mode) ile Metin Modu(Text Mode) arasında geçiş yapmayı sağlar
m - İndirilen imaj dosyalarının hatasız indirildiğini teyit etmek için "md5/sha1/sha256/sha512" değerlerini kontrol etmeyi sağlar
Ctrl+w - WIMBOOT Modu çalıştırmayı sağlar(Sadece normal Windows ISO ları için)
Ctrl+r - Grub2 Modu çalıştırmayı sağlar (Sadece bazı Linux dağıtımları için)
Ctrl+i - Uyumluluk Modu'nu (Compatible Mode) çalıştırmayı sağlar (Sadece hata ayıklama için bu modu kullanabilirsiniz)
Ctrl+u - ISO efi sürücüsünü yükler(Sadece hata ayıklama için bu mod kullanılabilir, resmi olarak kullanılamaz)
w/Ctrl+w - WIMBOOT Modu çalıştırmayı sağlar(Sadece normal Windows ISO ları için)
r/Ctrl+r - Grub2 Modu çalıştırmayı sağlar (Sadece bazı Linux dağıtımları için)
i/Ctrl+i - Uyumluluk Modu'nu (Compatible Mode) çalıştırmayı sağlar (Sadece hata ayıklama için bu modu kullanabilirsiniz)
u/Ctrl+u - ISO efi sürücüsünü yükler(Sadece hata ayıklama için bu mod kullanılabilir, resmi olarak kullanılamaz)
Geriye dönmek için ESC tuşuna basınız......

View File

@@ -8,10 +8,10 @@ F6 - 加载自定义 GRUB2 菜单。
F7 - 界面在文本模式和图形模式之间切换。
m - 计算文件校验值md5/sha1/sha256/sha512
Ctrl+w - WIMBOOT 模式 (只适用于标准的 Windows ISO文件
Ctrl+r - Grub2 模式 (只适用于常见的一些 Linux 系统ISO文件
Ctrl+i - 兼容模式 (只用作调试目的,不能正式使用)
Ctrl+u - 加载 ISO efi 驱动(只用作调试目的,不能正式使用)
w/Ctrl+w - WIMBOOT 模式 (只适用于标准的 Windows ISO文件
r/Ctrl+r - Grub2 模式 (只适用于常见的一些 Linux 系统ISO文件
i/Ctrl+i - 兼容模式 (只用作调试目的,不能正式使用)
u/Ctrl+u - 加载 ISO efi 驱动(只用作调试目的,不能正式使用)
按 ESC 键返回 ......

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -55,6 +55,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"توقفت عملية تثبيت Ventoy بدون تهيئة لعدم استيفاء بعض الشروط. تفقد ملف log.txt للتفاصيل.",
"STR_INSTALL_YES_TIP1":"تحذير: سيتم فقدان البيانات!",
"STR_INSTALL_YES_TIP2":"يرجى إدخال YES في مربع النص في الأسفل للتأكيد بأنك تريد عمل تثبيت جديد بدلاً من التحديث.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -114,6 +115,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"ZƏrərsiz Ventoy quraşdırması dayandırıldı, belə ki, bəzi şərtlər yerinə yetirilə bilməd. Daha ətraflı məlumat üçün.txt jurnal faylına baxın.",
"STR_INSTALL_YES_TIP1":"Warning: Data will be lost!",
"STR_INSTALL_YES_TIP2":"Please enter YES in the text box below to confirm that you indeed want to do a fresh install instead of upgrade.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -126,8 +128,8 @@
"STR_ERROR":"오류",
"STR_WARNING":"경고",
"STR_INFO":"정보",
"STR_INCORRECT_DIR":"올바른 디렉리에서 실행하십시오!",
"STR_INCORRECT_TREE_DIR":"여기서 실행하지 말고, 출시된 설치 패키지를 다운로드한 다음 거기서 실행십시오.",
"STR_INCORRECT_DIR":"올바른 디렉리에서 실행하십시오!",
"STR_INCORRECT_TREE_DIR":"여기서 프로그램 (INSTALL 디렉터리)을 실행하지 말고 설치 패키지를 다운로드하여 압축을 푼 후 그곳에서 실행해 주십시오.",
"STR_DEVICE":"장치",
"STR_LOCAL_VER":"패키지의 Ventoy 버전",
"STR_DISK_VER":"장치 내부의 Ventoy 버전",
@@ -173,7 +175,8 @@
"STR_PART_RESIZE_UNSUPPORTED":"일부 조건을 충족할 수 없기 때문에 Ventoy 비파괴 설치가 중지되었습니다. 자세한 내용은 log.txt를 확인하십시오.",
"STR_INSTALL_YES_TIP1":"경고: 데이터가 손실됩니다!",
"STR_INSTALL_YES_TIP2":"업그레이드 대신 새로 설치할지 확인하려면 아래 입력란에 YES를 입력하십시오.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
{
@@ -232,7 +235,8 @@
"STR_PART_RESIZE_UNSUPPORTED":"条件不满足,无法进行无损安装。详细信息请查阅 log.txt 文件。",
"STR_INSTALL_YES_TIP1":"警告: 所有数据将会丢失!",
"STR_INSTALL_YES_TIP2":"请在下面文本框中输入 YES 以确认你是要进行安装而不是升级。",
"STR_PART_VENTOY_FS":"Ventoy 分区文件系统类型",
"STRXXX":""
},
{
@@ -291,6 +295,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
"STR_INSTALL_YES_TIP1":"Warning: Data will be lost!",
"STR_INSTALL_YES_TIP2":"Please enter YES in the text box below to confirm that you indeed want to do a fresh install instead of upgrade.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -349,6 +354,8 @@
"STR_VTSI_CREATE_FAILED": "გაფრთხილება: მონაცემები დაიკარგება!",
"STR_MENU_PART_RESIZE": "გთხოვთ, შეიყვანოთ YES ქვემოთ მოცემულ ტექსტურ ველში, რათა დაადასტუროთ... გსურთ განახლების ნაცვლად განახორციელოთ ახალი ინსტალაცია.",
"STR_PART_RESIZE_TIP": "Ventoy ჩეეცდება დააყენოს არა-დესტრუქციული რამდენადაც შეეცდება. გსურს გაგრძელება?",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX": ""
},
{
@@ -407,6 +414,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
"STR_INSTALL_YES_TIP1":"Warning: Data will be lost!",
"STR_INSTALL_YES_TIP2":"Please enter YES in the text box below to confirm that you indeed want to do a fresh install instead of upgrade.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -466,6 +474,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"Nieniszcząca instalacja Ventoy została zatrzymana, ponieważ niektóre wymagania nie zostały spełnione. Sprawdź log.txt po szczegóły.",
"STR_INSTALL_YES_TIP1":"Ostrzeżenie: Dane zostaną utracone!",
"STR_INSTALL_YES_TIP2":"Wpisz YES w poniższym polu tekstowym, aby potwierdzić, że naprawdę chcesz przeprowadzić nową instalację zamiast aktualizacji.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -525,6 +534,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"Instalação não destrutiva do Ventoy interrompida devido fato desconhecido. Cheque o arquivo log.txt para detalhes.",
"STR_INSTALL_YES_TIP1":"Aviso: Os dados serão perdidos!",
"STR_INSTALL_YES_TIP2":"Por favor, digite YES na caixa de texto abaixo para confirmar que você realmente quer fazer uma nova instalação em vez de atualização.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -584,6 +594,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy Tahribatsız Kurulum, bazı koşullar sağlanmadığı için durduruldu. Ayrıntılı bilgi için log.txt dosyasını kontrol edin.",
"STR_INSTALL_YES_TIP1":"Uyarı: Tüm verileriniz kaybolacak!",
"STR_INSTALL_YES_TIP2":"Güncelleme yapmak yerine,yeni bir kurulum yapmak istediğinizi doğrulamak için lütfen aşağıdaki metin kutusuna YES yazın.",
"STR_PART_VENTOY_FS":"Ventoy bölümü Dosya Sistemi",
"STRXXX":""
},
@@ -643,6 +654,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"Installation ohne vorherige Formatierung wurde auf Grund einiger nicht erfüllbarer Bedingungen gestoppt. Für Details die log.txt prüfen.",
"STR_INSTALL_YES_TIP1":"Warnung: Die Daten gehen verloren!",
"STR_INSTALL_YES_TIP2":"Bitte bestätigen Sie in der unteren Textbox mit YES, dass Sie anstelle eines Upgrades eine frische Installation durchführen möchten.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -702,6 +714,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
"STR_INSTALL_YES_TIP1":"Warning: Data will be lost!",
"STR_INSTALL_YES_TIP2":"Please enter YES in the text box below to confirm that you indeed want to do a fresh install instead of upgrade.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -761,6 +774,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"L'installation non destructive de Ventoy s'est arrêtée car certaines conditions ne peuvent pas être remplies. Consultez log.txt pour plus de détails.",
"STR_INSTALL_YES_TIP1":"Attention : les données seront perdues !",
"STR_INSTALL_YES_TIP2":"Veuillez saisir YES dans la zone de texte ci-dessous pour confirmer que vous souhaitez bien effectuer une nouvelle installation au lieu d'une mise à niveau.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -820,6 +834,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"Nedestruktivní instalace Ventoy selhala, protože některé podmínky pro ni nemohly být splněny. Pro podrobnosti se podívejte do souboru log.txt.",
"STR_INSTALL_YES_TIP1":"Varování: Data budou ztracena!",
"STR_INSTALL_YES_TIP2":"Do níže uvedeného textového pole zadejte YES a potvrďte, že skutečně chcete provést novou instalaci namísto aktualizace.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -878,14 +893,15 @@
"STR_PART_RESIZE_UNSUPPORTED":"Nedeštruktívna inštalácia Ventoy zlyhala, lebo niektoré podmienky nemohli byť splnené. Podrobnosti nájdete v súbore log.txt.",
"STR_INSTALL_YES_TIP1":"Varovanie: Dôjde k strate údajov!",
"STR_INSTALL_YES_TIP2":"Prosím, zadajte YES v textovom poli nižšie, čím potvrdíte, že naozaj chcete vykonať novú inštaláciu miesto aktualizácie.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
{
"name":"Spanish (Español)",
"name":"Spanish (Latinoamérica)",
"FontFamily":"Courier New",
"FontSize":16,
"Author":"Carlos Sánchez, MELERIX",
"Author":"MELERIX",
"STR_ERROR":"Error",
"STR_WARNING":"Advertencia",
@@ -937,6 +953,67 @@
"STR_PART_RESIZE_UNSUPPORTED":"Instalación no destructiva de Ventoy detenida porque algunas condiciones no se pueden cumplir. Comprueba log.txt para detalles.",
"STR_INSTALL_YES_TIP1":"Advertencia: ¡Los datos se perderán!",
"STR_INSTALL_YES_TIP2":"Por favor ingresa YES en el cuadro de texto a continuación para confirmar que realmente quieres realizar una instalación nueva en vez de actualizar.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
{
"name":"Spanish (España)",
"FontFamily":"Courier New",
"FontSize":16,
"Author":"Carlos Sánchez, MELERIX, shulkalala",
"STR_ERROR":"Error",
"STR_WARNING":"Advertencia",
"STR_INFO":"Información",
"STR_INCORRECT_DIR":"¡Por favor, ejecute Ventoy desde el directorio correcto!",
"STR_INCORRECT_TREE_DIR":"No inicie Ventoy aquí, descargue el paquete de instalación publicado y ejecútelo allí.",
"STR_DEVICE":"Dispositivo",
"STR_LOCAL_VER":"Ventoy en paquete",
"STR_DISK_VER":"Ventoy en dispositivo",
"STR_STATUS":"Estado - LISTO",
"STR_INSTALL":"Instalar",
"STR_UPDATE":"Actualizar",
"STR_UPDATE_TIP":"La operación de actualización es segura. Los archivos ISO no se modificarán.#@¿Continuar?",
"STR_INSTALL_TIP":"Se va a formatear el dispositivo y a perder todos sus datos.#@¿Continuar?",
"STR_INSTALL_TIP2":"Se va a formatear el dispositivo y a perder todos sus datos.#@¿Continuar? (Segunda confirmación)",
"STR_INSTALL_SUCCESS":"¡Enhorabuena!#@Ventoy se ha instalado correctamente en el dispositivo.",
"STR_INSTALL_FAILED":"Ocurrió un error durante la instalación. Puede reinsertar el dispositivo USB e intentarlo de nuevo.#@Compruebe el archivo log.txt para más información.#@Si la instalación no deja de fallar, consulte el apartado de preguntas frecuentes en el sitio web oficial.",
"STR_UPDATE_SUCCESS":"¡Enhorabuena!#@Ventoy se ha actualizado correctamente en el dispositivo.",
"STR_UPDATE_FAILED":"Ocurrió un error durante la actualización. Puede reinsertar el dispositivo USB e intentarlo de nuevo.#@Compruebe el archivo log.txt para más información.#@Si la instalación no deja de fallar, consulte el apartado de preguntas frecuentes en el sitio web oficial.",
"STR_WAIT_PROCESS":"Un hilo está ejecutándose, por favor espere...",
"STR_MENU_OPTION":"Opción",
"STR_MENU_SECURE_BOOT":"Soporte de arranque seguro",
"STR_MENU_PART_CFG":"Configuración de particiones",
"STR_BTN_OK":"Aceptar",
"STR_BTN_CANCEL":"Cancelar",
"STR_PRESERVE_SPACE":"Reservar espacio de almacenamiento al final del dispositivo",
"STR_SPACE_VAL_INVALID":"Valor inválido para el espacio reservado",
"STR_MENU_CLEAR":"Limpiar Ventoy",
"STR_CLEAR_SUCCESS":"Ventoy se ha eliminado correctamente del dispositivo.",
"STR_CLEAR_FAILED":"Ocurrió un error al eliminar Ventoy del dispositivo. Puede reinsertar el dispositivo USB e intentarlo de nuevo.#@Compruebe el archivo log.txt para más información.",
"STR_MENU_PART_STYLE":"Estilo de partición",
"STR_DISK_2TB_MBR_ERROR":"Por favor, seleccione GPT para dispositivos con capacidad mayor de 2 TB",
"STR_SHOW_ALL_DEV":"Mostrar todos los dispositivos",
"STR_PART_ALIGN_4KB":"Alinear particiones a 4 KB",
"STR_WEB_COMMUNICATION_ERR":"Error de comunicación:",
"STR_WEB_REMOTE_ABNORMAL":"Error de comunicación: anormal remoto",
"STR_WEB_REQUEST_TIMEOUT":"Error de comunicación: tiempo de espera agotado",
"STR_WEB_SERVICE_UNAVAILABLE":"Error de comunicación: servicio no disponible",
"STR_WEB_TOKEN_MISMATCH":"Se ha actualizado el estado del servicio, por favor inténtelo de nuevo más tarde.",
"STR_WEB_SERVICE_BUSY":" El servicio está ocupado, por favor inténtelo de nuevo más tarde.",
"STR_MENU_VTSI_CREATE":"Generar archivo VTSI",
"STR_VTSI_CREATE_TIP":"Esta vez no se escribirá en el dispositivo, tan sólo se generará un archivo VTSI#@¿Continuar?",
"STR_VTSI_CREATE_SUCCESS":"¡El archivo VTSI se ha creado correctamente!#@Puede usar Rufus (3.15+) para escribirlo al dispositivo y completar la instalación de Ventoy.",
"STR_VTSI_CREATE_FAILED":"Se ha producido un error al intentar crear el archivo VTSI.",
"STR_MENU_PART_RESIZE":"Instalación no destructiva",
"STR_PART_RESIZE_TIP":"Ventoy intentará realizar una instalación no destructiva.#@¿Continuar?",
"STR_PART_RESIZE_SUCCESS":"¡Enhorabuena!#@La instalación no destructiva de Ventoy se ha completado correctamente.",
"STR_PART_RESIZE_FAILED":"La instalación no destructiva ha fallado.#@Compruebe el archivo log.txt para más información.",
"STR_PART_RESIZE_UNSUPPORTED":"La instalación no destructiva de Ventoy se ha detenido porque no se han cumplido todos los prerrequisitos.#@Compruebe el archivo log.txt para más información.",
"STR_INSTALL_YES_TIP1":"Advertencia: ¡Los datos se perderán!",
"STR_INSTALL_YES_TIP2":"Por favor, escriba YES en el cuadro de texto a continuación para confirmar que realmente quiere realizar una nueva instalación de Ventoy en vez de actualizarlo.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -944,7 +1021,7 @@
"name":"Russian (Pусский)",
"FontFamily":"Courier New",
"FontSize":16,
"Author":"BL4CKH47H4CK3R, Teraskull, thehugonote",
"Author":"BL4CKH47H4CK3R, Teraskull, thehugonote, wiz64",
"STR_ERROR":"Ошибка",
"STR_WARNING":"Предупреждение",
@@ -994,8 +1071,9 @@
"STR_PART_RESIZE_SUCCESS":"Поздравляем!#@Неразрушающая установка Ventoy успешно завершена.",
"STR_PART_RESIZE_FAILED":"Не удалось выполнить неразрушающую установку, проверьте файл log.txt для получения подробной информации.",
"STR_PART_RESIZE_UNSUPPORTED":"Неразрушающая установка Ventoy остановлена, поскольку некоторые условия не могут быть выполнены. Проверьте файл log.txt для получения подробной информации.",
"STR_INSTALL_YES_TIP1":"Warning: Data will be lost!",
"STR_INSTALL_YES_TIP2":"Please enter YES in the text box below to confirm that you indeed want to do a fresh install instead of upgrade.",
"STR_INSTALL_YES_TIP1":"Предупреждение: Данные будут потеряны!",
"STR_INSTALL_YES_TIP2":"Пожалуйста, введите YES в текстовое поле ниже, чтобы подтвердить, что вы действительно хотите выполнить новую установку вместо обновления.",
"STR_PART_VENTOY_FS":"Файловая система для Ventoy раздела",
"STRXXX":""
},
@@ -1003,7 +1081,7 @@
"name":"Bengali (বাংলা)",
"FontFamily":"Courier New",
"FontSize":16,
"Author":"BL4CKH47H4CK3R",
"Author":"BL4CKH47H4CK3R, wiz64",
"STR_ERROR":"ত্রুটি",
"STR_WARNING":"সতর্কতা",
@@ -1036,25 +1114,26 @@
"STR_CLEAR_FAILED":"ডিস্ক থেকে Ventoy সাফ করার সময় একটি ত্রুটি ঘটেছে। আপনি USB পুনরায় প্লাগ করতে পারেন এবং আবার চেষ্টা করতে পারেন। বিস্তারিত জানার জন্য log.txt পরীক্ষা করুন।",
"STR_MENU_PART_STYLE":"পার্টিশন স্টাইল",
"STR_DISK_2TB_MBR_ERROR":"2TB এর বেশি ডিস্কের জন্য দয়া করে GPT নির্বাচন করুন",
"STR_SHOW_ALL_DEV":"Show All Devices",
"STR_PART_ALIGN_4KB":"Align partitions with 4KB",
"STR_WEB_COMMUNICATION_ERR":"Communication error:",
"STR_WEB_REMOTE_ABNORMAL":"Communication error: remote abnormal",
"STR_WEB_REQUEST_TIMEOUT":"Communication error: Request timed out",
"STR_WEB_SERVICE_UNAVAILABLE":"Communication error: Service Unavailable",
"STR_WEB_TOKEN_MISMATCH":"Daemon status updated, please retry later.",
"STR_WEB_SERVICE_BUSY":"Service is busy, please retry later.",
"STR_MENU_VTSI_CREATE":"Generate VTSI File",
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
"STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
"STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
"STR_MENU_PART_RESIZE":"Non-destructive Install",
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
"STR_INSTALL_YES_TIP1":"Warning: Data will be lost!",
"STR_INSTALL_YES_TIP2":"Please enter YES in the text box below to confirm that you indeed want to do a fresh install instead of upgrade.",
"STR_SHOW_ALL_DEV":"সমস্ত ডিভাইস দেখান",
"STR_PART_ALIGN_4KB":"4KB দিয়ে পার্টিশন সারিবদ্ধ করুন",
"STR_WEB_COMMUNICATION_ERR":"যোগাযোগে ত্রুটি:",
"STR_WEB_REMOTE_ABNORMAL":"যোগাযোগ ত্রুটি: দূরবর্তী অস্বাভাবিক",
"STR_WEB_REQUEST_TIMEOUT":"যোগাযোগ ত্রুটি: অনুরোধের সময় শেষ হয়েছে৷",
"STR_WEB_SERVICE_UNAVAILABLE":"যোগাযোগ ত্রুটি: পরিষেবা অনুপলব্ধ৷",
"STR_WEB_TOKEN_MISMATCH":"ডেমন স্ট্যাটাস আপডেট হয়েছে, অনুগ্রহ করে পরে আবার চেষ্টা করুন।",
"STR_WEB_SERVICE_BUSY":"পরিষেবা ব্যস্ত, পরে আবার চেষ্টা করুন।",
"STR_MENU_VTSI_CREATE":"VTSI ফাইল তৈরি করুন",
"STR_VTSI_CREATE_TIP":"এই সময় ডিভাইসে লিখবেন না, তবে শুধুমাত্র একটি VTSI ফাইল তৈরি করবেন#@চালিয়ে যান?",
"STR_VTSI_CREATE_SUCCESS":"VTSI ফাইলটি সফলভাবে তৈরি হয়েছে!#@ আপনি Rufus(3.15+) ব্যবহার করে এটিকে ডিভাইসে লিখতে পারেন যাতে Ventoy-এর ইনস্টলেশন সম্পূর্ণ করা যায়।",
"STR_VTSI_CREATE_FAILED":"VTSI ফাইল তৈরি করা ব্যর্থ হয়েছে৷",
"STR_MENU_PART_RESIZE":"অ-ধ্বংসাত্মক ইনস্টল",
"STR_PART_RESIZE_TIP":"Ventoy সম্ভব হলে অ-ধ্বংসাত্মক ইনস্টলেশন চেষ্টা করবে। #@চালিয়ে যান?",
"STR_PART_RESIZE_SUCCESS":"অভিনন্দন!#@Ventoy অ-ধ্বংসাত্মক ইনস্টলেশন সফলভাবে শেষ হয়েছে।",
"STR_PART_RESIZE_FAILED":"অ-ধ্বংসাত্মক ইনস্টলেশন ব্যর্থ হয়েছে, বিস্তারিত জানার জন্য log.txt চেক করুন।",
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy অ-ধ্বংসাত্মক ইনস্টলেশন বন্ধ করা হয়েছে কারণ কিছু শর্ত পূরণ করা যাবে না। বিস্তারিত জানার জন্য log.txt দেখুন।",
"STR_INSTALL_YES_TIP1":"সতর্কতা: ডেটা হারিয়ে যাবে!",
"STR_INSTALL_YES_TIP2":"আপনি আপগ্রেড করার পরিবর্তে একটি নতুন ইনস্টল করতে চান তা নিশ্চিত করতে দয়া করে নীচের পাঠ্য বাক্সে Yes লিখুন৷।",
"STR_PART_VENTOY_FS":"Ventoy পার্টিশনের জন্য ফাইল সিস্টেম",
"STRXXX":""
},
@@ -1062,7 +1141,7 @@
"name":"Hindi (हिन्दी)",
"FontFamily":"Courier New",
"FontSize":16,
"Author":"BL4CKH47H4CK3R",
"Author":"BL4CKH47H4CK3R, wiz64",
"STR_ERROR":"त्रुटि",
"STR_WARNING":"चेतावनी",
@@ -1095,25 +1174,26 @@
"STR_CLEAR_FAILED":"डिस्क से Ventoy को साफ़ करते समय एक त्रुटि हुई। आप USB को पुन: भर सकते हैं और पुनः प्रयास कर सकते हैं। विस्तार के लिए log.txt की जाँच करें।",
"STR_MENU_PART_STYLE":"विभाजन शैली",
"STR_DISK_2TB_MBR_ERROR":"कृपया 2TB से अधिक डिस्क के लिए GPT का चयन करें",
"STR_SHOW_ALL_DEV":"Show All Devices",
"STR_PART_ALIGN_4KB":"Align partitions with 4KB",
"STR_WEB_COMMUNICATION_ERR":"Communication error:",
"STR_WEB_REMOTE_ABNORMAL":"Communication error: remote abnormal",
"STR_WEB_REQUEST_TIMEOUT":"Communication error: Request timed out",
"STR_WEB_SERVICE_UNAVAILABLE":"Communication error: Service Unavailable",
"STR_WEB_TOKEN_MISMATCH":"Daemon status updated, please retry later.",
"STR_WEB_SERVICE_BUSY":"Service is busy, please retry later.",
"STR_MENU_VTSI_CREATE":"Generate VTSI File",
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?",
"STR_VTSI_CREATE_SUCCESS":"VTSI file created successfully!#@You can use Rufus(3.15+) to write it to the device so as to complete the installation of Ventoy.",
"STR_VTSI_CREATE_FAILED":"VTSI file created failed.",
"STR_MENU_PART_RESIZE":"Non-destructive Install",
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?",
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.",
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.",
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
"STR_INSTALL_YES_TIP1":"Warning: Data will be lost!",
"STR_INSTALL_YES_TIP2":"Please enter YES in the text box below to confirm that you indeed want to do a fresh install instead of upgrade.",
"STR_SHOW_ALL_DEV":"सभी डिवाइस दिखाएं",
"STR_PART_ALIGN_4KB":"4KB के साथ partitions संरेखित करें",
"STR_WEB_COMMUNICATION_ERR":"संपर्क त्रुटि:",
"STR_WEB_REMOTE_ABNORMAL":"संचार त्रुटि: remote असामान्य",
"STR_WEB_REQUEST_TIMEOUT":"संचार त्रुटि: अनुरोध समयबाह्य (request timeout)",
"STR_WEB_SERVICE_UNAVAILABLE":"संचार त्रुटि: सेवा अनुपलब्ध",
"STR_WEB_TOKEN_MISMATCH":"Daemon की स्थिति अपडेट की गई, कृपया बाद में पुन: प्रयास करें।",
"STR_WEB_SERVICE_BUSY":"सेवा व्यस्त है, कृपया बाद में पुनः प्रयास करें।",
"STR_MENU_VTSI_CREATE":"VTSI File उत्पन्न करें",
"STR_VTSI_CREATE_TIP":"इस बार डिवाइस पर नहीं लिखा जाएगा, लेकिन केवल एक VTSI File उत्पन्न होगी#@जारी रखें?",
"STR_VTSI_CREATE_SUCCESS":"VTSI फ़ाइल सफलतापूर्वक बनाई गई!#@ आप इसे डिवाइस पर लिखने के लिए Rufus(3.15+) का उपयोग कर सकते हैं ताकि Ventoy की स्थापना को पूरा किया जा सके।",
"STR_VTSI_CREATE_FAILED":"बनाई गई VTSI file विफल रही।",
"STR_MENU_PART_RESIZE":"गैर-विनाशकारी इंस्टॉल",
"STR_PART_RESIZE_TIP":"यदि संभव हो तो Ventoy गैर-विनाशकारी स्थापना का प्रयास करेगा। #@जारी रखना?",
"STR_PART_RESIZE_SUCCESS":"बधाई हो!#@Ventoy गैर-विनाशकारी स्थापना सफलतापूर्वक समाप्त हो गई।",
"STR_PART_RESIZE_FAILED":"गैर-विनाशकारी स्थापना विफल, विवरण के लिए log.txt की जाँच करें।",
"STR_PART_RESIZE_UNSUPPORTED":"वेंटोय गैर-विनाशकारी स्थापना रोक दी गई, कुछ शर्तों को पूरा नहीं किया जा सकता है। विवरण के लिए log.txt की जाँच करें।",
"STR_INSTALL_YES_TIP1":"चेतावनी: डेटा खो जाएगा!",
"STR_INSTALL_YES_TIP2":"यह पुष्टि करने के लिए कि आप वास्तव में अपग्रेड के बजाय एक नया इंस्टॉल करना चाहते हैं, कृपया नीचे दिए टेक्स्ट बॉक्स में Yes दर्ज करें।",
"STR_PART_VENTOY_FS":"Ventoy विभाजन के लिए फाइल सिस्टम",
"STRXXX":""
},
@@ -1173,6 +1253,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"De niet-destructieve installatie van Ventoy is gestopt omdat aan sommige voorwaarden niet kan worden voldaan. Controleer log.txt voor details.",
"STR_INSTALL_YES_TIP1":"Warning: Data will be lost!",
"STR_INSTALL_YES_TIP2":"Please enter YES in the text box below to confirm that you indeed want to do a fresh install instead of upgrade.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -1232,6 +1313,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
"STR_INSTALL_YES_TIP1":"Warning: Data will be lost!",
"STR_INSTALL_YES_TIP2":"Please enter YES in the text box below to confirm that you indeed want to do a fresh install instead of upgrade.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -1291,6 +1373,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"Ventoyを非破壊的に導入できませんでした。非破壊的導入にあたっての要件が満たされていません。詳細な記録はlog.txtにあります。",
"STR_INSTALL_YES_TIP1":"警告: データが消去されます",
"STR_INSTALL_YES_TIP2":"Ventoyを更新するのではなく新規に導入するということを確認するために下の入力欄に「YES」と入力してください。",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -1350,6 +1433,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"L'installazione non distruttiva di Ventoy è stata interrotta perché alcune condizioni non possono essere soddisfatte.#@Per i dettagli controlla il file log.txt.",
"STR_INSTALL_YES_TIP1":"Attenzione: i dati verranno persi!",
"STR_INSTALL_YES_TIP2":"Digita YES nella casella di testo qui sotto per confermare che vuoi davvero eseguire un'installazione pulita anziché un aggiornamento.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -1409,6 +1493,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
"STR_INSTALL_YES_TIP1":"Warning: Data will be lost!",
"STR_INSTALL_YES_TIP2":"Please enter YES in the text box below to confirm that you indeed want to do a fresh install instead of upgrade.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -1468,6 +1553,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"A Ventoy rombolásmentes telepítése leállt, mert bizonyos feltételek nem teljesíthetők. A részleteket lásd a log.txt fájlban.",
"STR_INSTALL_YES_TIP1":"Figyelmeztetés: Az adatok elvesznek!",
"STR_INSTALL_YES_TIP2":"Írja a YES szót az alábbi szövegmezőbe, hogy megerősítse, valóban új telepítést szeretne végrehajtani a frissítés helyett.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -1527,6 +1613,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy 無損安裝已中止因為未滿足部分條件。詳細訊息請檢視 log.txt 檔案。",
"STR_INSTALL_YES_TIP1":"警告:資料將會遺失!",
"STR_INSTALL_YES_TIP2":"請在下方的文字輸入框輸入 YES 來證實您想要進行全新安裝取代升級。",
"STR_PART_VENTOY_FS":"Ventoy 分割區文件系統",
"STRXXX":""
},
@@ -1586,6 +1673,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
"STR_INSTALL_YES_TIP1":"Warning: Data will be lost!",
"STR_INSTALL_YES_TIP2":"Please enter YES in the text box below to confirm that you indeed want to do a fresh install instead of upgrade.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -1645,6 +1733,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
"STR_INSTALL_YES_TIP1":"Warning: Data will be lost!",
"STR_INSTALL_YES_TIP2":"Please enter YES in the text box below to confirm that you indeed want to do a fresh install instead of upgrade.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -1704,6 +1793,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
"STR_INSTALL_YES_TIP1":"Warning: Data will be lost!",
"STR_INSTALL_YES_TIP2":"Please enter YES in the text box below to confirm that you indeed want to do a fresh install instead of upgrade.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -1763,6 +1853,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
"STR_INSTALL_YES_TIP1":"Warning: Data will be lost!",
"STR_INSTALL_YES_TIP2":"Please enter YES in the text box below to confirm that you indeed want to do a fresh install instead of upgrade.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -1822,6 +1913,8 @@
"STR_PART_RESIZE_UNSUPPORTED":"Cài Ventoy theo cách cài đặt không phá hủy đã bị dừng lại vì chưa đúng điều kiện. Xem chi tiết ở tệp log.txt.",
"STR_INSTALL_YES_TIP1":"Warning: Data will be lost!",
"STR_INSTALL_YES_TIP2":"Please enter YES in the text box below to confirm that you indeed want to do a fresh install instead of upgrade.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
{
@@ -1880,6 +1973,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
"STR_INSTALL_YES_TIP1":"Warning: Data will be lost!",
"STR_INSTALL_YES_TIP2":"Please enter YES in the text box below to confirm that you indeed want to do a fresh install instead of upgrade.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -1939,6 +2033,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"Недеструктивната инсталација на Ventoy е запрена бидејќи некои услови не се исполнети. Проверете го log.txt за детали.",
"STR_INSTALL_YES_TIP1":"Warning: Data will be lost!",
"STR_INSTALL_YES_TIP2":"Please enter YES in the text box below to confirm that you indeed want to do a fresh install instead of upgrade.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -1998,6 +2093,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
"STR_INSTALL_YES_TIP1":"Warning: Data will be lost!",
"STR_INSTALL_YES_TIP2":"Please enter YES in the text box below to confirm that you indeed want to do a fresh install instead of upgrade.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -2057,6 +2153,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
"STR_INSTALL_YES_TIP1":"Warning: Data will be lost!",
"STR_INSTALL_YES_TIP2":"Please enter YES in the text box below to confirm that you indeed want to do a fresh install instead of upgrade.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -2116,6 +2213,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"Pemasangan tanpa merusakkan Ventoy terhenti karena beberapa kondisi yang tidak mendukung. Periksa berkas log.txt untuk detil.",
"STR_INSTALL_YES_TIP1":"Peringatan: Data akan hilang!",
"STR_INSTALL_YES_TIP2":"Silakan ketik YES pada kotak tulis di bawah untuk meyakinkan bahwa anda memang untuk melakukan pemasangan baru ketimbang memperbaruinya",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -2175,6 +2273,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
"STR_INSTALL_YES_TIP1":"Warning: Data will be lost!",
"STR_INSTALL_YES_TIP2":"Please enter YES in the text box below to confirm that you indeed want to do a fresh install instead of upgrade.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -2234,6 +2333,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"Неруйнівна установка Ventoy зупинена через неможливість виконання деяких умов. Перевірте log.txt для отримання детальної інформації.",
"STR_INSTALL_YES_TIP1":"Warning: Data will be lost!",
"STR_INSTALL_YES_TIP2":"Please enter YES in the text box below to confirm that you indeed want to do a fresh install instead of upgrade.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -2293,6 +2393,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
"STR_INSTALL_YES_TIP1":"Warning: Data will be lost!",
"STR_INSTALL_YES_TIP2":"Please enter YES in the text box below to confirm that you indeed want to do a fresh install instead of upgrade.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -2352,6 +2453,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"Icke-förstörande installation stoppades eftersom vissa villkor inte kunde uppfyllas. Mer information finns i log.txt.",
"STR_INSTALL_YES_TIP1":"Varning: Data kommer att gå förlorade!",
"STR_INSTALL_YES_TIP2":"Skriv YES i textrutan nedan för att bekräfta att du verkligen vill göra en nyinstallation i stället för att uppgradera.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -2411,6 +2513,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy je ustavil inštalacijo ker nekateri pogoji niso zadostni. Preveri log.txt a podrobnosti.",
"STR_INSTALL_YES_TIP1":"Pozor: Podatki bodo izbrisani!",
"STR_INSTALL_YES_TIP2":"Prosim vtipkajte YES v spodnje okno da potrdite čisto inštalacijo in ne zgolj nadgradnje.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -2470,6 +2573,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"Неразрушителното инсталиране на Ventoy е спряна, защото някои от условията не могат да бъдат изпълнени. Проверете log.txt за подробности.",
"STR_INSTALL_YES_TIP1":"Внимание: Ще има загуба на данни!",
"STR_INSTALL_YES_TIP2":"Въведете „YES“ в полето отдолу, за да потвърдите, че искате да извършите нова инсталация вместо обновяване.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -2529,6 +2633,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
"STR_INSTALL_YES_TIP1":"Warning: Data will be lost!",
"STR_INSTALL_YES_TIP2":"Please enter YES in the text box below to confirm that you indeed want to do a fresh install instead of upgrade.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -2588,6 +2693,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"Ventoyn ei-tuhoisa asennus pysähtyi koska jotkut ehdot eivät täyttyneet. Tarkista log.txt nähdäksesi yksityiskohdat.",
"STR_INSTALL_YES_TIP1":"Warning: Data will be lost!",
"STR_INSTALL_YES_TIP2":"Please enter YES in the text box below to confirm that you indeed want to do a fresh install instead of upgrade.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -2647,6 +2753,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"Instalación non destructiva do Ventoy interrompida porque non se poden cumprir algunhas condicións. Revisa o arquivo log.txt para mais detalles.",
"STR_INSTALL_YES_TIP1":"Warning: Data will be lost!",
"STR_INSTALL_YES_TIP2":"Please enter YES in the text box below to confirm that you indeed want to do a fresh install instead of upgrade.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -2706,6 +2813,7 @@
"STR_PART_RESIZE_UNSUPPORTED":"La instal·lació no destructiva de Ventoy no ha estat possible perquè els requeriments no es compleixen. Comproveu el fitxer log.txt per a més detalls.",
"STR_INSTALL_YES_TIP1":"Warning: Data will be lost!",
"STR_INSTALL_YES_TIP2":"Please enter YES in the text box below to confirm that you indeed want to do a fresh install instead of upgrade.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
@@ -2766,7 +2874,68 @@
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.",
"STR_INSTALL_YES_TIP1":"Warning: Data will be lost!",
"STR_INSTALL_YES_TIP2":"Please enter YES in the text box below to confirm that you indeed want to do a fresh install instead of upgrade.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
},
{
"name":"Tamil (தமிழ்)",
"FontFamily":"Courier New",
"FontSize":16,
"Author":"K.B.Dharun Krishna",
"STR_ERROR":"பிழை",
"STR_WARNING":"எச்சரிக்கை",
"STR_INFO":"தகவல்",
"STR_INCORRECT_DIR":"சரியான கோப்பகத்தின் கீழ் இயக்கவும்!",
"STR_INCORRECT_TREE_DIR":"என்னை இங்கே இயக்க வேண்டாம், வெளியிடப்பட்ட நிறுவல் தொகுப்பை பதிவிறக்கம் செய்து, அங்கு இயக்கவும்.",
"STR_DEVICE":"சாதனம்",
"STR_LOCAL_VER":"தொகுப்பில் வென்டோய்",
"STR_DISK_VER":"சாதனத்தில் வென்டோய்",
"STR_STATUS":"நிலை - தயார்",
"STR_INSTALL":"நிறுவு",
"STR_UPDATE":"புதுப்பிக்கவும்",
"STR_UPDATE_TIP":"மேம்படுத்தல் செயல்பாடு பாதுகாப்பானது, ISO கோப்புகள் மாறாமல் இருக்கும்.#@தொடரவா?",
"STR_INSTALL_TIP":"சாதனம் வடிவமைக்கப்படும் மற்றும் எல்லா தரவும் இழக்கப்படும்.#@தொடரவா?",
"STR_INSTALL_TIP2":"சாதனம் வடிவமைக்கப்படும் மற்றும் எல்லா தரவும் இழக்கப்படும்.#@தொடரவா? (இருமுறை சரிபார்க்கவும்)",
"STR_INSTALL_SUCCESS":"வாழ்த்துகள்!#@வென்டோய் சாதனத்தில் வெற்றிகரமாக நிறுவப்பட்டது.",
"STR_INSTALL_FAILED":"நிறுவலின் போது பிழை ஏற்பட்டது. USB சாதனத்தை மீண்டும் செருகி மீண்டும் முயற்சிக்கவும். விவரங்களுக்கு log.txt ஐப் பார்க்கவும். அது எப்போதும் தோல்வியுற்றால், அதிகாரப்பூர்வ இணையதளத்தில் அடிக்கடி கேட்கப்படும் கேள்விகளைப் பார்க்கவும்.",
"STR_UPDATE_SUCCESS":"வாழ்த்துகள்!#@வென்டோய் சாதனத்தில் வெற்றிகரமாக புதுப்பிக்கப்பட்டது.",
"STR_UPDATE_FAILED":"புதுப்பித்தலின் போது பிழை ஏற்பட்டது. USB சாதனத்தை மீண்டும் செருகி மீண்டும் முயற்சிக்கவும். விவரங்களுக்கு log.txt ஐப் பார்க்கவும். அது எப்போதும் தோல்வியுற்றால், அதிகாரப்பூர்வ இணையதளத்தில் அடிக்கடி கேட்கப்படும் கேள்விகளைப் பார்க்கவும்.",
"STR_WAIT_PROCESS":"ஒரு நூல் இயங்குகிறது, காத்திருக்கவும்...",
"STR_MENU_OPTION":"விருப்பத்தேர்வுகள்",
"STR_MENU_SECURE_BOOT":"பாதுகாப்பான பூட் ஆதரவு",
"STR_MENU_PART_CFG":"பகிர்வு கட்டமைப்பு",
"STR_BTN_OK":"சரி",
"STR_BTN_CANCEL":"ரத்துசெய்",
"STR_PRESERVE_SPACE":"வட்டின் முடிவில் சிறிது இடத்தை சேமிக்கவும்",
"STR_SPACE_VAL_INVALID":"ஒதுக்கப்பட்ட இடத்திற்கான தவறான மதிப்பு",
"STR_MENU_CLEAR":"தெளிவான வெண்டோய்",
"STR_CLEAR_SUCCESS":"சாதனத்திலிருந்து வென்டோய் வெற்றிகரமாக அகற்றப்பட்டது.",
"STR_CLEAR_FAILED":"வென்டோயை வட்டில் இருந்து அகற்றும்போது பிழை ஏற்பட்டது. USB சாதனத்தை மீண்டும் செருகி மீண்டும் முயற்சிக்கவும். விவரங்களுக்கு log.txt ஐப் பார்க்கவும்.",
"STR_MENU_PART_STYLE":"பகிர்வு நடை",
"STR_DISK_2TB_MBR_ERROR":"2TB க்கும் அதிகமான சாதனங்களுக்கு GPTஐத் தேர்ந்தெடுக்கவும்",
"STR_SHOW_ALL_DEV":"எல்லா சாதனங்களையும் காட்டு",
"STR_PART_ALIGN_4KB":"பகிர்வுகளை 4KB உடன் சீரமைக்கவும்",
"STR_WEB_COMMUNICATION_ERR":"தகவல் பிழை:",
"STR_WEB_REMOTE_ABNORMAL":"தொடர்பு பிழை: தொலைநிலை அசாதாரணமானது",
"STR_WEB_REQUEST_TIMEOUT":"தகவல்தொடர்பு பிழை: கோரிக்கை நேரம் முடிந்தது",
"STR_WEB_SERVICE_UNAVAILABLE":"தொடர்பு பிழை: சேவை கிடைக்கவில்லை",
"STR_WEB_TOKEN_MISMATCH":"டீமான் நிலை புதுப்பிக்கப்பட்டது, பிறகு முயற்சிக்கவும்.",
"STR_WEB_SERVICE_BUSY":"சேவை பிஸியாக உள்ளது, பிறகு முயற்சிக்கவும்.",
"STR_MENU_VTSI_CREATE":"VTSI கோப்பை உருவாக்கவும்",
"STR_VTSI_CREATE_TIP":"இந்த முறை சாதனத்தில் எழுதப்படாது, ஆனால் VTSI கோப்பை மட்டும் உருவாக்குகிறது#@தொடரவா?",
"STR_VTSI_CREATE_SUCCESS":"VTSI கோப்பு வெற்றிகரமாக உருவாக்கப்பட்டது!#@ரூஃபஸ்(3.15+) ஐப் பயன்படுத்தி, வென்டோயின் நிறுவலை முடிக்க, சாதனத்தில் எழுதலாம்.",
"STR_VTSI_CREATE_FAILED":"VTSI கோப்பு உருவாக்கப்படுவதில் தோல்வி.",
"STR_MENU_PART_RESIZE":"அழிவில்லாத நிறுவல்",
"STR_PART_RESIZE_TIP":"வென்டோய் முடிந்தால், அழிவில்லாத நிறுவலை முயற்சிக்கும். #@தொடரவா?",
"STR_PART_RESIZE_SUCCESS":"வாழ்த்துகள்!#@வென்டோய் அழிவில்லாத நிறுவல் வெற்றிகரமாக முடிந்தது.",
"STR_PART_RESIZE_FAILED":"அழிவில்லாத நிறுவல் தோல்வியடைந்தது, விவரங்களுக்கு log.txt ஐப் பார்க்கவும்.",
"STR_PART_RESIZE_UNSUPPORTED":"சில நிபந்தனைகளை பூர்த்தி செய்ய முடியாததால், வென்டோய் அழிவில்லாத நிறுவல் நிறுத்தப்பட்டது. விவரங்களுக்கு log.txt ஐப் பார்க்கவும்.",
"STR_INSTALL_YES_TIP1":"எச்சரிக்கை: தரவு தொலைந்து போகும்!",
"STR_INSTALL_YES_TIP2":"மேம்படுத்துவதற்குப் பதிலாக புதிதாக நிறுவ விரும்புகிறீர்கள் என்பதை உறுதிப்படுத்த, கீழே உள்ள உரைப் பெட்டியில் ஆம் என உள்ளிடவும்.",
"STR_PART_VENTOY_FS":"File System For Ventoy Partition",
"STRXXX":""
}
]

View File

@@ -50,6 +50,7 @@ int ventoy_read_file_to_buf(const char *FileName, int ExtLen, void **Bufer, int
const char * ventoy_get_local_version(void);
int ventoy_fill_gpt(uint64_t size, uint64_t reserve, int align4k, VTOY_GPT_INFO *gpt);
int ventoy_fill_mbr(uint64_t size, uint64_t reserve, int align4k, MBR_HEAD *pMBR);
int VentoyGetLocalBootImg(MBR_HEAD *pMBR);
#endif /* __VENTOY_UTIL_H__ */

View File

@@ -683,10 +683,45 @@ static int ventoy_write_gpt_part_table(int fd, uint64_t disksize, VTOY_GPT_INFO
return 0;
}
static int ventoy_mbr_need_update(ventoy_disk *disk, MBR_HEAD *mbr)
{
int update = 0;
int partition_style;
MBR_HEAD LocalMBR;
partition_style = disk->vtoydata.partition_style;
memcpy(mbr, &(disk->vtoydata.gptinfo.MBR), 512);
VentoyGetLocalBootImg(&LocalMBR);
memcpy(LocalMBR.BootCode + 0x180, mbr->BootCode + 0x180, 16);
if (partition_style)
{
LocalMBR.BootCode[92] = 0x22;
}
if (memcmp(LocalMBR.BootCode, mbr->BootCode, 440))
{
memcpy(mbr->BootCode, LocalMBR.BootCode, 440);
vlog("MBR boot code different, must update it.\n");
update = 1;
}
if (partition_style == 0 && mbr->PartTbl[0].Active == 0)
{
mbr->PartTbl[0].Active = 0x80;
mbr->PartTbl[1].Active = 0;
mbr->PartTbl[2].Active = 0;
mbr->PartTbl[3].Active = 0;
vlog("set MBR partition 1 active flag enabled\n");
update = 1;
}
return update;
}
static void * ventoy_update_thread(void *data)
{
int fd;
int updateMBR;
ssize_t len;
off_t offset;
MBR_HEAD MBR;
@@ -744,34 +779,17 @@ static void * ventoy_update_thread(void *data)
len = write(fd, disk->vtoydata.rsvdata, sizeof(disk->vtoydata.rsvdata));
vlog("Writing reserve data offset:%llu len:%llu ...\n", (_ull)offset, (_ull)len);
updateMBR = 0;
memcpy(&MBR, &(disk->vtoydata.gptinfo.MBR), 512);
if (disk->vtoydata.partition_style == 0 && MBR.PartTbl[0].Active == 0)
{
MBR.PartTbl[0].Active = 0x80;
MBR.PartTbl[1].Active = 0;
MBR.PartTbl[2].Active = 0;
MBR.PartTbl[3].Active = 0;
updateMBR = 1;
vlog("set MBR partition 1 active flag enabled\n");
}
if (MBR.BootCode[0x190] != 0x56 || MBR.BootCode[0x191] != 0x54)
{
vlog("set VT data %02x %02x\n", MBR.BootCode[0x190], MBR.BootCode[0x191]);
MBR.BootCode[0x190] = 0x56;
MBR.BootCode[0x191] = 0x54;
updateMBR = 1;
}
if (updateMBR)
if (ventoy_mbr_need_update(disk, &MBR))
{
offset = lseek(fd, 0, SEEK_SET);
len = write(fd, &MBR, 512);
vlog("update MBR offset:%llu len:%llu\n", (_ull)offset, (_ull)len);
}
else
{
vlog("No need to update MBR\n");
}
g_current_progress = PT_SYNC_DATA1;
vlog("fsync data1...\n");

View File

@@ -5,7 +5,6 @@ hsetroot -fill /usr/share/wallpapers/wallpaper.png
INIFILE=/ventoy/Ventoy2Disk.ini
echo "[Ventoy]" >> $INIFILE
echo "Language=Chinese Simplified (简体中文)" >> $INIFILE
echo "PartStyle=0" >> $INIFILE
echo "ShowAllDevice=0" >> $INIFILE

View File

@@ -8,14 +8,14 @@ build_func() {
libsuffix=$2
toolDir=$3
XXFLAG='-std=gnu99 -D_FILE_OFFSET_BITS=64'
XXFLAG='-std=gnu99 -D_FILE_OFFSET_BITS=64 -O2'
XXLIB=""
echo "CC=$1 libsuffix=$libsuffix toolDir=$toolDir"
echo "CC civetweb.o"
$1 $XXFLAG -c -Wall -Wextra -Wshadow -Wformat-security -Winit-self \
-Wmissing-prototypes -O2 -DLINUX \
-Wmissing-prototypes -DLINUX \
-I./src/Lib/libhttp/include \
-DNDEBUG -DNO_CGI -DNO_CACHING -DNO_SSL -DSQLITE_DISABLE_LFS -DSSL_ALREADY_INITIALIZED \
-DUSE_STACK_SIZE=102400 -DNDEBUG -fPIC \
@@ -23,7 +23,7 @@ build_func() {
-o ./civetweb.o
echo "CC plugson.o"
$1 $XXFLAG -O2 $exopt -Wall -Wno-unused-function -DSTATIC=static -DINIT= \
$1 $XXFLAG $exopt -Wall -Wno-unused-function -DSTATIC=static -DINIT= \
-I./src \
-I./src/Core \
-I./src/Web \
@@ -71,7 +71,6 @@ build_func() {
}
build_func "gcc" '64' 'x86_64'
build_func "gcc -m32" '32' 'i386'
build_func "aarch64-linux-gnu-gcc" 'aa64' 'aarch64'
build_func "mips-linux-gnu-gcc -mips64r2 -mabi=64" 'm64e' 'mips64el'

View File

@@ -311,12 +311,24 @@ uint64_t ventoy_get_disk_size_in_byte(const char *disk)
int ventoy_get_disk_vendor(const char *name, char *vendorbuf, int bufsize)
{
return ventoy_get_sys_file_line(vendorbuf, bufsize, "/sys/block/%s/device/vendor", name);
if (strncmp(name, "loop", 4) == 0)
{
scnprintf(vendorbuf, bufsize, "Local");
return 0;
}
return ventoy_get_sys_file_line(vendorbuf, bufsize, "/sys/block/%s/device/vendor", name);
}
int ventoy_get_disk_model(const char *name, char *modelbuf, int bufsize)
{
return ventoy_get_sys_file_line(modelbuf, bufsize, "/sys/block/%s/device/model", name);
if (strncmp(name, "loop", 4) == 0)
{
scnprintf(modelbuf, bufsize, "Loop Device");
return 0;
}
return ventoy_get_sys_file_line(modelbuf, bufsize, "/sys/block/%s/device/model", name);
}
static int fatlib_media_sector_read(uint32 sector, uint8 *buffer, uint32 sector_count)
@@ -576,9 +588,9 @@ int ventoy_get_disk_info(char **argv)
char model[128];
char *disk = argv[4];
if (strncmp(argv[4], "/dev/", 4) == 0)
if (strncmp(argv[4], "/dev/", 5) == 0)
{
disk += 4;
disk += 5;
}
ventoy_get_disk_vendor(disk, vendor, sizeof(vendor));
ventoy_get_disk_model(disk, model, sizeof(model));

View File

@@ -152,6 +152,9 @@ typedef struct tagVTOY_JSON
#define VTOY_JSON_FMT_ITEM_LN(P, Item) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "%s\"%s\",\n", P, (Item))
#define VTOY_JSON_FMT_ITEM_PATH_LN(P, Item) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "%s\"%s\",\n", P, ventoy_real_path(Item))
#define VTOY_JSON_FMT_ITEM_INT(Item) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, "%d,", (Item))
#define VTOY_JSON_FMT_COMA() ssprintf(__uiCurPos, __pcBuf, __uiBufLen, ",")
#define VTOY_JSON_FMT_COMA_N(cnt) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, ",\n")
#define VTOY_JSON_FMT_COMA_N_CNT(cnt) if ((cnt) > 0) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, ",\n")

View File

@@ -257,4 +257,48 @@ if (backup)
#endif
}
static const char g_encoding_table[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
'w', 'x', 'y', 'z', '0', '1', '2', '3',
'4', '5', '6', '7', '8', '9', '+', '/'};
char * ventoy_base64_encode(const char *data, int input_length, int *output_length)
{
int i = 0;
int j = 0;
char *encoded_data = NULL;
int mod_table[] = {0, 2, 1};
*output_length = 4 * ((input_length + 2) / 3);
encoded_data = malloc(*output_length + 4);
if (!encoded_data)
{
return NULL;
}
while (i < input_length)
{
unsigned int octet_a = i < input_length ? (unsigned char)data[i++] : 0;
unsigned int octet_b = i < input_length ? (unsigned char)data[i++] : 0;
unsigned int octet_c = i < input_length ? (unsigned char)data[i++] : 0;
unsigned int triple = (octet_a << 0x10) + (octet_b << 0x08) + octet_c;
encoded_data[j++] = g_encoding_table[(triple >> 3 * 6) & 0x3F];
encoded_data[j++] = g_encoding_table[(triple >> 2 * 6) & 0x3F];
encoded_data[j++] = g_encoding_table[(triple >> 1 * 6) & 0x3F];
encoded_data[j++] = g_encoding_table[(triple >> 0 * 6) & 0x3F];
}
for (i = 0; i < mod_table[input_length % 3]; i++)
{
encoded_data[*output_length - 1 - i] = '=';
}
return encoded_data;
}

View File

@@ -199,6 +199,7 @@ extern unsigned char *g_unxz_buffer;
extern int g_unxz_len;
void unxz_error(char *x);
int unxz_flush(void *src, unsigned int size);
char * ventoy_base64_encode(const char *data, int input_length, int *output_length);
#endif /* __VENTOY_UTIL_H__ */

View File

@@ -33,6 +33,7 @@
#include <linux/fs.h>
#include <dirent.h>
#include <time.h>
#include <semaphore.h>
#include <ventoy_define.h>
#include <ventoy_util.h>
@@ -234,30 +235,18 @@ int ventoy_write_buf_to_file(const char *FileName, void *Bufer, int BufLen)
return 0;
}
static sem_t g_writeback_sem;
static volatile int g_thread_stop = 0;
static pthread_t g_writeback_thread;
static pthread_mutex_t g_writeback_mutex;
static pthread_cond_t g_writeback_cond;
static void * ventoy_local_thread_run(void* data)
{
ventoy_http_writeback_pf callback = (ventoy_http_writeback_pf)data;
while (1)
while (0 == g_thread_stop)
{
pthread_mutex_lock(&g_writeback_mutex);
pthread_cond_wait(&g_writeback_cond, &g_writeback_mutex);
if (g_thread_stop)
{
pthread_mutex_unlock(&g_writeback_mutex);
break;
}
else
{
callback();
pthread_mutex_unlock(&g_writeback_mutex);
}
sem_wait(&g_writeback_sem);
callback();
}
return NULL;
@@ -265,15 +254,14 @@ static void * ventoy_local_thread_run(void* data)
void ventoy_set_writeback_event(void)
{
pthread_cond_signal(&g_writeback_cond);
sem_post(&g_writeback_sem);
}
int ventoy_start_writeback_thread(ventoy_http_writeback_pf callback)
{
g_thread_stop = 0;
pthread_mutex_init(&g_writeback_mutex, NULL);
pthread_cond_init(&g_writeback_cond, NULL);
sem_init(&g_writeback_sem, 0, 0);
pthread_create(&g_writeback_thread, NULL, ventoy_local_thread_run, callback);
return 0;
@@ -282,13 +270,10 @@ int ventoy_start_writeback_thread(ventoy_http_writeback_pf callback)
void ventoy_stop_writeback_thread(void)
{
g_thread_stop = 1;
pthread_cond_signal(&g_writeback_cond);
sem_post(&g_writeback_sem);
pthread_join(g_writeback_thread, NULL);
pthread_cond_destroy(&g_writeback_cond);
pthread_mutex_destroy(&g_writeback_mutex);
sem_destroy(&g_writeback_sem);
}

View File

@@ -60,6 +60,17 @@ static const char *g_ventoy_kbd_layout[] =
NULL
};
#define VTOY_DEL_ALL_PATH "4119ae33-98ea-448e-b9c0-569aafcf1fb4"
static int g_json_exist[plugin_type_max][bios_max];
static const char *g_plugin_name[plugin_type_max] =
{
"control", "theme", "menu_alias", "menu_tip",
"menu_class", "auto_install", "persistence", "injection",
"conf_replace", "password", "image_list",
"auto_memdisk", "dud"
};
static char g_ventoy_help_lang[MAX_LANGUAGE][8];
static char g_pub_path[2 * MAX_PATH];
@@ -341,7 +352,10 @@ static int ventoy_api_sysinfo(struct mg_connection *conn, VTOY_JSON *json)
static int ventoy_api_handshake(struct mg_connection *conn, VTOY_JSON *json)
{
int i = 0;
int j = 0;
int pos = 0;
char key[128];
(void)json;
@@ -350,6 +364,19 @@ static int ventoy_api_handshake(struct mg_connection *conn, VTOY_JSON *json)
VTOY_JSON_FMT_SINT("status", 0);
VTOY_JSON_FMT_SINT("save_error", g_sysinfo.config_save_error);
g_sysinfo.config_save_error = 0;
for (i = 0; i < plugin_type_max; i++)
{
scnprintf(key, sizeof(key), "exist_%s", g_plugin_name[i]);
VTOY_JSON_FMT_KEY(key);
VTOY_JSON_FMT_ARY_BEGIN();
for (j = 0; j < bios_max; j++)
{
VTOY_JSON_FMT_ITEM_INT(g_json_exist[i][j]);
}
VTOY_JSON_FMT_ARY_ENDEX();
}
VTOY_JSON_FMT_OBJ_END();
VTOY_JSON_FMT_END(pos);
@@ -486,9 +513,12 @@ void ventoy_data_default_control(data_control *data)
{
memset(data, 0, sizeof(data_control));
data->password_asterisk = 1;
data->secondary_menu = 1;
data->filter_dot_underscore = 1;
data->max_search_level = -1;
data->menu_timeout = 0;
data->secondary_menu_timeout = 0;
strlcpy(data->default_kbd_layout, "QWERTY_USA");
strlcpy(data->help_text_language, "en_US");
@@ -510,7 +540,10 @@ int ventoy_data_cmp_control(data_control *data1, data_control *data2)
data1->filter_vtoy != data2->filter_vtoy ||
data1->win11_bypass_check != data2->win11_bypass_check ||
data1->linux_remount != data2->linux_remount ||
data1->menu_timeout != data2->menu_timeout)
data1->password_asterisk != data2->password_asterisk ||
data1->secondary_menu != data2->secondary_menu ||
data1->menu_timeout != data2->menu_timeout ||
data1->secondary_menu_timeout != data2->secondary_menu_timeout)
{
return 1;
}
@@ -555,7 +588,10 @@ int ventoy_data_save_control(data_control *data, const char *title, char *buf, i
VTOY_JSON_FMT_CTRL_INT(L2, "VTOY_FILE_FLT_VTOY", filter_vtoy);
VTOY_JSON_FMT_CTRL_INT(L2, "VTOY_WIN11_BYPASS_CHECK", win11_bypass_check);
VTOY_JSON_FMT_CTRL_INT(L2, "VTOY_LINUX_REMOUNT", linux_remount);
VTOY_JSON_FMT_CTRL_INT(L2, "VTOY_SECONDARY_BOOT_MENU", secondary_menu);
VTOY_JSON_FMT_CTRL_INT(L2, "VTOY_SHOW_PASSWORD_ASTERISK", password_asterisk);
VTOY_JSON_FMT_CTRL_INT(L2, "VTOY_MENU_TIMEOUT", menu_timeout);
VTOY_JSON_FMT_CTRL_INT(L2, "VTOY_SECONDARY_TIMEOUT", secondary_menu_timeout);
VTOY_JSON_FMT_CTRL_STRN(L2, "VTOY_DEFAULT_KBD_LAYOUT", default_kbd_layout);
VTOY_JSON_FMT_CTRL_STRN(L2, "VTOY_HELP_TXT_LANGUAGE", help_text_language);
@@ -600,7 +636,10 @@ int ventoy_data_json_control(data_control *ctrl, char *buf, int buflen)
VTOY_JSON_FMT_SINT("filter_vtoy", ctrl->filter_vtoy);
VTOY_JSON_FMT_SINT("win11_bypass_check", ctrl->win11_bypass_check);
VTOY_JSON_FMT_SINT("linux_remount", ctrl->linux_remount);
VTOY_JSON_FMT_SINT("secondary_menu", ctrl->secondary_menu);
VTOY_JSON_FMT_SINT("password_asterisk", ctrl->password_asterisk);
VTOY_JSON_FMT_SINT("menu_timeout", ctrl->menu_timeout);
VTOY_JSON_FMT_SINT("secondary_menu_timeout", ctrl->secondary_menu_timeout);
VTOY_JSON_FMT_STRN("default_kbd_layout", ctrl->default_kbd_layout);
VTOY_JSON_FMT_STRN("help_text_language", ctrl->help_text_language);
@@ -666,7 +705,10 @@ static int ventoy_api_save_control(struct mg_connection *conn, VTOY_JSON *json)
VTOY_JSON_INT("filter_vtoy", ctrl->filter_vtoy);
VTOY_JSON_INT("win11_bypass_check", ctrl->win11_bypass_check);
VTOY_JSON_INT("linux_remount", ctrl->linux_remount);
VTOY_JSON_INT("secondary_menu", ctrl->secondary_menu);
VTOY_JSON_INT("password_asterisk", ctrl->password_asterisk);
VTOY_JSON_INT("menu_timeout", ctrl->menu_timeout);
VTOY_JSON_INT("secondary_menu_timeout", ctrl->secondary_menu_timeout);
VTOY_JSON_STR("default_image", ctrl->default_image);
VTOY_JSON_STR("default_search_root", ctrl->default_search_root);
@@ -708,7 +750,7 @@ int ventoy_data_cmp_theme(data_theme *data1, data_theme *data2)
{
return 1;
}
if (ventoy_path_list_cmp(data1->fontslist, data2->fontslist))
{
return 1;
@@ -917,7 +959,14 @@ static int ventoy_api_theme_del_file(struct mg_connection *conn, VTOY_JSON *json
path = VTOY_JSON_STR_EX("path");
if (path)
{
vtoy_list_del(last, node, data->filelist, path);
if (strcmp(path, VTOY_DEL_ALL_PATH) == 0)
{
vtoy_list_free(path_node, data->filelist);
}
else
{
vtoy_list_del(last, node, data->filelist, path);
}
}
ret = ventoy_data_save_all();
@@ -972,7 +1021,14 @@ static int ventoy_api_theme_del_font(struct mg_connection *conn, VTOY_JSON *json
path = VTOY_JSON_STR_EX("path");
if (path)
{
vtoy_list_del(last, node, data->fontslist, path);
if (strcmp(path, VTOY_DEL_ALL_PATH) == 0)
{
vtoy_list_free(path_node, data->fontslist);
}
else
{
vtoy_list_del(last, node, data->fontslist, path);
}
}
ret = ventoy_data_save_all();
@@ -1169,7 +1225,14 @@ static int ventoy_api_alias_del(struct mg_connection *conn, VTOY_JSON *json)
path = VTOY_JSON_STR_EX("path");
if (path)
{
vtoy_list_del(last, node, data->list, path);
if (strcmp(path, VTOY_DEL_ALL_PATH) == 0)
{
vtoy_list_free(data_alias_node, data->list);
}
else
{
vtoy_list_del(last, node, data->list, path);
}
}
ret = ventoy_data_save_all();
@@ -1407,7 +1470,14 @@ static int ventoy_api_tip_del(struct mg_connection *conn, VTOY_JSON *json)
path = VTOY_JSON_STR_EX("path");
if (path)
{
vtoy_list_del(last, node, data->list, path);
if (strcmp(path, VTOY_DEL_ALL_PATH) == 0)
{
vtoy_list_free(data_tip_node, data->list);
}
else
{
vtoy_list_del(last, node, data->list, path);
}
}
ret = ventoy_data_save_all();
@@ -1610,7 +1680,14 @@ static int ventoy_api_class_del(struct mg_connection *conn, VTOY_JSON *json)
path = VTOY_JSON_STR_EX("path");
if (path)
{
vtoy_list_del(last, node, data->list, path);
if (strcmp(path, VTOY_DEL_ALL_PATH) == 0)
{
vtoy_list_free(data_class_node, data->list);
}
else
{
vtoy_list_del(last, node, data->list, path);
}
}
ret = ventoy_data_save_all();
@@ -1739,7 +1816,14 @@ static int ventoy_api_auto_memdisk_del(struct mg_connection *conn, VTOY_JSON *js
path = VTOY_JSON_STR_EX("path");
if (path)
{
vtoy_list_del(last, node, data->list, path);
if (strcmp(path, VTOY_DEL_ALL_PATH) == 0)
{
vtoy_list_free(path_node, data->list);
}
else
{
vtoy_list_del(last, node, data->list, path);
}
}
ret = ventoy_data_save_all();
@@ -1914,7 +1998,14 @@ static int ventoy_api_image_list_del(struct mg_connection *conn, VTOY_JSON *json
path = VTOY_JSON_STR_EX("path");
if (path)
{
vtoy_list_del(last, node, data->list, path);
if (strcmp(path, VTOY_DEL_ALL_PATH) == 0)
{
vtoy_list_free(path_node, data->list);
}
else
{
vtoy_list_del(last, node, data->list, path);
}
}
ret = ventoy_data_save_all();
@@ -2165,7 +2256,14 @@ static int ventoy_api_password_del(struct mg_connection *conn, VTOY_JSON *json)
path = VTOY_JSON_STR_EX("path");
if (path)
{
vtoy_list_del(last, node, data->list, path);
if (strcmp(path, VTOY_DEL_ALL_PATH) == 0)
{
vtoy_list_free(menu_password, data->list);
}
else
{
vtoy_list_del(last, node, data->list, path);
}
}
ret = ventoy_data_save_all();
@@ -2356,7 +2454,14 @@ static int ventoy_api_conf_replace_del(struct mg_connection *conn, VTOY_JSON *js
path = VTOY_JSON_STR_EX("path");
if (path)
{
vtoy_list_del(last, node, data->list, path);
if (strcmp(path, VTOY_DEL_ALL_PATH) == 0)
{
vtoy_list_free(conf_replace_node, data->list);
}
else
{
vtoy_list_del(last, node, data->list, path);
}
}
ret = ventoy_data_save_all();
@@ -2545,6 +2650,7 @@ static int ventoy_api_dud_del(struct mg_connection *conn, VTOY_JSON *json)
int ret;
int index = 0;
const char *path = NULL;
dud_node *next = NULL;
dud_node *last = NULL;
dud_node *node = NULL;
data_dud *data = NULL;
@@ -2555,7 +2661,20 @@ static int ventoy_api_dud_del(struct mg_connection *conn, VTOY_JSON *json)
path = VTOY_JSON_STR_EX("path");
if (path)
{
vtoy_list_del_ex(last, node, data->list, path, ventoy_free_path_node_list);
if (strcmp(path, VTOY_DEL_ALL_PATH) == 0)
{
for (node = data->list; node; node = next)
{
next = node->next;
ventoy_free_path_node_list(node->list);
free(node);
}
data->list = NULL;
}
else
{
vtoy_list_del_ex(last, node, data->list, path, ventoy_free_path_node_list);
}
}
ret = ventoy_data_save_all();
@@ -2892,6 +3011,7 @@ static int ventoy_api_auto_install_del(struct mg_connection *conn, VTOY_JSON *js
int index = 0;
const char *path = NULL;
auto_install_node *last = NULL;
auto_install_node *next = NULL;
auto_install_node *node = NULL;
data_auto_install *data = NULL;
@@ -2901,7 +3021,20 @@ static int ventoy_api_auto_install_del(struct mg_connection *conn, VTOY_JSON *js
path = VTOY_JSON_STR_EX("path");
if (path)
{
vtoy_list_del_ex(last, node, data->list, path, ventoy_free_path_node_list);
if (strcmp(path, VTOY_DEL_ALL_PATH) == 0)
{
for (node = data->list; node; node = next)
{
next = node->next;
ventoy_free_path_node_list(node->list);
free(node);
}
data->list = NULL;
}
else
{
vtoy_list_del_ex(last, node, data->list, path, ventoy_free_path_node_list);
}
}
ret = ventoy_data_save_all();
@@ -3219,6 +3352,7 @@ static int ventoy_api_persistence_del(struct mg_connection *conn, VTOY_JSON *jso
int index = 0;
const char *path = NULL;
persistence_node *last = NULL;
persistence_node *next = NULL;
persistence_node *node = NULL;
data_persistence *data = NULL;
@@ -3228,7 +3362,20 @@ static int ventoy_api_persistence_del(struct mg_connection *conn, VTOY_JSON *jso
path = VTOY_JSON_STR_EX("path");
if (path)
{
vtoy_list_del_ex(last, node, data->list, path, ventoy_free_path_node_list);
if (strcmp(path, VTOY_DEL_ALL_PATH) == 0)
{
for (node = data->list; node; node = next)
{
next = node->next;
ventoy_free_path_node_list(node->list);
free(node);
}
data->list = NULL;
}
else
{
vtoy_list_del_ex(last, node, data->list, path, ventoy_free_path_node_list);
}
}
ret = ventoy_data_save_all();
@@ -3505,7 +3652,14 @@ static int ventoy_api_injection_del(struct mg_connection *conn, VTOY_JSON *json)
path = VTOY_JSON_STR_EX("path");
if (path)
{
vtoy_list_del(last, node, data->list, path);
if (strcmp(path, VTOY_DEL_ALL_PATH) == 0)
{
vtoy_list_free(injection_node, data->list);
}
else
{
vtoy_list_del(last, node, data->list, path);
}
}
ret = ventoy_data_save_all();
@@ -3514,6 +3668,34 @@ static int ventoy_api_injection_del(struct mg_connection *conn, VTOY_JSON *json)
return 0;
}
#if 0
#endif
static int ventoy_api_preview_json(struct mg_connection *conn, VTOY_JSON *json)
{
int pos = 0;
int len = 0;
int encodelen = 0;
char *encodebuf = NULL;
(void)json;
len = ventoy_data_real_save_all(0);
encodebuf = ventoy_base64_encode(JSON_SAVE_BUFFER, len, &encodelen);
encodebuf[encodelen] = 0;
VTOY_JSON_FMT_BEGIN(pos, JSON_BUFFER, JSON_BUF_MAX);
VTOY_JSON_FMT_OBJ_BEGIN();
VTOY_JSON_FMT_STRN("json", encodebuf);
VTOY_JSON_FMT_OBJ_END();
VTOY_JSON_FMT_END(pos);
free(encodebuf);
ventoy_json_buffer(conn, JSON_BUFFER, pos);
return 0;
}
#if 0
#endif
@@ -3524,14 +3706,17 @@ int ventoy_data_save_all(void)
return 0;
}
int ventoy_data_real_save_all(void)
int ventoy_data_real_save_all(int apilock)
{
int i = 0;
int pos = 0;
char title[64];
pthread_mutex_lock(&g_api_mutex);
if (apilock)
{
pthread_mutex_lock(&g_api_mutex);
}
ssprintf(pos, JSON_SAVE_BUFFER, JSON_BUF_MAX, "{\n");
ventoy_save_plug(control);
@@ -3555,7 +3740,10 @@ int ventoy_data_real_save_all(void)
}
ssprintf(pos, JSON_SAVE_BUFFER, JSON_BUF_MAX, "}\n");
pthread_mutex_unlock(&g_api_mutex);
if (apilock)
{
pthread_mutex_unlock(&g_api_mutex);
}
return pos;
}
@@ -3568,7 +3756,7 @@ int ventoy_http_writeback(void)
ventoy_get_json_path(filename, NULL);
pos = ventoy_data_real_save_all();
pos = ventoy_data_real_save_all(1);
#ifdef VENTOY_SIM
printf("%s", JSON_SAVE_BUFFER);
@@ -3665,11 +3853,11 @@ static JSON_CB g_ventoy_json_cb[] =
{ "save_injection", ventoy_api_save_injection },
{ "injection_add", ventoy_api_injection_add },
{ "injection_del", ventoy_api_injection_del },
{ "preview_json", ventoy_api_preview_json },
};
static int ventoy_json_handler(struct mg_connection *conn, VTOY_JSON *json)
static int ventoy_json_handler(struct mg_connection *conn, VTOY_JSON *json, char *jsonstr)
{
int i;
const char *method = NULL;
@@ -3686,7 +3874,7 @@ static int ventoy_json_handler(struct mg_connection *conn, VTOY_JSON *json)
ventoy_api_handshake(conn, json);
return 0;
}
for (i = 0; i < (int)(sizeof(g_ventoy_json_cb) / sizeof(g_ventoy_json_cb[0])); i++)
{
if (strcmp(method, g_ventoy_json_cb[i].method) == 0)
@@ -3730,7 +3918,7 @@ static int ventoy_request_handler(struct mg_connection *conn)
if (JSON_SUCCESS == vtoy_json_parse(json, post_data_buf))
{
pthread_mutex_lock(&g_api_mutex);
ventoy_json_handler(conn, json->pstChild);
ventoy_json_handler(conn, json->pstChild, post_data_buf);
pthread_mutex_unlock(&g_api_mutex);
}
else
@@ -3798,27 +3986,35 @@ static int ventoy_parse_control(VTOY_JSON *json, void *p)
if (strcmp(child->pcName, "VTOY_DEFAULT_MENU_MODE") == 0)
{
CONTROL_PARSE_INT(child, data->default_menu_mode);
CONTROL_PARSE_INT_DEF_0(child, data->default_menu_mode);
}
else if (strcmp(child->pcName, "VTOY_WIN11_BYPASS_CHECK") == 0)
{
CONTROL_PARSE_INT(child, data->win11_bypass_check);
CONTROL_PARSE_INT_DEF_0(child, data->win11_bypass_check);
}
else if (strcmp(child->pcName, "VTOY_LINUX_REMOUNT") == 0)
{
CONTROL_PARSE_INT(child, data->linux_remount);
CONTROL_PARSE_INT_DEF_0(child, data->linux_remount);
}
else if (strcmp(child->pcName, "VTOY_SECONDARY_BOOT_MENU") == 0)
{
CONTROL_PARSE_INT_DEF_1(child, data->secondary_menu);
}
else if (strcmp(child->pcName, "VTOY_SHOW_PASSWORD_ASTERISK") == 0)
{
CONTROL_PARSE_INT_DEF_1(child, data->password_asterisk);
}
else if (strcmp(child->pcName, "VTOY_TREE_VIEW_MENU_STYLE") == 0)
{
CONTROL_PARSE_INT(child, data->treeview_style);
CONTROL_PARSE_INT_DEF_0(child, data->treeview_style);
}
else if (strcmp(child->pcName, "VTOY_FILT_DOT_UNDERSCORE_FILE") == 0)
{
CONTROL_PARSE_INT(child, data->filter_dot_underscore);
CONTROL_PARSE_INT_DEF_1(child, data->filter_dot_underscore);
}
else if (strcmp(child->pcName, "VTOY_SORT_CASE_SENSITIVE") == 0)
{
CONTROL_PARSE_INT(child, data->sort_casesensitive);
CONTROL_PARSE_INT_DEF_0(child, data->sort_casesensitive);
}
else if (strcmp(child->pcName, "VTOY_MAX_SEARCH_LEVEL") == 0)
{
@@ -3865,33 +4061,37 @@ static int ventoy_parse_control(VTOY_JSON *json, void *p)
{
data->menu_timeout = (int)strtol(child->unData.pcStrVal, NULL, 10);
}
else if (strcmp(child->pcName, "VTOY_SECONDARY_TIMEOUT") == 0)
{
data->secondary_menu_timeout = (int)strtol(child->unData.pcStrVal, NULL, 10);
}
else if (strcmp(child->pcName, "VTOY_VHD_NO_WARNING") == 0)
{
CONTROL_PARSE_INT(child, data->vhd_no_warning);
CONTROL_PARSE_INT_DEF_0(child, data->vhd_no_warning);
}
else if (strcmp(child->pcName, "VTOY_FILE_FLT_ISO") == 0)
{
CONTROL_PARSE_INT(child, data->filter_iso);
CONTROL_PARSE_INT_DEF_0(child, data->filter_iso);
}
else if (strcmp(child->pcName, "VTOY_FILE_FLT_IMG") == 0)
{
CONTROL_PARSE_INT(child, data->filter_img);
CONTROL_PARSE_INT_DEF_0(child, data->filter_img);
}
else if (strcmp(child->pcName, "VTOY_FILE_FLT_EFI") == 0)
{
CONTROL_PARSE_INT(child, data->filter_efi);
CONTROL_PARSE_INT_DEF_0(child, data->filter_efi);
}
else if (strcmp(child->pcName, "VTOY_FILE_FLT_WIM") == 0)
{
CONTROL_PARSE_INT(child, data->filter_wim);
CONTROL_PARSE_INT_DEF_0(child, data->filter_wim);
}
else if (strcmp(child->pcName, "VTOY_FILE_FLT_VHD") == 0)
{
CONTROL_PARSE_INT(child, data->filter_vhd);
CONTROL_PARSE_INT_DEF_0(child, data->filter_vhd);
}
else if (strcmp(child->pcName, "VTOY_FILE_FLT_VTOY") == 0)
{
CONTROL_PARSE_INT(child, data->filter_vtoy);
CONTROL_PARSE_INT_DEF_0(child, data->filter_vtoy);
}
}
@@ -5008,7 +5208,8 @@ end:
int ventoy_http_start(const char *ip, const char *port)
{
int i;
int i = 0;
int ret = 0;
char addr[128];
char filename[128];
char backupname[128];
@@ -5045,10 +5246,13 @@ int ventoy_http_start(const char *ip, const char *port)
if (ventoy_is_file_exist("%s", filename))
{
ventoy_copy_file(filename, backupname);
ventoy_load_old_json(filename);
ret = ventoy_load_old_json(filename);
if (ret == 0)
{
ventoy_data_real_save_all(0);
}
}
/* option */
scnprintf(addr, sizeof(addr), "%s:%s", ip, port);
options[1] = addr;

View File

@@ -41,6 +41,24 @@ typedef enum bios_mode
bios_max
}bios_mode;
typedef enum plugin_type
{
plugin_type_control = 0,
plugin_type_theme,
plugin_type_menu_alias,
plugin_type_menu_tip,
plugin_type_menu_class,
plugin_type_auto_install,
plugin_type_persistence,
plugin_type_injection,
plugin_type_conf_replace,
plugin_type_password,
plugin_type_image_list,
plugin_type_auto_memdisk,
plugin_type_dud,
plugin_type_max
}plugin_type;
typedef struct data_control
{
@@ -58,7 +76,10 @@ typedef struct data_control
int filter_vtoy;
int win11_bypass_check;
int menu_timeout;
int secondary_menu_timeout;
int linux_remount;
int secondary_menu;
int password_asterisk;
char default_search_root[MAX_PATH];
char default_image[MAX_PATH];
char default_kbd_layout[32];
@@ -258,8 +279,10 @@ typedef struct data_persistence
for (i = 0; i < bios_max; i++) \
{\
scnprintf(title, sizeof(title), "%s%s", #plug, g_json_title_postfix[i]);\
g_json_exist[plugin_type_##plug][i] = 0;\
if (ventoy_data_cmp_##plug(g_data_##plug + i, g_data_##plug + bios_max))\
{\
g_json_exist[plugin_type_##plug][i] = 1;\
pos += ventoy_data_save_##plug(g_data_##plug + i, title, JSON_SAVE_BUFFER + pos, JSON_BUF_MAX - pos);\
}\
}\
@@ -300,6 +323,7 @@ typedef struct data_persistence
free(__node);\
__node = __next;\
}\
(list) = NULL;\
}
#define vtoy_list_del(last, node, LIST, field) \
@@ -379,9 +403,11 @@ else\
} \
}
#define CONTROL_PARSE_INT(node, val) \
#define CONTROL_PARSE_INT_DEF_0(node, val) \
if (node->unData.pcStrVal[0] == '1') val = 1
#define CONTROL_PARSE_INT_DEF_1(node, val) \
if (node->unData.pcStrVal[0] == '0') val = 0
#define VTOY_JSON_INT(key, val) vtoy_json_get_int(json, key, &val)
#define VTOY_JSON_STR(key, buf) vtoy_json_get_string(json, key, sizeof(buf), buf)
@@ -399,6 +425,7 @@ void ventoy_http_exit(void);
int ventoy_http_start(const char *ip, const char *port);
int ventoy_http_stop(void);
int ventoy_data_save_all(void);
int ventoy_data_real_save_all(int apilock);
#endif /* __VENTOY_HTTP_H__ */

View File

@@ -1 +1 @@
20220430 13:06:42
20221021 14:42:35

View File

@@ -57,6 +57,14 @@
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<li class="dropdown user user-menu">
<a href="javascript:void(0)" id="id_a_preview">
<span class="fa fa-file-code-o"></span>&nbsp;&nbsp;
<span id="id_span_preview" class="hidden-xs">Preview</span>
<span class="hidden-xs">&nbsp;&nbsp;&nbsp;</span>
</a>
</li>
<li class="dropdown user user-menu">
<a href="javascript:void(0)" id="id_a_language">
<span class="fa fa-language"></span>&nbsp;&nbsp;
@@ -710,6 +718,32 @@
</div>
</div>
</div>
<div class="modal" id="JsonPreviewModal">
<div class="modal-dialog" style="width: 80%;">
<div class="modal-content">
<form id="JsonPeviewForm" class="form-horizontal">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4>
<b id="JsonPreviewForm_lang_1">JSON</b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button type="button" id="id_btn_json_copy" class="btn btn-primary"><span class="fa fa-copy">&nbsp;&nbsp;</span><span id="id_span_copy">Copy</span></button>
</h4>
</div>
<div class="modal-body">
<textarea id="pre_json_preview" class="form-control" rows="30" style="font-family:Menlo,Monaco,Consolas,'Courier New',monospace"></textarea>
</div>
<div class="modal-footer">
<button id="PrewForm_lang_2" type="button" class="btn btn-primary btn-flat" data-dismiss="modal">确定</button>
</div>
</form>
</div>
</div>
</div>
<!-- Content Wrapper. Contains page content -->
@@ -723,7 +757,7 @@
<footer class="main-footer">
<div class="pull-right hidden-xs">
<b id="plugson_build_date">20220430 13:06:42</b>
<b id="plugson_build_date">20221021 14:42:35</b>
</div>
<strong><a href="https://www.ventoy.net" target="_blank">https://www.ventoy.net</a></strong>
</footer>
@@ -745,8 +779,8 @@
<script src="/static/js/jquery.validate.min.js"></script>
<script src="/static/js/jquery.validate.vtoymethods.js?v=100"></script>
<script src="/static/js/vtoy.js?v=100"></script>
<script src="/static/js/jquery.vtoy.alert.js?v=100"></script>
<script src="/static/js/vtoy.js?v=100"></script>
<script src="/static/js/md5.min.js"></script>
<!-- Bootstrap 3.3.5 -->
@@ -760,6 +794,36 @@
<script type="text/javascript">
function VtoyJsonCopyClick() {
var copyText = document.getElementById("pre_json_preview");
copyText.select();
copyText.setSelectionRange(0, 99999); // For mobile devices
try {
var successful = document.execCommand('copy');
copyText.setSelectionRange(0, 0);
if (successful) {
Message.success(g_vtoy_cur_language.STR_JSON_COPY_SUCCESS);
} else {
Message.error(g_vtoy_cur_language.STR_JSON_COPY_FAILED);
}
} catch (err) {
Message.error(g_vtoy_cur_language.STR_JSON_COPY_FAILED);
}
}
function VtoyPreviewClick() {
callVtoySync({
method : 'preview_json'
}, function(data) {
$('#JsonPeviewForm #JsonPreviewForm_lang_1').text(g_vtoy_cur_language.STR_JSON_PREVIEW);
$('#JsonPeviewForm #PrewForm_lang_2').text(g_vtoy_cur_language.STR_BTN_OK);
$('#pre_json_preview').text(atob(data.json));
$("#JsonPreviewModal").modal();
});
}
function VtoyLanguageClick() {
var defaultPage = window.location.hash;
@@ -791,6 +855,8 @@
});
$('#id_btn_json_copy').click(VtoyJsonCopyClick);
$('#id_a_preview').click(VtoyPreviewClick);
$('#id_a_language').click(VtoyLanguageClick);
$("#plugson-menu a").click(function() {
@@ -846,9 +912,13 @@
});
}
if (typeof(UpdateTabTitleIcon)==='function') {
UpdateTabTitleIcon(data);
}
setTimeout(function() {
ventoy_handshake();
}, 1000);
}, 200);
},
function(xmlHttpRequest, textStatus, errorThrown) {

View File

@@ -1,10 +1,12 @@
<div class="box box-primary" id="control">
<div class="box-header">
<div class="col-sm-10" style="padding-top:8px;">
<div class="col-sm-9" style="padding-top:8px;">
<i class="fa fa-desktop">&nbsp;&nbsp;</i>
<h1 class="box-title" style="font-weight:bold;" id="id_h1_page_title">x</h1>
</div>
<div class="col-sm-1" style="padding-top:2px;">
<button id="id_btn_reset" class="btn btn-sm btn-danger btn-del"><i class="fa fa-trash"></i><span id="id_btn_span_reset">Reset</span></button>
</div>
<div class="col-sm-2" style="font-size:16px;padding-top:8px;">
<a id="id_a_official_doc" target="_blank" href="https://www.ventoy.net/en/plugin_autoinstall.html"><span class="fa fa-link"></span><span id="id_span_official_doc">官网文档</span></a>
</div>
@@ -543,7 +545,27 @@
$('#id_tab_autoins a[href="#tab_3"]').click(OnClickMultiModeTab);
$('#id_tab_autoins a[href="#tab_4"]').click(OnClickMultiModeTab);
$('#id_tab_autoins a[href="#tab_5"]').click(OnClickMultiModeTab);
function UpdateTabTitleIcon(data) {
CommonUpdateTabTitleIcon(data.exist_auto_install, '#id_tab_autoins a[href="#tab_', 'auto_install');
}
$('#id_btn_reset').click(function() {
Modal.confirm({msg:GetResetTabConfigTipMsg(current_tab_index, 'auto_install')}).on(function(e) {
if (e) {
callVtoySync({
method : 'auto_install_del',
index: current_tab_index,
path: g_del_all_path
}, function(data) {
});
m_data_autoins[current_tab_index].length = 0;
VtoyFillCurrentPageItem(m_data_autoins[g_vtoy_data_default_index]);
Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);
}
});
});
$('#id_tab_autoins a[href="#tab_0"]').tab('show');
VtoyFillCurrentPageItem(m_data_autoins[0]);
VtoyPageLanguageChange(g_current_language);

View File

@@ -1,10 +1,12 @@
<div class="box box-primary" id="control">
<div class="box-header">
<div class="col-sm-10" style="padding-top:8px;">
<div class="col-sm-9" style="padding-top:8px;">
<i class="fa fa-floppy-o">&nbsp;&nbsp;</i>
<h1 class="box-title" style="font-weight:bold;" id="id_h1_page_title"></h1>
</div>
<div class="col-sm-1" style="padding-top:2px;">
<button id="id_btn_reset" class="btn btn-sm btn-danger btn-del"><i class="fa fa-trash"></i><span id="id_btn_span_reset">Reset</span></button>
</div>
<div class="col-sm-2" style="font-size:16px;padding-top:8px;">
<a id="id_a_official_doc" target="_blank" href="https://www.ventoy.net/en/plugin_automemdisk.html"><span class="fa fa-link"></span><span id="id_span_official_doc">官网文档</span></a>
</div>
@@ -172,7 +174,27 @@
$('#id_tab_auto_memdisk a[href="#tab_3"]').click(OnClickMultiModeTab);
$('#id_tab_auto_memdisk a[href="#tab_4"]').click(OnClickMultiModeTab);
$('#id_tab_auto_memdisk a[href="#tab_5"]').click(OnClickMultiModeTab);
function UpdateTabTitleIcon(data) {
CommonUpdateTabTitleIcon(data.exist_auto_memdisk, '#id_tab_auto_memdisk a[href="#tab_', 'auto_memdisk');
}
$('#id_btn_reset').click(function() {
Modal.confirm({msg:GetResetTabConfigTipMsg(current_tab_index, 'auto_memdisk')}).on(function(e) {
if (e) {
callVtoySync({
method : 'auto_memdisk_del',
index: current_tab_index,
path: g_del_all_path
}, function(data) {
});
m_data_memdisk[current_tab_index].length = 0;
VtoyFillCurrentPageItem(m_data_memdisk[g_vtoy_data_default_index]);
Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);
}
});
});
$('#id_tab_auto_memdisk a[href="#tab_0"]').tab('show');
VtoyFillCurrentPageItem(m_data_memdisk[0]);
VtoyPageLanguageChange(g_current_language);

View File

@@ -1,10 +1,12 @@
<div class="box box-primary" id="control">
<div class="box-header">
<div class="col-sm-10" style="padding-top:8px;">
<div class="col-sm-9" style="padding-top:8px;">
<i class="fa fa-retweet">&nbsp;&nbsp;</i>
<h1 class="box-title" style="font-weight:bold;" id="id_h1_page_title">菜单别名插件</h1>
</div>
<div class="col-sm-1" style="padding-top:2px;">
<button id="id_btn_reset" class="btn btn-sm btn-danger btn-del"><i class="fa fa-trash"></i><span id="id_btn_span_reset">Reset</span></button>
</div>
<div class="col-sm-2" style="font-size:16px;padding-top:8px;">
<a id="id_a_official_doc" target="_blank" href="https://www.ventoy.net/en/plugin_bootconf_replace.html"><span class="fa fa-link"></span><span id="id_span_official_doc">官网文档</span></a>
</div>
@@ -268,7 +270,27 @@
$('#id_tab_conf_replace a[href="#tab_3"]').click(OnClickMultiModeTab);
$('#id_tab_conf_replace a[href="#tab_4"]').click(OnClickMultiModeTab);
$('#id_tab_conf_replace a[href="#tab_5"]').click(OnClickMultiModeTab);
function UpdateTabTitleIcon(data) {
CommonUpdateTabTitleIcon(data.exist_conf_replace, '#id_tab_conf_replace a[href="#tab_', 'conf_replace');
}
$('#id_btn_reset').click(function() {
Modal.confirm({msg:GetResetTabConfigTipMsg(current_tab_index, 'conf_replace')}).on(function(e) {
if (e) {
callVtoySync({
method : 'conf_replace_del',
index: current_tab_index,
path: g_del_all_path
}, function(data) {
});
m_data_conf_replace[current_tab_index].length = 0;
VtoyFillCurrentPageItem(m_data_conf_replace[g_vtoy_data_default_index]);
Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);
}
});
});
$('#id_tab_conf_replace a[href="#tab_0"]').tab('show');
VtoyFillCurrentPageItem(m_data_conf_replace[0]);
VtoyPageLanguageChange(g_current_language);

Some files were not shown because too many files have changed in this diff Show More