1.1.11
Some checks failed
Ventoy CI / build (push) Has been cancelled
Mirror GitHub to Gitee / Sync-GitHub-to-Gitee (push) Has been cancelled

. Fix the display issue when UEFI boot Windows/WinPE
. #3537
. #3532
. Add VT_WINDOWS_DISK_NONVTOY_CLOSEST_XXX  VT_LINUX_DISK_NONVTOY_CLOSEST_XXX
This commit is contained in:
longpanda
2026-04-05 23:11:45 +08:00
parent d35b8431fe
commit 167c87402c
12 changed files with 786 additions and 587 deletions

View File

@@ -1,5 +1,5 @@
/******************************************************************************
* ventoy.c
* ventoy.c
*
* Copyright (c) 2020, longpanda <admin@ventoy.net>
*
@@ -7,12 +7,12 @@
* 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/>.
*
@@ -137,7 +137,7 @@ int ventoy_str_len_alnum(const char *str, int len)
{
int i;
int slen;
if (NULL == str || 0 == *str)
{
return 0;
@@ -168,7 +168,7 @@ int ventoy_str_len_alnum(const char *str, int len)
char * ventoy_str_basename(char *path)
{
char *pos = NULL;
pos = grub_strrchr(path, '/');
if (pos)
{
@@ -185,17 +185,17 @@ char * ventoy_str_basename(char *path)
int ventoy_str_chrcnt(const char *str, char c)
{
int n = 0;
if (str)
{
while (*str)
{
if (*str == c)
{
n++;
n++;
}
str++;
}
}
}
return n;
@@ -235,7 +235,7 @@ int ventoy_strncmp (const char *pattern, const char *str, grub_size_t n)
grub_err_t ventoy_env_int_set(const char *name, int value)
{
char buf[16];
grub_snprintf(buf, sizeof(buf), "%d", value);
return grub_env_set(name, buf);
}
@@ -248,13 +248,13 @@ void ventoy_debug_dump_guid(const char *prefix, grub_uint8_t *guid)
{
return;
}
debug("%s", prefix);
for (i = 0; i < 16; i++)
{
grub_printf("%02x ", guid[i]);
}
grub_printf("\n");
grub_printf("\n");
}
int ventoy_is_efi_os(void)
@@ -290,7 +290,7 @@ void ventoy_memfile_env_set(const char *prefix, const void *buf, unsigned long l
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);
@@ -374,7 +374,7 @@ static int ventoy_hwinfo_init(void)
return 0;
}
static global_var_cfg g_global_vars[] =
static global_var_cfg g_global_vars[] =
{
{ "gfxmode", "1024x768", NULL },
{ ventoy_left_key, "5%", NULL },
@@ -422,19 +422,20 @@ int ventoy_global_var_init(void)
for (i = 0; g_global_vars[i].name; i++)
{
g_global_vars[i].value = grub_strdup(g_global_vars[i].defval);
ventoy_env_export(g_global_vars[i].name, g_global_vars[i].defval);
ventoy_env_export(g_global_vars[i].name, g_global_vars[i].defval);
grub_register_variable_hook(g_global_vars[i].name, ventoy_global_var_read_hook, ventoy_global_var_write_hook);
}
return 0;
}
static ctrl_var_cfg g_ctrl_vars[] =
static ctrl_var_cfg g_ctrl_vars[] =
{
{ "VTOY_WIN11_BYPASS_CHECK", 1 },
{ "VTOY_WIN11_BYPASS_NRO", 1 },
{ "VTOY_LINUX_REMOUNT", 0 },
{ "VTOY_SECONDARY_BOOT_MENU", 1 },
{ "VTOY_WIN_UEFI_MAX_RES", 1 },
{ NULL, 0 }
};

File diff suppressed because it is too large Load Diff

View File

@@ -7,12 +7,12 @@
* 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/>.
*
@@ -82,7 +82,7 @@ typedef struct ventoy_image_location
/*
* disk region data (region_count)
* If the image file has more than one fragments in disk,
* If the image file has more than one fragments in disk,
* there will be more than one region data here.
*
*/
@@ -104,7 +104,7 @@ typedef struct ventoy_os_param
char vtoy_img_path[384]; // It seems to be enough, utf-8 format
grub_uint64_t vtoy_img_size; // image file size in bytes
/*
/*
* Ventoy will write a copy of ventoy_image_location data into runtime memory
* this is the physically address and length of that memory.
* Address 0 means no such data exist.
@@ -114,7 +114,7 @@ typedef struct ventoy_os_param
grub_uint64_t vtoy_img_location_addr;
grub_uint32_t vtoy_img_location_len;
/*
/*
* These 32 bytes are reserved by ventoy.
*
* vtoy_reserved[0]: vtoy_break_level
@@ -125,6 +125,7 @@ typedef struct ventoy_os_param
* vtoy_reserved[5]: vtoy_linux_remount
* vtoy_reserved[6]: vtoy_vlnk
* vtoy_reserved[7~10]: vtoy_disk_sig[4] used for vlnk
* vtoy_reserved[11]: vtoy_win_uefi_max_res
*
*/
grub_uint8_t vtoy_reserved[32]; // Internal use by ventoy
@@ -155,8 +156,8 @@ typedef struct ventoy_windows_data
typedef struct ventoy_secure_data
{
grub_uint8_t magic1[16]; /* VENTOY_GUID */
grub_uint8_t diskuuid[16];
grub_uint8_t Checksum[16];
grub_uint8_t diskuuid[16];
grub_uint8_t Checksum[16];
grub_uint8_t adminSHA256[32];
grub_uint8_t reserved[4000];
grub_uint8_t magic2[16]; /* VENTOY_GUID */
@@ -200,7 +201,7 @@ typedef struct ventoy_chain_head
grub_uint64_t virt_img_size_in_bytes;
grub_uint32_t boot_catalog;
grub_uint8_t boot_catalog_sector[2048];
grub_uint32_t img_chunk_offset;
grub_uint32_t img_chunk_num;
@@ -319,7 +320,7 @@ grub_uint64_t grub_udf_get_file_offset(grub_file_t file);
grub_uint64_t grub_udf_get_last_pd_size_offset(void);
grub_uint64_t grub_udf_get_last_file_attr_offset
(
grub_file_t file,
grub_file_t file,
grub_uint32_t *startBlock,
grub_uint64_t *fe_entry_size_offset
);