Compare commits

...

62 Commits

Author SHA1 Message Date
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
longpanda
9e28dd1394 1.0.79 release 2022-07-28 19:53:28 +08:00
longpanda
4100e7a886 Fix the repo missing for Kylin V10 SP2 Server 2022-07-26 23:08:40 +08:00
longpanda
a4f5ce2c9e update languages.json 2022-07-26 11:17:09 +08:00
aligoogo
c7967ea476 add georgian language (#1755) 2022-07-26 11:14:23 +08:00
sehnemvinicius
3e7f1ca764 Update portuguese translation (#1745) 2022-07-26 11:11:48 +08:00
longpanda
1bc18295ae Fix the bug that report 'invalid value for reserved space' in GTK. (#1752) 2022-07-25 10:49:57 +08:00
ShatteredMINT
b4f1f11742 remove '=' from reserved space check (#1753)
removes the (misplaced) '=' in the check of the configured reserved space in the 'on_part_cfg_ok' function.
This caused #1752
2022-07-25 10:46:07 +08:00
Jose Riha
20010c5e88 Fix and update Slovak translation (#1708) 2022-07-16 09:02:09 +08:00
Sopor
1de18e43c5 Update Swedish language (#1706)
* Update Swedish language

* Update Swedish language

Fixed the `YES`
2022-07-16 09:01:52 +08:00
lev741
15299d4d87 Updated Czech translation (#1705)
* Update languages.json

Updated Czech translation

* Update languages.json

Corrected typo
2022-07-16 09:01:30 +08:00
longpanda
5d6d6df39b autosel doesn't work since 1.0.77 (#1716) 2022-07-13 23:40:45 +08:00
longpanda
096cc99c3c Fix a bug that VTOY_LINUX_REMOUNT option doesn't take effect in openSUSE. 2022-07-13 22:40:32 +08:00
longpanda
602e8c7fdf Fix a bug when rhel based distribution has an external kickstart file. (#1717) 2022-07-12 17:13:49 +08:00
longpanda
da35a99f7c Support Fedora CoreOS (#1727) 2022-07-12 12:13:24 +08:00
longpanda
e46e24dde7 1.0.78 release 2022-07-01 19:10:12 +08:00
longpanda
0b81845e42 .ventoyignore also works in F2 browser mode. 2022-06-30 23:28:14 +08:00
longpanda
3c621e4aca Update Super-UEFIinSecureBoot-Disk to v3.4 (#1695) 2022-06-27 22:33:20 +08:00
longpanda
aecc579fcc Fix the bug when booting latest KaOS. (#1696) 2022-06-27 22:19:11 +08:00
longpanda
598af7f45c Auto remove the redundant trailing slash when set directory path on VentoyPlugson page. 2022-06-27 19:42:18 +08:00
longpanda
24b05c0345 Fix the bug when booting latest KaOS. (#1696) 2022-06-27 09:23:34 +08:00
Balázs Meskó
6d72617ef6 Update Hungarian translation (#1693)
* Update Hungarian translation

* Fixed a typo in languages.json
2022-06-24 18:52:25 +08:00
gidano
351f15ff18 Add files via upload (#1681)
Update Hungarian translaton
2022-06-20 16:26:31 +08:00
longpanda
1ee65a60c2 Fix a bug when booting TrueNAS Core 13.0. (#1684) 2022-06-20 15:29:27 +08:00
longpanda
ecbf45defe Fix an issue when booting StorageCraft StorageProtect SPX. (#1683) 2022-06-19 21:31:27 +08:00
122 changed files with 4168 additions and 1468 deletions

View File

@@ -21,7 +21,7 @@ body:
attributes: attributes:
label: Ventoy Version label: Ventoy Version
description: What version of ventoy are you running? description: What version of ventoy are you running?
placeholder: 1.0.76 placeholder: 1.0.80
validations: validations:
required: true required: true
- type: dropdown - type: dropdown
@@ -34,6 +34,16 @@ body:
- No. I didn't try the latest release. - No. I didn't try the latest release.
validations: validations:
required: true 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 - type: dropdown
id: bios id: bios
attributes: attributes:

View File

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

View File

@@ -82,12 +82,34 @@ static volatile ko_param g_ko_param =
#define vdebug(fmt, args...) if(kprintf) kprintf(KERN_ERR fmt, ##args) #define vdebug(fmt, args...) if(kprintf) kprintf(KERN_ERR fmt, ##args)
static int notrace dmpatch_replace_code(unsigned long addr, unsigned long size, int expect, const char *desc) static unsigned char *g_get_patch[MAX_PATCH] = { NULL };
static unsigned char *g_put_patch[MAX_PATCH] = { NULL };
static void notrace dmpatch_restore_code(unsigned char *opCode)
{
unsigned long align;
if (opCode)
{
align = (unsigned long)opCode / g_ko_param.pgsize * g_ko_param.pgsize;
set_mem_rw(align, 1);
*opCode = 0x80;
set_mem_ro(align, 1);
}
}
static int notrace dmpatch_replace_code
(
unsigned long addr,
unsigned long size,
int expect,
const char *desc,
unsigned char **patch
)
{ {
int i = 0; int i = 0;
int cnt = 0; int cnt = 0;
unsigned long align; unsigned long align;
unsigned char *patch[MAX_PATCH];
unsigned char *opCode = (unsigned char *)addr; unsigned char *opCode = (unsigned char *)addr;
vdebug("patch for %s 0x%lx %d\n", desc, addr, (int)size); vdebug("patch for %s 0x%lx %d\n", desc, addr, (int)size);
@@ -147,7 +169,7 @@ static int notrace dmpatch_init(void)
reg_kprobe = (kprobe_reg_pf)g_ko_param.reg_kprobe_addr; reg_kprobe = (kprobe_reg_pf)g_ko_param.reg_kprobe_addr;
unreg_kprobe = (kprobe_unreg_pf)g_ko_param.unreg_kprobe_addr; unreg_kprobe = (kprobe_unreg_pf)g_ko_param.unreg_kprobe_addr;
r = dmpatch_replace_code(g_ko_param.sym_get_addr, g_ko_param.sym_get_size, 2, "dm_get_table_device"); r = dmpatch_replace_code(g_ko_param.sym_get_addr, g_ko_param.sym_get_size, 2, "dm_get_table_device", g_get_patch);
if (r) if (r)
{ {
rc = -EINVAL; rc = -EINVAL;
@@ -155,7 +177,7 @@ static int notrace dmpatch_init(void)
} }
vdebug("patch dm_get_table_device success\n"); vdebug("patch dm_get_table_device success\n");
r = dmpatch_replace_code(g_ko_param.sym_put_addr, g_ko_param.sym_put_size, 1, "dm_put_table_device"); r = dmpatch_replace_code(g_ko_param.sym_put_addr, g_ko_param.sym_put_size, 1, "dm_put_table_device", g_put_patch);
if (r) if (r)
{ {
rc = -EINVAL; rc = -EINVAL;
@@ -174,7 +196,15 @@ out:
static void notrace dmpatch_exit(void) static void notrace dmpatch_exit(void)
{ {
int i = 0;
for (i = 0; i < MAX_PATCH; i++)
{
dmpatch_restore_code(g_get_patch[i]);
dmpatch_restore_code(g_put_patch[i]);
}
vdebug("dmpatch_exit success\n");
} }
module_init(dmpatch_init); module_init(dmpatch_init);

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://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://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 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 https://github.com/ventoy/musl-cross-make/releases/download/latest/output.tar.bz2 ===> /opt/output.tar.bz2

View File

@@ -60,7 +60,7 @@ ventoy_grub_param_file_replace *g_file_replace_list = NULL;
ventoy_efi_file_replace g_efi_file_replace; ventoy_efi_file_replace g_efi_file_replace;
ventoy_grub_param_file_replace *g_img_replace_list = NULL; ventoy_grub_param_file_replace *g_img_replace_list = NULL;
ventoy_efi_file_replace g_img_file_replace; ventoy_efi_file_replace g_img_file_replace[VTOY_MAX_CONF_REPLACE];
CONST CHAR16 gIso9660EfiDriverPath[] = ISO9660_EFI_DRIVER_PATH; CONST CHAR16 gIso9660EfiDriverPath[] = ISO9660_EFI_DRIVER_PATH;
CONST CHAR16 gUdfEfiDriverPath[] = UDF_EFI_DRIVER_PATH; CONST CHAR16 gUdfEfiDriverPath[] = UDF_EFI_DRIVER_PATH;
@@ -829,6 +829,7 @@ STATIC EFI_STATUS EFIAPI ventoy_parse_cmdline(IN EFI_HANDLE ImageHandle)
ventoy_grub_param *pGrubParam = NULL; ventoy_grub_param *pGrubParam = NULL;
EFI_LOADED_IMAGE_PROTOCOL *pImageInfo = NULL; EFI_LOADED_IMAGE_PROTOCOL *pImageInfo = NULL;
ventoy_chain_head *chain = NULL; ventoy_chain_head *chain = NULL;
ventoy_grub_param_file_replace *replace = NULL;
Status = gBS->HandleProtocol(ImageHandle, &gEfiLoadedImageProtocolGuid, (VOID **)&pImageInfo); Status = gBS->HandleProtocol(ImageHandle, &gEfiLoadedImageProtocolGuid, (VOID **)&pImageInfo);
if (EFI_ERROR(Status)) if (EFI_ERROR(Status))
@@ -926,18 +927,27 @@ STATIC EFI_STATUS EFIAPI ventoy_parse_cmdline(IN EFI_HANDLE ImageHandle)
old_cnt > 3 ? g_file_replace_list->old_file_name[3] : "" old_cnt > 3 ? g_file_replace_list->old_file_name[3] : ""
); );
g_img_replace_list = &pGrubParam->img_replace;
ventoy_proc_img_replace_name(g_img_replace_list); for (i = 0; i < VTOY_MAX_CONF_REPLACE; i++)
old_cnt = g_img_replace_list->old_file_cnt; {
debug("img replace: magic:0x%x virtid:%u name count:%u <%a> <%a> <%a> <%a>", replace = pGrubParam->img_replace + i;
g_img_replace_list->magic, if (replace->magic == GRUB_IMG_REPLACE_MAGIC)
g_img_replace_list->new_file_virtual_id, {
old_cnt, ventoy_proc_img_replace_name(replace);
old_cnt > 0 ? g_img_replace_list->old_file_name[0] : "", old_cnt = replace->old_file_cnt;
old_cnt > 1 ? g_img_replace_list->old_file_name[1] : "", debug("img replace[%d]: magic:0x%x virtid:%u name count:%u <%a> <%a> <%a> <%a>",
old_cnt > 2 ? g_img_replace_list->old_file_name[2] : "", i, replace->magic,
old_cnt > 3 ? g_img_replace_list->old_file_name[3] : "" replace->new_file_virtual_id,
); old_cnt,
old_cnt > 0 ? replace->old_file_name[0] : "",
old_cnt > 1 ? replace->old_file_name[1] : "",
old_cnt > 2 ? replace->old_file_name[2] : "",
old_cnt > 3 ? replace->old_file_name[3] : ""
);
g_img_replace_list = pGrubParam->img_replace;
}
}
pPos = StrStr(pCmdLine, L"mem:"); pPos = StrStr(pCmdLine, L"mem:");
chain = (ventoy_chain_head *)StrHexToUintn(pPos + 4); chain = (ventoy_chain_head *)StrHexToUintn(pPos + 4);
@@ -1178,8 +1188,7 @@ EFI_STATUS EFIAPI ventoy_boot(IN EFI_HANDLE ImageHandle)
gST->ConIn->Reset(gST->ConIn, FALSE); gST->ConIn->Reset(gST->ConIn, FALSE);
} }
if ((g_file_replace_list && g_file_replace_list->magic == GRUB_FILE_REPLACE_MAGIC) || if ((g_file_replace_list && g_file_replace_list->magic == GRUB_FILE_REPLACE_MAGIC) || g_img_replace_list)
(g_img_replace_list && g_img_replace_list->magic == GRUB_IMG_REPLACE_MAGIC))
{ {
ventoy_wrapper_push_openvolume(pFile->OpenVolume); ventoy_wrapper_push_openvolume(pFile->OpenVolume);
pFile->OpenVolume = ventoy_wrapper_open_volume; pFile->OpenVolume = ventoy_wrapper_open_volume;

View File

@@ -244,6 +244,7 @@ typedef int (*grub_env_printf_pf)(const char *fmt, ...);
#pragma pack(1) #pragma pack(1)
#define VTOY_MAX_CONF_REPLACE 2
#define GRUB_FILE_REPLACE_MAGIC 0x1258BEEF #define GRUB_FILE_REPLACE_MAGIC 0x1258BEEF
#define GRUB_IMG_REPLACE_MAGIC 0x1259BEEF #define GRUB_IMG_REPLACE_MAGIC 0x1259BEEF
@@ -270,7 +271,7 @@ typedef struct ventoy_grub_param
grub_env_get_pf grub_env_get; grub_env_get_pf grub_env_get;
grub_env_set_pf grub_env_set; grub_env_set_pf grub_env_set;
ventoy_grub_param_file_replace file_replace; ventoy_grub_param_file_replace file_replace;
ventoy_grub_param_file_replace img_replace; ventoy_grub_param_file_replace img_replace[VTOY_MAX_CONF_REPLACE];
grub_env_printf_pf grub_env_printf; grub_env_printf_pf grub_env_printf;
}ventoy_grub_param; }ventoy_grub_param;
@@ -400,7 +401,7 @@ extern ventoy_virt_chunk *g_virt_chunk;
extern UINT32 g_virt_chunk_num; extern UINT32 g_virt_chunk_num;
extern vtoy_block_data gBlockData; extern vtoy_block_data gBlockData;
extern ventoy_efi_file_replace g_efi_file_replace; extern ventoy_efi_file_replace g_efi_file_replace;
extern ventoy_efi_file_replace g_img_file_replace; extern ventoy_efi_file_replace g_img_file_replace[VTOY_MAX_CONF_REPLACE];
extern ventoy_sector_flag *g_sector_flag; extern ventoy_sector_flag *g_sector_flag;
extern UINT32 g_sector_flag_num; extern UINT32 g_sector_flag_num;
extern BOOLEAN gMemdiskMode; extern BOOLEAN gMemdiskMode;

View File

@@ -37,9 +37,6 @@
#include <Protocol/DriverBinding.h> #include <Protocol/DriverBinding.h>
#include <Ventoy.h> #include <Ventoy.h>
#define ASSIGN_REPLACE(This, replace) \
replace = (This->FlushEx == ventoy_wrapper_file_flush_ex) ? &g_efi_file_replace : &g_img_file_replace
UINT8 *g_iso_data_buf = NULL; UINT8 *g_iso_data_buf = NULL;
UINTN g_iso_buf_size = 0; UINTN g_iso_buf_size = 0;
BOOLEAN gMemdiskMode = FALSE; BOOLEAN gMemdiskMode = FALSE;
@@ -1251,13 +1248,96 @@ ventoy_wrapper_file_flush_ex(EFI_FILE_HANDLE This, EFI_FILE_IO_TOKEN *Token)
/* Ex version */ /* Ex version */
STATIC EFI_STATUS EFIAPI STATIC EFI_STATUS EFIAPI
ventoy_wrapper_file_flush_ex_img(EFI_FILE_HANDLE This, EFI_FILE_IO_TOKEN *Token) ventoy_wrapper_file_flush_ex_img0(EFI_FILE_HANDLE This, EFI_FILE_IO_TOKEN *Token)
{
(VOID)This;
(VOID)Token;
return EFI_SUCCESS;
}
/* Ex version */
STATIC EFI_STATUS EFIAPI
ventoy_wrapper_file_flush_ex_img1(EFI_FILE_HANDLE This, EFI_FILE_IO_TOKEN *Token)
{ {
(VOID)This; (VOID)This;
(VOID)Token; (VOID)Token;
return EFI_SUCCESS; return EFI_SUCCESS;
} }
#define DEF_WRAP_FUNC(n) \
STATIC EFI_STATUS EFIAPI ventoy_wrapper_file_flush_ex_img#n(EFI_FILE_HANDLE This, EFI_FILE_IO_TOKEN *Token) \
{\
(VOID)This;\
(VOID)Token;\
return EFI_SUCCESS;\
}
#define ITEM_WRAP_FUNC(n) ventoy_wrapper_file_flush_ex_img#n
#if (VTOY_MAX_CONF_REPLACE > 2)
DEF_WRAP_FUNC(2);
#endif
#if (VTOY_MAX_CONF_REPLACE > 3)
DEF_WRAP_FUNC(3);
#endif
#if (VTOY_MAX_CONF_REPLACE > 4)
DEF_WRAP_FUNC(4);
#endif
#if (VTOY_MAX_CONF_REPLACE > 5)
DEF_WRAP_FUNC(5);
#endif
#if (VTOY_MAX_CONF_REPLACE > 6)
DEF_WRAP_FUNC(6);
#endif
#if (VTOY_MAX_CONF_REPLACE > 7)
DEF_WRAP_FUNC(7);
#endif
#if (VTOY_MAX_CONF_REPLACE > 8)
#error "VTOY_MAX_CONF_REPLACE overflow"
#endif
static EFI_FILE_FLUSH_EX g_img_flush_func[VTOY_MAX_CONF_REPLACE] =
{
ventoy_wrapper_file_flush_ex_img0,
ventoy_wrapper_file_flush_ex_img1,
#if (VTOY_MAX_CONF_REPLACE > 2)
ITEM_WRAP_FUNC(2),
#endif
#if (VTOY_MAX_CONF_REPLACE > 3)
ITEM_WRAP_FUNC(3),
#endif
#if (VTOY_MAX_CONF_REPLACE > 4)
ITEM_WRAP_FUNC(4),
#endif
#if (VTOY_MAX_CONF_REPLACE > 5)
ITEM_WRAP_FUNC(5),
#endif
#if (VTOY_MAX_CONF_REPLACE > 6)
ITEM_WRAP_FUNC(6),
#endif
#if (VTOY_MAX_CONF_REPLACE > 7)
ITEM_WRAP_FUNC(7),
#endif
};
STATIC ventoy_efi_file_replace *ventoy_wrapper_get_replace(EFI_FILE_HANDLE This)
{
UINTN i;
if (This->FlushEx == ventoy_wrapper_file_flush_ex)
{
return &g_efi_file_replace;
}
for (i = 0; i < VTOY_MAX_CONF_REPLACE; i++)
{
if (This->FlushEx == g_img_flush_func[i])
{
return g_img_file_replace + i;
}
}
return NULL;
}
STATIC EFI_STATUS EFIAPI STATIC EFI_STATUS EFIAPI
ventoy_wrapper_file_write(EFI_FILE_HANDLE This, UINTN *Len, VOID *Data) ventoy_wrapper_file_write(EFI_FILE_HANDLE This, UINTN *Len, VOID *Data)
@@ -1288,7 +1368,7 @@ ventoy_wrapper_file_set_pos(EFI_FILE_HANDLE This, UINT64 Position)
{ {
ventoy_efi_file_replace *replace = NULL; ventoy_efi_file_replace *replace = NULL;
ASSIGN_REPLACE(This, replace); replace = ventoy_wrapper_get_replace(This);
if (Position <= replace->FileSizeBytes) if (Position <= replace->FileSizeBytes)
{ {
@@ -1307,7 +1387,7 @@ ventoy_wrapper_file_get_pos(EFI_FILE_HANDLE This, UINT64 *Position)
{ {
ventoy_efi_file_replace *replace = NULL; ventoy_efi_file_replace *replace = NULL;
ASSIGN_REPLACE(This, replace); replace = ventoy_wrapper_get_replace(This);
*Position = replace->CurPos; *Position = replace->CurPos;
@@ -1321,7 +1401,7 @@ ventoy_wrapper_file_get_info(EFI_FILE_HANDLE This, EFI_GUID *Type, UINTN *Len, V
EFI_FILE_INFO *Info = (EFI_FILE_INFO *) Data; EFI_FILE_INFO *Info = (EFI_FILE_INFO *) Data;
ventoy_efi_file_replace *replace = NULL; ventoy_efi_file_replace *replace = NULL;
ASSIGN_REPLACE(This, replace); replace = ventoy_wrapper_get_replace(This);
debug("ventoy_wrapper_file_get_info ... %u", *Len); debug("ventoy_wrapper_file_get_info ... %u", *Len);
@@ -1356,7 +1436,7 @@ ventoy_wrapper_file_read(EFI_FILE_HANDLE This, UINTN *Len, VOID *Data)
UINTN ReadLen = *Len; UINTN ReadLen = *Len;
ventoy_efi_file_replace *replace = NULL; ventoy_efi_file_replace *replace = NULL;
ASSIGN_REPLACE(This, replace); replace = ventoy_wrapper_get_replace(This);
debug("ventoy_wrapper_file_read ... %u", *Len); debug("ventoy_wrapper_file_read ... %u", *Len);
@@ -1382,7 +1462,7 @@ ventoy_wrapper_file_read_ex(IN EFI_FILE_PROTOCOL *This, IN OUT EFI_FILE_IO_TOKEN
return ventoy_wrapper_file_read(This, &(Token->BufferSize), Token->Buffer); return ventoy_wrapper_file_read(This, &(Token->BufferSize), Token->Buffer);
} }
STATIC EFI_STATUS EFIAPI ventoy_wrapper_file_procotol(EFI_FILE_PROTOCOL *File, BOOLEAN Img) STATIC EFI_STATUS EFIAPI ventoy_wrapper_file_procotol(EFI_FILE_PROTOCOL *File, BOOLEAN Img, UINTN Index)
{ {
File->Revision = EFI_FILE_PROTOCOL_REVISION2; File->Revision = EFI_FILE_PROTOCOL_REVISION2;
File->Open = ventoy_wrapper_fs_open; File->Open = ventoy_wrapper_fs_open;
@@ -1398,7 +1478,15 @@ STATIC EFI_STATUS EFIAPI ventoy_wrapper_file_procotol(EFI_FILE_PROTOCOL *File, B
File->OpenEx = ventoy_wrapper_file_open_ex; File->OpenEx = ventoy_wrapper_file_open_ex;
File->ReadEx = ventoy_wrapper_file_read_ex; File->ReadEx = ventoy_wrapper_file_read_ex;
File->WriteEx = ventoy_wrapper_file_write_ex; File->WriteEx = ventoy_wrapper_file_write_ex;
File->FlushEx = Img ? ventoy_wrapper_file_flush_ex_img : ventoy_wrapper_file_flush_ex;
if (Img)
{
File->FlushEx = g_img_flush_func[Index];
}
else
{
File->FlushEx = ventoy_wrapper_file_flush_ex;
}
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@@ -1419,6 +1507,7 @@ STATIC EFI_STATUS EFIAPI ventoy_wrapper_file_open
CHAR8 TmpName[256]; CHAR8 TmpName[256];
CHAR8 OldName[256]; CHAR8 OldName[256];
ventoy_virt_chunk *virt = NULL; ventoy_virt_chunk *virt = NULL;
ventoy_grub_param_file_replace *replace = NULL;
debug("## ventoy_wrapper_file_open <%s> ", Name); debug("## ventoy_wrapper_file_open <%s> ", Name);
@@ -1449,7 +1538,7 @@ STATIC EFI_STATUS EFIAPI ventoy_wrapper_file_open
{ {
g_original_fclose(*New); g_original_fclose(*New);
*New = &g_efi_file_replace.WrapperHandle; *New = &g_efi_file_replace.WrapperHandle;
ventoy_wrapper_file_procotol(*New, FALSE); ventoy_wrapper_file_procotol(*New, FALSE, 0);
virt = g_virt_chunk + g_file_replace_list->new_file_virtual_id; virt = g_virt_chunk + g_file_replace_list->new_file_virtual_id;
@@ -1475,15 +1564,18 @@ STATIC EFI_STATUS EFIAPI ventoy_wrapper_file_open
} }
} }
for (i = 0; g_img_replace_list && i < VTOY_MAX_CONF_REPLACE; i++)
if (g_img_replace_list && g_img_replace_list->magic == GRUB_IMG_REPLACE_MAGIC &&
g_img_replace_list->new_file_virtual_id < g_virt_chunk_num)
{ {
AsciiSPrint(TmpName, sizeof(TmpName), "%s", Name); replace = g_img_replace_list + i;
for (j = 0; j < g_img_replace_list->old_file_cnt; j++) if (replace->magic != GRUB_IMG_REPLACE_MAGIC || replace->new_file_virtual_id >= g_virt_chunk_num)
{ {
AsciiStrCpyS(OldName, sizeof(OldName), g_img_replace_list[i].old_file_name[j]); continue;
}
AsciiSPrint(TmpName, sizeof(TmpName), "%s", Name);
for (j = 0; j < replace->old_file_cnt; j++)
{
AsciiStrCpyS(OldName, sizeof(OldName), replace->old_file_name[j]);
if ((0 == AsciiStrCmp(OldName, TmpName)) || if ((0 == AsciiStrCmp(OldName, TmpName)) ||
(AsciiStrnCmp(OldName, "\\loader\\entries\\", 16) == 0 && (AsciiStrnCmp(OldName, "\\loader\\entries\\", 16) == 0 &&
AsciiStrCmp(OldName + 16, TmpName) == 0 AsciiStrCmp(OldName + 16, TmpName) == 0
@@ -1491,31 +1583,31 @@ STATIC EFI_STATUS EFIAPI ventoy_wrapper_file_open
) )
{ {
g_original_fclose(*New); g_original_fclose(*New);
*New = &g_img_file_replace.WrapperHandle; *New = &(g_img_file_replace[i].WrapperHandle);
ventoy_wrapper_file_procotol(*New, TRUE); ventoy_wrapper_file_procotol(*New, TRUE, i);
virt = g_virt_chunk + g_img_replace_list->new_file_virtual_id; virt = g_virt_chunk + replace->new_file_virtual_id;
Sectors = (virt->mem_sector_end - virt->mem_sector_start) + (virt->remap_sector_end - virt->remap_sector_start); Sectors = (virt->mem_sector_end - virt->mem_sector_start) + (virt->remap_sector_end - virt->remap_sector_start);
g_img_file_replace.BlockIoSectorStart = virt->mem_sector_start; g_img_file_replace[i].BlockIoSectorStart = virt->mem_sector_start;
g_img_file_replace.FileSizeBytes = Sectors * 2048; g_img_file_replace[i].FileSizeBytes = Sectors * 2048;
if (gDebugPrint) if (gDebugPrint)
{ {
debug("## ventoy_wrapper_file_open2 <%s> BlockStart:%lu Sectors:%lu Bytes:%lu", Name, debug("## ventoy_wrapper_file_open2 <%s> BlockStart:%lu Sectors:%lu Bytes:%lu", Name,
g_img_file_replace.BlockIoSectorStart, Sectors, Sectors * 2048); g_img_file_replace[i].BlockIoSectorStart, Sectors, Sectors * 2048);
sleep(3); sleep(3);
} }
return Status; return Status;
} }
} }
}
if (StrCmp(Name, L"\\loader\\entries") == 0) if (g_img_replace_list && StrCmp(Name, L"\\loader\\entries") == 0)
{ {
(*New)->Open = ventoy_wrapper_file_open; (*New)->Open = ventoy_wrapper_file_open;
}
} }
return Status; return Status;

View File

@@ -28,6 +28,8 @@ typedef int (*grub_env_set_pf)(const char *name, const char *val);
typedef const char * (*grub_env_get_pf)(const char *name); typedef const char * (*grub_env_get_pf)(const char *name);
typedef int (*grub_env_printf_pf)(const char *fmt, ...); typedef int (*grub_env_printf_pf)(const char *fmt, ...);
#define VTOY_MAX_CONF_REPLACE 2
typedef struct ventoy_grub_param_file_replace typedef struct ventoy_grub_param_file_replace
{ {
UINT32 magic; UINT32 magic;
@@ -41,7 +43,7 @@ typedef struct ventoy_grub_param
grub_env_get_pf grub_env_get; grub_env_get_pf grub_env_get;
grub_env_set_pf grub_env_set; grub_env_set_pf grub_env_set;
ventoy_grub_param_file_replace file_replace; ventoy_grub_param_file_replace file_replace;
ventoy_grub_param_file_replace img_replace; ventoy_grub_param_file_replace img_replace[VTOY_MAX_CONF_REPLACE];
grub_env_printf_pf grub_env_printf; grub_env_printf_pf grub_env_printf;
}ventoy_grub_param; }ventoy_grub_param;
#pragma pack() #pragma pack()

View File

@@ -229,6 +229,13 @@ test_parse (char **args, int *argn, int argc)
(*argn) += 3; (*argn) += 3;
continue; 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) if (grub_strcmp (args[*argn + 1], "-ge") == 0)
{ {
@@ -237,6 +244,13 @@ test_parse (char **args, int *argn, int argc)
(*argn) += 3; (*argn) += 3;
continue; 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) if (grub_strcmp (args[*argn + 1], "-gt") == 0)
{ {
@@ -245,6 +259,13 @@ test_parse (char **args, int *argn, int argc)
(*argn) += 3; (*argn) += 3;
continue; 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) if (grub_strcmp (args[*argn + 1], "-le") == 0)
{ {
@@ -253,6 +274,13 @@ test_parse (char **args, int *argn, int argc)
(*argn) += 3; (*argn) += 3;
continue; 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) if (grub_strcmp (args[*argn + 1], "-lt") == 0)
{ {
@@ -261,6 +289,13 @@ test_parse (char **args, int *argn, int argc)
(*argn) += 3; (*argn) += 3;
continue; 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) if (grub_strcmp (args[*argn + 1], "-ne") == 0)
{ {
@@ -269,6 +304,13 @@ test_parse (char **args, int *argn, int argc)
(*argn) += 3; (*argn) += 3;
continue; 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. /* GRUB extension: compare numbers skipping prefixes.
Useful for comparing versions. E.g. vmlinuz-2 -plt vmlinuz-11. */ 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_suppress_esc_default = 1;
int g_ventoy_menu_esc = 0; int g_ventoy_menu_esc = 0;
int g_ventoy_fn_mutex = 0; int g_ventoy_fn_mutex = 0;
int g_ventoy_secondary_menu_on = 0;
int g_ventoy_terminal_output = 0; int g_ventoy_terminal_output = 0;
#define VTOY_COMM_HOTKEY(cmdkey) \ #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); \ cmdstr = grub_env_get(cmdkey); \
if (cmdstr) \ if (cmdstr) \
{ \ { \
@@ -933,66 +934,91 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot)
goto refresh; goto refresh;
case GRUB_TERM_KEY_F1: case GRUB_TERM_KEY_F1:
case '1': case '1':
menu_fini (); if (0 == g_ventoy_secondary_menu_on)
g_ventoy_memdisk_mode = 1 - g_ventoy_memdisk_mode; {
g_ventoy_menu_refresh = 1; menu_fini ();
goto refresh; g_ventoy_memdisk_mode = 1 - g_ventoy_memdisk_mode;
g_ventoy_menu_refresh = 1;
goto refresh;
}
break;
case (GRUB_TERM_CTRL | 'i'): case (GRUB_TERM_CTRL | 'i'):
menu_fini (); case 'i':
g_ventoy_iso_raw = 1 - g_ventoy_iso_raw; if (0 == g_ventoy_secondary_menu_on)
g_ventoy_menu_refresh = 1; {
goto refresh; menu_fini ();
g_ventoy_iso_raw = 1 - g_ventoy_iso_raw;
g_ventoy_menu_refresh = 1;
goto refresh;
}
break;
case (GRUB_TERM_CTRL | 'r'): case (GRUB_TERM_CTRL | 'r'):
menu_fini (); case 'r':
g_ventoy_grub2_mode = 1 - g_ventoy_grub2_mode; if (0 == g_ventoy_secondary_menu_on)
g_ventoy_menu_refresh = 1; {
goto refresh; menu_fini ();
g_ventoy_grub2_mode = 1 - g_ventoy_grub2_mode;
g_ventoy_menu_refresh = 1;
goto refresh;
}
break;
case (GRUB_TERM_CTRL | 'w'): case (GRUB_TERM_CTRL | 'w'):
menu_fini (); case 'w':
g_ventoy_wimboot_mode = 1 - g_ventoy_wimboot_mode; if (0 == g_ventoy_secondary_menu_on)
g_ventoy_menu_refresh = 1; {
goto refresh; menu_fini ();
g_ventoy_wimboot_mode = 1 - g_ventoy_wimboot_mode;
g_ventoy_menu_refresh = 1;
goto refresh;
}
break;
case (GRUB_TERM_CTRL | 'u'): case (GRUB_TERM_CTRL | 'u'):
menu_fini (); case 'u':
g_ventoy_iso_uefi_drv = 1 - g_ventoy_iso_uefi_drv; if (0 == g_ventoy_secondary_menu_on)
g_ventoy_menu_refresh = 1; {
goto refresh; 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 (GRUB_TERM_CTRL | 'h'):
case 'h': case 'h':
{ {
cmdstr = grub_env_get("VTOY_HELP_CMD"); if (0 == g_ventoy_secondary_menu_on)
if (cmdstr)
{ {
grub_script_execute_sourcecode(cmdstr); cmdstr = grub_env_get("VTOY_HELP_CMD");
while (grub_getkey() != GRUB_TERM_ESC) if (cmdstr)
; {
menu_fini (); grub_script_execute_sourcecode(cmdstr);
goto refresh; while (grub_getkey() != GRUB_TERM_ESC)
;
menu_fini ();
goto refresh;
}
} }
break; break;
} }
case (GRUB_TERM_CTRL | 'm'): case (GRUB_TERM_CTRL | 'm'):
case 'm': case 'm':
{ {
if (g_ventoy_cur_img_path) if (0 == g_ventoy_secondary_menu_on)
{ {
grub_env_set("VTOY_CHKSUM_FILE_PATH", g_ventoy_cur_img_path); if (g_ventoy_cur_img_path)
cmdstr = grub_env_get("VTOY_CHKSUM_CMD");
if (cmdstr)
{ {
menu_fini(); grub_env_set("VTOY_CHKSUM_FILE_PATH", g_ventoy_cur_img_path);
grub_script_execute_sourcecode(cmdstr); cmdstr = grub_env_get("VTOY_CHKSUM_CMD");
goto refresh; 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; break;
} }

View File

@@ -188,6 +188,21 @@ void * ventoy_alloc_chain(grub_size_t size)
return p; 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) static int ventoy_arch_mode_init(void)
{ {

View File

@@ -171,6 +171,11 @@ static int ventoy_browser_iterate_partition(struct grub_disk *disk, const grub_p
fs->fs_label(dev, &Label); fs->fs_label(dev, &Label);
if (ventoy_check_file_exist("(%s)/.ventoyignore", partname))
{
return 0;
}
if (g_tree_view_menu_style == 0) if (g_tree_view_menu_style == 0)
{ {
grub_snprintf(title, sizeof(title), "%-10s (%s,%s%d) [%s] %s %s", grub_snprintf(title, sizeof(title), "%-10s (%s,%s%d) [%s] %s %s",
@@ -311,6 +316,25 @@ static int ventoy_browser_valid_filename(const char *filename, int len, int *typ
return 1; return 1;
} }
static int ventoy_browser_check_ignore(const char *device, const char *root, const char *dir)
{
grub_file_t file;
char fullpath[1024] = {0};
grub_snprintf(fullpath, 1023, "(%s)%s/%s/.ventoyignore", device, root, dir);
file = grub_file_open(fullpath, GRUB_FILE_TYPE_NONE);
if (!file)
{
grub_errno = 0;
return 0;
}
else
{
grub_file_close(file);
return 1;
}
}
static int ventoy_browser_iterate_dir(const char *filename, const struct grub_dirhook_info *info, void *data) static int ventoy_browser_iterate_dir(const char *filename, const struct grub_dirhook_info *info, void *data)
{ {
int type; int type;
@@ -328,6 +352,11 @@ static int ventoy_browser_iterate_dir(const char *filename, const struct grub_di
return 0; return 0;
} }
if (ventoy_browser_check_ignore(g_menu_device, g_menu_path_buf, filename))
{
return 0;
}
node = grub_zalloc(sizeof(browser_node)); node = grub_zalloc(sizeof(browser_node));
if (!node) if (!node)
{ {

View File

@@ -107,12 +107,14 @@ grub_uint32_t g_wimiso_size = 0;
int g_vhdboot_enable = 0; int g_vhdboot_enable = 0;
grub_uint64_t g_conf_replace_offset = 0;
grub_uint64_t g_svd_replace_offset = 0; grub_uint64_t g_svd_replace_offset = 0;
conf_replace *g_conf_replace_node = NULL;
grub_uint8_t *g_conf_replace_new_buf = NULL; int g_conf_replace_count = 0;
int g_conf_replace_new_len = 0; grub_uint64_t g_conf_replace_offset[VTOY_MAX_CONF_REPLACE] = { 0 };
int g_conf_replace_new_len_align = 0; conf_replace *g_conf_replace_node[VTOY_MAX_CONF_REPLACE] = { NULL };
grub_uint8_t *g_conf_replace_new_buf[VTOY_MAX_CONF_REPLACE] = { NULL };
int g_conf_replace_new_len[VTOY_MAX_CONF_REPLACE] = { 0 };
int g_conf_replace_new_len_align[VTOY_MAX_CONF_REPLACE] = { 0 };
int g_ventoy_disk_bios_id = 0; int g_ventoy_disk_bios_id = 0;
ventoy_gpt_info *g_ventoy_part_info = NULL; ventoy_gpt_info *g_ventoy_part_info = NULL;
@@ -146,8 +148,6 @@ static char g_iso_vd_id_application[130];
static int g_pager_flag = 0; static int g_pager_flag = 0;
static char g_old_pager[32]; 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] = const char *g_menu_class[img_type_max] =
{ {
"vtoyiso", "vtoywim", "vtoyefi", "vtoyimg", "vtoyvhd", "vtoyvtoy" "vtoyiso", "vtoywim", "vtoyefi", "vtoyimg", "vtoyvhd", "vtoyvtoy"
@@ -158,6 +158,8 @@ const char *g_menu_prefix[img_type_max] =
"iso", "wim", "efi", "img", "vhd", "vtoy" "iso", "wim", "efi", "img", "vhd", "vtoy"
}; };
static int g_vtoy_secondary_need_recover = 0;
static int g_vtoy_load_prompt = 0; static int g_vtoy_load_prompt = 0;
static char g_vtoy_prompt_msg[64]; static char g_vtoy_prompt_msg[64];
@@ -1034,8 +1036,6 @@ static grub_err_t ventoy_cmd_concat_efi_iso(grub_extcmd_context_t ctxt, int argc
int totlen = 0; int totlen = 0;
int offset = 0; int offset = 0;
grub_file_t file; grub_file_t file;
char name[32];
char value[32];
char *buf = NULL; char *buf = NULL;
char *data = NULL; char *data = NULL;
ventoy_iso9660_override *dirent; ventoy_iso9660_override *dirent;
@@ -1095,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_read(file, data + sizeof(ventoy_chain_head) + len, file->size);
grub_file_close(file); grub_file_close(file);
grub_snprintf(name, sizeof(name), "%s_addr", args[1]); ventoy_memfile_env_set(args[1], data, (ulonglong)totlen);
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);
return 0; return 0;
} }
@@ -1146,6 +1140,10 @@ grub_ssize_t ventoy_load_file_with_prompt(grub_file_t file, void *buf, grub_ssiz
left -= VTOY_SIZE_2MB; left -= VTOY_SIZE_2MB;
div = grub_divmod64((grub_uint64_t)((size - left) * 100), (grub_uint64_t)size, &ro); 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_printf("\r%s %d%% ", g_vtoy_prompt_msg, (int)div);
grub_refresh(); grub_refresh();
} }
@@ -1164,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) static grub_err_t ventoy_cmd_load_file_to_mem(grub_extcmd_context_t ctxt, int argc, char **args)
{ {
int rc = 1; int rc = 1;
char name[32];
char value[32];
char *buf = NULL; char *buf = NULL;
grub_file_t file; grub_file_t file;
enum grub_file_type type; enum grub_file_type type;
@@ -1216,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_file_read(file, buf, file->size);
} }
grub_snprintf(name, sizeof(name), "%s_addr", args[2]); ventoy_memfile_env_set(args[2], buf, (ulonglong)(file->size));
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);
grub_file_close(file); grub_file_close(file);
rc = 0; rc = 0;
@@ -1234,8 +1224,6 @@ static grub_err_t ventoy_cmd_load_img_memdisk(grub_extcmd_context_t ctxt, int ar
{ {
int rc = 1; int rc = 1;
int headlen; int headlen;
char name[32];
char value[32];
char *buf = NULL; char *buf = NULL;
grub_file_t file; grub_file_t file;
@@ -1267,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_file_read(file, buf + headlen, file->size);
grub_snprintf(name, sizeof(name), "%s_addr", args[1]); ventoy_memfile_env_set(args[1], buf, (ulonglong)(file->size));
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);
grub_file_close(file); grub_file_close(file);
rc = 0; rc = 0;
@@ -2177,6 +2159,59 @@ int ventoy_fill_data(grub_uint32_t buflen, char *buffer)
return len; 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);
}
int ventoy_check_password(const vtoy_password *pwd, int retry) int ventoy_check_password(const vtoy_password *pwd, int retry)
{ {
int offset; int offset;
@@ -2192,7 +2227,7 @@ int ventoy_check_password(const vtoy_password *pwd, int retry)
if (pwd->type == VTOY_PASSWORD_TXT) if (pwd->type == VTOY_PASSWORD_TXT)
{ {
grub_password_get(input, 128); ventoy_password_get(input, 128);
if (grub_strcmp(pwd->text, input) == 0) if (grub_strcmp(pwd->text, input) == 0)
{ {
return 0; return 0;
@@ -2200,7 +2235,7 @@ int ventoy_check_password(const vtoy_password *pwd, int retry)
} }
else if (pwd->type == VTOY_PASSWORD_MD5) else if (pwd->type == VTOY_PASSWORD_MD5)
{ {
grub_password_get(input, 128); ventoy_password_get(input, 128);
grub_crypto_hash(GRUB_MD_MD5, md5, input, grub_strlen(input)); grub_crypto_hash(GRUB_MD_MD5, md5, input, grub_strlen(input));
if (grub_memcmp(pwd->md5, md5, 16) == 0) if (grub_memcmp(pwd->md5, md5, 16) == 0)
{ {
@@ -2210,7 +2245,7 @@ int ventoy_check_password(const vtoy_password *pwd, int retry)
else if (pwd->type == VTOY_PASSWORD_SALT_MD5) else if (pwd->type == VTOY_PASSWORD_SALT_MD5)
{ {
offset = (int)grub_snprintf(input, 128, "%s", pwd->salt); offset = (int)grub_snprintf(input, 128, "%s", pwd->salt);
grub_password_get(input + offset, 128); ventoy_password_get(input + offset, 128);
grub_crypto_hash(GRUB_MD_MD5, md5, input, grub_strlen(input)); grub_crypto_hash(GRUB_MD_MD5, md5, input, grub_strlen(input));
if (grub_memcmp(pwd->md5, md5, 16) == 0) if (grub_memcmp(pwd->md5, md5, 16) == 0)
@@ -3250,8 +3285,9 @@ static grub_err_t ventoy_cmd_img_sector(grub_extcmd_context_t ctxt, int argc, ch
return grub_error(GRUB_ERR_BAD_ARGUMENT, "Can't open file %s\n", args[0]); return grub_error(GRUB_ERR_BAD_ARGUMENT, "Can't open file %s\n", args[0]);
} }
g_conf_replace_node = NULL; g_conf_replace_count = 0;
g_conf_replace_offset = 0; grub_memset(g_conf_replace_node, 0, sizeof(g_conf_replace_node ));
grub_memset(g_conf_replace_offset, 0, sizeof(g_conf_replace_offset ));
if (g_img_chunk_list.chunk) if (g_img_chunk_list.chunk)
{ {
@@ -3294,10 +3330,14 @@ static grub_err_t ventoy_cmd_img_sector(grub_extcmd_context_t ctxt, int argc, ch
static grub_err_t ventoy_select_conf_replace(grub_extcmd_context_t ctxt, int argc, char **args) static grub_err_t ventoy_select_conf_replace(grub_extcmd_context_t ctxt, int argc, char **args)
{ {
int i;
int n;
grub_uint64_t offset = 0; grub_uint64_t offset = 0;
grub_uint32_t align = 0; grub_uint32_t align = 0;
grub_file_t file = NULL; grub_file_t file = NULL;
conf_replace *node = NULL; conf_replace *node = NULL;
conf_replace *nodes[VTOY_MAX_CONF_REPLACE] = { NULL };
ventoy_grub_param_file_replace *replace = NULL;
(void)ctxt; (void)ctxt;
(void)argc; (void)argc;
@@ -3310,67 +3350,72 @@ static grub_err_t ventoy_select_conf_replace(grub_extcmd_context_t ctxt, int arg
return 0; return 0;
} }
node = ventoy_plugin_find_conf_replace(args[1]); n = ventoy_plugin_find_conf_replace(args[1], nodes);
if (!node) if (!n)
{ {
debug("Conf replace not found for %s\n", args[1]); debug("Conf replace not found for %s\n", args[1]);
goto end; goto end;
} }
debug("Find conf replace for %s\n", args[1]); debug("Find %d conf replace for %s\n", n, args[1]);
file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "(loop)%s", node->orgconf); g_conf_replace_count = n;
if (file) for (i = 0; i < n; i++)
{ {
offset = grub_iso9660_get_last_file_dirent_pos(file); node = nodes[i];
file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "(loop)%s", node->orgconf);
if (file)
{
offset = grub_iso9660_get_last_file_dirent_pos(file);
grub_file_close(file);
}
else if (node->img > 0)
{
offset = 0;
}
else
{
debug("<(loop)%s> NOT exist\n", node->orgconf);
continue;
}
file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s%s", args[0], node->newconf);
if (!file)
{
debug("New config file <%s%s> NOT exist\n", args[0], node->newconf);
continue;
}
align = ((int)file->size + 2047) / 2048 * 2048;
if (align > vtoy_max_replace_file_size)
{
debug("New config file <%s%s> too big\n", args[0], node->newconf);
grub_file_close(file);
continue;
}
grub_file_read(file, g_conf_replace_new_buf[i], file->size);
grub_file_close(file); grub_file_close(file);
g_conf_replace_new_len[i] = (int)file->size;
g_conf_replace_new_len_align[i] = align;
g_conf_replace_node[i] = node;
g_conf_replace_offset[i] = offset + 2;
if (node->img > 0)
{
replace = &(g_grub_param->img_replace[i]);
replace->magic = GRUB_IMG_REPLACE_MAGIC;
grub_snprintf(replace->old_file_name[replace->old_name_cnt], 256, "%s", node->orgconf);
replace->old_name_cnt++;
}
debug("conf_replace OK: newlen[%d]: %d img:%d\n", i, g_conf_replace_new_len[i], node->img);
} }
else if (node->img > 0)
{
offset = 0;
}
else
{
debug("<(loop)%s> NOT exist\n", node->orgconf);
goto end;
}
file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s%s", args[0], node->newconf);
if (!file)
{
debug("New config file <%s%s> NOT exist\n", args[0], node->newconf);
goto end;
}
align = ((int)file->size + 2047) / 2048 * 2048;
if (align > vtoy_max_replace_file_size)
{
debug("New config file <%s%s> too big\n", args[0], node->newconf);
goto end;
}
grub_file_read(file, g_conf_replace_new_buf, file->size);
g_conf_replace_new_len = (int)file->size;
g_conf_replace_new_len_align = align;
g_conf_replace_node = node;
g_conf_replace_offset = offset + 2;
if (node->img > 0)
{
g_grub_param->img_replace.magic = GRUB_IMG_REPLACE_MAGIC;
g_grub_param->img_replace.old_name_cnt = 1;
grub_snprintf(g_grub_param->img_replace.old_file_name[0], 256, "%s", node->orgconf);
}
debug("conf_replace OK: newlen: %d\n", g_conf_replace_new_len);
end: end:
if (file)
{
grub_file_close(file);
}
VENTOY_CMD_RETURN(GRUB_ERR_NONE); VENTOY_CMD_RETURN(GRUB_ERR_NONE);
} }
@@ -3630,7 +3675,7 @@ static grub_err_t ventoy_cmd_sel_auto_install(grub_extcmd_context_t ctxt, int ar
{ {
node->cursel = node->autosel - 1; node->cursel = node->autosel - 1;
debug("Auto install template auto select %d\n", node->autosel); debug("Auto install template auto select %d\n", node->autosel);
return 0; goto load;
} }
} }
@@ -3645,12 +3690,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, "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", ""); " echo %s\n}\n", "");
for (i = 0; i < node->templatenum; i++) 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", " echo \"\"\n}\n",
node->templatepath[i].path); node->templatepath[i].path);
} }
@@ -3670,6 +3715,7 @@ static grub_err_t ventoy_cmd_sel_auto_install(grub_extcmd_context_t ctxt, int ar
node->cursel = g_ventoy_last_entry - 1; node->cursel = g_ventoy_last_entry - 1;
load:
grub_check_free(node->filebuf); grub_check_free(node->filebuf);
node->filelen = 0; node->filelen = 0;
@@ -3750,12 +3796,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, "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", ""); " echo %s\n}\n", "");
for (i = 0; i < node->backendnum; i++) 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", " echo \"\"\n}\n",
node->backendpath[i].path); node->backendpath[i].path);
@@ -5943,8 +5989,180 @@ static grub_err_t ventoy_cmd_dump_rsv_page(grub_extcmd_context_t ctxt, int argc,
VENTOY_CMD_RETURN(GRUB_ERR_NONE); 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 ventoy_env_init(void)
{ {
int i;
char buf[64]; char buf[64];
grub_env_set("vtdebug_flag", ""); grub_env_set("vtdebug_flag", "");
@@ -5952,7 +6170,10 @@ int ventoy_env_init(void)
g_part_list_buf = grub_malloc(VTOY_PART_BUF_LEN); g_part_list_buf = grub_malloc(VTOY_PART_BUF_LEN);
g_tree_script_buf = grub_malloc(VTOY_MAX_SCRIPT_BUF); g_tree_script_buf = grub_malloc(VTOY_MAX_SCRIPT_BUF);
g_list_script_buf = grub_malloc(VTOY_MAX_SCRIPT_BUF); g_list_script_buf = grub_malloc(VTOY_MAX_SCRIPT_BUF);
g_conf_replace_new_buf = grub_malloc(vtoy_max_replace_file_size); for (i = 0; i < VTOY_MAX_CONF_REPLACE; i++)
{
g_conf_replace_new_buf[i] = grub_malloc(vtoy_max_replace_file_size);
}
ventoy_filt_register(0, ventoy_wrapper_open); ventoy_filt_register(0, ventoy_wrapper_open);
@@ -5970,12 +6191,6 @@ int ventoy_env_init(void)
grub_env_export("ventoy_env_param"); 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_addr");
grub_env_export("vtoy_winpeshl_ini_size"); grub_env_export("vtoy_winpeshl_ini_size");
@@ -6145,6 +6360,14 @@ static cmd_para ventoy_cmds[] =
{ "vt_iso_vd_id_begin", ventoy_cmd_iso_vd_id_begin, 0, NULL, "", "", NULL }, { "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_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_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) int ventoy_register_all_cmd(void)

View File

@@ -29,6 +29,8 @@
#define VTOY_FILT_MIN_FILE_SIZE 32768 #define VTOY_FILT_MIN_FILE_SIZE 32768
#define VTOY_LINUX_SYSTEMD_MENU_MAX_BUF 16384
#define VTOY_SIZE_1GB 1073741824 #define VTOY_SIZE_1GB 1073741824
#define VTOY_SIZE_1MB (1024 * 1024) #define VTOY_SIZE_1MB (1024 * 1024)
#define VTOY_SIZE_2MB (2 * 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...) \ #define vtoy_ssprintf(buf, pos, fmt, args...) \
pos += grub_snprintf(buf + pos, VTOY_MAX_SCRIPT_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...) \ #define browser_ssprintf(mbuf, fmt, args...) \
(mbuf)->pos += grub_snprintf((mbuf)->buf + (mbuf)->pos, (mbuf)->max - (mbuf)->pos, 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_RESERVED 0x00000001
#define FLAG_HEADER_COMPRESSION 0x00000002 #define FLAG_HEADER_COMPRESSION 0x00000002
#define FLAG_HEADER_READONLY 0x00000004 #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); 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); 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_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_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_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); 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_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_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_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_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_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); grub_err_t ventoy_cmd_set_wim_prompt(grub_extcmd_context_t ctxt, int argc, char **args);
@@ -960,7 +972,7 @@ typedef struct custom_boot
struct custom_boot *next; struct custom_boot *next;
}custom_boot; }custom_boot;
#define vtoy_max_replace_file_size (2 * 1024 * 1024) #define vtoy_max_replace_file_size (1024 * 1024)
typedef struct conf_replace typedef struct conf_replace
{ {
int pathlen; int pathlen;
@@ -1028,6 +1040,7 @@ typedef struct menu_password
}menu_password; }menu_password;
extern int g_ventoy_menu_esc; 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;
extern int g_ventoy_suppress_esc_default; extern int g_ventoy_suppress_esc_default;
extern int g_ventoy_last_entry; extern int g_ventoy_last_entry;
@@ -1046,12 +1059,13 @@ extern int g_vhdboot_enable;
extern int g_plugin_image_list; extern int g_plugin_image_list;
extern ventoy_gpt_info *g_ventoy_part_info; extern ventoy_gpt_info *g_ventoy_part_info;
extern grub_uint64_t g_conf_replace_offset; extern int g_conf_replace_count;
extern grub_uint64_t g_conf_replace_offset[VTOY_MAX_CONF_REPLACE];
extern grub_uint64_t g_svd_replace_offset; extern grub_uint64_t g_svd_replace_offset;
extern conf_replace *g_conf_replace_node; extern conf_replace *g_conf_replace_node[VTOY_MAX_CONF_REPLACE];
extern grub_uint8_t *g_conf_replace_new_buf; extern grub_uint8_t *g_conf_replace_new_buf[VTOY_MAX_CONF_REPLACE];
extern int g_conf_replace_new_len; extern int g_conf_replace_new_len[VTOY_MAX_CONF_REPLACE];
extern int g_conf_replace_new_len_align; extern int g_conf_replace_new_len_align[VTOY_MAX_CONF_REPLACE];
extern int g_ventoy_disk_bios_id; extern int g_ventoy_disk_bios_id;
extern grub_uint64_t g_ventoy_disk_size; extern grub_uint64_t g_ventoy_disk_size;
extern grub_uint64_t g_ventoy_disk_part_size[2]; extern grub_uint64_t g_ventoy_disk_part_size[2];
@@ -1095,7 +1109,7 @@ const menu_tip * ventoy_plugin_get_menu_tip(int type, const char *isopath);
const char * ventoy_plugin_get_menu_class(int type, const char *name, const char *path); const char * ventoy_plugin_get_menu_class(int type, const char *name, const char *path);
int ventoy_plugin_check_memdisk(const char *isopath); int ventoy_plugin_check_memdisk(const char *isopath);
int ventoy_plugin_get_image_list_index(int type, const char *name); int ventoy_plugin_get_image_list_index(int type, const char *name);
conf_replace * ventoy_plugin_find_conf_replace(const char *iso); int ventoy_plugin_find_conf_replace(const char *iso, conf_replace *nodes[VTOY_MAX_CONF_REPLACE]);
dud * ventoy_plugin_find_dud(const char *iso); dud * ventoy_plugin_find_dud(const char *iso);
int ventoy_plugin_load_dud(dud *node, const char *isopart); int ventoy_plugin_load_dud(dud *node, const char *isopart);
int ventoy_get_block_list(grub_file_t file, ventoy_img_chunk_list *chunklist, grub_disk_addr_t start); int ventoy_get_block_list(grub_file_t file, ventoy_img_chunk_list *chunklist, grub_disk_addr_t start);
@@ -1110,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_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_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_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); 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); 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); grub_err_t ventoy_cmd_unix_reset(grub_extcmd_context_t ctxt, int argc, char **args);
@@ -1217,6 +1232,16 @@ typedef struct var_node
struct var_node *next; struct var_node *next;
}var_node; }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 char *g_tree_script_buf;
extern int g_tree_script_pos; extern int g_tree_script_pos;
extern int g_tree_script_pre; extern int g_tree_script_pre;

View File

@@ -333,12 +333,84 @@ end:
VENTOY_CMD_RETURN(GRUB_ERR_NONE); 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) static grub_err_t ventoy_grub_cfg_initrd_collect(const char *fileName)
{ {
int i = 0; int i = 0;
int len = 0; int len = 0;
int dollar = 0; int dollar = 0;
int quotation = 0; int quotation = 0;
int initrd_dollar = 0;
grub_file_t file = NULL; grub_file_t file = NULL;
char *buf = NULL; char *buf = NULL;
char *start = 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); 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)) if (dollar == 1 || ventoy_find_initrd_by_name(g_initrd_img_list, img->name))
{ {
grub_free(img); grub_free(img);
@@ -458,6 +543,12 @@ static grub_err_t ventoy_grub_cfg_initrd_collect(const char *fileName)
grub_free(buf); grub_free(buf);
grub_file_close(file); 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); VENTOY_CMD_RETURN(GRUB_ERR_NONE);
} }
@@ -654,11 +745,18 @@ int ventoy_cpio_newc_fill_head(void *buf, int filesize, const void *filedata, co
static grub_uint32_t ventoy_linux_get_virt_chunk_count(void) static grub_uint32_t ventoy_linux_get_virt_chunk_count(void)
{ {
int i;
grub_uint32_t count = g_valid_initrd_count; grub_uint32_t count = g_valid_initrd_count;
if (g_conf_replace_offset > 0) if (g_conf_replace_count > 0)
{ {
count++; for (i = 0; i < g_conf_replace_count; i++)
{
if (g_conf_replace_offset[i] > 0)
{
count++;
}
}
} }
if (g_append_ext_sector > 0) if (g_append_ext_sector > 0)
@@ -671,13 +769,20 @@ static grub_uint32_t ventoy_linux_get_virt_chunk_count(void)
static grub_uint32_t ventoy_linux_get_virt_chunk_size(void) static grub_uint32_t ventoy_linux_get_virt_chunk_size(void)
{ {
int i;
grub_uint32_t size; grub_uint32_t size;
size = (sizeof(ventoy_virt_chunk) + g_ventoy_cpio_size) * g_valid_initrd_count; size = (sizeof(ventoy_virt_chunk) + g_ventoy_cpio_size) * g_valid_initrd_count;
if (g_conf_replace_offset > 0) if (g_conf_replace_count > 0)
{ {
size += sizeof(ventoy_virt_chunk) + g_conf_replace_new_len_align; for (i = 0; i < g_conf_replace_count; i++)
{
if (g_conf_replace_offset[i] > 0)
{
size += sizeof(ventoy_virt_chunk) + g_conf_replace_new_len_align[i];
}
}
} }
if (g_append_ext_sector > 0) if (g_append_ext_sector > 0)
@@ -690,6 +795,7 @@ static grub_uint32_t ventoy_linux_get_virt_chunk_size(void)
static void ventoy_linux_fill_virt_data( grub_uint64_t isosize, ventoy_chain_head *chain) static void ventoy_linux_fill_virt_data( grub_uint64_t isosize, ventoy_chain_head *chain)
{ {
int i = 0;
int id = 0; int id = 0;
int virtid = 0; int virtid = 0;
initrd_info *node; initrd_info *node;
@@ -699,6 +805,7 @@ static void ventoy_linux_fill_virt_data( grub_uint64_t isosize, ventoy_chain_
grub_uint32_t initrd_secs; grub_uint32_t initrd_secs;
char *override; char *override;
ventoy_virt_chunk *cur; ventoy_virt_chunk *cur;
ventoy_grub_param_file_replace *replace = NULL;
char name[32]; char name[32];
override = (char *)chain + chain->virt_chunk_offset; override = (char *)chain + chain->virt_chunk_offset;
@@ -764,30 +871,37 @@ static void ventoy_linux_fill_virt_data( grub_uint64_t isosize, ventoy_chain_
virtid++; virtid++;
} }
if (g_conf_replace_offset > 0) if (g_conf_replace_count > 0)
{ {
cpio_secs = g_conf_replace_new_len_align / 2048; for (i = 0; i < g_conf_replace_count; i++)
cur->mem_sector_start = sector;
cur->mem_sector_end = cur->mem_sector_start + cpio_secs;
cur->mem_sector_offset = offset;
cur->remap_sector_start = 0;
cur->remap_sector_end = 0;
cur->org_sector_start = 0;
grub_memcpy(override + offset, g_conf_replace_new_buf, g_conf_replace_new_len);
chain->virt_img_size_in_bytes += g_conf_replace_new_len_align;
if (g_grub_param->img_replace.magic == GRUB_IMG_REPLACE_MAGIC)
{ {
g_grub_param->img_replace.new_file_virtual_id = virtid; if (g_conf_replace_offset[i] > 0)
} {
cpio_secs = g_conf_replace_new_len_align[i] / 2048;
offset += g_conf_replace_new_len_align; cur->mem_sector_start = sector;
sector += cpio_secs; cur->mem_sector_end = cur->mem_sector_start + cpio_secs;
cur++; cur->mem_sector_offset = offset;
virtid++; cur->remap_sector_start = 0;
cur->remap_sector_end = 0;
cur->org_sector_start = 0;
grub_memcpy(override + offset, g_conf_replace_new_buf[i], g_conf_replace_new_len[i]);
chain->virt_img_size_in_bytes += g_conf_replace_new_len_align[i];
replace = g_grub_param->img_replace + i;
if (replace->magic == GRUB_IMG_REPLACE_MAGIC)
{
replace->new_file_virtual_id = virtid;
}
offset += g_conf_replace_new_len_align[i];
sector += cpio_secs;
cur++;
virtid++;
}
}
} }
return; return;
@@ -795,11 +909,18 @@ static void ventoy_linux_fill_virt_data( grub_uint64_t isosize, ventoy_chain_
static grub_uint32_t ventoy_linux_get_override_chunk_count(void) static grub_uint32_t ventoy_linux_get_override_chunk_count(void)
{ {
int i;
grub_uint32_t count = g_valid_initrd_count; grub_uint32_t count = g_valid_initrd_count;
if (g_conf_replace_offset > 0) if (g_conf_replace_count > 0)
{ {
count++; for (i = 0; i < g_conf_replace_count; i++)
{
if (g_conf_replace_offset[i] > 0)
{
count++;
}
}
} }
if (g_svd_replace_offset > 0) if (g_svd_replace_offset > 0)
@@ -812,11 +933,18 @@ static grub_uint32_t ventoy_linux_get_override_chunk_count(void)
static grub_uint32_t ventoy_linux_get_override_chunk_size(void) static grub_uint32_t ventoy_linux_get_override_chunk_size(void)
{ {
int i;
int count = g_valid_initrd_count; int count = g_valid_initrd_count;
if (g_conf_replace_offset > 0) if (g_conf_replace_count > 0)
{ {
count++; for (i = 0; i < g_conf_replace_count; i++)
{
if (g_conf_replace_offset[i] > 0)
{
count++;
}
}
} }
if (g_svd_replace_offset > 0) if (g_svd_replace_offset > 0)
@@ -829,6 +957,7 @@ static grub_uint32_t ventoy_linux_get_override_chunk_size(void)
static void ventoy_linux_fill_override_data( grub_uint64_t isosize, void *override) static void ventoy_linux_fill_override_data( grub_uint64_t isosize, void *override)
{ {
int i;
initrd_info *node; initrd_info *node;
grub_uint32_t mod; grub_uint32_t mod;
grub_uint32_t newlen; grub_uint32_t newlen;
@@ -883,21 +1012,27 @@ static void ventoy_linux_fill_override_data( grub_uint64_t isosize, void *ove
cur++; cur++;
} }
if (g_conf_replace_offset > 0) if (g_conf_replace_count > 0)
{ {
cur->img_offset = g_conf_replace_offset; for (i = 0; i < g_conf_replace_count; i++)
cur->override_size = sizeof(ventoy_iso9660_override); {
if (g_conf_replace_offset[i] > 0)
{
cur->img_offset = g_conf_replace_offset[i];
cur->override_size = sizeof(ventoy_iso9660_override);
newlen = (grub_uint32_t)(g_conf_replace_new_len); newlen = (grub_uint32_t)(g_conf_replace_new_len[i]);
dirent = (ventoy_iso9660_override *)cur->override_data; dirent = (ventoy_iso9660_override *)cur->override_data;
dirent->first_sector = (grub_uint32_t)sector; dirent->first_sector = (grub_uint32_t)sector;
dirent->size = newlen; dirent->size = newlen;
dirent->first_sector_be = grub_swap_bytes32(dirent->first_sector); dirent->first_sector_be = grub_swap_bytes32(dirent->first_sector);
dirent->size_be = grub_swap_bytes32(dirent->size); dirent->size_be = grub_swap_bytes32(dirent->size);
sector += (dirent->size + 2047) / 2048; sector += (dirent->size + 2047) / 2048;
cur++; cur++;
}
}
} }
if (g_svd_replace_offset > 0) if (g_svd_replace_offset > 0)
@@ -1437,7 +1572,6 @@ grub_err_t ventoy_cmd_trailer_cpio(grub_extcmd_context_t ctxt, int argc, char **
grub_uint8_t *bufend; grub_uint8_t *bufend;
cpio_newc_header *head; cpio_newc_header *head;
grub_file_t file; grub_file_t file;
char value[64];
const grub_uint8_t trailler[124] = { const grub_uint8_t trailler[124] = {
0x30, 0x37, 0x30, 0x37, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 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, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
@@ -1509,10 +1643,7 @@ grub_err_t ventoy_cmd_trailer_cpio(grub_extcmd_context_t ctxt, int argc, char **
} }
} }
grub_snprintf(value, sizeof(value), "0x%llx", (ulonglong)(ulong)g_ventoy_cpio_buf); ventoy_memfile_env_set("ventoy_cpio", g_ventoy_cpio_buf, (ulonglong)bufsize);
ventoy_set_env("ventoy_cpio_addr", value);
grub_snprintf(value, sizeof(value), "%d", bufsize);
ventoy_set_env("ventoy_cpio_size", value);
VENTOY_CMD_RETURN(GRUB_ERR_NONE); VENTOY_CMD_RETURN(GRUB_ERR_NONE);
} }
@@ -1534,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 *pLastChain = NULL;
const char *compatible; const char *compatible;
ventoy_chain_head *chain; ventoy_chain_head *chain;
char envbuf[64];
(void)ctxt; (void)ctxt;
(void)argc; (void)argc;
@@ -1622,10 +1752,7 @@ grub_err_t ventoy_cmd_linux_chain_data(grub_extcmd_context_t ctxt, int argc, cha
return 1; return 1;
} }
grub_snprintf(envbuf, sizeof(envbuf), "0x%lx", (unsigned long)chain); ventoy_memfile_env_set("vtoy_chain_mem", chain, (ulonglong)size);
grub_env_set("vtoy_chain_mem_addr", envbuf);
grub_snprintf(envbuf, sizeof(envbuf), "%u", size);
grub_env_set("vtoy_chain_mem_size", envbuf);
grub_memset(chain, 0, sizeof(ventoy_chain_head)); grub_memset(chain, 0, sizeof(ventoy_chain_head));
@@ -1676,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); 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

@@ -3054,14 +3054,15 @@ int ventoy_plugin_get_image_list_index(int type, const char *name)
return 0; return 0;
} }
conf_replace * ventoy_plugin_find_conf_replace(const char *iso) int ventoy_plugin_find_conf_replace(const char *iso, conf_replace *nodes[VTOY_MAX_CONF_REPLACE])
{ {
int n = 0;
int len; int len;
conf_replace *node; conf_replace *node;
if (!g_conf_replace_head) if (!g_conf_replace_head)
{ {
return NULL; return 0;
} }
len = (int)grub_strlen(iso); len = (int)grub_strlen(iso);
@@ -3070,11 +3071,15 @@ conf_replace * ventoy_plugin_find_conf_replace(const char *iso)
{ {
if (node->pathlen == len && ventoy_strncmp(node->isopath, iso, len) == 0) if (node->pathlen == len && ventoy_strncmp(node->isopath, iso, len) == 0)
{ {
return node; nodes[n++] = node;
if (n >= VTOY_MAX_CONF_REPLACE)
{
return n;
}
} }
} }
return NULL; return n;
} }
dud * ventoy_plugin_find_dud(const char *iso) dud * ventoy_plugin_find_dud(const char *iso)

View File

@@ -445,12 +445,16 @@ grub_err_t ventoy_cmd_parse_freenas_ver(grub_extcmd_context_t ctxt, int argc, ch
ver = vtoy_json_get_string_ex(json->pstChild, "Version"); ver = vtoy_json_get_string_ex(json->pstChild, "Version");
if (ver) if (ver)
{ {
debug("freenas version:<%s>\n", ver); debug("NAS version:<%s>\n", ver);
if (grub_strncmp(ver, "TrueNAS-", 8) == 0)
{
ver += 8;
}
ventoy_set_env(args[1], ver); ventoy_set_env(args[1], ver);
} }
else else
{ {
debug("freenas version:<%s>\n", "NOT FOUND"); debug("NAS version:<%s>\n", "NOT FOUND");
grub_env_unset(args[1]); grub_env_unset(args[1]);
} }
@@ -1114,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 *pLastChain = NULL;
const char *compatible; const char *compatible;
ventoy_chain_head *chain; ventoy_chain_head *chain;
char envbuf[64];
(void)ctxt; (void)ctxt;
(void)argc; (void)argc;
@@ -1193,10 +1196,7 @@ grub_err_t ventoy_cmd_unix_chain_data(grub_extcmd_context_t ctxt, int argc, char
return 1; return 1;
} }
grub_snprintf(envbuf, sizeof(envbuf), "0x%lx", (unsigned long)chain); ventoy_memfile_env_set("vtoy_chain_mem", chain, (ulonglong)size);
grub_env_set("vtoy_chain_mem_addr", envbuf);
grub_snprintf(envbuf, sizeof(envbuf), "%u", size);
grub_env_set("vtoy_chain_mem_size", envbuf);
grub_memset(chain, 0, sizeof(ventoy_chain_head)); 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]; int patchoffset[2];
ventoy_patch_vhd *patch1; ventoy_patch_vhd *patch1;
ventoy_patch_vhd *patch2; ventoy_patch_vhd *patch2;
char envbuf[64];
(void)ctxt; (void)ctxt;
(void)argc; (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 */ /* set buffer and size */
#ifdef GRUB_MACHINE_EFI #ifdef GRUB_MACHINE_EFI
grub_snprintf(envbuf, sizeof(envbuf), "0x%lx", (ulong)g_vhdboot_totbuf); ventoy_memfile_env_set("vtoy_vhd_buf", g_vhdboot_totbuf, (ulonglong)(g_vhdboot_isolen + sizeof(ventoy_chain_head)));
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);
#else #else
grub_snprintf(envbuf, sizeof(envbuf), "0x%lx", (ulong)g_vhdboot_isobuf); ventoy_memfile_env_set("vtoy_vhd_buf", g_vhdboot_isobuf, (ulonglong)g_vhdboot_isolen);
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);
#endif #endif
VENTOY_CMD_RETURN(GRUB_ERR_NONE); 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; grub_disk_t disk;
const char *pLastChain = NULL; const char *pLastChain = NULL;
ventoy_chain_head *chain; ventoy_chain_head *chain;
char envbuf[64];
(void)ctxt; (void)ctxt;
(void)argc; (void)argc;
@@ -695,10 +687,7 @@ grub_err_t ventoy_cmd_raw_chain_data(grub_extcmd_context_t ctxt, int argc, char
return 1; return 1;
} }
grub_snprintf(envbuf, sizeof(envbuf), "0x%lx", (unsigned long)chain); ventoy_memfile_env_set("vtoy_chain_mem", chain, (ulonglong)size);
grub_env_set("vtoy_chain_mem_addr", envbuf);
grub_snprintf(envbuf, sizeof(envbuf), "%u", size);
grub_env_set("vtoy_chain_mem_size", envbuf);
grub_env_export("vtoy_chain_mem_addr"); grub_env_export("vtoy_chain_mem_addr");
grub_env_export("vtoy_chain_mem_size"); 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; 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) grub_err_t ventoy_cmd_locate_wim_patch(grub_extcmd_context_t ctxt, int argc, char **args)
{ {
int datalen = 0; int datalen = 0;
@@ -1790,19 +1894,150 @@ end:
return rc; 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) 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 datalen = 0;
int dataflag = 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; const char *addr = NULL;
ventoy_chain_head *chain = NULL; ventoy_chain_head *chain = NULL;
ventoy_os_param *param = NULL; grub_uint8_t *param = NULL;
char envbuf[64]; grub_uint8_t *exe_data = NULL;
ventoy_windows_data *rtdata = NULL;
char exename[128] = {0};
wim_tail wim_data;
(void)ctxt; (void)ctxt;
(void)argc; (void)argc;
(void)args;
addr = grub_env_get("vtoy_chain_mem_addr"); addr = grub_env_get("vtoy_chain_mem_addr");
if (!addr) if (!addr)
@@ -1821,23 +2056,29 @@ 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); datalen = ventoy_get_windows_rtdata_len(chain->os_param.vtoy_img_path, &dataflag);
size = sizeof(ventoy_os_param) + datalen; rc = ventoy_extract_init_exe(args[0], &exe_data, &exe_len, exename);
param = (ventoy_os_param *)grub_zalloc(size); if (rc)
if (!param)
{ {
return 1; return 1;
} }
wim64 = ventoy_is_pe64(exe_data);
grub_memcpy(param, &chain->os_param, sizeof(ventoy_os_param)); grub_memset(&wim_data, 0, sizeof(wim_data));
ventoy_fill_windows_rtdata(param + 1, param->vtoy_img_path, dataflag); ventoy_cat_exe_file_data(&wim_data, exe_len, exe_data, datalen);
grub_check_free(exe_data);
grub_snprintf(envbuf, sizeof(envbuf), "0x%lx", (unsigned long)param); jump_align = ventoy_align(wim_data.jump_exe_len, 16);
grub_env_set("vtoy_wimboot_mem_addr", envbuf); param = wim_data.jump_bin_data;
debug("vtoy_wimboot_mem_addr: %s\n", envbuf);
grub_snprintf(envbuf, sizeof(envbuf), "%u", size); grub_memcpy(param + jump_align, &chain->os_param, sizeof(ventoy_os_param));
grub_env_set("vtoy_wimboot_mem_size", envbuf);
debug("vtoy_wimboot_mem_size: %s\n", envbuf); 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");
VENTOY_CMD_RETURN(GRUB_ERR_NONE); 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 *pLastChain = NULL;
const char *compatible; const char *compatible;
ventoy_chain_head *chain; ventoy_chain_head *chain;
char envbuf[64];
(void)ctxt; (void)ctxt;
(void)argc; (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) if (0 == ventoy_compatible && g_wim_valid_patch_count == 0)
{ {
unknown_image = 1; 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]); 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; return 1;
} }
grub_snprintf(envbuf, sizeof(envbuf), "0x%lx", (unsigned long)chain); ventoy_memfile_env_set("vtoy_chain_mem", chain, (ulonglong)size);
grub_env_set("vtoy_chain_mem_addr", envbuf);
grub_snprintf(envbuf, sizeof(envbuf), "%u", size);
grub_env_set("vtoy_chain_mem_size", envbuf);
grub_memset(chain, 0, sizeof(ventoy_chain_head)); 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; 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_err_t ventoy_cmd_wim_check_bootable(grub_extcmd_context_t ctxt, int argc, char **args)
{ {
grub_uint32_t boot_index; 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_img_chunk *chunknode;
ventoy_override_chunk *override; ventoy_override_chunk *override;
ventoy_img_chunk_list wimchunk; ventoy_img_chunk_list wimchunk;
char envbuf[128];
debug("vlnk wim chain data begin <%s> ...\n", wimfile->name); 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; return 1;
} }
grub_snprintf(envbuf, sizeof(envbuf), "0x%lx", (unsigned long)chain); ventoy_memfile_env_set("vtoy_chain_mem", chain, (ulonglong)size);
grub_env_set("vtoy_chain_mem_addr", envbuf);
grub_snprintf(envbuf, sizeof(envbuf), "%u", size);
grub_env_set("vtoy_chain_mem_size", envbuf);
grub_memset(chain, 0, sizeof(ventoy_chain_head)); 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_img_chunk *chunknode;
ventoy_override_chunk *override; ventoy_override_chunk *override;
ventoy_img_chunk_list wimchunk; ventoy_img_chunk_list wimchunk;
char envbuf[128];
debug("normal wim chain data begin <%s> ...\n", wimfile->name); 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; return 1;
} }
grub_snprintf(envbuf, sizeof(envbuf), "0x%lx", (unsigned long)chain); ventoy_memfile_env_set("vtoy_chain_mem", chain, (ulonglong)size);
grub_env_set("vtoy_chain_mem_addr", envbuf);
grub_snprintf(envbuf, sizeof(envbuf), "%u", size);
grub_env_set("vtoy_chain_mem_size", envbuf);
grub_memset(chain, 0, sizeof(ventoy_chain_head)); grub_memset(chain, 0, sizeof(ventoy_chain_head));

View File

@@ -262,6 +262,7 @@ typedef struct ventoy_img_chunk_list
#pragma pack(1) #pragma pack(1)
#define VTOY_MAX_CONF_REPLACE 2
#define GRUB_FILE_REPLACE_MAGIC 0x1258BEEF #define GRUB_FILE_REPLACE_MAGIC 0x1258BEEF
#define GRUB_IMG_REPLACE_MAGIC 0x1259BEEF #define GRUB_IMG_REPLACE_MAGIC 0x1259BEEF
@@ -282,7 +283,7 @@ typedef struct ventoy_grub_param
grub_env_get_pf grub_env_get; grub_env_get_pf grub_env_get;
grub_env_set_pf grub_env_set; grub_env_set_pf grub_env_set;
ventoy_grub_param_file_replace file_replace; ventoy_grub_param_file_replace file_replace;
ventoy_grub_param_file_replace img_replace; ventoy_grub_param_file_replace img_replace[VTOY_MAX_CONF_REPLACE];
grub_env_printf_pf grub_env_printf; grub_env_printf_pf grub_env_printf;
}ventoy_grub_param; }ventoy_grub_param;
@@ -303,6 +304,7 @@ grub_uint64_t grub_udf_get_last_file_attr_offset
grub_uint64_t *fe_entry_size_offset grub_uint64_t *fe_entry_size_offset
); );
int ventoy_is_efi_os(void); int ventoy_is_efi_os(void);
void ventoy_memfile_env_set(const char *prefix, const void *buf, unsigned long long len);
#endif /* __VENTOY_H__ */ #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 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 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*) KoName=$(ls $VTOY_PATH/mnt/squashfs/lib/modules/$2/kernel/drivers/md/dm-mod.ko*)
vtlog "insmod $KoName" vtlog "insmod $KoName"

View File

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

View File

@@ -24,6 +24,9 @@ if $GREP -q kaspersky /proc/version; then
if [ -f /ventoy/ventoy_persistent_map ]; then if [ -f /ventoy/ventoy_persistent_map ]; then
$SED "/sysresccd_parsecmdline[^(]*$/a\ BACKSTORE_CMD='LABEL=casper-rw,noloop'" -i /init $SED "/sysresccd_parsecmdline[^(]*$/a\ BACKSTORE_CMD='LABEL=casper-rw,noloop'" -i /init
fi 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 elif [ -d /etc/udev/rules.d ] || [ -d /lib/udev/rules.d ]; then
ventoy_systemd_udevd_work_around ventoy_systemd_udevd_work_around
ventoy_add_udev_rule "$VTOY_PATH/hook/default/udev_disk_hook.sh %k noreplace" ventoy_add_udev_rule "$VTOY_PATH/hook/default/udev_disk_hook.sh %k noreplace"

View File

@@ -0,0 +1,118 @@
#!/ventoy/busybox/sh
#************************************************************************************
# Copyright (c) 2020, longpanda <admin@ventoy.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
#************************************************************************************
. /ventoy/hook/ventoy-hook-lib.sh
vtlog "######### $0 $* ############"
VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
ventoy_os_install_dmsetup_by_fuse() {
vtlog "ventoy_os_install_dmsetup_by_fuse $*"
mkdir -p $VTOY_PATH/mnt/fuse $VTOY_PATH/mnt/iso $VTOY_PATH/mnt/squashfs
vtoydm -p -f $VTOY_PATH/ventoy_image_map -d $1 > $VTOY_PATH/ventoy_dm_table
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
sfsfile=$VTOY_PATH/mnt/iso/kdeos/x86_64/root-image.sqfs
mount -t squashfs $sfsfile $VTOY_PATH/mnt/squashfs
kVer=$(uname -r)
KoName=$(ls $VTOY_PATH/mnt/squashfs/lib/modules/$kVer/kernel/drivers/md/dm-mod.ko*)
vtlog "insmod $KoName"
if echo $KoName | grep -q '\.zst'; then
zstdcat $KoName > $VTOY_PATH/dm-mod.ko
insmod $VTOY_PATH/dm-mod.ko
else
insmod $KoName
fi
ventoy_check_umount $VTOY_PATH/mnt/squashfs
ventoy_check_umount $VTOY_PATH/mnt/iso
ventoy_check_umount $VTOY_PATH/mnt/fuse
vtlog "umount done"
}
if is_ventoy_hook_finished; then
exit 0
fi
wait_for_usb_disk_ready
vtdiskname=$(get_ventoy_disk_name)
if [ "$vtdiskname" = "unknown" ]; then
vtlog "ventoy disk not found"
exit 0
fi
if grep -q 'device-mapper' /proc/devices; then
vtlog "device-mapper module exist"
else
ventoy_os_install_dmsetup_by_fuse $vtdiskname
fi
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/')
vtDM=$(ventoy_find_dm_id ${blkdev_num})
vtlog "blkdev_num=$blkdev_num vtDM=$vtDM ..."
while [ -n "Y" ]; do
if [ -b /dev/$vtDM ]; then
break
else
sleep 0.3
fi
done
if [ -n "$1" ]; then
vtlog "ln -s /dev/$vtDM $1"
if [ -e "$1" ]; then
vtlog "$1 already exist"
else
ln -s /dev/$vtDM "$1"
fi
else
vtLABEL=$($BUSYBOX_PATH/blkid /dev/$vtDM | $SED 's/.*LABEL="\([^"]*\)".*/\1/')
vtlog "vtLABEL is $vtLABEL"
if [ -z "$vtLABEL" ]; then
vtLABEL=$($SED "s/.*label=\([^ ]*\)/\1/" /proc/cmdline)
vtlog "vtLABEL is $vtLABEL from cmdline"
fi
if [ -e "/dev/disk/by-label/$vtLABEL" ]; then
vtlog "$1 already exist"
else
ln -s /dev/$vtDM "/dev/disk/by-label/$vtLABEL"
fi
fi
PATH=$VTPATH_OLD
# OK finish
set_ventoy_hook_finish

View File

@@ -2,5 +2,14 @@
. $VTOY_PATH/hook/ventoy-os-lib.sh . $VTOY_PATH/hook/ventoy-os-lib.sh
ventoy_systemd_udevd_work_around if $GREP -q '^"$mount_handler"' /init; then
ventoy_add_udev_rule "$VTOY_PATH/hook/kaos/udev_disk_hook.sh %k" echo 'use mount_handler1 ...' >> $VTLOG
$SED "/^\"\$mount_handler\"/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/kaos/ventoy-disk.sh" -i /init
elif $GREP -q '^$mount_handler' /init; then
echo 'use mount_handler2 ...' >> $VTLOG
$SED "/^\$mount_handler/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/kaos/ventoy-disk.sh" -i /init
fi
if [ -f $VTOY_PATH/ventoy_persistent_map ]; then
$SED "1 aexport cow_label=vtoycow" -i /init
fi

View File

@@ -1,6 +1,6 @@
#!/ventoy/busybox/sh #!/bin/sh
#************************************************************************************ #************************************************************************************
# Copyright (c) 2020, longpanda <admin@ventoy.net> # Copyright (c) 2022, longpanda <admin@ventoy.net>
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as # modify it under the terms of the GNU General Public License as
@@ -17,23 +17,8 @@
# #
#************************************************************************************ #************************************************************************************
. /ventoy/hook/ventoy-hook-lib.sh if [ -f /run/install/ks.cfg ]; then
sh /ventoy/hook/default/auto_install_varexp.sh /run/install/ks.cfg
if is_ventoy_hook_finished || not_ventoy_disk "${1:0:-1}"; then
exit 0
fi fi
VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH exit 0
modprobe fuse
mkdir -p $VTOY_PATH/mnt/fuse $VTOY_PATH/mnt/iso
vtoydm -p -f $VTOY_PATH/ventoy_image_map -d "/dev/${1:0:-1}" > $VTOY_PATH/ventoy_dm_table
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
# OK finish
set_ventoy_hook_finish
PATH=$VTPATH_OLD

View File

@@ -24,18 +24,21 @@ if [ -f $VTOY_PATH/autoinstall ]; then
else else
for vtParam in $($CAT /proc/cmdline); do for vtParam in $($CAT /proc/cmdline); do
if echo $vtParam | $GREP -q 'inst.ks=hd:LABEL='; then if echo $vtParam | $GREP -q 'inst.ks=hd:LABEL='; then
vtRawKsFull="$vtParam"
vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}') vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}')
VTKS="inst.ks=hd:/dev/ventoy:$vtRawKs" VTKS="inst.ks=hd:/dev/ventoy:$vtRawKs"
break break
fi fi
if echo $vtParam | $GREP -q '^ks=.*:/'; then if echo $vtParam | $GREP -q '^ks=.*:/'; then
vtRawKsFull="$vtParam"
vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}') vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}')
VTKS="ks=hd:/dev/ventoy:$vtRawKs" VTKS="ks=hd:/dev/ventoy:$vtRawKs"
break break
fi fi
if echo $vtParam | $GREP -q '^inst.ks=.*:/'; then if echo $vtParam | $GREP -q '^inst.ks=.*:/'; then
vtRawKsFull="$vtParam"
vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}') vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}')
VTKS="inst.ks=hd:/dev/ventoy:$vtRawKs" VTKS="inst.ks=hd:/dev/ventoy:$vtRawKs"
break break
@@ -63,7 +66,13 @@ fi
echo "VTKS=$VTKS VTOVERLAY=$VTOVERLAY" >> $VTLOG echo "VTKS=$VTKS VTOVERLAY=$VTOVERLAY" >> $VTLOG
if [ -n "$vtRawKs" ]; then if [ -n "$vtRawKs" ]; then
echo "$vtRawKs" > $VTOY_PATH/ventoy_ks_rootpath if echo $vtRawKsFull | $EGREP -q "=http|=https|=ftp|=nfs|=hmc"; then
echo "vtRawKsFull=$vtRawKsFull no patch needed." >> $VTLOG
vtRawKs=""
VTKS=""
else
echo "$vtRawKs" > $VTOY_PATH/ventoy_ks_rootpath
fi
fi fi
if ls $VTOY_PATH | $GREP -q 'ventoy_dud[0-9]'; then if ls $VTOY_PATH | $GREP -q 'ventoy_dud[0-9]'; then
@@ -98,3 +107,7 @@ if [ -f /usr/sbin/anaconda-diskroot ]; then
$SED 's/^mount $dev $repodir/mount -oro $dev $repodir/' -i /usr/sbin/anaconda-diskroot $SED 's/^mount $dev $repodir/mount -oro $dev $repodir/' -i /usr/sbin/anaconda-diskroot
fi fi
if [ -f $VTOY_PATH/autoinstall ]; then
cp -a $VTOY_PATH/hook/openEuler/ventoy-autoexp.sh /lib/dracut/hooks/pre-mount/99-ventoy-autoexp.sh
fi

View File

@@ -51,6 +51,9 @@ if is_inotify_ventoy_part $3; then
if [ -e /sbin/anaconda-diskroot ]; then if [ -e /sbin/anaconda-diskroot ]; then
vtlog "set anaconda-diskroot ..." 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 /sbin/anaconda-diskroot /dev/ventoy
fi fi

View File

@@ -39,6 +39,9 @@ fi
if [ -e /sbin/anaconda-diskroot ]; then if [ -e /sbin/anaconda-diskroot ]; then
vtlog "set anaconda-diskroot /dev/ventoy ..." 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 /sbin/anaconda-diskroot /dev/ventoy
fi fi

View File

@@ -26,19 +26,26 @@ if [ -f $VTOY_PATH/autoinstall ]; then
VTKS="inst.ks=file:$VTOY_PATH/autoinstall" VTKS="inst.ks=file:$VTOY_PATH/autoinstall"
else else
for vtParam in $($CAT /proc/cmdline); do 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 if echo $vtParam | $GREP -q 'inst.ks=hd:LABEL='; then
vtRawKsFull="$vtParam"
vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}') vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}')
VTKS="inst.ks=hd:/dev/ventoy:$vtRawKs" VTKS="inst.ks=hd:/dev/ventoy:$vtRawKs"
break break
fi fi
if echo $vtParam | $GREP -q '^ks=.*:/'; then if echo $vtParam | $GREP -q '^ks=.*:/'; then
vtRawKsFull="$vtParam"
vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}') vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}')
VTKS="ks=hd:/dev/ventoy:$vtRawKs" VTKS="ks=hd:/dev/ventoy:$vtRawKs"
break break
fi fi
if echo $vtParam | $GREP -q '^inst.ks=.*:/'; then if echo $vtParam | $GREP -q '^inst.ks=.*:/'; then
vtRawKsFull="$vtParam"
vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}') vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}')
VTKS="inst.ks=hd:/dev/ventoy:$vtRawKs" VTKS="inst.ks=hd:/dev/ventoy:$vtRawKs"
break break
@@ -67,7 +74,13 @@ fi
echo "VTKS=$VTKS VTOVERLAY=$VTOVERLAY" >> $VTLOG echo "VTKS=$VTKS VTOVERLAY=$VTOVERLAY" >> $VTLOG
if [ -n "$vtRawKs" ]; then if [ -n "$vtRawKs" ]; then
echo "$vtRawKs" > $VTOY_PATH/ventoy_ks_rootpath if echo $vtRawKsFull | $EGREP -q "=http|=https|=ftp|=nfs|=hmc"; then
echo "vtRawKsFull=$vtRawKsFull no patch needed." >> $VTLOG
vtRawKs=""
VTKS=""
else
echo "$vtRawKs" > $VTOY_PATH/ventoy_ks_rootpath
fi
fi fi
if ls $VTOY_PATH | $GREP -q 'ventoy_dud[0-9]'; then if ls $VTOY_PATH | $GREP -q 'ventoy_dud[0-9]'; then
@@ -128,6 +141,12 @@ if [ -e /usr/sbin/anaconda-diskroot ]; then
$SED 's/^mount $dev $repodir/mount -oro $dev $repodir/' -i /usr/sbin/anaconda-diskroot $SED 's/^mount $dev $repodir/mount -oro $dev $repodir/' -i /usr/sbin/anaconda-diskroot
fi fi
#For Fedora CoreOS
if $GREP -i -q 'fedora.*coreos' /etc/os-release; then
$SED "s#isosrc=.*#isosrc=/dev/mapper/ventoy#" -i /lib/systemd/system-generators/live-generator
cp -a $VTOY_PATH/hook/rhel7/ventoy-make-link.sh /lib/dracut/hooks/pre-mount/99-ventoy-premount-mklink.sh
fi
if [ -f $VTOY_PATH/autoinstall ]; then if [ -f $VTOY_PATH/autoinstall ]; then
cp -a $VTOY_PATH/hook/rhel7/ventoy-autoexp.sh /lib/dracut/hooks/pre-mount/99-ventoy-autoexp.sh cp -a $VTOY_PATH/hook/rhel7/ventoy-autoexp.sh /lib/dracut/hooks/pre-mount/99-ventoy-autoexp.sh
fi fi

View File

@@ -49,7 +49,12 @@ if is_inotify_ventoy_part $3; then
if [ -e $vtGenRulFile ] && $GREP -q dmsquash $vtGenRulFile; then if [ -e $vtGenRulFile ] && $GREP -q dmsquash $vtGenRulFile; then
vtScript=$($GREP -m1 'RUN.=' $vtGenRulFile | $AWK -F'RUN.=' '{print $2}' | $SED 's/"\(.*\)".*/\1/') vtScript=$($GREP -m1 'RUN.=' $vtGenRulFile | $AWK -F'RUN.=' '{print $2}' | $SED 's/"\(.*\)".*/\1/')
vtlog "vtScript=$vtScript" vtlog "vtScript=$vtScript"
$vtScript
if $GREP -q SCRE /proc/cmdline; then
/sbin/dmsquash-live-root /dev/ventoy
else
$vtScript
fi
else else
vtlog "$vtGenRulFile not exist..." vtlog "$vtGenRulFile not exist..."
fi fi
@@ -65,6 +70,9 @@ if is_inotify_ventoy_part $3; then
if [ -e /sbin/anaconda-diskroot ]; then if [ -e /sbin/anaconda-diskroot ]; then
vtlog "set anaconda-diskroot ..." 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 /sbin/anaconda-diskroot /dev/ventoy
fi fi

View File

@@ -39,6 +39,9 @@ fi
if [ -e /sbin/anaconda-diskroot ]; then if [ -e /sbin/anaconda-diskroot ]; then
vtlog "set anaconda-diskroot /dev/ventoy ..." 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 /sbin/anaconda-diskroot /dev/ventoy
fi fi

View File

@@ -278,11 +278,23 @@ ventoy_dm_patch() {
$CAT /proc/kallsyms | $BUSYBOX_PATH/sort > $VTOY_PATH/kallsyms $CAT /proc/kallsyms | $BUSYBOX_PATH/sort > $VTOY_PATH/kallsyms
vtLine=$($VTOY_PATH/tool/vtoyksym dm_get_table_device $VTOY_PATH/kallsyms) if $GREP -m1 -q 'open_table_device.isra' $VTOY_PATH/kallsyms; then
vtLine=$($VTOY_PATH/tool/vtoyksym open_table_device.isra $VTOY_PATH/kallsyms)
vtlog "get open_table_device.isra address $vtLine"
else
vtLine=$($VTOY_PATH/tool/vtoyksym dm_get_table_device $VTOY_PATH/kallsyms)
vtlog "get dm_get_table_device address $vtLine"
fi
get_addr=$(echo $vtLine | $AWK '{print $1}') get_addr=$(echo $vtLine | $AWK '{print $1}')
get_size=$(echo $vtLine | $AWK '{print $2}') get_size=$(echo $vtLine | $AWK '{print $2}')
vtLine=$($VTOY_PATH/tool/vtoyksym dm_put_table_device $VTOY_PATH/kallsyms) if $GREP -m1 -q 'close_table_device.isra' $VTOY_PATH/kallsyms; then
vtLine=$($VTOY_PATH/tool/vtoyksym close_table_device.isra $VTOY_PATH/kallsyms)
vtlog "get close_table_device.isra address $vtLine"
else
vtLine=$($VTOY_PATH/tool/vtoyksym dm_put_table_device $VTOY_PATH/kallsyms)
vtlog "get dm_put_table_device address $vtLine"
fi
put_addr=$(echo $vtLine | $AWK '{print $1}') put_addr=$(echo $vtLine | $AWK '{print $1}')
put_size=$(echo $vtLine | $AWK '{print $2}') put_size=$(echo $vtLine | $AWK '{print $2}')
@@ -738,6 +750,7 @@ ventoy_udev_disk_common_hook() {
fi fi
if $GREP -q 'dm_patch' /proc/modules; then if $GREP -q 'dm_patch' /proc/modules; then
vtlog "remove dm_patch module."
$BUSYBOX_PATH/rmmod dm_patch $BUSYBOX_PATH/rmmod dm_patch
fi fi
} }
@@ -868,3 +881,14 @@ ventoy_check_install_module_xz() {
$BUSYBOX_PATH/insmod "$1" $BUSYBOX_PATH/insmod "$1"
fi fi
} }
ventoy_check_umount() {
for vtLoop in 0 1 2 3 4 5 6 7 8 9; do
$BUSYBOX_PATH/umount "$1" > /dev/null 2>&1
if $BUSYBOX_PATH/mountpoint -q "$1"; then
$SLEEP 1
else
break
fi
done
}

View File

@@ -37,9 +37,38 @@ if [ "$vtdiskname" = "unknown" ]; then
fi fi
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace" ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
ventoy_create_dev_ventoy_part 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 PATH=$VTPATH_OLD
set_ventoy_hook_finish 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 "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 #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 $SED "s#/sys/block/\${WKG_DRV}/#/sys/block/\$vtDM/#g" -i /init

View File

@@ -362,6 +362,13 @@ ventoy_get_os_type() {
fi fi
#Kylin V10 Server
if [ -f /usr/sbin/dhclient ]; then
if $BUSYBOX_PATH/strings /usr/sbin/dhclient | $GREP -i -q -m1 openeuler; then
echo 'openEuler'; return
fi
fi
echo "default" echo "default"
} }

View File

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

View File

@@ -18,6 +18,18 @@ print_usage() {
echo '' 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 while [ -n "$1" ]; do
if [ "$1" = "-s" ]; then if [ "$1" = "-s" ]; then
shift shift

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

@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
print_usage() { print_usage() {
echo 'Usage: ExtendPersistentImg.sh file size' echo 'Usage: ExtendPersistentImg.sh file size'
@@ -19,6 +19,18 @@ if [ -z "$2" ]; then
exit 1 exit 1
fi 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 file=$1
size=$2 size=$2

View File

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

View File

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

Binary file not shown.

View File

@@ -158,7 +158,7 @@ function get_os_type {
function vt_check_compatible_pe { function vt_check_compatible_pe {
#Check for PE without external tools #Check for PE without external tools
#set compatible if ISO file is less than 80MB #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 set ventoy_compatible=YES
fi fi
@@ -381,6 +381,8 @@ function distro_specify_initrd_file_phase2 {
vt_linux_specify_initrd_file /sysresccd/boot/i686/sysresccd.img vt_linux_specify_initrd_file /sysresccd/boot/i686/sysresccd.img
elif [ -f (loop)/boot/full.cz ]; then elif [ -f (loop)/boot/full.cz ]; then
vt_linux_specify_initrd_file /boot/full.cz vt_linux_specify_initrd_file /boot/full.cz
elif [ -f (loop)/images/pxeboot/initrd.img ]; then
vt_linux_specify_initrd_file /images/pxeboot/initrd.img
fi fi
} }
@@ -597,8 +599,12 @@ function ventoy_unix_comm_proc {
function uefi_windows_menu_func { function uefi_windows_menu_func {
vt_windows_reset 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 if [ "$ventoy_fs_probe" = "iso9660" ]; then
loopback -d loop loopback -d loop
vt_iso9660_nojoliet 1 vt_iso9660_nojoliet 1
@@ -621,8 +627,8 @@ function uefi_windows_menu_func {
vt_windows_chain_data "${1}${chosen_path}" vt_windows_chain_data "${1}${chosen_path}"
ventoy_debug_pause ventoy_debug_pause
if vt_check_mode 4 "$vt_chosen_name"; then if [ "$vt_cur_wimboot_mode" = "1" ]; then
vtoy_windows_wimboot_func vtoy_wimboot_func
fi fi
if [ -n "$vtoy_chain_mem_addr" ]; then if [ -n "$vtoy_chain_mem_addr" ]; then
@@ -768,7 +774,7 @@ function uefi_linux_menu_func {
vt_linux_chain_data "${1}${chosen_path}" 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 if [ -f (loop)/efi/clover/cloverx64.efi ]; then
unset LoadIsoEfiDriver unset LoadIsoEfiDriver
fi fi
@@ -781,6 +787,10 @@ function uefi_linux_menu_func {
unset vtGrub2Mode unset vtGrub2Mode
if vt_check_mode 3 "$vt_chosen_name"; then if vt_check_mode 3 "$vt_chosen_name"; then
set vtGrub2Mode=1 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 elif vt_str_begin "$vt_volume_id" "KRD"; then
if [ -f (loop)/boot/grub/grub.cfg.sig ]; then if [ -f (loop)/boot/grub/grub.cfg.sig ]; then
set vtGrub2Mode=1 set vtGrub2Mode=1
@@ -814,6 +824,18 @@ function uefi_linux_menu_func {
break break
fi fi
done 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 if [ "$vtback_cfg_find" = "0" ]; then
echo " " echo " "
@@ -910,6 +932,15 @@ function uefi_iso_menu_func {
vt_check_compatible (loop) vt_check_compatible (loop)
fi 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}" vt_img_sector "${1}${chosen_path}"
if [ "$ventoy_fs_probe" = "iso9660" ]; then if [ "$ventoy_fs_probe" = "iso9660" ]; then
@@ -927,6 +958,7 @@ function uefi_iso_menu_func {
fi fi
ventoy_gui_console ventoy_gui_console
vt_secondary_recover_mode
} }
function uefi_iso_memdisk { function uefi_iso_memdisk {
@@ -940,8 +972,7 @@ function uefi_iso_memdisk {
ventoy_gui_console ventoy_gui_console
} }
function vtoy_windows_wimboot {
function vtoy_windows_wimboot_func {
if [ -f (loop)/x86/sources/boot.wim -a -f (loop)/x64/sources/boot.wim ]; then if [ -f (loop)/x86/sources/boot.wim -a -f (loop)/x64/sources/boot.wim ]; then
vt_sel_wimboot vtoy_wimboot_bit vt_sel_wimboot vtoy_wimboot_bit
if [ "$vtoy_wimboot_bit" = "32" ]; then if [ "$vtoy_wimboot_bit" = "32" ]; then
@@ -959,43 +990,24 @@ function vtoy_windows_wimboot_func {
fi fi
if [ -n "${vtdebug_flag}" ]; then 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 fi
for wmfile in sources/boot.wim boot/bcd boot/boot.sdi; do vt_windows_wimboot_data "$vtoy_wimboot_prefix/sources/boot.wim" vtoy_init_exe vtoy_wim_bit
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
if [ "$grub_platform" = "pc" ]; then if [ "$grub_platform" = "pc" ]; then
set vt_wimkernel=wimboot.x86_64.xz
linux16 "$vtoy_path/$vt_wimkernel" quiet linux16 "$vtoy_path/$vt_wimkernel" quiet
ventoy_debug_pause ventoy_debug_pause
vt_set_wim_load_prompt 1 "Loading files......" vt_set_wim_load_prompt 1 "Loading files......"
initrd16 newc:vtoyjump.exe:$vtoy_path/vtoyjump${vtoy_wimboot_bit}.exe \ initrd16 newc:winpeshl.exe:mem:${vtoy_wimboot_mem_addr}:size:${vtoy_wimboot_mem_size} \
newc:wimboot.data:mem:${vtoy_wimboot_mem_addr}:size:${vtoy_wimboot_mem_size} \ newc:vtoy_wimboot:$vtoy_wimboot_prefix/boot/bcd \
newc:winpeshl.ini:mem:${vtoy_winpeshl_ini_addr}:size:${vtoy_winpeshl_ini_size} \
newc:bcd:$vtoy_wimboot_prefix/boot/bcd \ newc:bcd:$vtoy_wimboot_prefix/boot/bcd \
newc:boot.sdi:$vtoy_wimboot_prefix/boot/boot.sdi \ newc:boot.sdi:$vtoy_wimboot_prefix/boot/boot.sdi \
newc:boot.wim:$vtoy_wimboot_prefix/sources/boot.wim newc:boot.wim:$vtoy_wimboot_prefix/sources/boot.wim
vt_set_wim_load_prompt 0 vt_set_wim_load_prompt 0
boot boot
else 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_set_wim_load_prompt 1 "Loading files......"
vt_load_file_to_mem "nodecompress" $vtoy_wimboot_prefix/sources/boot.wim vtoy_wimfile_mem vt_load_file_to_mem "nodecompress" $vtoy_wimboot_prefix/sources/boot.wim vtoy_wimfile_mem
vt_set_wim_load_prompt 0 vt_set_wim_load_prompt 0
@@ -1008,9 +1020,8 @@ function vtoy_windows_wimboot_func {
ventoy_cli_console ventoy_cli_console
chainloader "$vtoy_path/$vt_wimkernel" quiet \ chainloader "$vtoy_path/$vt_wimkernel" quiet \
"vf=wimboot.data:mem:${vtoy_wimboot_mem_addr}:size:${vtoy_wimboot_mem_size}" \ "vf=winpeshl.exe:mem:${vtoy_wimboot_mem_addr}:size:${vtoy_wimboot_mem_size}" \
"vf=winpeshl.ini:mem:${vtoy_winpeshl_ini_addr}:size:${vtoy_winpeshl_ini_size}" \ "vf=vtoy_wimboot:$vtoy_wimboot_prefix/boot/bcd" \
"vf=vtoyjump.exe:$vtoy_path/vtoyjump${vtoy_wimboot_bit}.exe" \
"vf=bcd:$vtoy_wimboot_prefix/boot/bcd" \ "vf=bcd:$vtoy_wimboot_prefix/boot/bcd" \
"vf=boot.sdi:$vtoy_wimboot_prefix/boot/boot.sdi" \ "vf=boot.sdi:$vtoy_wimboot_prefix/boot/boot.sdi" \
"vf=boot.wim:$vtoy_wimfile_path" \ "vf=boot.wim:$vtoy_wimfile_path" \
@@ -1021,11 +1032,125 @@ function vtoy_windows_wimboot_func {
fi 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 { function legacy_windows_menu_func {
vt_windows_reset 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 if [ "$ventoy_fs_probe" = "iso9660" ]; then
loopback -d loop loopback -d loop
vt_iso9660_nojoliet 1 vt_iso9660_nojoliet 1
@@ -1044,14 +1169,16 @@ function legacy_windows_menu_func {
fi fi
ventoy_debug_pause ventoy_debug_pause
locate_wim "${chosen_path}" if [ -z "$vt_cur_wimboot_mode" ]; then
locate_wim "${chosen_path}"
fi
fi fi
vt_windows_chain_data "${1}${chosen_path}" vt_windows_chain_data "${1}${chosen_path}"
ventoy_debug_pause ventoy_debug_pause
if vt_check_mode 4 "$vt_chosen_name"; then if [ "$vt_cur_wimboot_mode" = "1" ]; then
vtoy_windows_wimboot_func vtoy_wimboot_func
fi fi
if [ -n "$vtoy_chain_mem_addr" ]; then if [ -n "$vtoy_chain_mem_addr" ]; then
@@ -1133,7 +1260,16 @@ function legacy_linux_menu_func {
ventoy_debug_pause ventoy_debug_pause
if [ -n "$vtoy_chain_mem_addr" ]; then if [ -n "$vtoy_chain_mem_addr" ]; then
unset vtGrub2Mode
if vt_check_mode 3 "$vt_chosen_name"; then 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_acpi_param ${vtoy_chain_mem_addr} 2048
ventoy_cli_console ventoy_cli_console
@@ -1155,6 +1291,18 @@ function legacy_linux_menu_func {
break break
fi fi
done 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 vt_unset_boot_opt
set root=$vtback_root set root=$vtback_root
@@ -1218,6 +1366,15 @@ function legacy_iso_menu_func {
vt_check_compatible (loop) vt_check_compatible (loop)
fi 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}" vt_img_sector "${1}${chosen_path}"
if [ "$ventoy_fs_probe" = "iso9660" ]; then if [ "$ventoy_fs_probe" = "iso9660" ]; then
@@ -1233,6 +1390,7 @@ function legacy_iso_menu_func {
vt_check_compatible_linux (loop) vt_check_compatible_linux (loop)
legacy_linux_menu_func "$1" "${chosen_path}" legacy_linux_menu_func "$1" "${chosen_path}"
fi fi
vt_secondary_recover_mode
} }
function legacy_iso_memdisk { function legacy_iso_memdisk {
@@ -1307,7 +1465,7 @@ function iso_common_menuentry {
vt_chosen_img_path vt_chosen_path vt_chosen_size vt_chosen_name 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 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 vt_mod $vt_chosen_size 2048 vt_chosen_size_mod
if [ $vt_chosen_size_mod -ne 0 ]; then if [ $vt_chosen_size_mod -ne 0 ]; then
echo -e "\n $vt_volume_space $vt_chosen_size $vt_chosen_size_mod\n" echo -e "\n $vt_volume_space $vt_chosen_size $vt_chosen_size_mod\n"
@@ -1355,7 +1513,7 @@ function iso_common_menuentry {
fi fi
#For iKuai8 (<64MB) #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 if vt_str_begin "$vt_chosen_name" "iKuai"; then
set vtMemDiskBoot=1 set vtMemDiskBoot=1
fi fi
@@ -1689,6 +1847,41 @@ function ventoy_img_easyos {
loopback -d easysfs 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 { function ventoy_img_volumio {
vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver" 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 vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit
@@ -1797,7 +1990,7 @@ function ventoy_img_ubos {
} }
function ventoy_img_recalbox { 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" echo -e "\nPlease extend the img file size before boot it. \n"
ventoy_pause ventoy_pause
return return
@@ -2076,11 +2269,15 @@ function img_common_menuentry {
if vt_str_begin "$vtImgHd3Label" "ROOT-"; then if vt_str_begin "$vtImgHd3Label" "ROOT-"; then
if [ -f (vtimghd,3)/etc/os-release.d/ID ]; then if [ -f (vtimghd,3)/etc/os-release.d/ID ]; then
vt_1st_line (vtimghd,3)/etc/os-release.d/ID vt_release_line1 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 ventoy_img_fydeos
else
ventoy_img_cloudready
fi fi
elif [ -f (vtimghd,3)/etc/cloudready-release ]; then elif [ -f (vtimghd,3)/etc/cloudready-release ]; then
ventoy_img_cloudready ventoy_img_cloudready
elif [ -f (vtimghd,3)/etc/chrome_dev.conf ]; then
ventoy_img_cloudready
fi fi
elif vt_str_begin "$vtImgHd1Label" "LAKKA"; then elif vt_str_begin "$vtImgHd1Label" "LAKKA"; then
ventoy_img_openelec lakka ventoy_img_openelec lakka
@@ -2100,6 +2297,8 @@ function img_common_menuentry {
ventoy_img_esysrescue ventoy_img_esysrescue
elif [ -e (vtimghd,1)/easy.sfs ]; then elif [ -e (vtimghd,1)/easy.sfs ]; then
ventoy_img_easyos ventoy_img_easyos
elif [ -d (vtimghd,2)/easyos ]; then
ventoy_img_easyos2
elif [ -e (vtimghd,1)/volumio.initrd ]; then elif [ -e (vtimghd,1)/volumio.initrd ]; then
ventoy_img_volumio ventoy_img_volumio
elif [ -f (vtimghd,2)/loader/entries/ubos.conf ]; then elif [ -f (vtimghd,2)/loader/entries/ubos.conf ]; then
@@ -2145,7 +2344,7 @@ function img_unsupport_menuentry {
############################################################# #############################################################
############################################################# #############################################################
set VENTOY_VERSION="1.0.77" set VENTOY_VERSION="1.0.81"
#ACPI not compatible with Window7/8, so disable by default #ACPI not compatible with Window7/8, so disable by default
set VTOY_PARAM_NO_ACPI=1 set VTOY_PARAM_NO_ACPI=1
@@ -2203,6 +2402,11 @@ if [ "$vtoy_dev" = "tftp" ]; then
done done
loadfont ascii 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 if [ -f $vtoy_iso_part/ventoy/ventoy.json ]; then
set vt_plugin_path=$vtoy_iso_part set vt_plugin_path=$vtoy_iso_part
else else

View File

@@ -8,10 +8,10 @@ F6 - Benutzerdefiniertes Grub2-Menü laden
F7 - Wechseln zwischen GUI-Modus <-> TEXT-Modus F7 - Wechseln zwischen GUI-Modus <-> TEXT-Modus
m - Prüfsummencheck Image Dateien (md5/sha1/sha256/sha512) m - Prüfsummencheck Image Dateien (md5/sha1/sha256/sha512)
Ctrl+w - WIMBOOT Modus (Nur für Standard Windows ISO) w/Ctrl+w - WIMBOOT Modus (Nur für Standard Windows ISO)
Ctrl+r - Grub2 Modus (Nur für einige Linux distros) r/Ctrl+r - Grub2 Modus (Nur für einige Linux distros)
Ctrl+i - Kompatibilitäts Modus (Nur für Fehleranalyse) i/Ctrl+i - Kompatibilitäts Modus (Nur für Fehleranalyse)
Ctrl+u - Lade ISO efi Treiber (Nur für Fehleranalyse, darf nicht offiziel benutzt werden) 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 F7 - Switch between GUI Mode <-> TEXT Mode
m - Checksum image files (md5/sha1/sha256/sha512) m - Checksum image files (md5/sha1/sha256/sha512)
Ctrl+w - WIMBOOT Mode (Only for standard Windows ISO) w/Ctrl+w - WIMBOOT Mode (Only for standard Windows ISO)
Ctrl+r - Grub2 Mode (Only for some Linux distros) r/Ctrl+r - Grub2 Mode (Only for some Linux distros)
Ctrl+i - Compatible Mode (Just only for debug) i/Ctrl+i - Compatible Mode (Just only for debug)
Ctrl+u - Load ISO efi driver (Just only for debug, can not be used officially) 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 F7 - Basculer entre le mode graphique <-> mode texte
m - Somme de contrôle des images (md5/sha1/sha256/sha512) m - Somme de contrôle des images (md5/sha1/sha256/sha512)
Ctrl+w - Mode WIMBOOT (seulement pour les images standards Windows) w/Ctrl+w - Mode WIMBOOT (seulement pour les images standards Windows)
Ctrl+r - Mode Grub2 (seulement pour quelques Linux) r/Ctrl+r - Mode Grub2 (seulement pour quelques Linux)
Ctrl+i - Mode Compatible (seulement à fins de tests) i/Ctrl+i - Mode Compatible (seulement à fins de tests)
Ctrl+u - Load ISO efi driver (Just only for debug, can not be used officially) u/Ctrl+u - Load ISO efi driver (Just only for debug, can not be used officially)
Appuyer sur Echap pour sortir ...... 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 F7 - Mijenja između GUI <-> TEXT načina rada
m - Generira heš odabranog imidž fajla (md5/sha1/sha256/sha512) m - Generira heš odabranog imidž fajla (md5/sha1/sha256/sha512)
Ctrl+w - WIMBOOT način rada (samo za standardne Windows imidž fajlove) w/Ctrl+w - WIMBOOT način rada (samo za standardne Windows imidž fajlove)
Ctrl+r - GRUB2 način rada (samo za neke Linux distribucije) r/Ctrl+r - GRUB2 način rada (samo za neke Linux distribucije)
Ctrl+i - Kompatibilni način rada (samo za testiranje) i/Ctrl+i - Kompatibilni način rada (samo za testiranje)
Ctrl+u - Učitava EFI drajver za imidž fajlove (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 F7 - Beralih antara mode GUI <-> Mode TEXT
m - Periksa berkas files (md5/sha1/sha256/sha512) m - Periksa berkas files (md5/sha1/sha256/sha512)
Ctrl+w - Mode WIMBOOT (Hanya untuk berkas ISO Windows standar) w/Ctrl+w - Mode WIMBOOT (Hanya untuk berkas ISO Windows standar)
Ctrl+r - Mode Grub2 (Hanya untuk distro Linux tertentu) r/Ctrl+r - Mode Grub2 (Hanya untuk distro Linux tertentu)
Ctrl+i - Mode Kompatibel/Compatible (Hanya untuk debug saja) i/Ctrl+i - Mode Kompatibel/Compatible (Hanya untuk debug saja)
Ctrl+u - Memuat ISO efi driver (Hanya untuk debug saja, tidak dapat dipakai secara umum) 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 F7 - 操作形式を切り替えるGUI ↔ CUI
m - イメージの検査合計を計算する (md5/sha1/sha256/sha512) m - イメージの検査合計を計算する (md5/sha1/sha256/sha512)
Ctrl+w - WIMBOOTモード標準的なWindows ISO専用 w/Ctrl+w - WIMBOOTモード標準的なWindows ISO専用
Ctrl+r - Grub2モード一部のLinuxディストリビューション専用 r/Ctrl+r - Grub2モード一部のLinuxディストリビューション専用
Ctrl+i - 互換モード(開発用) i/Ctrl+i - 互換モード(開発用)
Ctrl+u - ISO efiドライバーを読み取る開発用非公式 u/Ctrl+u - ISO efiドライバーを読み取る開発用非公式

View File

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

View File

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

View File

@@ -8,10 +8,10 @@ F6 - Учитава прилагођен GRUB2 мени
F7 - Мења између GUI <-> TEXT начина рада F7 - Мења између GUI <-> TEXT начина рада
m - Генерира хеш одабраног имиџ фајла (md5/sha1/sha256/sha512) m - Генерира хеш одабраног имиџ фајла (md5/sha1/sha256/sha512)
Ctrl+w - WIMBOOT начин рада (само за стандардне Windows имиџ фајлове) w/Ctrl+w - WIMBOOT начин рада (само за стандардне Windows имиџ фајлове)
Ctrl+r - GRUB2 начин рада (само за неке Linux дистрибуције) r/Ctrl+r - GRUB2 начин рада (само за неке Linux дистрибуције)
Ctrl+i - Компатибилни начин рада (само за тестирање) i/Ctrl+i - Компатибилни начин рада (само за тестирање)
Ctrl+u - Учитава EFI драјвер за имиџ фајлове (само за тестирање) 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 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 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) w/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) r/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) i/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) 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...... Geriye dönmek için ESC tuşuna basınız......

View File

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

View File

@@ -294,6 +294,63 @@
"STRXXX":"" "STRXXX":""
}, },
{
"name": "georgian (ქართული)",
"FontFamily": "Courier New",
"FontSize": 16,
"Author": "44f33",
"STR_ERROR": "შეცდომა",
"STR_WARNING": "გაფრთხილება",
"STR_INFO": "ინფორმაცია",
"STR_INCORRECT_DIR": "გთხოვთ გაუშვათ სწორ დირექტორიაში!",
"STR_INCORRECT_TREE_DIR": "აქ არ გაუშვათ, გთხოვთ ჩამოტვირთოთ გამოშვებული ინსტალაციის პაკეტი და იქ და-run-ოთ",
"STR_DEVICE": "მოწყობილობა",
"STR_INSTALL_YES_TIP1": "გაფრთხილება: მონაცემები დაიკარგება",
"STR_INSTALL_YES_TIP2": "გთხოვთ შეიყვანოთ YES რათა დამტკიცდეს რომ თვენ დარწმუნებული ხართ რომ გსურთ ხელახლა დაყენაბა ვიდრე განახლება",
"STR_LOCAL_VER": "Ventoy პაკეტში",
"STR_DISK_VER": "Ventoy მოწყობილობაში",
"STR_STATUS": "სტატუსი - მზადაა",
"STR_PART_RESIZE_FAILED": "არა-დესტრუქციული ინსტალაცია წარუმატებლივ დასრულა, ნახეთ log.txt დეტალებისთვის",
"STR_PART_RESIZE_SUCCESS": "გილოცავთ #@Ventoy არა-დესტრუქციული ინსტალაცია წარმატებით დასრულდა",
"STR_PART_RESIZE_UNSUPPORTED": "Ventoy-ს არასაზიანო ინსტალაცია შეჩერდა რადგან რაღაც პირობები არ კმაყოფილდება. ნახეთ log.txt დეტალებისთვის.",
"STR_INSTALL": "ინსტალაცია",
"STR_UPDATE": "განახლება",
"STR_UPDATE_TIP": "განახლების ოპერაცია უსაფრთხოა, ISO ფაილები არ შეიცვლება. გსურს გაგრძელება?",
"STR_INSTALL_TIP": "მოწყობილობა დაფორმატდება და ყველა მონაცემი დაიკარგება.გსურს გაგრძელება?",
"STR_INSTALL_TIP2": "მოწყობილობა დაფორმატდება და ყველა მონაცემი დაიკარგება! დარწმუნებული ხართ რომ ამის განხორციელება ნამდვილად გსურთ?",
"STR_INSTALL_SUCCESS": "გილოცავთ! Ventoy წარმატებით დაინსტალირდა თქვენს მოწყობილობაზე.",
"STR_INSTALL_FAILED": "დაყენებისას მოხდა შეცდომა. გთხოვთ მიმართოთ FAQ-ს ოფიციალურ ვებსაიტზე.",
"STR_UPDATE_SUCCESS": "გილოცავთ!#@Ventoy წარმატებით განახლდა მოწყობილობაზე.",
"STR_UPDATE_FAILED": "შეცდომა მოხდა განახლების დროს. შეგიძლიათ აკონტროლოთ… გაუქმება",
"STR_WAIT_PROCESS": "შეინარჩუნე გარკვეული სივრცე დისკის ბოლოს",
"STR_MENU_OPTION": "არასწორი მნიშვნელობა რეზერვირებული სივრცისთვის",
"STR_MENU_SECURE_BOOT": "გასუფთავება Ventoy",
"STR_MENU_PART_CFG": "Ventoy წარმატებით წაიშალა მოწყობილობიდან.",
"STR_BTN_OK": "დაიქმნა შეცდომა Ventoy-ის დისკიდან ამოღებისას მოწყობილობა და სცადეთ ხელახლა. შეამოწმეთ log.txt დეტალებისთვის.",
"STR_BTN_CANCEL": "პარტიციის სტილი",
"STR_PRESERVE_SPACE": "გთხოვთ აირჩიოთ GPT 2 ტერაბიატზე მეტი მოწყობილობებისთვის",
"STR_SPACE_VAL_INVALID": "ყველა მოწყობილობის ჩვენება",
"STR_MENU_CLEAR": "პარტიციის გასწორება 4KB-ით",
"STR_CLEAR_SUCCESS": "კომუნიკაციის შეცდომა:",
"STR_CLEAR_FAILED": "კომუნიკაციის შეცდომა: დისტანციური არანორმალური",
"STR_MENU_PART_STYLE": "კომუნიკაციის შეცდომა: მოთხოვნის დრო ამოიწურა",
"STR_DISK_2TB_MBR_ERROR": "კომუნიკაციის შეცდომა: სერვისი მიუწვდომელია",
"STR_SHOW_ALL_DEV": "Daemon-ის სტატუსი განახლებულია, გთხოვთ, სცადოთ მოგვიანებით.",
"STR_PART_ALIGN_4KB": "სერვისი დაკავებულია, გთხოვთ, სცადოთ მოგვიანებით.",
"STR_WEB_COMMUNICATION_ERR": "VTSI ფაილის გენერირება",
"STR_WEB_REMOTE_ABNORMAL": "ამჯერად არ დაწეროთ მოწყობილობაში, არამედ მხოლოდ შექმნათ VTSI ფაილი#@გაგრძელება?",
"STR_WEB_REQUEST_TIMEOUT": "VTSI ფაილი შეიქმნა წარმატებით!#@შეგიძლიათ გამოიყენოთ Rufus…ice, რათა დაასრულოთ Ventoy-ის ინსტალაცია.",
"STR_WEB_SERVICE_UNAVAILABLE": "VTSI ფაილი შეიქმნა ვერ მოხერხდა.",
"STR_WEB_TOKEN_MISMATCH": "არადესტრუქციული ინსტალაცია",
"STR_WEB_SERVICE_BUSY": "Ventoy შეეცდება არა-დესტრუქციულ ინსტალაციას, თუ ეს შესაძლებელია. #@გაგრძელება?",
"STR_MENU_VTSI_CREATE": "გილოცავთ! #@Ventoy არა-დესტრუქციული ინსტალაცია წარმატებით დასრულდა.",
"STR_VTSI_CREATE_TIP": "არადესტრუქციული ინსტალაცია ვერ მოხერხდა, შეამოწმეთ log.txt დეტალებისთვის.",
"STR_VTSI_CREATE_SUCCESS": "Ventoy არა-დესტრუქციული ინსტალაცია შეჩერდა, რადგან… პირობა ვერ შესრულდება . შეამოწმეთ log.txt დეტალებისთვის.",
"STR_VTSI_CREATE_FAILED": "გაფრთხილება: მონაცემები დაიკარგება!",
"STR_MENU_PART_RESIZE": "გთხოვთ, შეიყვანოთ YES ქვემოთ მოცემულ ტექსტურ ველში, რათა დაადასტუროთ... გსურთ განახლების ნაცვლად განახორციელოთ ახალი ინსტალაცია.",
"STR_PART_RESIZE_TIP": "Ventoy ჩეეცდება დააყენოს არა-დესტრუქციული რამდენადაც შეეცდება. გსურს გაგრძელება?",
"STRXXX": ""
},
{ {
"name":"Persian (فارسی)", "name":"Persian (فارسی)",
"FontFamily":"Courier New", "FontFamily":"Courier New",
@@ -420,7 +477,7 @@
"STR_ERROR":"Erro", "STR_ERROR":"Erro",
"STR_WARNING":"Atenção", "STR_WARNING":"Atenção",
"STR_INFO":"Info", "STR_INFO":"Informação",
"STR_INCORRECT_DIR":"Por favor, execute no diretório correto!", "STR_INCORRECT_DIR":"Por favor, execute no diretório correto!",
"STR_INCORRECT_TREE_DIR":"Não me execute aqui, por favor baixe o pacote de instalação lançado, e me execute lá.", "STR_INCORRECT_TREE_DIR":"Não me execute aqui, por favor baixe o pacote de instalação lançado, e me execute lá.",
"STR_DEVICE":"Dispositivo", "STR_DEVICE":"Dispositivo",
@@ -466,8 +523,8 @@
"STR_PART_RESIZE_SUCCESS":"Parabéns!#@Instalação não destrutiva do Ventoy concluída com sucesso.", "STR_PART_RESIZE_SUCCESS":"Parabéns!#@Instalação não destrutiva do Ventoy concluída com sucesso.",
"STR_PART_RESIZE_FAILED":"Falha na instalação não destrutiva, cheque o arquivo log.txt para entender.", "STR_PART_RESIZE_FAILED":"Falha na instalação não destrutiva, cheque o arquivo log.txt para entender.",
"STR_PART_RESIZE_UNSUPPORTED":"Instalação não destrutiva do Ventoy interrompida devido fato desconhecido. Cheque o arquivo log.txt para detalhes.", "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":"Warning: Data will be lost!", "STR_INSTALL_YES_TIP1":"Aviso: Os dados serão perdidos!",
"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_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.",
"STRXXX":"" "STRXXX":""
}, },
@@ -711,12 +768,12 @@
"name":"Czech (Čeština)", "name":"Czech (Čeština)",
"FontFamily":"Courier New", "FontFamily":"Courier New",
"FontSize":16, "FontSize":16,
"Author":"vavanade", "Author":"vavanade, lev741",
"STR_ERROR":"Chyba", "STR_ERROR":"Chyba",
"STR_WARNING":"Varování", "STR_WARNING":"Varování",
"STR_INFO":"Info", "STR_INFO":"Info",
"STR_INCORRECT_DIR":"Spusťte prosím ve správném adresáři!", "STR_INCORRECT_DIR":"Spusťte Ventoy ve správném adresáři!",
"STR_INCORRECT_TREE_DIR":"Nespouštějte mě zde, stáhněte si prosím vydaný instalační balík a spusťte v něm.", "STR_INCORRECT_TREE_DIR":"Nespouštějte mě zde, stáhněte si prosím vydaný instalační balík a spusťte v něm.",
"STR_DEVICE":"Zařízení", "STR_DEVICE":"Zařízení",
"STR_LOCAL_VER":"Ventoy v Balíčku", "STR_LOCAL_VER":"Ventoy v Balíčku",
@@ -726,26 +783,26 @@
"STR_UPDATE":"Aktualizovat", "STR_UPDATE":"Aktualizovat",
"STR_UPDATE_TIP":"Operace aktualizace je bezpečná, ISO soubory nebudou změněny.#@Pokračovat?", "STR_UPDATE_TIP":"Operace aktualizace je bezpečná, ISO soubory nebudou změněny.#@Pokračovat?",
"STR_INSTALL_TIP":"Disk bude zformátován a všechna data budou ztracena!#@Pokračovat?", "STR_INSTALL_TIP":"Disk bude zformátován a všechna data budou ztracena!#@Pokračovat?",
"STR_INSTALL_TIP2":"Disk bude zformátován a všechna data budou ztracena!#@Pokračovat? (druhá kontrola)", "STR_INSTALL_TIP2":"Disk bude zformátován a všechna data budou ztracena!#@Pokračovat? (druhé potvrzení)",
"STR_INSTALL_SUCCESS":"Gratulujeme!#@Ventoy byla na zařízení úspěšně nainstalována.", "STR_INSTALL_SUCCESS":"Gratulujeme!#@Ventoy byla na zařízení úspěšně nainstalována.",
"STR_INSTALL_FAILED":"V průběhu instalace se vyskytla chyba. Můžete vyjmout a znovu zastrčit USB zařízení a zkusit to znovu. Pro podrobnosti se podívejte do souboru log.txt.", "STR_INSTALL_FAILED":"V průběhu instalace se vyskytla chyba. Můžete vyjmout a znovu zastrčit USB zařízení a zkusit to znovu. Pro podrobnosti se podívejte do souboru log.txt.",
"STR_UPDATE_SUCCESS":"Gratulujeme!#@Ventoy byla na zařízení úspěšně aktualizována.", "STR_UPDATE_SUCCESS":"Gratulujeme!#@Ventoy byla na zařízení úspěšně aktualizována.",
"STR_UPDATE_FAILED":"V průběhu aktualizace se vyskytla chyba. Můžete vyjmout a znovu zastrčit USB zařízení a zkusit to znovu. Pro podrobnosti se podívejte do souboru log.txt.", "STR_UPDATE_FAILED":"V průběhu aktualizace se vyskytla chyba. Můžete vyjmout a znovu zastrčit USB zařízení a zkusit to znovu. Pro podrobnosti se podívejte do souboru log.txt.",
"STR_WAIT_PROCESS":"Vlákno běží, prosíme vyčkejte...", "STR_WAIT_PROCESS":"Vlákno běží, prosíme vyčkejte...",
"STR_MENU_OPTION":"Možnosti", "STR_MENU_OPTION":"Možnosti",
"STR_MENU_SECURE_BOOT":"Secure Boot Podpora", "STR_MENU_SECURE_BOOT":"Podpora Secure Boot",
"STR_MENU_PART_CFG":"Konfigurace Oddílu", "STR_MENU_PART_CFG":"Konfigurace Oddílu",
"STR_BTN_OK":"OK", "STR_BTN_OK":"OK",
"STR_BTN_CANCEL":"Zrušit", "STR_BTN_CANCEL":"Zrušit",
"STR_PRESERVE_SPACE":"Zachovejte místo na spodní straně disku", "STR_PRESERVE_SPACE":"Zachovejte místo na konci disku",
"STR_SPACE_VAL_INVALID":"Neplatná hodnota pro vyhrazený prostor", "STR_SPACE_VAL_INVALID":"Neplatná hodnota pro vyhrazený prostor",
"STR_MENU_CLEAR":"Vymazat Ventoy", "STR_MENU_CLEAR":"Odstranit Ventoy",
"STR_CLEAR_SUCCESS":"Ventoy byl ze zařízení úspěšne odstraněn.", "STR_CLEAR_SUCCESS":"Ventoy byl ze zařízení úspěšne odstraněn.",
"STR_CLEAR_FAILED":"Nastala chyba při odstraňovaní Ventoy z disku. Múžete USB vytáhnout a znova zastrčit a vyskoušet to znovu. Pro podrobnosti se podívejte do souboru log.txt", "STR_CLEAR_FAILED":"Nastala chyba při odstraňovaní Ventoy z disku. Múžete USB vytáhnout a znova zastrčit a vyskoušet to znovu. Pro podrobnosti se podívejte do souboru log.txt",
"STR_MENU_PART_STYLE":"Styl Oddílu", "STR_MENU_PART_STYLE":"Styl Oddílu",
"STR_DISK_2TB_MBR_ERROR":"Vyberte GPT pro disk přes 2TB", "STR_DISK_2TB_MBR_ERROR":"Vyberte GPT pro disk větší než 2TB",
"STR_SHOW_ALL_DEV":"Zobrazit všechna zařízení", "STR_SHOW_ALL_DEV":"Zobrazit všechna zařízení",
"STR_PART_ALIGN_4KB":"Zarovnejte oddíly s 4KB", "STR_PART_ALIGN_4KB":"Zarovnat oddíly s velikostí 4KB",
"STR_WEB_COMMUNICATION_ERR":"Chyba komunikace:", "STR_WEB_COMMUNICATION_ERR":"Chyba komunikace:",
"STR_WEB_REMOTE_ABNORMAL":"Chyba komunikace: remote abnormal", "STR_WEB_REMOTE_ABNORMAL":"Chyba komunikace: remote abnormal",
"STR_WEB_REQUEST_TIMEOUT":"Chyba komunikace: Request timed out", "STR_WEB_REQUEST_TIMEOUT":"Chyba komunikace: Request timed out",
@@ -758,11 +815,11 @@
"STR_VTSI_CREATE_FAILED":"Chyba při vytváření VTSI souboru.", "STR_VTSI_CREATE_FAILED":"Chyba při vytváření VTSI souboru.",
"STR_MENU_PART_RESIZE":"Nedestruktivní Instalace", "STR_MENU_PART_RESIZE":"Nedestruktivní Instalace",
"STR_PART_RESIZE_TIP":"Ventoy se pokusí o nedestruktivní instalaci. #@Pokračovat?", "STR_PART_RESIZE_TIP":"Ventoy se pokusí o nedestruktivní instalaci. #@Pokračovat?",
"STR_PART_RESIZE_SUCCESS":"Gratulujeme!#@Nedestruktivní instalace Ventoy byla úspěšne dokončená.", "STR_PART_RESIZE_SUCCESS":"Gratulujeme!#@Nedestruktivní instalace Ventoy byla úspěšně dokončena.",
"STR_PART_RESIZE_FAILED":"Nedestruktivní instalace zlyhala. Pro podrobnosti se podívejte do souboru log.txt.", "STR_PART_RESIZE_FAILED":"Nedestruktivní instalace selhala. Pro podrobnosti se podívejte do souboru log.txt.",
"STR_PART_RESIZE_UNSUPPORTED":"Nedestruktivní instalace Ventoy zlyhala, protože některé podmínky nemohli být splněné. Pro podrobnosti se podívejte do souboru log.txt.", "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":"Warning: Data will be lost!", "STR_INSTALL_YES_TIP1":"Varování: Data budou ztracena!",
"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_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.",
"STRXXX":"" "STRXXX":""
}, },
@@ -770,65 +827,65 @@
"name":"Slovak (Slovenčina)", "name":"Slovak (Slovenčina)",
"FontFamily":"Courier New", "FontFamily":"Courier New",
"FontSize":16, "FontSize":16,
"Author":"reggiiie", "Author":"reggiiie/jose1711",
"STR_ERR":"Chyba", "STR_ERR":"Chyba",
"STR_WARNING":"Varovanie", "STR_WARNING":"Varovanie",
"STR_INFO":"Info", "STR_INFO":"Info",
"STR_INCORRECT_DIR":"Spusťte prosím v správnom adresári!", "STR_INCORRECT_DIR":"Spustite, prosím, v správnom adresári!",
"STR_INCORRECT_TREE_DIR":"Nepsúšťajte ma tu, stiahnite si prosím vydaný inštalačný balík a spustite ma v ňom.", "STR_INCORRECT_TREE_DIR":"Nespúšťajte ma tu, stiahnite si, prosím, vydaný inštalačný balík a spustite ma v ňom.",
"STR_DEVICE":"Zariadenie", "STR_DEVICE":"Zariadenie",
"STR_LOCAL_VER":"Ventoy v Balíčku", "STR_LOCAL_VER":"Ventoy v balíčku",
"STR_DISK_VER":"Ventoy v Zariadení", "STR_DISK_VER":"Ventoy v zariadení",
"STR_STATUS":"Status - PRIPRAVENÝ", "STR_STATUS":"Stav - PRIPRAVENÝ",
"STR_INSTALL":"Inštalovať", "STR_INSTALL":"Inštalovať",
"STR_UPDATE":"Aktualizovať", "STR_UPDATE":"Aktualizovať",
"STR_UPDATE_TIP":"Aktualizácia je bezpečná, ISO súbory zostanú nezmenené.#@Pokračovať?", "STR_UPDATE_TIP":"Aktualizácia je bezpečná, ISO súbory zostanú nezmenené.#@Pokračovať?",
"STR_INSTALL_TIP":"Disk bude formátovaný a všetky dáta budú ztratené!#@Pokračovať?", "STR_INSTALL_TIP":"Disk bude formátovaný a všetky údaje sa stratia!#@Pokračovať?",
"STR_INSTALL_TIP2":"Disk bude formátovaný a všetky dáta budú ztratené!#@Pokračovať? (Druhá Kontrola)", "STR_INSTALL_TIP2":"Disk bude formátovaný a všetky údaje sa stratia!#@Pokračovať? (dvojitá kontrola)",
"STR_INSTALL_SUCCESS":"Gratulujeme!#@Ventoy bol na zariadenie úspěšne nainštalovaný.", "STR_INSTALL_SUCCESS":"Gratulujeme!#@Ventoy bol úspešne nainštalovaný na zariadenie.",
"STR_INSTALL_FAILED":"V priebehu inštalácie sa vyskytla chyba. Môžete USB vytiahnuť a znova zastrčiť a skúsiť to znovu. Pre podrobnosti sa pozrite do súboru log.txt. Ak sa chyba stále opakuje, prosím skontrolujte FAQ na oficiálnej stránke.", "STR_INSTALL_FAILED":"V priebehu inštalácie sa vyskytla chyba. Môžete USB vytiahnuť, znova ho zasunúť a skúsiť to znovu. Podrobnosti nájdete v súbore log.txt. Ak sa chyba stále opakuje, skontrolujte, prosím, FAQ na oficiálnej stránke.",
"STR_UPDATE_SUCCESS":"Gratulujeme!#@Ventoy bol na zariadení úspěšne aktualizovaný.", "STR_UPDATE_SUCCESS":"Gratulujeme!#@Ventoy na zariadení bol úspešne aktualizovaný.",
"STR_UPDATE_FAILED":"V priebehu aktualizácie sa vyskytla chyba. Môžete USB vytiahnuť a znova zastrčiť a skúsiť to znovu. Pre podrobnosti sa pozrite do súboru log.txt. Ak sa chyba stále opakuje, prosím skontrolujte FAQ na oficiálnej stránke.", "STR_UPDATE_FAILED":"V priebehu aktualizácie sa vyskytla chyba. Môžete USB vytiahnuť, znova ho zasunúť a skúsiť to znovu. Podrobnosti nájdete v súbore log.txt. Ak sa chyba stále opakuje, skontrolujte, prosím, FAQ na oficiálnej stránke.",
"STR_MENU_OPTION":"Možnosti", "STR_MENU_OPTION":"Možnosti",
"STR_MENU_SECURE_BOOT":"Secure Boot Podpora", "STR_MENU_SECURE_BOOT":"Podpora pre Secure Boot",
"STR_MENU_PART_CFG":"Konfigurácia Oddielu", "STR_MENU_PART_CFG":"Konfigurácia oddielu",
"STR_BTN_OK":"OK", "STR_BTN_OK":"OK",
"STR_BTN_CANCEL":"Zrušiť", "STR_BTN_CANCEL":"Zrušiť",
"STR_PRESERVE_SPACE":"Zachovajte nejaké miesto na konci disku", "STR_PRESERVE_SPACE":"Zachovať nejaké miesto na konci disku",
"STR_SPACE_VAL_INVALID":"Neplatná hodnota pre vyhradený priestor", "STR_SPACE_VAL_INVALID":"Neplatná hodnota pre vyhradený priestor",
"STR_MENU_CLEAR":"Vymazať Ventoy", "STR_MENU_CLEAR":"Vymazať Ventoy",
"STR_CLEAR_SUCCESS":"Ventoy bol zo zariadenia úspešne odstránený.", "STR_CLEAR_SUCCESS":"Ventoy bol zo zariadenia úspešne odstránený.",
"STR_CLEAR_FAILED":"Nastala chyba pri odstraňovaní Ventoy z disku. Môžete USB vytiahnuť a znova zastrčiť a skúsiť to znovu. Pre podrobnosti sa pozrite do súboru log.txt.", "STR_CLEAR_FAILED":"Nastala chyba pri odstraňovaní Ventoy z disku. Môžete USB vytiahnuť, znova ho zasunúť a skúsiť to znovu. Podrobnosti nájdete v súbore log.txt.",
"STR_MENU_PART_STYLE":"Štýl Oddielu", "STR_MENU_PART_STYLE":"Štýl oddielu",
"STR_DISK_2TB_MBR_ERROR":"Prosím vyberte GPT pre disk nad 2TB", "STR_DISK_2TB_MBR_ERROR":"Prosím vyberte GPT pre disk väčší ako 2 TB",
"STR_SHOW_ALL_DEV":"Zobrazit Všetky Zariadenia", "STR_SHOW_ALL_DEV":"Zobraziť všetky zariadenia",
"STR_PART_ALIGN_4KB":"Zarovnať oddiely s 4KB", "STR_PART_ALIGN_4KB":"Zarovnať oddiely na 4 KB",
"STR_WEB_COMMUNICATION_ERR":"Chyba komunikácie:", "STR_WEB_COMMUNICATION_ERR":"Chyba komunikácie:",
"STR_WEB_REMOTE_ABNORMAL":"Chyba komunikácie: remote abnormal", "STR_WEB_REMOTE_ABNORMAL":"Chyba komunikácie: Chyba vzdialeného hostiteľa",
"STR_WEB_REQUEST_TIMEOUT":"Chyba komunikácie: Request timed out", "STR_WEB_REQUEST_TIMEOUT":"Chyba komunikácie: Požiadavka vypršala",
"STR_WEB_SERVICE_UNAVAILABLE":"Chyba komunikácie: Service Unavailable", "STR_WEB_SERVICE_UNAVAILABLE":"Chyba komunikácie: Služba je nedostupná",
"STR_WEB_TOKEN_MISMATCH":"Daemon status bol aktualizovaný, prosím skúste neskôr.", "STR_WEB_TOKEN_MISMATCH":"Stav démona bol aktualizovaný, skúste to, prosím, neskôr.",
"STR_WEB_SERVICE_BUSY":"Služba je zaneprázdnená, prosím skúste neskôr.", "STR_WEB_SERVICE_BUSY":"Služba je zaneprázdnená, skúste to, prosím, neskôr.",
"STR_MENU_VTSI_CREATE":"Vygenerovať VTSI Súbor", "STR_MENU_VTSI_CREATE":"Vygenerovať VTSI Súbor",
"STR_VTSI_CREATE_TIP":"Tentokrát sa nebude do zariadenia zapisovať, len sa vygeneruje VTSI súbor#@Pokračovať?", "STR_VTSI_CREATE_TIP":"Tentokrát sa nebude na zariadenie zapisovať, len sa vygeneruje VTSI súbor#@Pokračovať?",
"STR_VTSI_CREATE_SUCCESS":"VTSI súbor úspešne vytvorený!#@Môžete použiť Rufus(3.15+) na jeho zapísanie do zariadena na dokončenie inštalácie Ventoy.", "STR_VTSI_CREATE_SUCCESS":"VTSI súbor bol úspešne vytvorený!#@Môžete použiť Rufus(3.15+) na jeho zapísanie na zariadenie, aby ste mohli dokonč inštaláciu Ventoy.",
"STR_VTSI_CREATE_FAILED":"Chyba pri vytváraní VTSI súboru.", "STR_VTSI_CREATE_FAILED":"Chyba pri vytváraní VTSI súboru.",
"STR_MENU_PART_RESIZE":"Nedeštruktívna Inštalácia", "STR_MENU_PART_RESIZE":"Nedeštruktívna inštalácia",
"STR_PART_RESIZE_TIP":"Ventoy sa pokúsi o nedeštruktívnu inštaláciu. #@Pokračovať?", "STR_PART_RESIZE_TIP":"Ventoy sa pokúsi o nedeštruktívnu inštaláciu. #@Pokračovať?",
"STR_PART_RESIZE_SUCCESS":"Gratulujeme!#@Nedeštruktívna inštalácia Ventoy bola úspešne dokončená.", "STR_PART_RESIZE_SUCCESS":"Gratulujeme!#@Nedeštruktívna inštalácia Ventoy bola úspešne dokončená.",
"STR_PART_RESIZE_FAILED":"Nedeštruktívna inštalácia zlyhala. Pre podrobnosti sa pozrite do súboru log.txt.", "STR_PART_RESIZE_FAILED":"Nedeštruktívna inštalácia zlyhala. Podrobnosti nájdete v súbore log.txt.",
"STR_PART_RESIZE_UNSUPPORTED":"Nedeštruktívna inštalácia Ventoy zlyhala, lebo niektoré podmienky nemohli byť splnené. Pre podrobnosti sa pozrite do súboru log.txt.", "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":"Warning: Data will be lost!", "STR_INSTALL_YES_TIP1":"Varovanie: Dôjde k strate údajov!",
"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_TIP2":"Prosím, zadajte YES v textovom poli nižšie, čím potvrdíte, že naozaj chcete vykonať novú inštaláciu miesto aktualizácie.",
"STRXXX":"" "STRXXX":""
}, },
{ {
"name":"Spanish (Español)", "name":"Spanish (Latinoamérica)",
"FontFamily":"Courier New", "FontFamily":"Courier New",
"FontSize":16, "FontSize":16,
"Author":"Carlos Sánchez, MELERIX", "Author":"MELERIX",
"STR_ERROR":"Error", "STR_ERROR":"Error",
"STR_WARNING":"Advertencia", "STR_WARNING":"Advertencia",
@@ -883,6 +940,65 @@
"STRXXX":"" "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.",
"STRXXX":""
},
{ {
"name":"Russian (Pусский)", "name":"Russian (Pусский)",
"FontFamily":"Courier New", "FontFamily":"Courier New",
@@ -1359,58 +1475,58 @@
"name":"Hungarian (Magyar)", "name":"Hungarian (Magyar)",
"FontFamily":"Courier New", "FontFamily":"Courier New",
"FontSize":16, "FontSize":16,
"Author":"Bitfarago", "Author":"Bitfarago, gidano, meskobalazs",
"STR_ERROR":"Hiba", "STR_ERROR":"Hiba",
"STR_WARNING":"Figyelem", "STR_WARNING":"Figyelmeztetés",
"STR_INFO":"Infó", "STR_INFO":"Információ",
"STR_INCORRECT_DIR":"Kérjük, futtasd a megfelelő könyvtárból!", "STR_INCORRECT_DIR":"Futtassa a megfelelő könyvtárból.",
"STR_INCORRECT_TREE_DIR":"Ne futtasd innen. Töltsd le a kiadott telepítőcsomagot és onnan futtasd.", "STR_INCORRECT_TREE_DIR":"Ne innen futtassa, töltse le a kiadott telepítőcsomagot, és futtassa onnan.",
"STR_DEVICE":"Eszköz", "STR_DEVICE":"Eszköz",
"STR_LOCAL_VER":"Ventoy a csomagban", "STR_LOCAL_VER":"A csomagban lévő Ventoy",
"STR_DISK_VER":"Ventoy az eszközön", "STR_DISK_VER":"Az eszközön lévő Ventoy",
"STR_STATUS":"Állapot - KÉSZ", "STR_STATUS":"Állapot KÉSZ",
"STR_INSTALL":"Telepítés", "STR_INSTALL":"Telepítés",
"STR_UPDATE":"Frissítés", "STR_UPDATE":"Frissítés",
"STR_UPDATE_TIP":"A frissítés biztonságos, az ISO fájlok nem változnak.#@Folytatod?", "STR_UPDATE_TIP":"A frissítés biztonságos, az ISO-fájlok nem változnak.#@Folytatja?",
"STR_INSTALL_TIP":"A meghajtó formázva lesz és minden rajta lévő adat elveszik.#@Folytatod?", "STR_INSTALL_TIP":"A meghajtó formázva lesz, és minden rajta lévő adat elvész.#@Folytatja?",
"STR_INSTALL_TIP2":"A meghajtó formázva lesz és minden rajta lévő adat elveszik.#@Folytatod? (Második jóváhagyás)", "STR_INSTALL_TIP2":"A meghajtó formázva lesz, és minden rajta lévő adat elvész.#@Folytatja? (Második jóváhagyás)",
"STR_INSTALL_SUCCESS":"Gratulálunk!#@A Ventoy sikeresen telepítve lett az eszközön.", "STR_INSTALL_SUCCESS":"Gratulálunk!#@A Ventoy sikeresen telepítve lett az eszközön.",
"STR_INSTALL_FAILED":"Hiba történt a telepítés során. Csatlakoztasd újra az USB eszközt, és próbáld újra.#@A részleteket lásd a log.txt fájlban.", "STR_INSTALL_FAILED":"Hiba történt a telepítés során. Csatlakoztassa újra az USB-eszközt, és próbálja újra.#@A részleteket lásd a log.txt fájlban.",
"STR_UPDATE_SUCCESS":"Gratulálunk!#@A Ventoy sikeresen frissítve lett az eszközön.", "STR_UPDATE_SUCCESS":"Gratulálunk!#@A Ventoy sikeresen frissítve lett az eszközön.",
"STR_UPDATE_FAILED":"Hiba történt a frissítés során. Csatlakoztasd újra az USB eszközt, és próbáld újra.#@A részleteket lásd a log.txt fájlban.", "STR_UPDATE_FAILED":"Hiba történt a frissítés során. Csatlakoztassa újra az USB-eszközt, és próbálja újra.#@A részleteket lásd a log.txt fájlban.",
"STR_WAIT_PROCESS":"A feldolgozás még folyamatban van, kérlek várj...", "STR_WAIT_PROCESS":"A feldolgozás még folyamatban van, kis türelmet…",
"STR_MENU_OPTION":"Opció", "STR_MENU_OPTION":"Beállítás",
"STR_MENU_SECURE_BOOT":"Biztonsági mód (Secure Boot)", "STR_MENU_SECURE_BOOT":"Secure Boot támogatás",
"STR_MENU_PART_CFG":"Partíciókonfiguráció", "STR_MENU_PART_CFG":"Partíciókonfiguráció",
"STR_BTN_OK":"rendben", "STR_BTN_OK":"OK",
"STR_BTN_CANCEL":"Megszünteti", "STR_BTN_CANCEL":"Mégse",
"STR_PRESERVE_SPACE":"Tartson szabad helyet a lemez alján", "STR_PRESERVE_SPACE":"Szabad terület hagyása a lemez végén",
"STR_SPACE_VAL_INVALID":"A fenntartott hely érvénytelen értéke", "STR_SPACE_VAL_INVALID":"Érvénytelen érték a fenntartott helynél",
"STR_MENU_CLEAR":"Clear Ventoy", "STR_MENU_CLEAR":"A Ventoy eltávolítása",
"STR_CLEAR_SUCCESS":"Ventoy has been successfully removed from the device.", "STR_CLEAR_SUCCESS":"A Ventoy sikeresen eltávolítva az eszközről.",
"STR_CLEAR_FAILED":"An error occurred when clear Ventoy from disk. You can replug the USB and try again. Check log.txt for detail.", "STR_CLEAR_FAILED":"Hiba történt a Ventoy lemezről törlése során. Újra csatlakoztathatja az USB-t, és megpróbálhatja újra. A részleteket lásd a log.txt fájlban.",
"STR_MENU_PART_STYLE":"Partition Style", "STR_MENU_PART_STYLE":"Partíció fajtája",
"STR_DISK_2TB_MBR_ERROR":"Please select GPT for disk over 2TB", "STR_DISK_2TB_MBR_ERROR":"2 TB-nál nagyobb lemezhez válassza a GPT-t",
"STR_SHOW_ALL_DEV":"Show All Devices", "STR_SHOW_ALL_DEV":"Az összes eszköz megjelenítése",
"STR_PART_ALIGN_4KB":"Align partitions with 4KB", "STR_PART_ALIGN_4KB":"A partíciók 4 kB-hoz igazítása",
"STR_WEB_COMMUNICATION_ERR":"Communication error:", "STR_WEB_COMMUNICATION_ERR":"Kommunikációs hiba:",
"STR_WEB_REMOTE_ABNORMAL":"Communication error: remote abnormal", "STR_WEB_REMOTE_ABNORMAL":"Kommunikációs hiba: Távoli hiba",
"STR_WEB_REQUEST_TIMEOUT":"Communication error: Request timed out", "STR_WEB_REQUEST_TIMEOUT":"Kommunikációs hiba: Kérés időtúllépése",
"STR_WEB_SERVICE_UNAVAILABLE":"Communication error: Service Unavailable", "STR_WEB_SERVICE_UNAVAILABLE":"Kommunikációs hiba: A szolgáltatás nem érhető el",
"STR_WEB_TOKEN_MISMATCH":"Daemon status updated, please retry later.", "STR_WEB_TOKEN_MISMATCH":"A démon állapota frissítve, próbálja újra később.",
"STR_WEB_SERVICE_BUSY":"Service is busy, please retry later.", "STR_WEB_SERVICE_BUSY":"A szolgáltatás foglalt, próbálja újra később.",
"STR_MENU_VTSI_CREATE":"Generate VTSI File", "STR_MENU_VTSI_CREATE":"VTSI fájl előállítása",
"STR_VTSI_CREATE_TIP":"This time will not write to the device, but only generate a VTSI file#@Continue?", "STR_VTSI_CREATE_TIP":"Ez alkalommal nem ír az eszközre, csak egy VTSI fájlt állít elő#@Folytatja?",
"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_SUCCESS":"A VTSI fájl sikeresen létrehozva!#@A Rufus(3.15+) segítségével az eszközre írhatja a Ventoy telepítésének befejezéséhez.",
"STR_VTSI_CREATE_FAILED":"VTSI file created failed.", "STR_VTSI_CREATE_FAILED":"A VTSI fájl létrehozása nem sikerült.",
"STR_MENU_PART_RESIZE":"Non-destructive Install", "STR_MENU_PART_RESIZE":"Rombolásmentes telepítés",
"STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?", "STR_PART_RESIZE_TIP":"A Ventoy lehetőség szerint megpróbálja a rombolásmentes telepítést. #@Folytatja?",
"STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.", "STR_PART_RESIZE_SUCCESS":"Gratulálunk!#@A Ventoy rombolásmentes telepítése sikeresen befejeződött.",
"STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.", "STR_PART_RESIZE_FAILED":"A rombolásmentes telepítés nem sikerült, a részleteket lásd a log.txt fájlban.",
"STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.", "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":"Warning: Data will be lost!", "STR_INSTALL_YES_TIP1":"Figyelmeztetés: Az adatok elvesznek!",
"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_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.",
"STRXXX":"" "STRXXX":""
}, },
@@ -2293,8 +2409,8 @@
"STR_PART_RESIZE_SUCCESS":"Gratulerar!#@Ventoy lyckades slutföra en icke-förstörande installation.", "STR_PART_RESIZE_SUCCESS":"Gratulerar!#@Ventoy lyckades slutföra en icke-förstörande installation.",
"STR_PART_RESIZE_FAILED":"Ventoy misslyckades slutföra en icke-förstörande installation. Mer information finns i log.txt.", "STR_PART_RESIZE_FAILED":"Ventoy misslyckades slutföra en icke-förstörande installation. Mer information finns i log.txt.",
"STR_PART_RESIZE_UNSUPPORTED":"Icke-förstörande installation stoppades eftersom vissa villkor inte kunde uppfyllas. Mer information finns i log.txt.", "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":"Warning: Data will be lost!", "STR_INSTALL_YES_TIP1":"Varning: Data kommer att gå förlorade!",
"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_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.",
"STRXXX":"" "STRXXX":""
}, },
@@ -2710,6 +2826,65 @@
"STR_INSTALL_YES_TIP1":"Warning: Data will be lost!", "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_TIP2":"Please enter YES in the text box below to confirm that you indeed want to do a fresh install instead of upgrade.",
"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":"மேம்படுத்துவதற்குப் பதிலாக புதிதாக நிறுவ விரும்புகிறீர்கள் என்பதை உறுதிப்படுத்த, கீழே உள்ள உரைப் பெட்டியில் ஆம் என உள்ளிடவும்.",
"STRXXX":"" "STRXXX":""
} }
] ]

View File

@@ -936,7 +936,7 @@ void on_part_cfg_ok(GtkWidget *widget, gpointer data)
for (pos = input; *pos; pos++) for (pos = input; *pos; pos++)
{ {
if (*pos < '0' || *pos >= '9') if (*pos < '0' || *pos > '9')
{ {
msgbox(GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "STR_SPACE_VAL_INVALID"); msgbox(GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "STR_SPACE_VAL_INVALID");
return; return;

View File

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

View File

@@ -311,11 +311,23 @@ uint64_t ventoy_get_disk_size_in_byte(const char *disk)
int ventoy_get_disk_vendor(const char *name, char *vendorbuf, int bufsize) int ventoy_get_disk_vendor(const char *name, char *vendorbuf, int bufsize)
{ {
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); 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) int ventoy_get_disk_model(const char *name, char *modelbuf, int bufsize)
{ {
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); return ventoy_get_sys_file_line(modelbuf, bufsize, "/sys/block/%s/device/model", name);
} }
@@ -576,9 +588,9 @@ int ventoy_get_disk_info(char **argv)
char model[128]; char model[128];
char *disk = argv[4]; 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_vendor(disk, vendor, sizeof(vendor));
ventoy_get_disk_model(disk, model, sizeof(model)); 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_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_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() ssprintf(__uiCurPos, __pcBuf, __uiBufLen, ",")
#define VTOY_JSON_FMT_COMA_N(cnt) ssprintf(__uiCurPos, __pcBuf, __uiBufLen, ",\n") #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") #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 #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; extern int g_unxz_len;
void unxz_error(char *x); void unxz_error(char *x);
int unxz_flush(void *src, unsigned int size); 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__ */ #endif /* __VENTOY_UTIL_H__ */

View File

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

View File

@@ -60,6 +60,17 @@ static const char *g_ventoy_kbd_layout[] =
NULL 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_ventoy_help_lang[MAX_LANGUAGE][8];
static char g_pub_path[2 * MAX_PATH]; 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) static int ventoy_api_handshake(struct mg_connection *conn, VTOY_JSON *json)
{ {
int i = 0;
int j = 0;
int pos = 0; int pos = 0;
char key[128];
(void)json; (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("status", 0);
VTOY_JSON_FMT_SINT("save_error", g_sysinfo.config_save_error); VTOY_JSON_FMT_SINT("save_error", g_sysinfo.config_save_error);
g_sysinfo.config_save_error = 0; 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_OBJ_END();
VTOY_JSON_FMT_END(pos); VTOY_JSON_FMT_END(pos);
@@ -486,9 +513,11 @@ void ventoy_data_default_control(data_control *data)
{ {
memset(data, 0, sizeof(data_control)); memset(data, 0, sizeof(data_control));
data->secondary_menu = 1;
data->filter_dot_underscore = 1; data->filter_dot_underscore = 1;
data->max_search_level = -1; data->max_search_level = -1;
data->menu_timeout = 0; data->menu_timeout = 0;
data->secondary_menu_timeout = 0;
strlcpy(data->default_kbd_layout, "QWERTY_USA"); strlcpy(data->default_kbd_layout, "QWERTY_USA");
strlcpy(data->help_text_language, "en_US"); strlcpy(data->help_text_language, "en_US");
@@ -510,7 +539,9 @@ int ventoy_data_cmp_control(data_control *data1, data_control *data2)
data1->filter_vtoy != data2->filter_vtoy || data1->filter_vtoy != data2->filter_vtoy ||
data1->win11_bypass_check != data2->win11_bypass_check || data1->win11_bypass_check != data2->win11_bypass_check ||
data1->linux_remount != data2->linux_remount || data1->linux_remount != data2->linux_remount ||
data1->menu_timeout != data2->menu_timeout) data1->secondary_menu != data2->secondary_menu ||
data1->menu_timeout != data2->menu_timeout ||
data1->secondary_menu_timeout != data2->secondary_menu_timeout)
{ {
return 1; return 1;
} }
@@ -555,7 +586,9 @@ 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_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_WIN11_BYPASS_CHECK", win11_bypass_check);
VTOY_JSON_FMT_CTRL_INT(L2, "VTOY_LINUX_REMOUNT", linux_remount); 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_MENU_TIMEOUT", menu_timeout); 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_DEFAULT_KBD_LAYOUT", default_kbd_layout);
VTOY_JSON_FMT_CTRL_STRN(L2, "VTOY_HELP_TXT_LANGUAGE", help_text_language); VTOY_JSON_FMT_CTRL_STRN(L2, "VTOY_HELP_TXT_LANGUAGE", help_text_language);
@@ -600,7 +633,9 @@ 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("filter_vtoy", ctrl->filter_vtoy);
VTOY_JSON_FMT_SINT("win11_bypass_check", ctrl->win11_bypass_check); VTOY_JSON_FMT_SINT("win11_bypass_check", ctrl->win11_bypass_check);
VTOY_JSON_FMT_SINT("linux_remount", ctrl->linux_remount); VTOY_JSON_FMT_SINT("linux_remount", ctrl->linux_remount);
VTOY_JSON_FMT_SINT("secondary_menu", ctrl->secondary_menu);
VTOY_JSON_FMT_SINT("menu_timeout", ctrl->menu_timeout); 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("default_kbd_layout", ctrl->default_kbd_layout);
VTOY_JSON_FMT_STRN("help_text_language", ctrl->help_text_language); VTOY_JSON_FMT_STRN("help_text_language", ctrl->help_text_language);
@@ -666,7 +701,9 @@ static int ventoy_api_save_control(struct mg_connection *conn, VTOY_JSON *json)
VTOY_JSON_INT("filter_vtoy", ctrl->filter_vtoy); VTOY_JSON_INT("filter_vtoy", ctrl->filter_vtoy);
VTOY_JSON_INT("win11_bypass_check", ctrl->win11_bypass_check); VTOY_JSON_INT("win11_bypass_check", ctrl->win11_bypass_check);
VTOY_JSON_INT("linux_remount", ctrl->linux_remount); VTOY_JSON_INT("linux_remount", ctrl->linux_remount);
VTOY_JSON_INT("secondary_menu", ctrl->secondary_menu);
VTOY_JSON_INT("menu_timeout", ctrl->menu_timeout); 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_image", ctrl->default_image);
VTOY_JSON_STR("default_search_root", ctrl->default_search_root); VTOY_JSON_STR("default_search_root", ctrl->default_search_root);
@@ -917,7 +954,14 @@ static int ventoy_api_theme_del_file(struct mg_connection *conn, VTOY_JSON *json
path = VTOY_JSON_STR_EX("path"); path = VTOY_JSON_STR_EX("path");
if (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(); ret = ventoy_data_save_all();
@@ -972,7 +1016,14 @@ static int ventoy_api_theme_del_font(struct mg_connection *conn, VTOY_JSON *json
path = VTOY_JSON_STR_EX("path"); path = VTOY_JSON_STR_EX("path");
if (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(); ret = ventoy_data_save_all();
@@ -1169,7 +1220,14 @@ static int ventoy_api_alias_del(struct mg_connection *conn, VTOY_JSON *json)
path = VTOY_JSON_STR_EX("path"); path = VTOY_JSON_STR_EX("path");
if (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(); ret = ventoy_data_save_all();
@@ -1407,7 +1465,14 @@ static int ventoy_api_tip_del(struct mg_connection *conn, VTOY_JSON *json)
path = VTOY_JSON_STR_EX("path"); path = VTOY_JSON_STR_EX("path");
if (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(); ret = ventoy_data_save_all();
@@ -1610,7 +1675,14 @@ static int ventoy_api_class_del(struct mg_connection *conn, VTOY_JSON *json)
path = VTOY_JSON_STR_EX("path"); path = VTOY_JSON_STR_EX("path");
if (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(); ret = ventoy_data_save_all();
@@ -1739,7 +1811,14 @@ static int ventoy_api_auto_memdisk_del(struct mg_connection *conn, VTOY_JSON *js
path = VTOY_JSON_STR_EX("path"); path = VTOY_JSON_STR_EX("path");
if (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(); ret = ventoy_data_save_all();
@@ -1914,7 +1993,14 @@ static int ventoy_api_image_list_del(struct mg_connection *conn, VTOY_JSON *json
path = VTOY_JSON_STR_EX("path"); path = VTOY_JSON_STR_EX("path");
if (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(); ret = ventoy_data_save_all();
@@ -2165,7 +2251,14 @@ static int ventoy_api_password_del(struct mg_connection *conn, VTOY_JSON *json)
path = VTOY_JSON_STR_EX("path"); path = VTOY_JSON_STR_EX("path");
if (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(); ret = ventoy_data_save_all();
@@ -2356,7 +2449,14 @@ static int ventoy_api_conf_replace_del(struct mg_connection *conn, VTOY_JSON *js
path = VTOY_JSON_STR_EX("path"); path = VTOY_JSON_STR_EX("path");
if (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(); ret = ventoy_data_save_all();
@@ -2545,6 +2645,7 @@ static int ventoy_api_dud_del(struct mg_connection *conn, VTOY_JSON *json)
int ret; int ret;
int index = 0; int index = 0;
const char *path = NULL; const char *path = NULL;
dud_node *next = NULL;
dud_node *last = NULL; dud_node *last = NULL;
dud_node *node = NULL; dud_node *node = NULL;
data_dud *data = NULL; data_dud *data = NULL;
@@ -2555,7 +2656,20 @@ static int ventoy_api_dud_del(struct mg_connection *conn, VTOY_JSON *json)
path = VTOY_JSON_STR_EX("path"); path = VTOY_JSON_STR_EX("path");
if (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(); ret = ventoy_data_save_all();
@@ -2892,6 +3006,7 @@ static int ventoy_api_auto_install_del(struct mg_connection *conn, VTOY_JSON *js
int index = 0; int index = 0;
const char *path = NULL; const char *path = NULL;
auto_install_node *last = NULL; auto_install_node *last = NULL;
auto_install_node *next = NULL;
auto_install_node *node = NULL; auto_install_node *node = NULL;
data_auto_install *data = NULL; data_auto_install *data = NULL;
@@ -2901,7 +3016,20 @@ static int ventoy_api_auto_install_del(struct mg_connection *conn, VTOY_JSON *js
path = VTOY_JSON_STR_EX("path"); path = VTOY_JSON_STR_EX("path");
if (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(); ret = ventoy_data_save_all();
@@ -3219,6 +3347,7 @@ static int ventoy_api_persistence_del(struct mg_connection *conn, VTOY_JSON *jso
int index = 0; int index = 0;
const char *path = NULL; const char *path = NULL;
persistence_node *last = NULL; persistence_node *last = NULL;
persistence_node *next = NULL;
persistence_node *node = NULL; persistence_node *node = NULL;
data_persistence *data = NULL; data_persistence *data = NULL;
@@ -3228,7 +3357,20 @@ static int ventoy_api_persistence_del(struct mg_connection *conn, VTOY_JSON *jso
path = VTOY_JSON_STR_EX("path"); path = VTOY_JSON_STR_EX("path");
if (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(); ret = ventoy_data_save_all();
@@ -3505,7 +3647,14 @@ static int ventoy_api_injection_del(struct mg_connection *conn, VTOY_JSON *json)
path = VTOY_JSON_STR_EX("path"); path = VTOY_JSON_STR_EX("path");
if (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(); ret = ventoy_data_save_all();
@@ -3514,6 +3663,34 @@ static int ventoy_api_injection_del(struct mg_connection *conn, VTOY_JSON *json)
return 0; 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 #if 0
#endif #endif
@@ -3524,13 +3701,16 @@ int ventoy_data_save_all(void)
return 0; return 0;
} }
int ventoy_data_real_save_all(void) int ventoy_data_real_save_all(int apilock)
{ {
int i = 0; int i = 0;
int pos = 0; int pos = 0;
char title[64]; 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"); ssprintf(pos, JSON_SAVE_BUFFER, JSON_BUF_MAX, "{\n");
@@ -3555,7 +3735,10 @@ int ventoy_data_real_save_all(void)
} }
ssprintf(pos, JSON_SAVE_BUFFER, JSON_BUF_MAX, "}\n"); 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; return pos;
} }
@@ -3568,7 +3751,7 @@ int ventoy_http_writeback(void)
ventoy_get_json_path(filename, NULL); ventoy_get_json_path(filename, NULL);
pos = ventoy_data_real_save_all(); pos = ventoy_data_real_save_all(1);
#ifdef VENTOY_SIM #ifdef VENTOY_SIM
printf("%s", JSON_SAVE_BUFFER); printf("%s", JSON_SAVE_BUFFER);
@@ -3665,11 +3848,11 @@ static JSON_CB g_ventoy_json_cb[] =
{ "save_injection", ventoy_api_save_injection }, { "save_injection", ventoy_api_save_injection },
{ "injection_add", ventoy_api_injection_add }, { "injection_add", ventoy_api_injection_add },
{ "injection_del", ventoy_api_injection_del }, { "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; int i;
const char *method = NULL; const char *method = NULL;
@@ -3730,7 +3913,7 @@ static int ventoy_request_handler(struct mg_connection *conn)
if (JSON_SUCCESS == vtoy_json_parse(json, post_data_buf)) if (JSON_SUCCESS == vtoy_json_parse(json, post_data_buf))
{ {
pthread_mutex_lock(&g_api_mutex); 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); pthread_mutex_unlock(&g_api_mutex);
} }
else else
@@ -3808,6 +3991,10 @@ static int ventoy_parse_control(VTOY_JSON *json, void *p)
{ {
CONTROL_PARSE_INT(child, data->linux_remount); CONTROL_PARSE_INT(child, data->linux_remount);
} }
else if (strcmp(child->pcName, "VTOY_SECONDARY_BOOT_MENU") == 0)
{
CONTROL_PARSE_INT(child, data->secondary_menu);
}
else if (strcmp(child->pcName, "VTOY_TREE_VIEW_MENU_STYLE") == 0) else if (strcmp(child->pcName, "VTOY_TREE_VIEW_MENU_STYLE") == 0)
{ {
CONTROL_PARSE_INT(child, data->treeview_style); CONTROL_PARSE_INT(child, data->treeview_style);
@@ -3865,6 +4052,10 @@ static int ventoy_parse_control(VTOY_JSON *json, void *p)
{ {
data->menu_timeout = (int)strtol(child->unData.pcStrVal, NULL, 10); 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) else if (strcmp(child->pcName, "VTOY_VHD_NO_WARNING") == 0)
{ {
CONTROL_PARSE_INT(child, data->vhd_no_warning); CONTROL_PARSE_INT(child, data->vhd_no_warning);
@@ -5008,7 +5199,8 @@ end:
int ventoy_http_start(const char *ip, const char *port) int ventoy_http_start(const char *ip, const char *port)
{ {
int i; int i = 0;
int ret = 0;
char addr[128]; char addr[128];
char filename[128]; char filename[128];
char backupname[128]; char backupname[128];
@@ -5045,10 +5237,13 @@ int ventoy_http_start(const char *ip, const char *port)
if (ventoy_is_file_exist("%s", filename)) if (ventoy_is_file_exist("%s", filename))
{ {
ventoy_copy_file(filename, backupname); 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 */ /* option */
scnprintf(addr, sizeof(addr), "%s:%s", ip, port); scnprintf(addr, sizeof(addr), "%s:%s", ip, port);
options[1] = addr; options[1] = addr;

View File

@@ -41,6 +41,24 @@ typedef enum bios_mode
bios_max bios_max
}bios_mode; }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 typedef struct data_control
{ {
@@ -58,7 +76,9 @@ typedef struct data_control
int filter_vtoy; int filter_vtoy;
int win11_bypass_check; int win11_bypass_check;
int menu_timeout; int menu_timeout;
int secondary_menu_timeout;
int linux_remount; int linux_remount;
int secondary_menu;
char default_search_root[MAX_PATH]; char default_search_root[MAX_PATH];
char default_image[MAX_PATH]; char default_image[MAX_PATH];
char default_kbd_layout[32]; char default_kbd_layout[32];
@@ -258,8 +278,10 @@ typedef struct data_persistence
for (i = 0; i < bios_max; i++) \ for (i = 0; i < bios_max; i++) \
{\ {\
scnprintf(title, sizeof(title), "%s%s", #plug, g_json_title_postfix[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))\ 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);\ pos += ventoy_data_save_##plug(g_data_##plug + i, title, JSON_SAVE_BUFFER + pos, JSON_BUF_MAX - pos);\
}\ }\
}\ }\
@@ -300,6 +322,7 @@ typedef struct data_persistence
free(__node);\ free(__node);\
__node = __next;\ __node = __next;\
}\ }\
(list) = NULL;\
} }
#define vtoy_list_del(last, node, LIST, field) \ #define vtoy_list_del(last, node, LIST, field) \
@@ -399,6 +422,7 @@ void ventoy_http_exit(void);
int ventoy_http_start(const char *ip, const char *port); int ventoy_http_start(const char *ip, const char *port);
int ventoy_http_stop(void); int ventoy_http_stop(void);
int ventoy_data_save_all(void); int ventoy_data_save_all(void);
int ventoy_data_real_save_all(int apilock);
#endif /* __VENTOY_HTTP_H__ */ #endif /* __VENTOY_HTTP_H__ */

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