diff --git a/.github/ISSUE_TEMPLATE/issue_template.yml b/.github/ISSUE_TEMPLATE/issue_template.yml index 85ed49e3..396c69d7 100644 --- a/.github/ISSUE_TEMPLATE/issue_template.yml +++ b/.github/ISSUE_TEMPLATE/issue_template.yml @@ -21,7 +21,7 @@ body: attributes: label: Ventoy Version description: What version of ventoy are you running? - placeholder: 1.0.65 + placeholder: 1.0.66 validations: required: true - type: dropdown diff --git a/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/Ventoy/Ventoy.c b/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/Ventoy/Ventoy.c index 5d997225..67e6881a 100644 --- a/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/Ventoy/Ventoy.c +++ b/EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/Ventoy/Ventoy.c @@ -229,12 +229,14 @@ static void EFIAPI ventoy_dump_chain(ventoy_chain_head *chain) debug("os_param->vtoy_img_size=<%llu>", chain->os_param.vtoy_img_size); debug("os_param->vtoy_img_location_addr=<0x%llx>", chain->os_param.vtoy_img_location_addr); debug("os_param->vtoy_img_location_len=<%u>", chain->os_param.vtoy_img_location_len); - debug("os_param->vtoy_reserved=<%u %u %u %u %u>", + debug("os_param->vtoy_reserved=<%u %u %u %u %u %u %u>", g_os_param_reserved[0], g_os_param_reserved[1], g_os_param_reserved[2], g_os_param_reserved[3], - g_os_param_reserved[4] + g_os_param_reserved[4], + g_os_param_reserved[5], + g_os_param_reserved[6] ); ventoy_debug_pause(); @@ -578,7 +580,7 @@ STATIC EFI_STATUS EFIAPI ventoy_find_iso_disk(IN EFI_HANDLE ImageHandle) if (CompareMem(g_chain->os_param.vtoy_disk_guid, pBuffer + 0x180, 16) == 0) { pMBR = (MBR_HEAD *)pBuffer; - if (pMBR->PartTbl[0].FsFlag != 0xEE) + if (g_os_param_reserved[6] == 0 && pMBR->PartTbl[0].FsFlag != 0xEE) { if (pMBR->PartTbl[0].StartSectorId != 2048 || pMBR->PartTbl[1].SectorCount != 65536 || @@ -956,6 +958,7 @@ STATIC EFI_STATUS EFIAPI ventoy_parse_cmdline(IN EFI_HANDLE ImageHandle) debug("memdisk mode iso_buf_size:%u", g_iso_buf_size); g_chain = chain; + g_os_param_reserved = (UINT8 *)(g_chain->os_param.vtoy_reserved); gMemdiskMode = TRUE; } else diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/file.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/file.c index b4d5238c..61e02614 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/file.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/file.c @@ -106,19 +106,109 @@ int ventoy_check_file_exist(const char * fmt, ...) } } +typedef struct grub_vlnk +{ + int srclen; + char src[512]; + char dst[512]; + struct grub_vlnk *next; +}grub_vlnk; + +static grub_vlnk *g_vlnk_list; + +int grub_file_is_vlnk_suffix(const char *name, int len) +{ + grub_uint32_t suffix; + + if (len > 9) + { + suffix = *(grub_uint32_t *)(name + len - 4); + if (grub_strncmp(name + len - 9, ".vlnk.", 6) == 0) + { + /* .iso .wim .img .vhd .efi .dat */ + if (suffix == 0x6F73692E || suffix == 0x6D69772E || + suffix == 0x676D692E || suffix == 0x6468762E || + suffix == 0x6966652E || suffix == 0x7461642E) + { + return 1; + } + } + else if (len > 10 && grub_strncmp(name + len - 10, ".vlnk.", 6) == 0) + { + /* vhdx vtoy */ + if (suffix == 0x78646876 || suffix == 0x796F7476) + { + return 1; + } + } + } + + return 0; +} + +int grub_file_add_vlnk(const char *src, const char *dst) +{ + grub_vlnk *node = NULL; + + if (src && dst) + { + node = grub_zalloc(sizeof(grub_vlnk)); + if (node) + { + node->srclen = (int)grub_strlen(src); + grub_strncpy(node->src, src, sizeof(node->src) - 1); + grub_strncpy(node->dst, dst, sizeof(node->dst) - 1); + + node->next = g_vlnk_list; + g_vlnk_list = node; + return 0; + } + } + + return 1; +} + +const char *grub_file_get_vlnk(const char *name, int *vlnk) +{ + int len; + grub_vlnk *node = g_vlnk_list; + + len = grub_strlen(name); + if (!grub_file_is_vlnk_suffix(name, len)) + { + return name; + } + + while (node) + { + if (node->srclen == len && grub_strcmp(name, node->src) == 0) + { + *vlnk = 1; + return node->dst; + } + node = node->next; + } + + return name; +} + grub_file_t grub_file_open (const char *name, enum grub_file_type type) { + int vlnk = 0; grub_device_t device = 0; grub_file_t file = 0, last_file = 0; char *device_name; const char *file_name; grub_file_filter_id_t filter; - /* : mem:xxx:size:xxx format in chainloader */ - if (grub_strncmp(name, GRUB_MEMFILE_MEM, grub_strlen(GRUB_MEMFILE_MEM)) == 0) { + /* : mem:xxx:size:xxx format in chainloader grub_strlen(GRUB_MEMFILE_MEM) */ + if (grub_strncmp(name, GRUB_MEMFILE_MEM, 4) == 0) { return grub_memfile_open(name); - } + } + + if (g_vlnk_list && (type & GRUB_FILE_TYPE_NO_VLNK) == 0) + name = grub_file_get_vlnk(name, &vlnk); device_name = grub_file_get_device_name (name); if (grub_errno) @@ -141,6 +231,7 @@ grub_file_open (const char *name, enum grub_file_type type) goto fail; file->device = device; + file->vlnk = vlnk; /* In case of relative pathnames and non-Unix systems (like Windows) * name of host files may not start with `/'. Blocklists for host files diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/fs.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/fs.c index 3052ae9e..2736259e 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/fs.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/kern/fs.c @@ -42,6 +42,44 @@ probe_dummy_iter (const char *filename __attribute__ ((unused)), return 1; } +grub_fs_t grub_fs_list_probe(grub_device_t device, const char **list) +{ + int i; + grub_fs_t p; + + if (!device->disk) + return 0; + + for (p = grub_fs_list; p; p = p->next) + { + for (i = 0; list[i]; i++) + { + if (grub_strcmp(p->name, list[i]) == 0) + break; + } + + if (list[i] == NULL) + continue; + + grub_dprintf("fs", "Detecting %s...\n", p->name); + + (p->fs_dir) (device, "/", probe_dummy_iter, NULL); + if (grub_errno == GRUB_ERR_NONE) + return p; + + grub_error_push (); + grub_dprintf ("fs", "%s detection failed.\n", p->name); + grub_error_pop (); + + if (grub_errno != GRUB_ERR_BAD_FS && grub_errno != GRUB_ERR_OUT_OF_RANGE) { + return 0; + } + grub_errno = GRUB_ERR_NONE; + } + + return 0; +} + grub_fs_t grub_fs_probe (grub_device_t device) { diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c index 158d1658..2fb78c30 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c @@ -102,6 +102,7 @@ ventoy_img_chunk_list g_img_chunk_list; int g_wimboot_enable = 0; ventoy_img_chunk_list g_wimiso_chunk_list; char *g_wimiso_path = NULL; +grub_uint32_t g_wimiso_size = 0; int g_vhdboot_enable = 0; @@ -155,6 +156,8 @@ static char g_vtoy_prompt_msg[64]; static char g_json_case_mis_path[32]; +static ventoy_vlnk_part *g_vlnk_part_list = NULL; + static int ventoy_get_fs_type(const char *fs) { if (NULL == fs) @@ -699,32 +702,6 @@ grub_file_t ventoy_grub_file_open(enum grub_file_type type, const char *fmt, ... return file; } -int ventoy_is_file_exist(const char *fmt, ...) -{ - va_list ap; - int len; - char *pos = NULL; - char buf[256] = {0}; - - grub_snprintf(buf, sizeof(buf), "%s", "[ -f \""); - pos = buf + 6; - - va_start (ap, fmt); - len = grub_vsnprintf(pos, 255, fmt, ap); - va_end (ap); - - grub_strncpy(pos + len, "\" ]", 3); - - debug("script exec %s\n", buf); - - if (0 == grub_script_execute_sourcecode(buf)) - { - return 1; - } - - return 0; -} - int ventoy_is_dir_exist(const char *fmt, ...) { va_list ap; @@ -1007,6 +984,7 @@ static grub_err_t ventoy_cmd_load_wimboot(grub_extcmd_context_t ctxt, int argc, (void)args; g_wimboot_enable = 0; + g_wimiso_size = 0; grub_check_free(g_wimiso_path); grub_check_free(g_wimiso_chunk_list.chunk); @@ -1030,7 +1008,7 @@ static grub_err_t ventoy_cmd_load_wimboot(grub_extcmd_context_t ctxt, int argc, g_wimboot_enable = 1; g_wimiso_path = grub_strdup(args[0]); - + g_wimiso_size = (grub_uint32_t)(file->size); grub_file_close(file); return 0; @@ -1074,6 +1052,11 @@ static grub_err_t ventoy_cmd_concat_efi_iso(grub_extcmd_context_t ctxt, int argc return 1; } + if (grub_strncmp(args[0], g_iso_path, grub_strlen(g_iso_path))) + { + file->vlnk = 1; + } + totlen += ventoy_align_2k(file->size); dirent = (ventoy_iso9660_override *)(buf + offset); @@ -1611,12 +1594,231 @@ static int ventoy_img_name_valid(const char *filename, grub_size_t namelen) return 1; } +static int ventoy_vlnk_iterate_partition(struct grub_disk *disk, const grub_partition_t partition, void *data) +{ + ventoy_vlnk_part *node = NULL; + grub_uint32_t *pSig = (grub_uint32_t *)data; + + node = grub_zalloc(sizeof(ventoy_vlnk_part)); + if (node) + { + node->disksig = *pSig; + node->partoffset = (partition->start << GRUB_DISK_SECTOR_BITS); + grub_snprintf(node->disk, sizeof(node->disk) - 1, "%s", disk->name); + grub_snprintf(node->device, sizeof(node->device) - 1, "%s,%d", disk->name, partition->number + 1); + + node->next = g_vlnk_part_list; + g_vlnk_part_list = node; + } + + return 0; +} + +static int ventoy_vlnk_iterate_disk(const char *name, void *data) +{ + grub_disk_t disk; + grub_uint32_t sig; + + (void)data; + + disk = grub_disk_open(name); + if (disk) + { + grub_disk_read(disk, 0, 0x1b8, 4, &sig); + + /* skip ventoy device self */ + if (sig != *(grub_uint32_t *)data) + { + grub_partition_iterate(disk, ventoy_vlnk_iterate_partition, &sig); + } + + grub_disk_close(disk); + } + + return 0; +} + +static int ventoy_vlnk_probe_fs(ventoy_vlnk_part *cur) +{ + const char *fs[ventoy_fs_max + 1] = + { + "exfat", "ntfs", "ext2", "xfs", "udf", "fat", NULL + }; + + if (!cur->dev) + { + cur->dev = grub_device_open(cur->device); + } + + if (cur->dev) + { + cur->fs = grub_fs_list_probe(cur->dev, fs); + } + + return 0; +} + +static int ventoy_check_vlnk_data(ventoy_vlnk *vlnk, int print, char *dst, int size) +{ + int diskfind = 0; + int partfind = 0; + int filefind = 0; + char *disk, *device; + grub_uint32_t readcrc, calccrc; + ventoy_vlnk_part *cur; + grub_fs_t fs = NULL; + + if (grub_memcmp(&(vlnk->guid), &g_ventoy_guid, sizeof(ventoy_guid))) + { + if (print) + { + grub_printf("VLNK invalid guid\n"); + grub_refresh(); + } + return 1; + } + + readcrc = vlnk->crc32; + vlnk->crc32 = 0; + calccrc = grub_getcrc32c(0, vlnk, sizeof(ventoy_vlnk)); + if (readcrc != calccrc) + { + if (print) + { + grub_printf("VLNK invalid crc 0x%08x 0x%08x\n", calccrc, readcrc); + grub_refresh(); + } + return 1; + } + + if (!g_vlnk_part_list) + { + grub_disk_dev_iterate(ventoy_vlnk_iterate_disk, g_ventoy_part_info->MBR.BootCode + 0x1b8); + } + + for (cur = g_vlnk_part_list; cur && filefind == 0; cur = cur->next) + { + if (cur->disksig == vlnk->disk_signature) + { + diskfind = 1; + disk = cur->disk; + if (cur->partoffset == vlnk->part_offset) + { + partfind = 1; + device = cur->device; + + if (cur->probe == 0) + { + cur->probe = 1; + ventoy_vlnk_probe_fs(cur); + } + + if (!fs) + { + fs = cur->fs; + } + + if (cur->fs) + { + struct grub_file file; + + grub_memset(&file, 0, sizeof(file)); + file.device = cur->dev; + if (cur->fs->fs_open(&file, vlnk->filepath) == GRUB_ERR_NONE) + { + filefind = 1; + cur->fs->fs_close(&file); + grub_snprintf(dst, size - 1, "(%s)%s", cur->device, vlnk->filepath); + } + } + } + } + } + + if (print) + { + grub_printf("\n==== VLNK Information ====\n" + "Disk Signature: %08x\n" + "Partition Offset: %llu\n" + "File Path: <%s>\n\n", + vlnk->disk_signature, (ulonglong)vlnk->part_offset, vlnk->filepath); + + if (diskfind) + { + grub_printf("Disk Find: [ YES ] [ %s ]\n", disk); + } + else + { + grub_printf("Disk Find: [ NO ]\n"); + } + + if (partfind) + { + grub_printf("Part Find: [ YES ] [ %s ] [ %s ]\n", device, fs ? fs->name : "N/A"); + } + else + { + grub_printf("Part Find: [ NO ]\n"); + } + grub_printf("File Find: [ %s ]\n", filefind ? "YES" : "NO"); + if (filefind) + { + grub_printf("VLNK File: <%s>\n", dst); + } + + grub_printf("\n"); + grub_refresh(); + } + + return (1 - filefind); +} + +int ventoy_add_vlnk_file(char *dir, const char *name) +{ + int rc = 1; + char src[512]; + char dst[512]; + grub_file_t file = NULL; + ventoy_vlnk vlnk; + + if (!dir) + { + grub_snprintf(src, sizeof(src), "%s%s", g_iso_path, name); + } + else if (dir[0] == '/') + { + grub_snprintf(src, sizeof(src), "%s%s%s", g_iso_path, dir, name); + } + else + { + grub_snprintf(src, sizeof(src), "%s/%s%s", g_iso_path, dir, name); + } + + file = grub_file_open(src, VENTOY_FILE_TYPE); + if (!file) + { + return 1; + } + + grub_memset(&vlnk, 0, sizeof(vlnk)); + grub_file_read(file, &vlnk, sizeof(vlnk)); + grub_file_close(file); + + if (ventoy_check_vlnk_data(&vlnk, 0, dst, sizeof(dst)) == 0) + { + rc = grub_file_add_vlnk(src, dst); + } + + return rc; +} + static int ventoy_collect_img_files(const char *filename, const struct grub_dirhook_info *info, void *data) { //int i = 0; int type = 0; int ignore = 0; int index = 0; + int vlnk = 0; grub_size_t len; img_info *img; img_info *tail; @@ -1785,6 +1987,18 @@ static int ventoy_collect_img_files(const char *filename, const struct grub_dirh return 0; } } + + if (info->size == VTOY_FILT_MIN_FILE_SIZE || info->size == 0) + { + if (grub_file_is_vlnk_suffix(filename, len)) + { + vlnk = 1; + if (ventoy_add_vlnk_file(node->dir, filename) != 0) + { + return 0; + } + } + } img = grub_zalloc(sizeof(img_info)); if (img) @@ -1796,9 +2010,16 @@ static int ventoy_collect_img_files(const char *filename, const struct grub_dirh img->pathlen = grub_snprintf(img->path, sizeof(img->path), "%s%s", node->dir, img->name); img->size = info->size; - if (0 == img->size) + if (vlnk || 0 == img->size) { - img->size = ventoy_grub_get_file_size("%s/%s%s", g_iso_path, node->dir, filename); + if (node->dir[0] == '/') + { + img->size = ventoy_grub_get_file_size("%s%s%s", g_iso_path, node->dir, filename); + } + else + { + img->size = ventoy_grub_get_file_size("%s/%s%s", g_iso_path, node->dir, filename); + } } if (img->size < VTOY_FILT_MIN_FILE_SIZE) @@ -2803,6 +3024,10 @@ void ventoy_fill_os_param(grub_file_t file, ventoy_os_param *param) param->vtoy_reserved[5] = 1; } + /* ventoy_disk_signature used for vlnk */ + param->vtoy_reserved[6] = file->vlnk; + grub_memcpy(param->vtoy_reserved + 7, g_ventoy_part_info->MBR.BootCode + 0x1b8, 4); + /* calculate checksum */ for (i = 0; i < sizeof(ventoy_os_param); i++) { @@ -5084,6 +5309,114 @@ out: return ret; } +static grub_err_t grub_cmd_vlnk_dump_part(grub_extcmd_context_t ctxt, int argc, char **args) +{ + int n = 0; + ventoy_vlnk_part *node; + + (void)ctxt; + (void)argc; + (void)args; + + for (node = g_vlnk_part_list; node; node = node->next) + { + grub_printf("[%d] %s disksig:%08x offset:%llu fs:%s\n", + ++n, node->device, node->disksig, + (ulonglong)node->partoffset, (node->fs ? node->fs->name : "N/A")); + } + + return 0; +} + +static grub_err_t grub_cmd_is_vlnk_name(grub_extcmd_context_t ctxt, int argc, char **args) +{ + int len = 0; + + (void)ctxt; + + if (argc == 1) + { + len = (int)grub_strlen(args[0]); + if (grub_file_is_vlnk_suffix(args[0], len)) + { + return 0; + } + } + + return 1; +} + +static grub_err_t grub_cmd_get_vlnk_dst(grub_extcmd_context_t ctxt, int argc, char **args) +{ + int vlnk = 0; + const char *name = NULL; + + (void)ctxt; + + if (argc == 2) + { + grub_env_unset(args[1]); + name = grub_file_get_vlnk(args[0], &vlnk); + if (vlnk) + { + debug("VLNK SRC: <%s>\n", args[0]); + debug("VLNK DST: <%s>\n", name); + grub_env_set(args[1], name); + return 0; + } + } + + return 1; +} + +static grub_err_t grub_cmd_check_vlnk(grub_extcmd_context_t ctxt, int argc, char **args) +{ + int ret = 1; + int len = 0; + grub_file_t file = NULL; + ventoy_vlnk vlnk; + char dst[512]; + + (void)ctxt; + + if (argc != 1) + { + goto out; + } + + len = (int)grub_strlen(args[0]); + if (!grub_file_is_vlnk_suffix(args[0], len)) + { + grub_printf("Invalid vlnk suffix\n"); + goto out; + } + + file = grub_file_open(args[0], VENTOY_FILE_TYPE | GRUB_FILE_TYPE_NO_VLNK); + if (!file) + { + grub_printf("Failed to open %s\n", args[0]); + goto out; + } + + if (file->size != 32768) + { + grub_printf("Invalid vlnk file (size=%llu).\n", (ulonglong)file->size); + goto out; + } + + grub_memset(&vlnk, 0, sizeof(vlnk)); + grub_file_read(file, &vlnk, sizeof(vlnk)); + + ret = ventoy_check_vlnk_data(&vlnk, 1, dst, sizeof(dst)); + +out: + + grub_refresh(); + check_free(file, grub_file_close); + grub_errno = GRUB_ERR_NONE; + return ret; +} + int ventoy_env_init(void) { char buf[64]; @@ -5271,6 +5604,10 @@ static cmd_para ventoy_cmds[] = { "vt_append_extra_sector", ventoy_cmd_append_ext_sector, 0, NULL, "", "", NULL }, { "gptpriority", grub_cmd_gptpriority, 0, NULL, "", "", NULL }, { "vt_syslinux_need_nojoliet", grub_cmd_syslinux_nojoliet, 0, NULL, "", "", NULL }, + { "vt_vlnk_check", grub_cmd_check_vlnk, 0, NULL, "", "", NULL }, + { "vt_vlnk_dump_part", grub_cmd_vlnk_dump_part, 0, NULL, "", "", NULL }, + { "vt_is_vlnk_name", grub_cmd_is_vlnk_name, 0, NULL, "", "", NULL }, + { "vt_get_vlnk_dst", grub_cmd_get_vlnk_dst, 0, NULL, "", "", NULL }, }; int ventoy_register_all_cmd(void) diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_def.h b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_def.h index b9f94d5c..69d34400 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_def.h +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_def.h @@ -304,6 +304,7 @@ extern ventoy_guid g_ventoy_guid; extern ventoy_img_chunk_list g_img_chunk_list; extern ventoy_img_chunk_list g_wimiso_chunk_list; extern char *g_wimiso_path; +extern grub_uint32_t g_wimiso_size; extern char g_arch_mode_suffix[64]; extern const char *g_menu_prefix[img_type_max]; @@ -604,7 +605,6 @@ grub_err_t ventoy_cmd_trailer_cpio(grub_extcmd_context_t ctxt, int argc, char ** int ventoy_cpio_newc_fill_head(void *buf, int filesize, const void *filedata, const char *name); grub_file_t ventoy_grub_file_open(enum grub_file_type type, const char *fmt, ...); grub_uint64_t ventoy_grub_get_file_size(const char *fmt, ...); -int ventoy_is_file_exist(const char *fmt, ...); int ventoy_is_dir_exist(const char *fmt, ...); int ventoy_fill_data(grub_uint32_t buflen, char *buffer); grub_err_t ventoy_cmd_load_plugin(grub_extcmd_context_t ctxt, int argc, char **args); @@ -826,6 +826,7 @@ typedef struct ventoy_video_mode typedef struct file_fullpath { char path[256]; + int vlnk_add; }file_fullpath; typedef struct theme_list @@ -1153,5 +1154,20 @@ struct g_ventoy_map{ }; #pragma pack() +typedef struct ventoy_vlnk_part +{ + grub_uint32_t disksig; + grub_uint64_t partoffset; + char disk[64]; + char device[64]; + grub_device_t dev; + grub_fs_t fs; + int probe; + struct ventoy_vlnk_part *next; +}ventoy_vlnk_part; + +extern char g_iso_path[256]; +int ventoy_add_vlnk_file(char *dir, const char *name); + #endif /* __VENTOY_DEF_H__ */ diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_plugin.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_plugin.c index 59fca857..841327ae 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_plugin.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_plugin.c @@ -171,11 +171,11 @@ static int ventoy_plugin_theme_check(VTOY_JSON *json, const char *isodisk) grub_printf("file: %s\n", value); if (value[0] == '/') { - exist = ventoy_is_file_exist("%s%s", isodisk, value); + exist = ventoy_check_file_exist("%s%s", isodisk, value); } else { - exist = ventoy_is_file_exist("%s/ventoy/%s", isodisk, value); + exist = ventoy_check_file_exist("%s/ventoy/%s", isodisk, value); } if (exist == 0) @@ -195,11 +195,11 @@ static int ventoy_plugin_theme_check(VTOY_JSON *json, const char *isodisk) grub_printf("file: %s\n", value); if (value[0] == '/') { - exist = ventoy_is_file_exist("%s%s", isodisk, value); + exist = ventoy_check_file_exist("%s%s", isodisk, value); } else { - exist = ventoy_is_file_exist("%s/ventoy/%s", isodisk, value); + exist = ventoy_check_file_exist("%s/ventoy/%s", isodisk, value); } if (exist == 0) @@ -463,7 +463,7 @@ static int ventoy_plugin_check_path(const char *path, const char *file) return 1; } - if (!ventoy_is_file_exist("%s%s", path, file)) + if (!ventoy_check_file_exist("%s%s", path, file)) { grub_printf("%s%s does NOT exist\n", path, file); return 1; @@ -561,7 +561,7 @@ static int ventoy_plugin_parse_fullpath { debug("%s is string type data\n", node->pcName); - if ((node->unData.pcStrVal[0] != '/') || (!ventoy_is_file_exist("%s%s", isodisk, node->unData.pcStrVal))) + if ((node->unData.pcStrVal[0] != '/') || (!ventoy_check_file_exist("%s%s", isodisk, node->unData.pcStrVal))) { debug("%s%s file not found\n", isodisk, node->unData.pcStrVal); return 1; @@ -596,7 +596,7 @@ static int ventoy_plugin_parse_fullpath for (count = 0, child = node->pstChild; child; child = child->pstNext) { - if (ventoy_is_file_exist("%s%s", isodisk, child->unData.pcStrVal)) + if (ventoy_check_file_exist("%s%s", isodisk, child->unData.pcStrVal)) { grub_snprintf(path->path, sizeof(path->path), "%s", child->unData.pcStrVal); path++; @@ -1401,7 +1401,7 @@ static int ventoy_plugin_menualias_check(VTOY_JSON *json, const char *isodisk) { grub_printf("image: <%s> [ * ]\n", path); } - else if (ventoy_is_file_exist("%s%s", isodisk, path)) + else if (ventoy_check_file_exist("%s%s", isodisk, path)) { grub_printf("image: <%s> [ OK ]\n", path); } @@ -1542,7 +1542,7 @@ static int ventoy_plugin_menutip_check(VTOY_JSON *json, const char *isodisk) { grub_printf("image: <%s> [ * ]\n", path); } - else if (ventoy_is_file_exist("%s%s", isodisk, path)) + else if (ventoy_check_file_exist("%s%s", isodisk, path)) { grub_printf("image: <%s> [ OK ]\n", path); } @@ -2684,6 +2684,8 @@ persistence_config * ventoy_plugin_find_persistent(const char *isopath) int ventoy_plugin_get_persistent_chunklist(const char *isopath, int index, ventoy_img_chunk_list *chunk_list) { int rc = 1; + int len = 0; + char *path = NULL; grub_uint64_t start = 0; grub_file_t file = NULL; persistence_config *node = NULL; @@ -2704,10 +2706,22 @@ int ventoy_plugin_get_persistent_chunklist(const char *isopath, int index, vento return 1; } - file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s%s", g_iso_disk_name, node->backendpath[index].path); + path = node->backendpath[index].path; + + if (node->backendpath[index].vlnk_add == 0) + { + len = grub_strlen(path); + if (len > 9 && grub_strncmp(path + len - 9, ".vlnk.dat", 9) == 0) + { + ventoy_add_vlnk_file(NULL, path); + node->backendpath[index].vlnk_add = 1; + } + } + + file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s%s", g_iso_disk_name, path); if (!file) { - debug("Failed to open file %s%s\n", g_iso_disk_name, node->backendpath[index].path); + debug("Failed to open file %s%s\n", g_iso_disk_name, path); goto end; } diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_vhd.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_vhd.c index b37cf0ac..7bc7d90f 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_vhd.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_vhd.c @@ -667,6 +667,11 @@ grub_err_t ventoy_cmd_raw_chain_data(grub_extcmd_context_t ctxt, int argc, char return 1; } + if (grub_strncmp(args[0], g_iso_path, grub_strlen(g_iso_path))) + { + file->vlnk = 1; + } + img_chunk_size = g_img_chunk_list.cur_chunk * sizeof(ventoy_img_chunk); size = sizeof(ventoy_chain_head) + img_chunk_size; diff --git a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_windows.c b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_windows.c index 4e605093..c854ad4a 100644 --- a/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_windows.c +++ b/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_windows.c @@ -1994,21 +1994,12 @@ static grub_uint32_t ventoy_get_wim_iso_offset(const char *filepath) return imgoffset; } -static int ventoy_get_wim_chunklist(const char *filename, ventoy_img_chunk_list *wimchunk, grub_uint64_t *wimsize) +static int ventoy_get_wim_chunklist(grub_file_t wimfile, ventoy_img_chunk_list *wimchunk) { - grub_file_t wimfile; - - wimfile = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s", filename); - if (!wimfile) - { - return 1; - } - grub_memset(wimchunk, 0, sizeof(ventoy_img_chunk_list)); wimchunk->chunk = grub_malloc(sizeof(ventoy_img_chunk) * DEFAULT_CHUNK_NUM); if (NULL == wimchunk->chunk) { - grub_file_close(wimfile); return grub_error(GRUB_ERR_OUT_OF_MEMORY, "Can't allocate image chunk memoty\n"); } @@ -2017,9 +2008,6 @@ static int ventoy_get_wim_chunklist(const char *filename, ventoy_img_chunk_list ventoy_get_block_list(wimfile, wimchunk, wimfile->device->disk->partition->start); - *wimsize = wimfile->size; - grub_file_close(wimfile); - return 0; } @@ -2058,7 +2046,7 @@ grub_err_t ventoy_cmd_wim_check_bootable(grub_extcmd_context_t ctxt, int argc, c VENTOY_CMD_RETURN(GRUB_ERR_NONE); } -grub_err_t ventoy_cmd_wim_chain_data(grub_extcmd_context_t ctxt, int argc, char **args) +static grub_err_t ventoy_vlnk_wim_chain_data(grub_file_t wimfile) { grub_uint32_t i = 0; grub_uint32_t imgoffset = 0; @@ -2079,10 +2067,7 @@ grub_err_t ventoy_cmd_wim_chain_data(grub_extcmd_context_t ctxt, int argc, char ventoy_img_chunk_list wimchunk; char envbuf[128]; - (void)ctxt; - (void)argc; - - debug("wim chain data begin <%s> ...\n", args[0]); + debug("vlnk wim chain data begin <%s> ...\n", wimfile->name); if (NULL == g_wimiso_chunk_list.chunk || NULL == g_wimiso_path) { @@ -2097,11 +2082,177 @@ grub_err_t ventoy_cmd_wim_chain_data(grub_extcmd_context_t ctxt, int argc, char return 1; } - if (0 != ventoy_get_wim_chunklist(args[0], &wimchunk, &wimsize)) + if (0 != ventoy_get_wim_chunklist(wimfile, &wimchunk)) { grub_printf("Failed to get wim chunklist\n"); return 1; } + wimsize = wimfile->size; + + file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s", g_wimiso_path); + if (!file) + { + return 1; + } + + boot_catlog = ventoy_get_iso_boot_catlog(file); + + img_chunk1_size = g_wimiso_chunk_list.cur_chunk * sizeof(ventoy_img_chunk); + img_chunk2_size = wimchunk.cur_chunk * sizeof(ventoy_img_chunk); + override_size = sizeof(ventoy_override_chunk) + g_wimiso_size; + + size = sizeof(ventoy_chain_head) + img_chunk1_size + img_chunk2_size + override_size; + + pLastChain = grub_env_get("vtoy_chain_mem_addr"); + if (pLastChain) + { + chain = (ventoy_chain_head *)grub_strtoul(pLastChain, NULL, 16); + if (chain) + { + debug("free last chain memory %p\n", chain); + grub_free(chain); + } + } + + chain = grub_malloc(size); + if (!chain) + { + grub_printf("Failed to alloc chain memory size %u\n", size); + grub_file_close(file); + return 1; + } + + grub_snprintf(envbuf, sizeof(envbuf), "0x%lx", (unsigned long)chain); + grub_env_set("vtoy_chain_mem_addr", envbuf); + grub_snprintf(envbuf, sizeof(envbuf), "%u", size); + grub_env_set("vtoy_chain_mem_size", envbuf); + + grub_memset(chain, 0, sizeof(ventoy_chain_head)); + + /* part 1: os parameter */ + g_ventoy_chain_type = ventoy_chain_wim; + ventoy_fill_os_param(wimfile, &(chain->os_param)); + + /* part 2: chain head */ + disk = wimfile->device->disk; + chain->disk_drive = disk->id; + chain->disk_sector_size = (1 << disk->log_sector_size); + chain->real_img_size_in_bytes = ventoy_align_2k(file->size) + ventoy_align_2k(wimsize); + chain->virt_img_size_in_bytes = chain->real_img_size_in_bytes; + chain->boot_catalog = boot_catlog; + + if (!ventoy_is_efi_os()) + { + grub_file_seek(file, boot_catlog * 2048); + grub_file_read(file, chain->boot_catalog_sector, sizeof(chain->boot_catalog_sector)); + } + + /* part 3: image chunk */ + chain->img_chunk_offset = sizeof(ventoy_chain_head); + chain->img_chunk_num = g_wimiso_chunk_list.cur_chunk + wimchunk.cur_chunk; + grub_memcpy((char *)chain + chain->img_chunk_offset, g_wimiso_chunk_list.chunk, img_chunk1_size); + + chunknode = (ventoy_img_chunk *)((char *)chain + chain->img_chunk_offset); + for (i = 0; i < g_wimiso_chunk_list.cur_chunk; i++) + { + chunknode->disk_end_sector = chunknode->disk_end_sector - chunknode->disk_start_sector; + chunknode->disk_start_sector = 0; + chunknode++; + } + + /* fs cluster size >= 2048, so don't need to proc align */ + + /* align by 2048 */ + chunknode = wimchunk.chunk + wimchunk.cur_chunk - 1; + i = (chunknode->disk_end_sector + 1 - chunknode->disk_start_sector) % 4; + if (i) + { + chunknode->disk_end_sector += 4 - i; + } + + isosector = (grub_uint32_t)((file->size + 2047) / 2048); + for (i = 0; i < wimchunk.cur_chunk; i++) + { + chunknode = wimchunk.chunk + i; + chunknode->img_start_sector = isosector; + chunknode->img_end_sector = chunknode->img_start_sector + + ((chunknode->disk_end_sector + 1 - chunknode->disk_start_sector) / 4) - 1; + isosector = chunknode->img_end_sector + 1; + } + + grub_memcpy((char *)chain + chain->img_chunk_offset + img_chunk1_size, wimchunk.chunk, img_chunk2_size); + + /* part 4: override chunk */ + chain->override_chunk_offset = chain->img_chunk_offset + img_chunk1_size + img_chunk2_size; + chain->override_chunk_num = 1; + + override = (ventoy_override_chunk *)((char *)chain + chain->override_chunk_offset); + override->img_offset = 0; + override->override_size = g_wimiso_size; + + grub_file_seek(file, 0); + grub_file_read(file, override->override_data, file->size); + + dirent = (ventoy_iso9660_override *)(override->override_data + imgoffset); + dirent->first_sector = (grub_uint32_t)((file->size + 2047) / 2048); + dirent->size = (grub_uint32_t)(wimsize); + dirent->first_sector_be = grub_swap_bytes32(dirent->first_sector); + dirent->size_be = grub_swap_bytes32(dirent->size); + + debug("imgoffset=%u first_sector=0x%x size=0x%x\n", imgoffset, dirent->first_sector, dirent->size); + + if (ventoy_is_efi_os() == 0) + { + ventoy_windows_drive_map(chain); + } + + grub_file_close(file); + + VENTOY_CMD_RETURN(GRUB_ERR_NONE); +} + +static grub_err_t ventoy_normal_wim_chain_data(grub_file_t wimfile) +{ + grub_uint32_t i = 0; + grub_uint32_t imgoffset = 0; + grub_uint32_t size = 0; + grub_uint32_t isosector = 0; + grub_uint64_t wimsize = 0; + grub_uint32_t boot_catlog = 0; + grub_uint32_t img_chunk1_size = 0; + grub_uint32_t img_chunk2_size = 0; + grub_uint32_t override_size = 0; + grub_file_t file; + grub_disk_t disk; + const char *pLastChain = NULL; + ventoy_chain_head *chain; + ventoy_iso9660_override *dirent; + ventoy_img_chunk *chunknode; + ventoy_override_chunk *override; + ventoy_img_chunk_list wimchunk; + char envbuf[128]; + + debug("normal wim chain data begin <%s> ...\n", wimfile->name); + + if (NULL == g_wimiso_chunk_list.chunk || NULL == g_wimiso_path) + { + grub_printf("ventoy not ready\n"); + return 1; + } + + imgoffset = ventoy_get_wim_iso_offset(g_wimiso_path); + if (imgoffset == 0) + { + grub_printf("image offset not found\n"); + return 1; + } + + if (0 != ventoy_get_wim_chunklist(wimfile, &wimchunk)) + { + grub_printf("Failed to get wim chunklist\n"); + return 1; + } + wimsize = wimfile->size; file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s", g_wimiso_path); if (!file) @@ -2214,6 +2365,33 @@ grub_err_t ventoy_cmd_wim_chain_data(grub_extcmd_context_t ctxt, int argc, char VENTOY_CMD_RETURN(GRUB_ERR_NONE); } +grub_err_t ventoy_cmd_wim_chain_data(grub_extcmd_context_t ctxt, int argc, char **args) +{ + grub_err_t ret; + grub_file_t wimfile; + + (void)ctxt; + (void)argc; + + wimfile = grub_file_open(args[0], VENTOY_FILE_TYPE); + if (!wimfile) + { + return 1; + } + + if (wimfile->vlnk) + { + ret = ventoy_vlnk_wim_chain_data(wimfile); + } + else + { + ret = ventoy_normal_wim_chain_data(wimfile); + } + + grub_file_close(wimfile); + return ret; +} + int ventoy_chain_file_size(const char *path) { int size; diff --git a/GRUB2/MOD_SRC/grub-2.04/include/grub/file.h b/GRUB2/MOD_SRC/grub-2.04/include/grub/file.h index 6c4203cb..2d64b590 100644 --- a/GRUB2/MOD_SRC/grub-2.04/include/grub/file.h +++ b/GRUB2/MOD_SRC/grub-2.04/include/grub/file.h @@ -132,7 +132,8 @@ enum grub_file_type /* --skip-sig is specified. */ GRUB_FILE_TYPE_SKIP_SIGNATURE = 0x10000, - GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000 + GRUB_FILE_TYPE_NO_DECOMPRESS = 0x20000, + GRUB_FILE_TYPE_NO_VLNK = 0x40000, }; /* File description. */ @@ -141,6 +142,8 @@ struct grub_file /* File name. */ char *name; + int vlnk; + /* The underlying device. */ grub_device_t device; @@ -213,6 +216,10 @@ grub_ssize_t EXPORT_FUNC(grub_file_read) (grub_file_t file, void *buf, grub_off_t EXPORT_FUNC(grub_file_seek) (grub_file_t file, grub_off_t offset); grub_err_t EXPORT_FUNC(grub_file_close) (grub_file_t file); +int EXPORT_FUNC(grub_file_is_vlnk_suffix)(const char *name, int len); +int EXPORT_FUNC(grub_file_add_vlnk)(const char *src, const char *dst); +const char * EXPORT_FUNC(grub_file_get_vlnk)(const char *name, int *vlnk); + /* Return value of grub_file_size() in case file size is unknown. */ #define GRUB_FILE_SIZE_UNKNOWN 0xffffffffffffffffULL diff --git a/GRUB2/MOD_SRC/grub-2.04/include/grub/fs.h b/GRUB2/MOD_SRC/grub-2.04/include/grub/fs.h index 3955faa6..50b3a185 100644 --- a/GRUB2/MOD_SRC/grub-2.04/include/grub/fs.h +++ b/GRUB2/MOD_SRC/grub-2.04/include/grub/fs.h @@ -128,5 +128,6 @@ grub_fs_unregister (grub_fs_t fs) #define FOR_FILESYSTEMS(var) FOR_LIST_ELEMENTS((var), (grub_fs_list)) grub_fs_t EXPORT_FUNC(grub_fs_probe) (grub_device_t device); +grub_fs_t EXPORT_FUNC(grub_fs_list_probe) (grub_device_t device, const char **list); #endif /* ! GRUB_FS_HEADER */ diff --git a/GRUB2/MOD_SRC/grub-2.04/include/grub/ventoy.h b/GRUB2/MOD_SRC/grub-2.04/include/grub/ventoy.h index 0102ef59..9199fa41 100644 --- a/GRUB2/MOD_SRC/grub-2.04/include/grub/ventoy.h +++ b/GRUB2/MOD_SRC/grub-2.04/include/grub/ventoy.h @@ -122,6 +122,8 @@ typedef struct ventoy_os_param * vtoy_reserved[3]: vtoy_iso_format 0:iso9660 1:udf * vtoy_reserved[4]: vtoy_windows_cd_prompt * vtoy_reserved[5]: vtoy_linux_remount + * vtoy_reserved[6]: vtoy_vlnk + * vtoy_reserved[7~10]: vtoy_disk_sig[4] used for vlnk * */ grub_uint8_t vtoy_reserved[32]; // Internal use by ventoy @@ -151,11 +153,23 @@ typedef struct ventoy_secure_data grub_uint8_t magic2[16]; /* VENTOY_GUID */ }ventoy_secure_data; + +typedef struct ventoy_vlnk +{ + ventoy_guid guid; // VENTOY_GUID + grub_uint32_t crc32; // crc32 + grub_uint32_t disk_signature; + grub_uint64_t part_offset; // in bytes + char filepath[384]; + grub_uint8_t reserved[96]; +}ventoy_vlnk; + #pragma pack() // compile assert check : sizeof(ventoy_os_param) must be 512 COMPILE_ASSERT(1,sizeof(ventoy_os_param) == 512); COMPILE_ASSERT(2,sizeof(ventoy_secure_data) == 4096); +COMPILE_ASSERT(3,sizeof(ventoy_vlnk) == 512); diff --git a/IMG/cpio/ventoy/hook/ventoy-hook-lib.sh b/IMG/cpio/ventoy/hook/ventoy-hook-lib.sh index c2f426a7..88bfe738 100644 --- a/IMG/cpio/ventoy/hook/ventoy-hook-lib.sh +++ b/IMG/cpio/ventoy/hook/ventoy-hook-lib.sh @@ -31,6 +31,7 @@ HEAD=$BUSYBOX_PATH/head VTOY_DM_PATH=/dev/mapper/ventoy VTOY_DEBUG_LEVEL=$($BUSYBOX_PATH/hexdump -n 1 -s 450 -e '1/1 "%02x"' $VTOY_PATH/ventoy_os_param) VTOY_LINUX_REMOUNT=$($BUSYBOX_PATH/hexdump -n 1 -s 454 -e '1/1 "%02x"' $VTOY_PATH/ventoy_os_param) +VTOY_VLNK_BOOT=$($BUSYBOX_PATH/hexdump -n 1 -s 455 -e '1/1 "%02x"' $VTOY_PATH/ventoy_os_param) if [ "$VTOY_DEBUG_LEVEL" = "01" ]; then if [ -e /dev/console ]; then @@ -65,12 +66,16 @@ set_ventoy_hook_finish() { echo 'Y' > $VTOY_PATH/hook_finish } -get_ventoy_disk_name() { - line=$($VTOY_PATH/tool/vtoydump -f /ventoy/ventoy_os_param) - if [ $? -eq 0 ]; then - echo ${line%%#*} - else - echo "unknown" +get_ventoy_disk_name() { + if [ "$VTOY_VLNK_BOOT" = "01" ]; then + $VTOY_PATH/tool/vtoydump -t /ventoy/ventoy_os_param + else + line=$($VTOY_PATH/tool/vtoydump -f /ventoy/ventoy_os_param) + if [ $? -eq 0 ]; then + echo ${line%%#*} + else + echo "unknown" + fi fi } @@ -121,14 +126,6 @@ check_usb_disk_ready() { [ -e "${vtpart2}" ] } -is_ventoy_disk() { - if $VTOY_PATH/tool/vtoydump -f $VTOY_PATH/ventoy_os_param -c "$1"; then - $BUSYBOX_PATH/true - else - $BUSYBOX_PATH/false - fi -} - not_ventoy_disk() { if echo $1 | $EGREP -q "nvme.*p$|mmc.*p$|nbd.*p$"; then vtDiskName=${1:0:-1} @@ -136,10 +133,15 @@ not_ventoy_disk() { vtDiskName=$1 fi - if $VTOY_PATH/tool/vtoydump -f $VTOY_PATH/ventoy_os_param -c "$vtDiskName"; then - $BUSYBOX_PATH/false + if [ "$VTOY_VLNK_BOOT" = "01" ]; then + vtVtoyDisk=$($VTOY_PATH/tool/vtoydump -t $VTOY_PATH/ventoy_os_param) + [ "$vtVtoyDisk" != "/dev/$vtDiskName" ] else - $BUSYBOX_PATH/true + if $VTOY_PATH/tool/vtoydump -f $VTOY_PATH/ventoy_os_param -c "$vtDiskName"; then + $BUSYBOX_PATH/false + else + $BUSYBOX_PATH/true + fi fi } @@ -803,7 +805,12 @@ is_inotify_ventoy_part() { fi if [ -e /dev/$vtShortName ]; then - $VTOY_PATH/tool/vtoydump -f $VTOY_PATH/ventoy_os_param -c $vtShortName + if [ "$VTOY_VLNK_BOOT" = "01" ]; then + vtOrgDiskName=$($VTOY_PATH/tool/vtoydump -t $VTOY_PATH/ventoy_os_param) + [ "$vtOrgDiskName" = "/dev/$vtShortName" ] + else + $VTOY_PATH/tool/vtoydump -f $VTOY_PATH/ventoy_os_param -c $vtShortName + fi return fi fi diff --git a/IMG/cpio/ventoy/loop/cloudready/ventoy-hook.sh b/IMG/cpio/ventoy/loop/cloudready/ventoy-hook.sh index 2cf658ba..666a4e0b 100644 --- a/IMG/cpio/ventoy/loop/cloudready/ventoy-hook.sh +++ b/IMG/cpio/ventoy/loop/cloudready/ventoy-hook.sh @@ -129,6 +129,10 @@ mount -t devtmpfs dev /newdev cp -a /dev/mapper/ventoy* /newdev/mapper/ cp -a /dev/ventoy* /newdev/ +if [ "$VTOY_VLNK_BOOT" = "01" ]; then + vtLine=$($VTOY_PATH/tool/vtoydump -f /ventoy/ventoy_os_param) + vtdiskname=${vtLine%%#*} +fi vtshortname="${vtdiskname#/dev/}" mv /newdev/${vtshortname} /newdev/backup_${vtshortname} diff --git a/IMG/cpio/ventoy/loop/fydeos/ventoy-hook.sh b/IMG/cpio/ventoy/loop/fydeos/ventoy-hook.sh index 2cf658ba..666a4e0b 100644 --- a/IMG/cpio/ventoy/loop/fydeos/ventoy-hook.sh +++ b/IMG/cpio/ventoy/loop/fydeos/ventoy-hook.sh @@ -129,6 +129,10 @@ mount -t devtmpfs dev /newdev cp -a /dev/mapper/ventoy* /newdev/mapper/ cp -a /dev/ventoy* /newdev/ +if [ "$VTOY_VLNK_BOOT" = "01" ]; then + vtLine=$($VTOY_PATH/tool/vtoydump -f /ventoy/ventoy_os_param) + vtdiskname=${vtLine%%#*} +fi vtshortname="${vtdiskname#/dev/}" mv /newdev/${vtshortname} /newdev/backup_${vtshortname} diff --git a/INSTALL/README b/INSTALL/README index a435d567..92502d71 100644 --- a/INSTALL/README +++ b/INSTALL/README @@ -26,6 +26,14 @@ Please refer https://www.ventoy.net/en/doc_start.html for details. 1. sudo sh VentoyPlugson.sh 2. open your browser and visit http://127.0.0.1:24681 +========== VentoyVlnk.sh =============== +Usage: sudo sh VentoyVlnk.sh CMD FILE + CMD: + -c FILE create vlnk for FILE + -l VLNK parse vlnk file + -v print verbose info + -h print this help + ========= VentoyGUI =================== VentoyGUI is native GUI program for Linux (GTK/QT) diff --git a/INSTALL/grub/arm64-efi/affs.mod b/INSTALL/grub/arm64-efi/affs.mod index 4656e87a..2042c172 100644 Binary files a/INSTALL/grub/arm64-efi/affs.mod and b/INSTALL/grub/arm64-efi/affs.mod differ diff --git a/INSTALL/grub/arm64-efi/afs.mod b/INSTALL/grub/arm64-efi/afs.mod index e8982a9f..5bc5cb1d 100644 Binary files a/INSTALL/grub/arm64-efi/afs.mod and b/INSTALL/grub/arm64-efi/afs.mod differ diff --git a/INSTALL/grub/arm64-efi/bfs.mod b/INSTALL/grub/arm64-efi/bfs.mod index e24a0998..fc7dae2a 100644 Binary files a/INSTALL/grub/arm64-efi/bfs.mod and b/INSTALL/grub/arm64-efi/bfs.mod differ diff --git a/INSTALL/grub/arm64-efi/btrfs.mod b/INSTALL/grub/arm64-efi/btrfs.mod index 6dbb181b..ee546727 100644 Binary files a/INSTALL/grub/arm64-efi/btrfs.mod and b/INSTALL/grub/arm64-efi/btrfs.mod differ diff --git a/INSTALL/grub/arm64-efi/cbfs.mod b/INSTALL/grub/arm64-efi/cbfs.mod index a59d1c0f..882413aa 100644 Binary files a/INSTALL/grub/arm64-efi/cbfs.mod and b/INSTALL/grub/arm64-efi/cbfs.mod differ diff --git a/INSTALL/grub/arm64-efi/cmp.mod b/INSTALL/grub/arm64-efi/cmp.mod index d392b473..28e828f3 100644 Binary files a/INSTALL/grub/arm64-efi/cmp.mod and b/INSTALL/grub/arm64-efi/cmp.mod differ diff --git a/INSTALL/grub/arm64-efi/cpio.mod b/INSTALL/grub/arm64-efi/cpio.mod index 541fe71b..387d4b79 100644 Binary files a/INSTALL/grub/arm64-efi/cpio.mod and b/INSTALL/grub/arm64-efi/cpio.mod differ diff --git a/INSTALL/grub/arm64-efi/cpio_be.mod b/INSTALL/grub/arm64-efi/cpio_be.mod index db0c096a..b2193f6e 100644 Binary files a/INSTALL/grub/arm64-efi/cpio_be.mod and b/INSTALL/grub/arm64-efi/cpio_be.mod differ diff --git a/INSTALL/grub/arm64-efi/f2fs.mod b/INSTALL/grub/arm64-efi/f2fs.mod index eb62b755..381880df 100644 Binary files a/INSTALL/grub/arm64-efi/f2fs.mod and b/INSTALL/grub/arm64-efi/f2fs.mod differ diff --git a/INSTALL/grub/arm64-efi/fdt.mod b/INSTALL/grub/arm64-efi/fdt.mod index 1c8029ec..c624b64a 100644 Binary files a/INSTALL/grub/arm64-efi/fdt.mod and b/INSTALL/grub/arm64-efi/fdt.mod differ diff --git a/INSTALL/grub/arm64-efi/hexdump.mod b/INSTALL/grub/arm64-efi/hexdump.mod index 3018a844..3874910d 100644 Binary files a/INSTALL/grub/arm64-efi/hexdump.mod and b/INSTALL/grub/arm64-efi/hexdump.mod differ diff --git a/INSTALL/grub/arm64-efi/hfs.mod b/INSTALL/grub/arm64-efi/hfs.mod index 728d2593..f4113b94 100644 Binary files a/INSTALL/grub/arm64-efi/hfs.mod and b/INSTALL/grub/arm64-efi/hfs.mod differ diff --git a/INSTALL/grub/arm64-efi/jfs.mod b/INSTALL/grub/arm64-efi/jfs.mod index aebbdd18..c9139a13 100644 Binary files a/INSTALL/grub/arm64-efi/jfs.mod and b/INSTALL/grub/arm64-efi/jfs.mod differ diff --git a/INSTALL/grub/arm64-efi/loadenv.mod b/INSTALL/grub/arm64-efi/loadenv.mod index 8c6a2a88..eeb7f274 100644 Binary files a/INSTALL/grub/arm64-efi/loadenv.mod and b/INSTALL/grub/arm64-efi/loadenv.mod differ diff --git a/INSTALL/grub/arm64-efi/macho.mod b/INSTALL/grub/arm64-efi/macho.mod index 109f49fd..c2f1eb63 100644 Binary files a/INSTALL/grub/arm64-efi/macho.mod and b/INSTALL/grub/arm64-efi/macho.mod differ diff --git a/INSTALL/grub/arm64-efi/minix.mod b/INSTALL/grub/arm64-efi/minix.mod index b6959460..39dec9a7 100644 Binary files a/INSTALL/grub/arm64-efi/minix.mod and b/INSTALL/grub/arm64-efi/minix.mod differ diff --git a/INSTALL/grub/arm64-efi/minix2.mod b/INSTALL/grub/arm64-efi/minix2.mod index 01775e8d..1c027b44 100644 Binary files a/INSTALL/grub/arm64-efi/minix2.mod and b/INSTALL/grub/arm64-efi/minix2.mod differ diff --git a/INSTALL/grub/arm64-efi/minix2_be.mod b/INSTALL/grub/arm64-efi/minix2_be.mod index f8cf8f79..20b6276d 100644 Binary files a/INSTALL/grub/arm64-efi/minix2_be.mod and b/INSTALL/grub/arm64-efi/minix2_be.mod differ diff --git a/INSTALL/grub/arm64-efi/minix3.mod b/INSTALL/grub/arm64-efi/minix3.mod index 0c61d0ba..6585c7f8 100644 Binary files a/INSTALL/grub/arm64-efi/minix3.mod and b/INSTALL/grub/arm64-efi/minix3.mod differ diff --git a/INSTALL/grub/arm64-efi/minix3_be.mod b/INSTALL/grub/arm64-efi/minix3_be.mod index 91843b86..2192a11a 100644 Binary files a/INSTALL/grub/arm64-efi/minix3_be.mod and b/INSTALL/grub/arm64-efi/minix3_be.mod differ diff --git a/INSTALL/grub/arm64-efi/minix_be.mod b/INSTALL/grub/arm64-efi/minix_be.mod index 0dc4c2a1..154c4ab3 100644 Binary files a/INSTALL/grub/arm64-efi/minix_be.mod and b/INSTALL/grub/arm64-efi/minix_be.mod differ diff --git a/INSTALL/grub/arm64-efi/moddep.lst b/INSTALL/grub/arm64-efi/moddep.lst index 1a4cafca..fad03460 100644 Binary files a/INSTALL/grub/arm64-efi/moddep.lst and b/INSTALL/grub/arm64-efi/moddep.lst differ diff --git a/INSTALL/grub/arm64-efi/nilfs2.mod b/INSTALL/grub/arm64-efi/nilfs2.mod index 0742bc81..c207df9a 100644 Binary files a/INSTALL/grub/arm64-efi/nilfs2.mod and b/INSTALL/grub/arm64-efi/nilfs2.mod differ diff --git a/INSTALL/grub/arm64-efi/normal.mod b/INSTALL/grub/arm64-efi/normal.mod index a2557d46..04ce41a7 100644 Binary files a/INSTALL/grub/arm64-efi/normal.mod and b/INSTALL/grub/arm64-efi/normal.mod differ diff --git a/INSTALL/grub/arm64-efi/odc.mod b/INSTALL/grub/arm64-efi/odc.mod index c7c13fbd..3ed3c1c4 100644 Binary files a/INSTALL/grub/arm64-efi/odc.mod and b/INSTALL/grub/arm64-efi/odc.mod differ diff --git a/INSTALL/grub/arm64-efi/offsetio.mod b/INSTALL/grub/arm64-efi/offsetio.mod index e9eba9fc..397a1620 100644 Binary files a/INSTALL/grub/arm64-efi/offsetio.mod and b/INSTALL/grub/arm64-efi/offsetio.mod differ diff --git a/INSTALL/grub/arm64-efi/pgp.mod b/INSTALL/grub/arm64-efi/pgp.mod index 05a1eec9..c041eeec 100644 Binary files a/INSTALL/grub/arm64-efi/pgp.mod and b/INSTALL/grub/arm64-efi/pgp.mod differ diff --git a/INSTALL/grub/arm64-efi/procfs.mod b/INSTALL/grub/arm64-efi/procfs.mod index fb59fcc7..1c693327 100644 Binary files a/INSTALL/grub/arm64-efi/procfs.mod and b/INSTALL/grub/arm64-efi/procfs.mod differ diff --git a/INSTALL/grub/arm64-efi/progress.mod b/INSTALL/grub/arm64-efi/progress.mod index 86a5baeb..da0883dd 100644 Binary files a/INSTALL/grub/arm64-efi/progress.mod and b/INSTALL/grub/arm64-efi/progress.mod differ diff --git a/INSTALL/grub/arm64-efi/reiserfs.mod b/INSTALL/grub/arm64-efi/reiserfs.mod index 46a19bc5..c0112609 100644 Binary files a/INSTALL/grub/arm64-efi/reiserfs.mod and b/INSTALL/grub/arm64-efi/reiserfs.mod differ diff --git a/INSTALL/grub/arm64-efi/romfs.mod b/INSTALL/grub/arm64-efi/romfs.mod index b861540c..31c30ab4 100644 Binary files a/INSTALL/grub/arm64-efi/romfs.mod and b/INSTALL/grub/arm64-efi/romfs.mod differ diff --git a/INSTALL/grub/arm64-efi/sfs.mod b/INSTALL/grub/arm64-efi/sfs.mod index 299ed04a..ae09a2ec 100644 Binary files a/INSTALL/grub/arm64-efi/sfs.mod and b/INSTALL/grub/arm64-efi/sfs.mod differ diff --git a/INSTALL/grub/arm64-efi/testload.mod b/INSTALL/grub/arm64-efi/testload.mod index 7aa0eaf4..c0660652 100644 Binary files a/INSTALL/grub/arm64-efi/testload.mod and b/INSTALL/grub/arm64-efi/testload.mod differ diff --git a/INSTALL/grub/arm64-efi/tga.mod b/INSTALL/grub/arm64-efi/tga.mod index 8698d99b..778b672c 100644 Binary files a/INSTALL/grub/arm64-efi/tga.mod and b/INSTALL/grub/arm64-efi/tga.mod differ diff --git a/INSTALL/grub/arm64-efi/ufs1.mod b/INSTALL/grub/arm64-efi/ufs1.mod index 54480205..a6d94954 100644 Binary files a/INSTALL/grub/arm64-efi/ufs1.mod and b/INSTALL/grub/arm64-efi/ufs1.mod differ diff --git a/INSTALL/grub/arm64-efi/ufs1_be.mod b/INSTALL/grub/arm64-efi/ufs1_be.mod index 68c17887..90fdc232 100644 Binary files a/INSTALL/grub/arm64-efi/ufs1_be.mod and b/INSTALL/grub/arm64-efi/ufs1_be.mod differ diff --git a/INSTALL/grub/arm64-efi/ufs2.mod b/INSTALL/grub/arm64-efi/ufs2.mod index c65ea874..7b527270 100644 Binary files a/INSTALL/grub/arm64-efi/ufs2.mod and b/INSTALL/grub/arm64-efi/ufs2.mod differ diff --git a/INSTALL/grub/arm64-efi/verifiers.mod b/INSTALL/grub/arm64-efi/verifiers.mod index 0b389c4a..bee98f50 100644 Binary files a/INSTALL/grub/arm64-efi/verifiers.mod and b/INSTALL/grub/arm64-efi/verifiers.mod differ diff --git a/INSTALL/grub/arm64-efi/xen_boot.mod b/INSTALL/grub/arm64-efi/xen_boot.mod index ae21ef0d..6d8d2748 100644 Binary files a/INSTALL/grub/arm64-efi/xen_boot.mod and b/INSTALL/grub/arm64-efi/xen_boot.mod differ diff --git a/INSTALL/grub/arm64-efi/zfs.mod b/INSTALL/grub/arm64-efi/zfs.mod index f83071a8..4ed99c2d 100644 Binary files a/INSTALL/grub/arm64-efi/zfs.mod and b/INSTALL/grub/arm64-efi/zfs.mod differ diff --git a/INSTALL/grub/grub.cfg b/INSTALL/grub/grub.cfg index 950d38ce..e110bc86 100644 --- a/INSTALL/grub/grub.cfg +++ b/INSTALL/grub/grub.cfg @@ -1390,7 +1390,19 @@ function efi_common_menuentry { return fi - vt_concat_efi_iso "${vtoy_iso_part}${vt_chosen_path}" vtoy_iso_buf + unset vt_vlnk_dst + if vt_is_vlnk_name "${vt_chosen_path}"; then + vt_get_vlnk_dst "${vtoy_iso_part}${vt_chosen_path}" vt_vlnk_dst + if [ -z "$vt_vlnk_dst" ]; then + echo -e "\n### VLNK FILE NOT FOUND ###\n### VLNK 文件不存在 ###\n" + ventoy_pause + return + fi + else + vt_vlnk_dst="${vtoy_iso_part}${vt_chosen_path}" + fi + + vt_concat_efi_iso "${vt_vlnk_dst}" vtoy_iso_buf ventoy_debug_pause @@ -1402,7 +1414,7 @@ function efi_common_menuentry { if [ -n "$vtoy_dotefi_retry" ]; then unset vtoy_dotefi_retry - chainloader "${vtoy_iso_part}${vt_chosen_path}" + chainloader "${vt_vlnk_dst}" boot fi @@ -1438,17 +1450,6 @@ function vhdboot_common_func { } function vhd_common_menuentry { - - if [ "$VTOY_VHD_NO_WARNING" != "1" ]; then - if [ "$vtoy_iso_fs" != "ntfs" ]; then - echo -e "!!! WARNING !!!\n" - echo -e "\nPartition1 ($vtoy_iso_fs) is NOT ntfs, the VHD(x) file may not boot normally \n" - echo -e "\nVHD(x) 文件所在分区不是 ntfs 格式, 可能无法正常启动 \n\n" - echo -n "press ENTER to continue boot (请按 回车 键继续) ..." - read vtInputKey - fi - fi - vt_chosen_img_path vt_chosen_path vt_chosen_size if vt_check_password "${vt_chosen_path}"; then @@ -1459,7 +1460,28 @@ function vhd_common_menuentry { return fi - vhdboot_common_func "${vt_chosen_path}" + unset vt_vlnk_dst + if vt_is_vlnk_name "${vt_chosen_path}"; then + vt_get_vlnk_dst "${vtoy_iso_part}${vt_chosen_path}" vt_vlnk_dst + if [ -z "$vt_vlnk_dst" ]; then + echo -e "\n### VLNK FILE NOT FOUND ###\n### VLNK 文件不存在 ###\n" + ventoy_pause + return + fi + else + vt_vlnk_dst="${vt_chosen_path}" + if [ "$VTOY_VHD_NO_WARNING" != "1" ]; then + if [ "$vtoy_iso_fs" != "ntfs" ]; then + echo -e "!!! WARNING !!!\n" + echo -e "\nPartition1 ($vtoy_iso_fs) is NOT ntfs, the VHD(x) file may not boot normally \n" + echo -e "\nVHD(x) 文件所在分区不是 ntfs 格式, 可能无法正常启动 \n\n" + echo -n "press ENTER to continue boot (请按 回车 键继续) ..." + read vtInputKey + fi + fi + fi + + vhdboot_common_func "${vt_vlnk_dst}" } function vhd_unsupport_menuentry { @@ -1535,7 +1557,19 @@ function vtoy_common_menuentry { return fi - vtoyboot_common_func "${vtoy_iso_part}${vt_chosen_path}" + unset vt_vlnk_dst + if vt_is_vlnk_name "${vt_chosen_path}"; then + vt_get_vlnk_dst "${vtoy_iso_part}${vt_chosen_path}" vt_vlnk_dst + if [ -z "$vt_vlnk_dst" ]; then + echo -e "\n### VLNK FILE NOT FOUND ###\n### VLNK 文件不存在 ###\n" + ventoy_pause + return + fi + else + vt_vlnk_dst="${vtoy_iso_part}${vt_chosen_path}" + fi + + vtoyboot_common_func "${vt_vlnk_dst}" } function vtoy_unsupport_menuentry { @@ -2036,7 +2070,7 @@ function img_unsupport_menuentry { ############################################################# ############################################################# -set VENTOY_VERSION="1.0.65" +set VENTOY_VERSION="1.0.66" #ACPI not compatible with Window7/8, so disable by default set VTOY_PARAM_NO_ACPI=1 @@ -2044,7 +2078,7 @@ set VTOY_PARAM_NO_ACPI=1 # Default menu display mode, you can change it as you want. # 0: List mode # 1: TreeView mode -set VTOY_DEFAULT_MENU_MODE=0 +set VTOY_DEFAULT_MENU_MODE=1 set VTOY_MEM_DISK_STR="[Memdisk]" set VTOY_ISO_RAW_STR="Compatible Mode" @@ -2156,6 +2190,7 @@ else set VTOY_HOTKEY_TIP="h:Help F1:Memdisk F2:Power F3:ListView F4:Localboot F5:Tools F6:ExMenu" fi +terminal_output console if [ -n "$vtoy_gfxmode" ]; then set gfxmode=$vtoy_gfxmode diff --git a/INSTALL/grub/i386-efi/affs.mod b/INSTALL/grub/i386-efi/affs.mod index 8ba2f262..17e12fe7 100644 Binary files a/INSTALL/grub/i386-efi/affs.mod and b/INSTALL/grub/i386-efi/affs.mod differ diff --git a/INSTALL/grub/i386-efi/afs.mod b/INSTALL/grub/i386-efi/afs.mod index 42260548..eedba846 100644 Binary files a/INSTALL/grub/i386-efi/afs.mod and b/INSTALL/grub/i386-efi/afs.mod differ diff --git a/INSTALL/grub/i386-efi/aout.mod b/INSTALL/grub/i386-efi/aout.mod index 3e3ce9b1..35c79ce8 100644 Binary files a/INSTALL/grub/i386-efi/aout.mod and b/INSTALL/grub/i386-efi/aout.mod differ diff --git a/INSTALL/grub/i386-efi/bfs.mod b/INSTALL/grub/i386-efi/bfs.mod index e69b0827..2a8f9e99 100644 Binary files a/INSTALL/grub/i386-efi/bfs.mod and b/INSTALL/grub/i386-efi/bfs.mod differ diff --git a/INSTALL/grub/i386-efi/bsd.mod b/INSTALL/grub/i386-efi/bsd.mod index ea3e86f9..05b6c583 100644 Binary files a/INSTALL/grub/i386-efi/bsd.mod and b/INSTALL/grub/i386-efi/bsd.mod differ diff --git a/INSTALL/grub/i386-efi/btrfs.mod b/INSTALL/grub/i386-efi/btrfs.mod index 20f080db..1ad0b872 100644 Binary files a/INSTALL/grub/i386-efi/btrfs.mod and b/INSTALL/grub/i386-efi/btrfs.mod differ diff --git a/INSTALL/grub/i386-efi/cbfs.mod b/INSTALL/grub/i386-efi/cbfs.mod index 7a6fa094..25868f62 100644 Binary files a/INSTALL/grub/i386-efi/cbfs.mod and b/INSTALL/grub/i386-efi/cbfs.mod differ diff --git a/INSTALL/grub/i386-efi/cmp.mod b/INSTALL/grub/i386-efi/cmp.mod index e9eb48e3..7373cd6f 100644 Binary files a/INSTALL/grub/i386-efi/cmp.mod and b/INSTALL/grub/i386-efi/cmp.mod differ diff --git a/INSTALL/grub/i386-efi/cpio.mod b/INSTALL/grub/i386-efi/cpio.mod index f23822c9..b06a5898 100644 Binary files a/INSTALL/grub/i386-efi/cpio.mod and b/INSTALL/grub/i386-efi/cpio.mod differ diff --git a/INSTALL/grub/i386-efi/cpio_be.mod b/INSTALL/grub/i386-efi/cpio_be.mod index 60714628..e974c657 100644 Binary files a/INSTALL/grub/i386-efi/cpio_be.mod and b/INSTALL/grub/i386-efi/cpio_be.mod differ diff --git a/INSTALL/grub/i386-efi/f2fs.mod b/INSTALL/grub/i386-efi/f2fs.mod index b245c9d6..3a391f20 100644 Binary files a/INSTALL/grub/i386-efi/f2fs.mod and b/INSTALL/grub/i386-efi/f2fs.mod differ diff --git a/INSTALL/grub/i386-efi/hexdump.mod b/INSTALL/grub/i386-efi/hexdump.mod index 5cb22cac..f99f5864 100644 Binary files a/INSTALL/grub/i386-efi/hexdump.mod and b/INSTALL/grub/i386-efi/hexdump.mod differ diff --git a/INSTALL/grub/i386-efi/hfs.mod b/INSTALL/grub/i386-efi/hfs.mod index 7e44a334..abd125c7 100644 Binary files a/INSTALL/grub/i386-efi/hfs.mod and b/INSTALL/grub/i386-efi/hfs.mod differ diff --git a/INSTALL/grub/i386-efi/jfs.mod b/INSTALL/grub/i386-efi/jfs.mod index d247fb56..0feab322 100644 Binary files a/INSTALL/grub/i386-efi/jfs.mod and b/INSTALL/grub/i386-efi/jfs.mod differ diff --git a/INSTALL/grub/i386-efi/linux16.mod b/INSTALL/grub/i386-efi/linux16.mod index 9edbda4a..9a0a1b4d 100644 Binary files a/INSTALL/grub/i386-efi/linux16.mod and b/INSTALL/grub/i386-efi/linux16.mod differ diff --git a/INSTALL/grub/i386-efi/loadbios.mod b/INSTALL/grub/i386-efi/loadbios.mod index 0601fe21..91f19b44 100644 Binary files a/INSTALL/grub/i386-efi/loadbios.mod and b/INSTALL/grub/i386-efi/loadbios.mod differ diff --git a/INSTALL/grub/i386-efi/loadenv.mod b/INSTALL/grub/i386-efi/loadenv.mod index d32017db..c7619f55 100644 Binary files a/INSTALL/grub/i386-efi/loadenv.mod and b/INSTALL/grub/i386-efi/loadenv.mod differ diff --git a/INSTALL/grub/i386-efi/macho.mod b/INSTALL/grub/i386-efi/macho.mod index b97d1050..beec10ec 100644 Binary files a/INSTALL/grub/i386-efi/macho.mod and b/INSTALL/grub/i386-efi/macho.mod differ diff --git a/INSTALL/grub/i386-efi/minix.mod b/INSTALL/grub/i386-efi/minix.mod index 08c6f713..a3d1c02e 100644 Binary files a/INSTALL/grub/i386-efi/minix.mod and b/INSTALL/grub/i386-efi/minix.mod differ diff --git a/INSTALL/grub/i386-efi/minix2.mod b/INSTALL/grub/i386-efi/minix2.mod index 372fec6a..0c73e4e8 100644 Binary files a/INSTALL/grub/i386-efi/minix2.mod and b/INSTALL/grub/i386-efi/minix2.mod differ diff --git a/INSTALL/grub/i386-efi/minix2_be.mod b/INSTALL/grub/i386-efi/minix2_be.mod index 34867dde..4b6ce2f1 100644 Binary files a/INSTALL/grub/i386-efi/minix2_be.mod and b/INSTALL/grub/i386-efi/minix2_be.mod differ diff --git a/INSTALL/grub/i386-efi/minix3.mod b/INSTALL/grub/i386-efi/minix3.mod index 0e886a88..1f4f704e 100644 Binary files a/INSTALL/grub/i386-efi/minix3.mod and b/INSTALL/grub/i386-efi/minix3.mod differ diff --git a/INSTALL/grub/i386-efi/minix3_be.mod b/INSTALL/grub/i386-efi/minix3_be.mod index f9eaba5b..194da0f6 100644 Binary files a/INSTALL/grub/i386-efi/minix3_be.mod and b/INSTALL/grub/i386-efi/minix3_be.mod differ diff --git a/INSTALL/grub/i386-efi/minix_be.mod b/INSTALL/grub/i386-efi/minix_be.mod index 2b2a0f13..04ee8f17 100644 Binary files a/INSTALL/grub/i386-efi/minix_be.mod and b/INSTALL/grub/i386-efi/minix_be.mod differ diff --git a/INSTALL/grub/i386-efi/moddep.lst b/INSTALL/grub/i386-efi/moddep.lst index 479d6bd5..82ae547a 100644 --- a/INSTALL/grub/i386-efi/moddep.lst +++ b/INSTALL/grub/i386-efi/moddep.lst @@ -120,7 +120,7 @@ ehci: cs5536 usb boot crypto: part_bsd: part_msdos cs5536: -ventoy: elf fshelp ext2 btrfs font crypto gcry_md5 exfat udf extcmd datetime div normal video gcry_sha1 iso9660 +ventoy: fshelp ext2 elf btrfs font crypto gcry_md5 exfat udf div extcmd datetime normal video gcry_sha1 iso9660 gcry_sha512: crypto password: crypto normal fshelp: diff --git a/INSTALL/grub/i386-efi/multiboot.mod b/INSTALL/grub/i386-efi/multiboot.mod index 12519fd4..0a80010b 100644 Binary files a/INSTALL/grub/i386-efi/multiboot.mod and b/INSTALL/grub/i386-efi/multiboot.mod differ diff --git a/INSTALL/grub/i386-efi/multiboot2.mod b/INSTALL/grub/i386-efi/multiboot2.mod index c05719f7..ed46eeac 100644 Binary files a/INSTALL/grub/i386-efi/multiboot2.mod and b/INSTALL/grub/i386-efi/multiboot2.mod differ diff --git a/INSTALL/grub/i386-efi/nativedisk.mod b/INSTALL/grub/i386-efi/nativedisk.mod index 1779ad09..6063443b 100644 Binary files a/INSTALL/grub/i386-efi/nativedisk.mod and b/INSTALL/grub/i386-efi/nativedisk.mod differ diff --git a/INSTALL/grub/i386-efi/nilfs2.mod b/INSTALL/grub/i386-efi/nilfs2.mod index 4adb48c3..02e7572a 100644 Binary files a/INSTALL/grub/i386-efi/nilfs2.mod and b/INSTALL/grub/i386-efi/nilfs2.mod differ diff --git a/INSTALL/grub/i386-efi/normal.mod b/INSTALL/grub/i386-efi/normal.mod index fe35b9c6..467046ff 100644 Binary files a/INSTALL/grub/i386-efi/normal.mod and b/INSTALL/grub/i386-efi/normal.mod differ diff --git a/INSTALL/grub/i386-efi/odc.mod b/INSTALL/grub/i386-efi/odc.mod index a115affe..614418a0 100644 Binary files a/INSTALL/grub/i386-efi/odc.mod and b/INSTALL/grub/i386-efi/odc.mod differ diff --git a/INSTALL/grub/i386-efi/offsetio.mod b/INSTALL/grub/i386-efi/offsetio.mod index aa681a7a..62500890 100644 Binary files a/INSTALL/grub/i386-efi/offsetio.mod and b/INSTALL/grub/i386-efi/offsetio.mod differ diff --git a/INSTALL/grub/i386-efi/pgp.mod b/INSTALL/grub/i386-efi/pgp.mod index fc272313..0e78e8f0 100644 Binary files a/INSTALL/grub/i386-efi/pgp.mod and b/INSTALL/grub/i386-efi/pgp.mod differ diff --git a/INSTALL/grub/i386-efi/procfs.mod b/INSTALL/grub/i386-efi/procfs.mod index e30dd2bb..04b27e2d 100644 Binary files a/INSTALL/grub/i386-efi/procfs.mod and b/INSTALL/grub/i386-efi/procfs.mod differ diff --git a/INSTALL/grub/i386-efi/progress.mod b/INSTALL/grub/i386-efi/progress.mod index ee1481d8..c8b00fd6 100644 Binary files a/INSTALL/grub/i386-efi/progress.mod and b/INSTALL/grub/i386-efi/progress.mod differ diff --git a/INSTALL/grub/i386-efi/reiserfs.mod b/INSTALL/grub/i386-efi/reiserfs.mod index 6c85ff89..e8dfb863 100644 Binary files a/INSTALL/grub/i386-efi/reiserfs.mod and b/INSTALL/grub/i386-efi/reiserfs.mod differ diff --git a/INSTALL/grub/i386-efi/romfs.mod b/INSTALL/grub/i386-efi/romfs.mod index 34f5955f..db077c14 100644 Binary files a/INSTALL/grub/i386-efi/romfs.mod and b/INSTALL/grub/i386-efi/romfs.mod differ diff --git a/INSTALL/grub/i386-efi/sfs.mod b/INSTALL/grub/i386-efi/sfs.mod index 97103dee..8f4eb833 100644 Binary files a/INSTALL/grub/i386-efi/sfs.mod and b/INSTALL/grub/i386-efi/sfs.mod differ diff --git a/INSTALL/grub/i386-efi/testload.mod b/INSTALL/grub/i386-efi/testload.mod index e053e283..addd9ec1 100644 Binary files a/INSTALL/grub/i386-efi/testload.mod and b/INSTALL/grub/i386-efi/testload.mod differ diff --git a/INSTALL/grub/i386-efi/tga.mod b/INSTALL/grub/i386-efi/tga.mod index 16523b6e..62d9a39c 100644 Binary files a/INSTALL/grub/i386-efi/tga.mod and b/INSTALL/grub/i386-efi/tga.mod differ diff --git a/INSTALL/grub/i386-efi/ufs1.mod b/INSTALL/grub/i386-efi/ufs1.mod index dc06fcab..70356dfb 100644 Binary files a/INSTALL/grub/i386-efi/ufs1.mod and b/INSTALL/grub/i386-efi/ufs1.mod differ diff --git a/INSTALL/grub/i386-efi/ufs1_be.mod b/INSTALL/grub/i386-efi/ufs1_be.mod index 4371324c..160b7ac4 100644 Binary files a/INSTALL/grub/i386-efi/ufs1_be.mod and b/INSTALL/grub/i386-efi/ufs1_be.mod differ diff --git a/INSTALL/grub/i386-efi/ufs2.mod b/INSTALL/grub/i386-efi/ufs2.mod index a4a939b6..2754630d 100644 Binary files a/INSTALL/grub/i386-efi/ufs2.mod and b/INSTALL/grub/i386-efi/ufs2.mod differ diff --git a/INSTALL/grub/i386-efi/verifiers.mod b/INSTALL/grub/i386-efi/verifiers.mod index 7bd45fe8..00ca55f6 100644 Binary files a/INSTALL/grub/i386-efi/verifiers.mod and b/INSTALL/grub/i386-efi/verifiers.mod differ diff --git a/INSTALL/grub/i386-efi/xnu.mod b/INSTALL/grub/i386-efi/xnu.mod index 6f71890e..b1e874a1 100644 Binary files a/INSTALL/grub/i386-efi/xnu.mod and b/INSTALL/grub/i386-efi/xnu.mod differ diff --git a/INSTALL/grub/i386-efi/zfs.mod b/INSTALL/grub/i386-efi/zfs.mod index 0f9ee6a9..b5fa5d53 100644 Binary files a/INSTALL/grub/i386-efi/zfs.mod and b/INSTALL/grub/i386-efi/zfs.mod differ diff --git a/INSTALL/grub/i386-pc/acpi.mod b/INSTALL/grub/i386-pc/acpi.mod index 8768848c..1c28ba86 100644 Binary files a/INSTALL/grub/i386-pc/acpi.mod and b/INSTALL/grub/i386-pc/acpi.mod differ diff --git a/INSTALL/grub/i386-pc/affs.mod b/INSTALL/grub/i386-pc/affs.mod index 1aabc41c..aad7f0e7 100644 Binary files a/INSTALL/grub/i386-pc/affs.mod and b/INSTALL/grub/i386-pc/affs.mod differ diff --git a/INSTALL/grub/i386-pc/afs.mod b/INSTALL/grub/i386-pc/afs.mod index 020612f3..495bc815 100644 Binary files a/INSTALL/grub/i386-pc/afs.mod and b/INSTALL/grub/i386-pc/afs.mod differ diff --git a/INSTALL/grub/i386-pc/aout.mod b/INSTALL/grub/i386-pc/aout.mod index e775a1eb..189c8477 100644 Binary files a/INSTALL/grub/i386-pc/aout.mod and b/INSTALL/grub/i386-pc/aout.mod differ diff --git a/INSTALL/grub/i386-pc/bfs.mod b/INSTALL/grub/i386-pc/bfs.mod index 07ac6456..427ce266 100644 Binary files a/INSTALL/grub/i386-pc/bfs.mod and b/INSTALL/grub/i386-pc/bfs.mod differ diff --git a/INSTALL/grub/i386-pc/bitmap_scale.mod b/INSTALL/grub/i386-pc/bitmap_scale.mod index 8b46a187..02687ffb 100644 Binary files a/INSTALL/grub/i386-pc/bitmap_scale.mod and b/INSTALL/grub/i386-pc/bitmap_scale.mod differ diff --git a/INSTALL/grub/i386-pc/bsd.mod b/INSTALL/grub/i386-pc/bsd.mod index 51d7358d..35f1bcbb 100644 Binary files a/INSTALL/grub/i386-pc/bsd.mod and b/INSTALL/grub/i386-pc/bsd.mod differ diff --git a/INSTALL/grub/i386-pc/btrfs.mod b/INSTALL/grub/i386-pc/btrfs.mod index 25aa06e2..f56207fa 100644 Binary files a/INSTALL/grub/i386-pc/btrfs.mod and b/INSTALL/grub/i386-pc/btrfs.mod differ diff --git a/INSTALL/grub/i386-pc/bufio.mod b/INSTALL/grub/i386-pc/bufio.mod index 73bd58e9..6db404b6 100644 Binary files a/INSTALL/grub/i386-pc/bufio.mod and b/INSTALL/grub/i386-pc/bufio.mod differ diff --git a/INSTALL/grub/i386-pc/cbfs.mod b/INSTALL/grub/i386-pc/cbfs.mod index 578ed2cd..987e9aa0 100644 Binary files a/INSTALL/grub/i386-pc/cbfs.mod and b/INSTALL/grub/i386-pc/cbfs.mod differ diff --git a/INSTALL/grub/i386-pc/cmp.mod b/INSTALL/grub/i386-pc/cmp.mod index d5155d7e..e482c305 100644 Binary files a/INSTALL/grub/i386-pc/cmp.mod and b/INSTALL/grub/i386-pc/cmp.mod differ diff --git a/INSTALL/grub/i386-pc/core.img b/INSTALL/grub/i386-pc/core.img index 2dabb509..d94561e0 100644 Binary files a/INSTALL/grub/i386-pc/core.img and b/INSTALL/grub/i386-pc/core.img differ diff --git a/INSTALL/grub/i386-pc/cpio.mod b/INSTALL/grub/i386-pc/cpio.mod index 550b2af1..6bf0ef06 100644 Binary files a/INSTALL/grub/i386-pc/cpio.mod and b/INSTALL/grub/i386-pc/cpio.mod differ diff --git a/INSTALL/grub/i386-pc/cpio_be.mod b/INSTALL/grub/i386-pc/cpio_be.mod index 42776b17..3b0df64a 100644 Binary files a/INSTALL/grub/i386-pc/cpio_be.mod and b/INSTALL/grub/i386-pc/cpio_be.mod differ diff --git a/INSTALL/grub/i386-pc/efiemu.mod b/INSTALL/grub/i386-pc/efiemu.mod index 88fd5f0a..b6ea6986 100644 Binary files a/INSTALL/grub/i386-pc/efiemu.mod and b/INSTALL/grub/i386-pc/efiemu.mod differ diff --git a/INSTALL/grub/i386-pc/f2fs.mod b/INSTALL/grub/i386-pc/f2fs.mod index f0fe6fd1..fa9ed6cf 100644 Binary files a/INSTALL/grub/i386-pc/f2fs.mod and b/INSTALL/grub/i386-pc/f2fs.mod differ diff --git a/INSTALL/grub/i386-pc/freedos.mod b/INSTALL/grub/i386-pc/freedos.mod index 08cabd0e..0ea367b8 100644 Binary files a/INSTALL/grub/i386-pc/freedos.mod and b/INSTALL/grub/i386-pc/freedos.mod differ diff --git a/INSTALL/grub/i386-pc/hexdump.mod b/INSTALL/grub/i386-pc/hexdump.mod index 7ccea176..93837fed 100644 Binary files a/INSTALL/grub/i386-pc/hexdump.mod and b/INSTALL/grub/i386-pc/hexdump.mod differ diff --git a/INSTALL/grub/i386-pc/hfs.mod b/INSTALL/grub/i386-pc/hfs.mod index eb1134c6..a8d2d8f0 100644 Binary files a/INSTALL/grub/i386-pc/hfs.mod and b/INSTALL/grub/i386-pc/hfs.mod differ diff --git a/INSTALL/grub/i386-pc/hfsplus.mod b/INSTALL/grub/i386-pc/hfsplus.mod index f07eedb4..72938300 100644 Binary files a/INSTALL/grub/i386-pc/hfsplus.mod and b/INSTALL/grub/i386-pc/hfsplus.mod differ diff --git a/INSTALL/grub/i386-pc/jfs.mod b/INSTALL/grub/i386-pc/jfs.mod index 1dbc2684..028c6581 100644 Binary files a/INSTALL/grub/i386-pc/jfs.mod and b/INSTALL/grub/i386-pc/jfs.mod differ diff --git a/INSTALL/grub/i386-pc/loadenv.mod b/INSTALL/grub/i386-pc/loadenv.mod index 683cd904..834e8d91 100644 Binary files a/INSTALL/grub/i386-pc/loadenv.mod and b/INSTALL/grub/i386-pc/loadenv.mod differ diff --git a/INSTALL/grub/i386-pc/macho.mod b/INSTALL/grub/i386-pc/macho.mod index c4a88cef..6aa4cf51 100644 Binary files a/INSTALL/grub/i386-pc/macho.mod and b/INSTALL/grub/i386-pc/macho.mod differ diff --git a/INSTALL/grub/i386-pc/minix.mod b/INSTALL/grub/i386-pc/minix.mod index 87477bff..87064eea 100644 Binary files a/INSTALL/grub/i386-pc/minix.mod and b/INSTALL/grub/i386-pc/minix.mod differ diff --git a/INSTALL/grub/i386-pc/minix2.mod b/INSTALL/grub/i386-pc/minix2.mod index 01d2f609..0d0b6d29 100644 Binary files a/INSTALL/grub/i386-pc/minix2.mod and b/INSTALL/grub/i386-pc/minix2.mod differ diff --git a/INSTALL/grub/i386-pc/minix2_be.mod b/INSTALL/grub/i386-pc/minix2_be.mod index 260e1e7b..e383aa56 100644 Binary files a/INSTALL/grub/i386-pc/minix2_be.mod and b/INSTALL/grub/i386-pc/minix2_be.mod differ diff --git a/INSTALL/grub/i386-pc/minix3.mod b/INSTALL/grub/i386-pc/minix3.mod index 256f5d71..f96fb45c 100644 Binary files a/INSTALL/grub/i386-pc/minix3.mod and b/INSTALL/grub/i386-pc/minix3.mod differ diff --git a/INSTALL/grub/i386-pc/minix3_be.mod b/INSTALL/grub/i386-pc/minix3_be.mod index 7212cb60..d3dca213 100644 Binary files a/INSTALL/grub/i386-pc/minix3_be.mod and b/INSTALL/grub/i386-pc/minix3_be.mod differ diff --git a/INSTALL/grub/i386-pc/minix_be.mod b/INSTALL/grub/i386-pc/minix_be.mod index cf7f0462..604dffea 100644 Binary files a/INSTALL/grub/i386-pc/minix_be.mod and b/INSTALL/grub/i386-pc/minix_be.mod differ diff --git a/INSTALL/grub/i386-pc/moddep.lst b/INSTALL/grub/i386-pc/moddep.lst index df8a1864..d205b28a 100644 --- a/INSTALL/grub/i386-pc/moddep.lst +++ b/INSTALL/grub/i386-pc/moddep.lst @@ -123,7 +123,7 @@ crypto: part_bsd: part_msdos cs5536: pci biosdisk: -ventoy: elf fshelp ext2 btrfs font crypto gcry_md5 exfat udf extcmd datetime div normal video gcry_sha1 iso9660 acpi +ventoy: elf fshelp ext2 btrfs font crypto gcry_md5 exfat udf div extcmd datetime normal video gcry_sha1 iso9660 acpi lsapm: gcry_sha512: crypto password: crypto normal diff --git a/INSTALL/grub/i386-pc/multiboot.mod b/INSTALL/grub/i386-pc/multiboot.mod index 0547a54d..a327afe2 100644 Binary files a/INSTALL/grub/i386-pc/multiboot.mod and b/INSTALL/grub/i386-pc/multiboot.mod differ diff --git a/INSTALL/grub/i386-pc/multiboot2.mod b/INSTALL/grub/i386-pc/multiboot2.mod index a4879c75..9f6f775f 100644 Binary files a/INSTALL/grub/i386-pc/multiboot2.mod and b/INSTALL/grub/i386-pc/multiboot2.mod differ diff --git a/INSTALL/grub/i386-pc/nativedisk.mod b/INSTALL/grub/i386-pc/nativedisk.mod index df1a07df..f77fd13a 100644 Binary files a/INSTALL/grub/i386-pc/nativedisk.mod and b/INSTALL/grub/i386-pc/nativedisk.mod differ diff --git a/INSTALL/grub/i386-pc/net.mod b/INSTALL/grub/i386-pc/net.mod index 33752703..182fed55 100644 Binary files a/INSTALL/grub/i386-pc/net.mod and b/INSTALL/grub/i386-pc/net.mod differ diff --git a/INSTALL/grub/i386-pc/nilfs2.mod b/INSTALL/grub/i386-pc/nilfs2.mod index 3d2b1387..a1baea36 100644 Binary files a/INSTALL/grub/i386-pc/nilfs2.mod and b/INSTALL/grub/i386-pc/nilfs2.mod differ diff --git a/INSTALL/grub/i386-pc/odc.mod b/INSTALL/grub/i386-pc/odc.mod index bf6ef93f..36bda912 100644 Binary files a/INSTALL/grub/i386-pc/odc.mod and b/INSTALL/grub/i386-pc/odc.mod differ diff --git a/INSTALL/grub/i386-pc/offsetio.mod b/INSTALL/grub/i386-pc/offsetio.mod index 9db26d07..be57ff59 100644 Binary files a/INSTALL/grub/i386-pc/offsetio.mod and b/INSTALL/grub/i386-pc/offsetio.mod differ diff --git a/INSTALL/grub/i386-pc/pgp.mod b/INSTALL/grub/i386-pc/pgp.mod index 3270fff7..a487fdf9 100644 Binary files a/INSTALL/grub/i386-pc/pgp.mod and b/INSTALL/grub/i386-pc/pgp.mod differ diff --git a/INSTALL/grub/i386-pc/plan9.mod b/INSTALL/grub/i386-pc/plan9.mod index 4845df34..2fccdbc4 100644 Binary files a/INSTALL/grub/i386-pc/plan9.mod and b/INSTALL/grub/i386-pc/plan9.mod differ diff --git a/INSTALL/grub/i386-pc/procfs.mod b/INSTALL/grub/i386-pc/procfs.mod index a0e20ec4..b67ff465 100644 Binary files a/INSTALL/grub/i386-pc/procfs.mod and b/INSTALL/grub/i386-pc/procfs.mod differ diff --git a/INSTALL/grub/i386-pc/progress.mod b/INSTALL/grub/i386-pc/progress.mod index 67dd96e8..c93b2420 100644 Binary files a/INSTALL/grub/i386-pc/progress.mod and b/INSTALL/grub/i386-pc/progress.mod differ diff --git a/INSTALL/grub/i386-pc/pxechain.mod b/INSTALL/grub/i386-pc/pxechain.mod index 2a1bc6af..627626ed 100644 Binary files a/INSTALL/grub/i386-pc/pxechain.mod and b/INSTALL/grub/i386-pc/pxechain.mod differ diff --git a/INSTALL/grub/i386-pc/reiserfs.mod b/INSTALL/grub/i386-pc/reiserfs.mod index c51d8f63..853fe500 100644 Binary files a/INSTALL/grub/i386-pc/reiserfs.mod and b/INSTALL/grub/i386-pc/reiserfs.mod differ diff --git a/INSTALL/grub/i386-pc/romfs.mod b/INSTALL/grub/i386-pc/romfs.mod index d420e236..e154ab98 100644 Binary files a/INSTALL/grub/i386-pc/romfs.mod and b/INSTALL/grub/i386-pc/romfs.mod differ diff --git a/INSTALL/grub/i386-pc/sfs.mod b/INSTALL/grub/i386-pc/sfs.mod index 3cf881b4..86240a7a 100644 Binary files a/INSTALL/grub/i386-pc/sfs.mod and b/INSTALL/grub/i386-pc/sfs.mod differ diff --git a/INSTALL/grub/i386-pc/testload.mod b/INSTALL/grub/i386-pc/testload.mod index 1d428810..27965dee 100644 Binary files a/INSTALL/grub/i386-pc/testload.mod and b/INSTALL/grub/i386-pc/testload.mod differ diff --git a/INSTALL/grub/i386-pc/tga.mod b/INSTALL/grub/i386-pc/tga.mod index c8fcd0b5..9b333d79 100644 Binary files a/INSTALL/grub/i386-pc/tga.mod and b/INSTALL/grub/i386-pc/tga.mod differ diff --git a/INSTALL/grub/i386-pc/ufs1.mod b/INSTALL/grub/i386-pc/ufs1.mod index 4772a202..e2e7f9a7 100644 Binary files a/INSTALL/grub/i386-pc/ufs1.mod and b/INSTALL/grub/i386-pc/ufs1.mod differ diff --git a/INSTALL/grub/i386-pc/ufs1_be.mod b/INSTALL/grub/i386-pc/ufs1_be.mod index 31a50d7c..f615f3c9 100644 Binary files a/INSTALL/grub/i386-pc/ufs1_be.mod and b/INSTALL/grub/i386-pc/ufs1_be.mod differ diff --git a/INSTALL/grub/i386-pc/ufs2.mod b/INSTALL/grub/i386-pc/ufs2.mod index 088fba39..f1b01d75 100644 Binary files a/INSTALL/grub/i386-pc/ufs2.mod and b/INSTALL/grub/i386-pc/ufs2.mod differ diff --git a/INSTALL/grub/i386-pc/verifiers.mod b/INSTALL/grub/i386-pc/verifiers.mod index f7b8ab91..c2dd2075 100644 Binary files a/INSTALL/grub/i386-pc/verifiers.mod and b/INSTALL/grub/i386-pc/verifiers.mod differ diff --git a/INSTALL/grub/i386-pc/xnu.mod b/INSTALL/grub/i386-pc/xnu.mod index 96c2e583..6aa05906 100644 Binary files a/INSTALL/grub/i386-pc/xnu.mod and b/INSTALL/grub/i386-pc/xnu.mod differ diff --git a/INSTALL/grub/i386-pc/zfs.mod b/INSTALL/grub/i386-pc/zfs.mod index 28adaa65..eb5d3264 100644 Binary files a/INSTALL/grub/i386-pc/zfs.mod and b/INSTALL/grub/i386-pc/zfs.mod differ diff --git a/INSTALL/grub/mips64el-efi/affs.mod b/INSTALL/grub/mips64el-efi/affs.mod index 80ee7ecc..79f7d3b8 100644 Binary files a/INSTALL/grub/mips64el-efi/affs.mod and b/INSTALL/grub/mips64el-efi/affs.mod differ diff --git a/INSTALL/grub/mips64el-efi/afs.mod b/INSTALL/grub/mips64el-efi/afs.mod index fe2a1c81..e09eb7b9 100644 Binary files a/INSTALL/grub/mips64el-efi/afs.mod and b/INSTALL/grub/mips64el-efi/afs.mod differ diff --git a/INSTALL/grub/mips64el-efi/bfs.mod b/INSTALL/grub/mips64el-efi/bfs.mod index 133bc607..cb28a88e 100644 Binary files a/INSTALL/grub/mips64el-efi/bfs.mod and b/INSTALL/grub/mips64el-efi/bfs.mod differ diff --git a/INSTALL/grub/mips64el-efi/btrfs.mod b/INSTALL/grub/mips64el-efi/btrfs.mod index d268085b..e3b549b7 100644 Binary files a/INSTALL/grub/mips64el-efi/btrfs.mod and b/INSTALL/grub/mips64el-efi/btrfs.mod differ diff --git a/INSTALL/grub/mips64el-efi/cbfs.mod b/INSTALL/grub/mips64el-efi/cbfs.mod index c3c2bfaa..c95efc9a 100644 Binary files a/INSTALL/grub/mips64el-efi/cbfs.mod and b/INSTALL/grub/mips64el-efi/cbfs.mod differ diff --git a/INSTALL/grub/mips64el-efi/cmp.mod b/INSTALL/grub/mips64el-efi/cmp.mod index 98de3928..09e90e53 100644 Binary files a/INSTALL/grub/mips64el-efi/cmp.mod and b/INSTALL/grub/mips64el-efi/cmp.mod differ diff --git a/INSTALL/grub/mips64el-efi/cpio.mod b/INSTALL/grub/mips64el-efi/cpio.mod index 1df9f5cb..0af3d1eb 100644 Binary files a/INSTALL/grub/mips64el-efi/cpio.mod and b/INSTALL/grub/mips64el-efi/cpio.mod differ diff --git a/INSTALL/grub/mips64el-efi/cpio_be.mod b/INSTALL/grub/mips64el-efi/cpio_be.mod index cb4e8a08..126fac39 100644 Binary files a/INSTALL/grub/mips64el-efi/cpio_be.mod and b/INSTALL/grub/mips64el-efi/cpio_be.mod differ diff --git a/INSTALL/grub/mips64el-efi/f2fs.mod b/INSTALL/grub/mips64el-efi/f2fs.mod index 373a97f2..3516fe32 100644 Binary files a/INSTALL/grub/mips64el-efi/f2fs.mod and b/INSTALL/grub/mips64el-efi/f2fs.mod differ diff --git a/INSTALL/grub/mips64el-efi/hexdump.mod b/INSTALL/grub/mips64el-efi/hexdump.mod index b056cba8..e9240e8d 100644 Binary files a/INSTALL/grub/mips64el-efi/hexdump.mod and b/INSTALL/grub/mips64el-efi/hexdump.mod differ diff --git a/INSTALL/grub/mips64el-efi/hfs.mod b/INSTALL/grub/mips64el-efi/hfs.mod index bc579bdb..a13022b5 100644 Binary files a/INSTALL/grub/mips64el-efi/hfs.mod and b/INSTALL/grub/mips64el-efi/hfs.mod differ diff --git a/INSTALL/grub/mips64el-efi/jfs.mod b/INSTALL/grub/mips64el-efi/jfs.mod index 38f9888c..3104fb7f 100644 Binary files a/INSTALL/grub/mips64el-efi/jfs.mod and b/INSTALL/grub/mips64el-efi/jfs.mod differ diff --git a/INSTALL/grub/mips64el-efi/loadenv.mod b/INSTALL/grub/mips64el-efi/loadenv.mod index 091f014a..7584c9bb 100644 Binary files a/INSTALL/grub/mips64el-efi/loadenv.mod and b/INSTALL/grub/mips64el-efi/loadenv.mod differ diff --git a/INSTALL/grub/mips64el-efi/macho.mod b/INSTALL/grub/mips64el-efi/macho.mod index 30acfd54..043b2e73 100644 Binary files a/INSTALL/grub/mips64el-efi/macho.mod and b/INSTALL/grub/mips64el-efi/macho.mod differ diff --git a/INSTALL/grub/mips64el-efi/minix.mod b/INSTALL/grub/mips64el-efi/minix.mod index 3a16c280..ef34533a 100644 Binary files a/INSTALL/grub/mips64el-efi/minix.mod and b/INSTALL/grub/mips64el-efi/minix.mod differ diff --git a/INSTALL/grub/mips64el-efi/minix2.mod b/INSTALL/grub/mips64el-efi/minix2.mod index 7ad76d1a..cd505fa2 100644 Binary files a/INSTALL/grub/mips64el-efi/minix2.mod and b/INSTALL/grub/mips64el-efi/minix2.mod differ diff --git a/INSTALL/grub/mips64el-efi/minix2_be.mod b/INSTALL/grub/mips64el-efi/minix2_be.mod index 72ddc958..7f4fec2b 100644 Binary files a/INSTALL/grub/mips64el-efi/minix2_be.mod and b/INSTALL/grub/mips64el-efi/minix2_be.mod differ diff --git a/INSTALL/grub/mips64el-efi/minix3.mod b/INSTALL/grub/mips64el-efi/minix3.mod index 979bb9d0..d2b94ca1 100644 Binary files a/INSTALL/grub/mips64el-efi/minix3.mod and b/INSTALL/grub/mips64el-efi/minix3.mod differ diff --git a/INSTALL/grub/mips64el-efi/minix3_be.mod b/INSTALL/grub/mips64el-efi/minix3_be.mod index 87021fe4..13bf1bae 100644 Binary files a/INSTALL/grub/mips64el-efi/minix3_be.mod and b/INSTALL/grub/mips64el-efi/minix3_be.mod differ diff --git a/INSTALL/grub/mips64el-efi/minix_be.mod b/INSTALL/grub/mips64el-efi/minix_be.mod index acc3187f..2b58151f 100644 Binary files a/INSTALL/grub/mips64el-efi/minix_be.mod and b/INSTALL/grub/mips64el-efi/minix_be.mod differ diff --git a/INSTALL/grub/mips64el-efi/moddep.lst b/INSTALL/grub/mips64el-efi/moddep.lst index b16abbf1..554171b5 100644 Binary files a/INSTALL/grub/mips64el-efi/moddep.lst and b/INSTALL/grub/mips64el-efi/moddep.lst differ diff --git a/INSTALL/grub/mips64el-efi/nilfs2.mod b/INSTALL/grub/mips64el-efi/nilfs2.mod index 19594cf6..61893666 100644 Binary files a/INSTALL/grub/mips64el-efi/nilfs2.mod and b/INSTALL/grub/mips64el-efi/nilfs2.mod differ diff --git a/INSTALL/grub/mips64el-efi/normal.mod b/INSTALL/grub/mips64el-efi/normal.mod index 8236497c..a10d308b 100644 Binary files a/INSTALL/grub/mips64el-efi/normal.mod and b/INSTALL/grub/mips64el-efi/normal.mod differ diff --git a/INSTALL/grub/mips64el-efi/odc.mod b/INSTALL/grub/mips64el-efi/odc.mod index 1c004226..20afc1ea 100644 Binary files a/INSTALL/grub/mips64el-efi/odc.mod and b/INSTALL/grub/mips64el-efi/odc.mod differ diff --git a/INSTALL/grub/mips64el-efi/offsetio.mod b/INSTALL/grub/mips64el-efi/offsetio.mod index e3d38127..c3147389 100644 Binary files a/INSTALL/grub/mips64el-efi/offsetio.mod and b/INSTALL/grub/mips64el-efi/offsetio.mod differ diff --git a/INSTALL/grub/mips64el-efi/pgp.mod b/INSTALL/grub/mips64el-efi/pgp.mod index 7948f3f6..24f438fb 100644 Binary files a/INSTALL/grub/mips64el-efi/pgp.mod and b/INSTALL/grub/mips64el-efi/pgp.mod differ diff --git a/INSTALL/grub/mips64el-efi/procfs.mod b/INSTALL/grub/mips64el-efi/procfs.mod index 3d86a0a4..f8318893 100644 Binary files a/INSTALL/grub/mips64el-efi/procfs.mod and b/INSTALL/grub/mips64el-efi/procfs.mod differ diff --git a/INSTALL/grub/mips64el-efi/progress.mod b/INSTALL/grub/mips64el-efi/progress.mod index 3547a322..b23fc39f 100644 Binary files a/INSTALL/grub/mips64el-efi/progress.mod and b/INSTALL/grub/mips64el-efi/progress.mod differ diff --git a/INSTALL/grub/mips64el-efi/reiserfs.mod b/INSTALL/grub/mips64el-efi/reiserfs.mod index b425c034..6eee7c97 100644 Binary files a/INSTALL/grub/mips64el-efi/reiserfs.mod and b/INSTALL/grub/mips64el-efi/reiserfs.mod differ diff --git a/INSTALL/grub/mips64el-efi/romfs.mod b/INSTALL/grub/mips64el-efi/romfs.mod index 85a0a59e..7e90eb26 100644 Binary files a/INSTALL/grub/mips64el-efi/romfs.mod and b/INSTALL/grub/mips64el-efi/romfs.mod differ diff --git a/INSTALL/grub/mips64el-efi/sfs.mod b/INSTALL/grub/mips64el-efi/sfs.mod index 484fb2da..4ea53fe1 100644 Binary files a/INSTALL/grub/mips64el-efi/sfs.mod and b/INSTALL/grub/mips64el-efi/sfs.mod differ diff --git a/INSTALL/grub/mips64el-efi/testload.mod b/INSTALL/grub/mips64el-efi/testload.mod index 09e724aa..3a241b06 100644 Binary files a/INSTALL/grub/mips64el-efi/testload.mod and b/INSTALL/grub/mips64el-efi/testload.mod differ diff --git a/INSTALL/grub/mips64el-efi/tga.mod b/INSTALL/grub/mips64el-efi/tga.mod index 2e1e62d5..c6ab4b42 100644 Binary files a/INSTALL/grub/mips64el-efi/tga.mod and b/INSTALL/grub/mips64el-efi/tga.mod differ diff --git a/INSTALL/grub/mips64el-efi/ufs1.mod b/INSTALL/grub/mips64el-efi/ufs1.mod index 738d7050..a8a19366 100644 Binary files a/INSTALL/grub/mips64el-efi/ufs1.mod and b/INSTALL/grub/mips64el-efi/ufs1.mod differ diff --git a/INSTALL/grub/mips64el-efi/ufs1_be.mod b/INSTALL/grub/mips64el-efi/ufs1_be.mod index b38fd905..521caf3a 100644 Binary files a/INSTALL/grub/mips64el-efi/ufs1_be.mod and b/INSTALL/grub/mips64el-efi/ufs1_be.mod differ diff --git a/INSTALL/grub/mips64el-efi/ufs2.mod b/INSTALL/grub/mips64el-efi/ufs2.mod index 177da8a1..f2a63188 100644 Binary files a/INSTALL/grub/mips64el-efi/ufs2.mod and b/INSTALL/grub/mips64el-efi/ufs2.mod differ diff --git a/INSTALL/grub/mips64el-efi/verifiers.mod b/INSTALL/grub/mips64el-efi/verifiers.mod index 9d16385c..e058a904 100644 Binary files a/INSTALL/grub/mips64el-efi/verifiers.mod and b/INSTALL/grub/mips64el-efi/verifiers.mod differ diff --git a/INSTALL/grub/mips64el-efi/zfs.mod b/INSTALL/grub/mips64el-efi/zfs.mod index 13b9f823..4d22ea77 100644 Binary files a/INSTALL/grub/mips64el-efi/zfs.mod and b/INSTALL/grub/mips64el-efi/zfs.mod differ diff --git a/INSTALL/grub/x86_64-efi/affs.mod b/INSTALL/grub/x86_64-efi/affs.mod index 8c67092e..5dca7c66 100644 Binary files a/INSTALL/grub/x86_64-efi/affs.mod and b/INSTALL/grub/x86_64-efi/affs.mod differ diff --git a/INSTALL/grub/x86_64-efi/afs.mod b/INSTALL/grub/x86_64-efi/afs.mod index 98157773..5be6473a 100644 Binary files a/INSTALL/grub/x86_64-efi/afs.mod and b/INSTALL/grub/x86_64-efi/afs.mod differ diff --git a/INSTALL/grub/x86_64-efi/aout.mod b/INSTALL/grub/x86_64-efi/aout.mod index db8ab3ea..aec5b825 100644 Binary files a/INSTALL/grub/x86_64-efi/aout.mod and b/INSTALL/grub/x86_64-efi/aout.mod differ diff --git a/INSTALL/grub/x86_64-efi/bfs.mod b/INSTALL/grub/x86_64-efi/bfs.mod index 3065049f..c74d6e1d 100644 Binary files a/INSTALL/grub/x86_64-efi/bfs.mod and b/INSTALL/grub/x86_64-efi/bfs.mod differ diff --git a/INSTALL/grub/x86_64-efi/bsd.mod b/INSTALL/grub/x86_64-efi/bsd.mod index 9f5235b0..c7f3fe06 100644 Binary files a/INSTALL/grub/x86_64-efi/bsd.mod and b/INSTALL/grub/x86_64-efi/bsd.mod differ diff --git a/INSTALL/grub/x86_64-efi/btrfs.mod b/INSTALL/grub/x86_64-efi/btrfs.mod index af470c3d..afcd8c4c 100644 Binary files a/INSTALL/grub/x86_64-efi/btrfs.mod and b/INSTALL/grub/x86_64-efi/btrfs.mod differ diff --git a/INSTALL/grub/x86_64-efi/cbfs.mod b/INSTALL/grub/x86_64-efi/cbfs.mod index 385069bb..6bfcfa06 100644 Binary files a/INSTALL/grub/x86_64-efi/cbfs.mod and b/INSTALL/grub/x86_64-efi/cbfs.mod differ diff --git a/INSTALL/grub/x86_64-efi/cmp.mod b/INSTALL/grub/x86_64-efi/cmp.mod index 29dbd130..f7397955 100644 Binary files a/INSTALL/grub/x86_64-efi/cmp.mod and b/INSTALL/grub/x86_64-efi/cmp.mod differ diff --git a/INSTALL/grub/x86_64-efi/cpio.mod b/INSTALL/grub/x86_64-efi/cpio.mod index e774c231..c5d64b1b 100644 Binary files a/INSTALL/grub/x86_64-efi/cpio.mod and b/INSTALL/grub/x86_64-efi/cpio.mod differ diff --git a/INSTALL/grub/x86_64-efi/cpio_be.mod b/INSTALL/grub/x86_64-efi/cpio_be.mod index 621213fd..e81b6256 100644 Binary files a/INSTALL/grub/x86_64-efi/cpio_be.mod and b/INSTALL/grub/x86_64-efi/cpio_be.mod differ diff --git a/INSTALL/grub/x86_64-efi/f2fs.mod b/INSTALL/grub/x86_64-efi/f2fs.mod index 4d9e530c..aec09542 100644 Binary files a/INSTALL/grub/x86_64-efi/f2fs.mod and b/INSTALL/grub/x86_64-efi/f2fs.mod differ diff --git a/INSTALL/grub/x86_64-efi/hexdump.mod b/INSTALL/grub/x86_64-efi/hexdump.mod index 05c5722a..75a176da 100644 Binary files a/INSTALL/grub/x86_64-efi/hexdump.mod and b/INSTALL/grub/x86_64-efi/hexdump.mod differ diff --git a/INSTALL/grub/x86_64-efi/hfs.mod b/INSTALL/grub/x86_64-efi/hfs.mod index d04180a9..efab966e 100644 Binary files a/INSTALL/grub/x86_64-efi/hfs.mod and b/INSTALL/grub/x86_64-efi/hfs.mod differ diff --git a/INSTALL/grub/x86_64-efi/jfs.mod b/INSTALL/grub/x86_64-efi/jfs.mod index 776a758e..4f99b2cf 100644 Binary files a/INSTALL/grub/x86_64-efi/jfs.mod and b/INSTALL/grub/x86_64-efi/jfs.mod differ diff --git a/INSTALL/grub/x86_64-efi/linux16.mod b/INSTALL/grub/x86_64-efi/linux16.mod index 1aa94eff..d36f75f3 100644 Binary files a/INSTALL/grub/x86_64-efi/linux16.mod and b/INSTALL/grub/x86_64-efi/linux16.mod differ diff --git a/INSTALL/grub/x86_64-efi/loadbios.mod b/INSTALL/grub/x86_64-efi/loadbios.mod index 9dae5686..b4e1d1f0 100644 Binary files a/INSTALL/grub/x86_64-efi/loadbios.mod and b/INSTALL/grub/x86_64-efi/loadbios.mod differ diff --git a/INSTALL/grub/x86_64-efi/loadenv.mod b/INSTALL/grub/x86_64-efi/loadenv.mod index 6bfde6bb..8ab183ac 100644 Binary files a/INSTALL/grub/x86_64-efi/loadenv.mod and b/INSTALL/grub/x86_64-efi/loadenv.mod differ diff --git a/INSTALL/grub/x86_64-efi/macho.mod b/INSTALL/grub/x86_64-efi/macho.mod index d8d73442..b174dcfe 100644 Binary files a/INSTALL/grub/x86_64-efi/macho.mod and b/INSTALL/grub/x86_64-efi/macho.mod differ diff --git a/INSTALL/grub/x86_64-efi/minix.mod b/INSTALL/grub/x86_64-efi/minix.mod index 21548278..bf5442dc 100644 Binary files a/INSTALL/grub/x86_64-efi/minix.mod and b/INSTALL/grub/x86_64-efi/minix.mod differ diff --git a/INSTALL/grub/x86_64-efi/minix2.mod b/INSTALL/grub/x86_64-efi/minix2.mod index 402eb731..6a7c81d5 100644 Binary files a/INSTALL/grub/x86_64-efi/minix2.mod and b/INSTALL/grub/x86_64-efi/minix2.mod differ diff --git a/INSTALL/grub/x86_64-efi/minix2_be.mod b/INSTALL/grub/x86_64-efi/minix2_be.mod index 1fd15f37..baf21875 100644 Binary files a/INSTALL/grub/x86_64-efi/minix2_be.mod and b/INSTALL/grub/x86_64-efi/minix2_be.mod differ diff --git a/INSTALL/grub/x86_64-efi/minix3.mod b/INSTALL/grub/x86_64-efi/minix3.mod index b6312831..2e601d79 100644 Binary files a/INSTALL/grub/x86_64-efi/minix3.mod and b/INSTALL/grub/x86_64-efi/minix3.mod differ diff --git a/INSTALL/grub/x86_64-efi/minix3_be.mod b/INSTALL/grub/x86_64-efi/minix3_be.mod index 2d24bad4..5d052b64 100644 Binary files a/INSTALL/grub/x86_64-efi/minix3_be.mod and b/INSTALL/grub/x86_64-efi/minix3_be.mod differ diff --git a/INSTALL/grub/x86_64-efi/minix_be.mod b/INSTALL/grub/x86_64-efi/minix_be.mod index a039b6da..0bf16a33 100644 Binary files a/INSTALL/grub/x86_64-efi/minix_be.mod and b/INSTALL/grub/x86_64-efi/minix_be.mod differ diff --git a/INSTALL/grub/x86_64-efi/moddep.lst b/INSTALL/grub/x86_64-efi/moddep.lst index 57059958..8cbceb04 100644 --- a/INSTALL/grub/x86_64-efi/moddep.lst +++ b/INSTALL/grub/x86_64-efi/moddep.lst @@ -120,7 +120,7 @@ ehci: cs5536 usb boot crypto: part_bsd: part_msdos cs5536: -ventoy: elf fshelp ext2 btrfs font crypto gcry_md5 exfat udf extcmd datetime div normal video gcry_sha1 iso9660 +ventoy: fshelp ext2 elf btrfs font crypto gcry_md5 exfat udf div extcmd datetime normal video gcry_sha1 iso9660 gcry_sha512: crypto password: crypto normal fshelp: diff --git a/INSTALL/grub/x86_64-efi/multiboot.mod b/INSTALL/grub/x86_64-efi/multiboot.mod index 9a827f20..4fc337be 100644 Binary files a/INSTALL/grub/x86_64-efi/multiboot.mod and b/INSTALL/grub/x86_64-efi/multiboot.mod differ diff --git a/INSTALL/grub/x86_64-efi/multiboot2.mod b/INSTALL/grub/x86_64-efi/multiboot2.mod index 057693d9..eec62fd9 100644 Binary files a/INSTALL/grub/x86_64-efi/multiboot2.mod and b/INSTALL/grub/x86_64-efi/multiboot2.mod differ diff --git a/INSTALL/grub/x86_64-efi/nativedisk.mod b/INSTALL/grub/x86_64-efi/nativedisk.mod index 3061804f..41e87c22 100644 Binary files a/INSTALL/grub/x86_64-efi/nativedisk.mod and b/INSTALL/grub/x86_64-efi/nativedisk.mod differ diff --git a/INSTALL/grub/x86_64-efi/nilfs2.mod b/INSTALL/grub/x86_64-efi/nilfs2.mod index 2aa661da..ce329fc8 100644 Binary files a/INSTALL/grub/x86_64-efi/nilfs2.mod and b/INSTALL/grub/x86_64-efi/nilfs2.mod differ diff --git a/INSTALL/grub/x86_64-efi/normal.mod b/INSTALL/grub/x86_64-efi/normal.mod index 92839027..5ed99b73 100644 Binary files a/INSTALL/grub/x86_64-efi/normal.mod and b/INSTALL/grub/x86_64-efi/normal.mod differ diff --git a/INSTALL/grub/x86_64-efi/odc.mod b/INSTALL/grub/x86_64-efi/odc.mod index 512d7e70..1ae07900 100644 Binary files a/INSTALL/grub/x86_64-efi/odc.mod and b/INSTALL/grub/x86_64-efi/odc.mod differ diff --git a/INSTALL/grub/x86_64-efi/offsetio.mod b/INSTALL/grub/x86_64-efi/offsetio.mod index 99c12779..15c8c228 100644 Binary files a/INSTALL/grub/x86_64-efi/offsetio.mod and b/INSTALL/grub/x86_64-efi/offsetio.mod differ diff --git a/INSTALL/grub/x86_64-efi/pgp.mod b/INSTALL/grub/x86_64-efi/pgp.mod index 309f6135..994a868f 100644 Binary files a/INSTALL/grub/x86_64-efi/pgp.mod and b/INSTALL/grub/x86_64-efi/pgp.mod differ diff --git a/INSTALL/grub/x86_64-efi/procfs.mod b/INSTALL/grub/x86_64-efi/procfs.mod index 01d42e95..aad83d33 100644 Binary files a/INSTALL/grub/x86_64-efi/procfs.mod and b/INSTALL/grub/x86_64-efi/procfs.mod differ diff --git a/INSTALL/grub/x86_64-efi/progress.mod b/INSTALL/grub/x86_64-efi/progress.mod index e8448364..de091257 100644 Binary files a/INSTALL/grub/x86_64-efi/progress.mod and b/INSTALL/grub/x86_64-efi/progress.mod differ diff --git a/INSTALL/grub/x86_64-efi/reiserfs.mod b/INSTALL/grub/x86_64-efi/reiserfs.mod index 542ae3ce..1b98ff6b 100644 Binary files a/INSTALL/grub/x86_64-efi/reiserfs.mod and b/INSTALL/grub/x86_64-efi/reiserfs.mod differ diff --git a/INSTALL/grub/x86_64-efi/romfs.mod b/INSTALL/grub/x86_64-efi/romfs.mod index c42d9c7e..b2951437 100644 Binary files a/INSTALL/grub/x86_64-efi/romfs.mod and b/INSTALL/grub/x86_64-efi/romfs.mod differ diff --git a/INSTALL/grub/x86_64-efi/sfs.mod b/INSTALL/grub/x86_64-efi/sfs.mod index 2e3a2142..a532b1f4 100644 Binary files a/INSTALL/grub/x86_64-efi/sfs.mod and b/INSTALL/grub/x86_64-efi/sfs.mod differ diff --git a/INSTALL/grub/x86_64-efi/testload.mod b/INSTALL/grub/x86_64-efi/testload.mod index 1b58c210..a7185ac0 100644 Binary files a/INSTALL/grub/x86_64-efi/testload.mod and b/INSTALL/grub/x86_64-efi/testload.mod differ diff --git a/INSTALL/grub/x86_64-efi/tga.mod b/INSTALL/grub/x86_64-efi/tga.mod index 02ce149e..ecbf32d1 100644 Binary files a/INSTALL/grub/x86_64-efi/tga.mod and b/INSTALL/grub/x86_64-efi/tga.mod differ diff --git a/INSTALL/grub/x86_64-efi/ufs1.mod b/INSTALL/grub/x86_64-efi/ufs1.mod index ab79b219..de627644 100644 Binary files a/INSTALL/grub/x86_64-efi/ufs1.mod and b/INSTALL/grub/x86_64-efi/ufs1.mod differ diff --git a/INSTALL/grub/x86_64-efi/ufs1_be.mod b/INSTALL/grub/x86_64-efi/ufs1_be.mod index 296c2fcb..bab70123 100644 Binary files a/INSTALL/grub/x86_64-efi/ufs1_be.mod and b/INSTALL/grub/x86_64-efi/ufs1_be.mod differ diff --git a/INSTALL/grub/x86_64-efi/ufs2.mod b/INSTALL/grub/x86_64-efi/ufs2.mod index c84e55a5..d1cc24cd 100644 Binary files a/INSTALL/grub/x86_64-efi/ufs2.mod and b/INSTALL/grub/x86_64-efi/ufs2.mod differ diff --git a/INSTALL/grub/x86_64-efi/verifiers.mod b/INSTALL/grub/x86_64-efi/verifiers.mod index 6cb24d3c..c44200f3 100644 Binary files a/INSTALL/grub/x86_64-efi/verifiers.mod and b/INSTALL/grub/x86_64-efi/verifiers.mod differ diff --git a/INSTALL/grub/x86_64-efi/xnu.mod b/INSTALL/grub/x86_64-efi/xnu.mod index ad4d811c..3ba80d20 100644 Binary files a/INSTALL/grub/x86_64-efi/xnu.mod and b/INSTALL/grub/x86_64-efi/xnu.mod differ diff --git a/INSTALL/grub/x86_64-efi/zfs.mod b/INSTALL/grub/x86_64-efi/zfs.mod index 70f1d917..b213ee3f 100644 Binary files a/INSTALL/grub/x86_64-efi/zfs.mod and b/INSTALL/grub/x86_64-efi/zfs.mod differ diff --git a/INSTALL/ventoy/ventoy.cpio b/INSTALL/ventoy/ventoy.cpio index 2545928a..0c2889d8 100644 Binary files a/INSTALL/ventoy/ventoy.cpio and b/INSTALL/ventoy/ventoy.cpio differ diff --git a/INSTALL/ventoy/ventoy_aa64.efi b/INSTALL/ventoy/ventoy_aa64.efi index 506a49e1..f550456e 100644 Binary files a/INSTALL/ventoy/ventoy_aa64.efi and b/INSTALL/ventoy/ventoy_aa64.efi differ diff --git a/INSTALL/ventoy/ventoy_arm64.cpio b/INSTALL/ventoy/ventoy_arm64.cpio index c4ea7af2..f9a36eee 100644 Binary files a/INSTALL/ventoy/ventoy_arm64.cpio and b/INSTALL/ventoy/ventoy_arm64.cpio differ diff --git a/INSTALL/ventoy/ventoy_ia32.efi b/INSTALL/ventoy/ventoy_ia32.efi index a891aef8..61515d74 100644 Binary files a/INSTALL/ventoy/ventoy_ia32.efi and b/INSTALL/ventoy/ventoy_ia32.efi differ diff --git a/INSTALL/ventoy/ventoy_mips64.cpio b/INSTALL/ventoy/ventoy_mips64.cpio index 7967349b..162478b8 100644 Binary files a/INSTALL/ventoy/ventoy_mips64.cpio and b/INSTALL/ventoy/ventoy_mips64.cpio differ diff --git a/INSTALL/ventoy/ventoy_unix.cpio b/INSTALL/ventoy/ventoy_unix.cpio index 83fdf00b..9cf11c36 100644 Binary files a/INSTALL/ventoy/ventoy_unix.cpio and b/INSTALL/ventoy/ventoy_unix.cpio differ diff --git a/INSTALL/ventoy/ventoy_x64.efi b/INSTALL/ventoy/ventoy_x64.efi index 1ad45154..73eef7b6 100644 Binary files a/INSTALL/ventoy/ventoy_x64.efi and b/INSTALL/ventoy/ventoy_x64.efi differ diff --git a/INSTALL/ventoy/ventoy_x86.cpio b/INSTALL/ventoy/ventoy_x86.cpio index 920f4f50..e63ee3fd 100644 Binary files a/INSTALL/ventoy/ventoy_x86.cpio and b/INSTALL/ventoy/ventoy_x86.cpio differ diff --git a/INSTALL/ventoy/vtloopex.cpio b/INSTALL/ventoy/vtloopex.cpio index 48d2faab..88a76b05 100644 Binary files a/INSTALL/ventoy/vtloopex.cpio and b/INSTALL/ventoy/vtloopex.cpio differ diff --git a/INSTALL/ventoy/vtoyjump32.exe b/INSTALL/ventoy/vtoyjump32.exe index 992a3623..960c0253 100644 Binary files a/INSTALL/ventoy/vtoyjump32.exe and b/INSTALL/ventoy/vtoyjump32.exe differ diff --git a/INSTALL/ventoy/vtoyjump64.exe b/INSTALL/ventoy/vtoyjump64.exe index 7a425c06..82a42ae9 100644 Binary files a/INSTALL/ventoy/vtoyjump64.exe and b/INSTALL/ventoy/vtoyjump64.exe differ diff --git a/INSTALL/ventoy/vtoyutil_aa64.efi b/INSTALL/ventoy/vtoyutil_aa64.efi index 5dafe9b4..e2e305e6 100644 Binary files a/INSTALL/ventoy/vtoyutil_aa64.efi and b/INSTALL/ventoy/vtoyutil_aa64.efi differ diff --git a/INSTALL/ventoy/vtoyutil_ia32.efi b/INSTALL/ventoy/vtoyutil_ia32.efi index 47e40c46..6b2d05ca 100644 Binary files a/INSTALL/ventoy/vtoyutil_ia32.efi and b/INSTALL/ventoy/vtoyutil_ia32.efi differ diff --git a/INSTALL/ventoy/vtoyutil_x64.efi b/INSTALL/ventoy/vtoyutil_x64.efi index 8cfe7a81..a75bcef0 100644 Binary files a/INSTALL/ventoy/vtoyutil_x64.efi and b/INSTALL/ventoy/vtoyutil_x64.efi differ diff --git a/INSTALL/ventoy_pack.sh b/INSTALL/ventoy_pack.sh index 315d840a..aa132a39 100644 --- a/INSTALL/ventoy_pack.sh +++ b/INSTALL/ventoy_pack.sh @@ -41,6 +41,11 @@ sh build.sh sh pack.sh cd - +cd ../Vlnk +sh build.sh +sh pack.sh +cd - + LOOP=$(losetup -f) @@ -118,6 +123,7 @@ rm -f $tmpdir/ENROLL_THIS_KEY_IN_MOKMANAGER.cer cp $OPT Ventoy2Disk.sh $tmpdir/ cp $OPT VentoyWeb.sh $tmpdir/ cp $OPT VentoyPlugson.sh $tmpdir/ +cp $OPT VentoyVlnk.sh $tmpdir/ cp $OPT VentoyGUI* $tmpdir/ @@ -128,6 +134,7 @@ cp $OPT ExtendPersistentImg.sh $tmpdir/ dos2unix -q $tmpdir/Ventoy2Disk.sh dos2unix -q $tmpdir/VentoyWeb.sh dos2unix -q $tmpdir/VentoyPlugson.sh +dos2unix -q $tmpdir/VentoyVlnk.sh dos2unix -q $tmpdir/CreatePersistentImg.sh @@ -167,6 +174,7 @@ find $tmpdir/ -type f -exec chmod 644 "{}" + chmod +x $tmpdir/Ventoy2Disk.sh chmod +x $tmpdir/VentoyWeb.sh chmod +x $tmpdir/VentoyPlugson.sh +chmod +x $tmpdir/VentoyVlnk.sh chmod +x $tmpdir/VentoyGUI* cp $OPT $LANG_DIR/languages.json $tmpdir/tool/ @@ -183,6 +191,7 @@ rm -f ventoy-${curver}-windows.zip cp $OPT Ventoy2Disk.exe $tmpdir/ cp $OPT VentoyPlugson.exe $tmpdir/ +cp $OPT VentoyVlnk.exe $tmpdir/ cp $OPT FOR_X64_ARM.txt $tmpdir/ mkdir -p $tmpdir/altexe cp $OPT Ventoy2Disk_*.exe $tmpdir/altexe/ diff --git a/LANGUAGES/languages.json b/LANGUAGES/languages.json index 6f913951..9a55938e 100644 --- a/LANGUAGES/languages.json +++ b/LANGUAGES/languages.json @@ -2504,6 +2504,64 @@ "STR_PART_RESIZE_FAILED":"Hi ha hagut un error durant el procés d'instal·lació no destructiva, comproveu el fitxer log.txt per a més detalls.", "STR_PART_RESIZE_UNSUPPORTED":"La instal·lació no destructiva de Ventoy no ha estat possible perquè els requeriments no es compleixen. Comproveu el fitxer log.txt per a més detalls.", + "STRXXX":"" + }, + + { + "name":"Georgian (ქართული)", + "FontFamily":"Courier New", + "FontSize":16, + "Author":"Levan Baindurashvili", + + "STR_ERROR":"შეცდომა", + "STR_WARNING":"გაფრთხილება", + "STR_INFO":"ინფორმაცია", + "STR_INCORRECT_DIR":"გთხოვთ, გაუშვით სხვა კატალოგში!", + "STR_INCORRECT_TREE_DIR":"ნუ გამიშვებ აქ, გთხოვთ გადმოწეროთ გამოშვებული ინსტალაციის პაკეტი და გაუშვათ სხვაგან.", + "STR_DEVICE":"მოწყობილობა", + "STR_LOCAL_VER":"Ventoy პაკეტში", + "STR_DISK_VER":"Ventoy მოწყობილობაზე", + "STR_STATUS":"სტატუსი - მზადაა", + "STR_INSTALL":"დაყენება", + "STR_UPDATE":"განახლება", + "STR_UPDATE_TIP":"განახლება უსაფრთხოა და ISO ფაილები უცვლელი დარჩება.#@გაგრძელება?", + "STR_INSTALL_TIP":"დისკი დაფორმატდება და ყველა მონაცემი დაიკარგება.#@გსურთ გააგრძელოთ?", + "STR_INSTALL_TIP2":"დისკი დაფორმატდება და ყველა მონაცემი დაიკარგება.#@ ნამდვილად გსურთ გაგრძელება?", + "STR_INSTALL_SUCCESS":"გილოცავთ!#@Ventoy წარმატებით დაინსტალირდა თქვენს მოწყობილობაზე.", + "STR_INSTALL_FAILED":"Ventoy-ის ინსტალაციისას მოხდა შეცდომა. ხელახლა შეაერთეთ თქვენი მოწყობილობა და სცადეთ ხელახლა. შეამოწმეთ log.txt შეცდომებისთვის.", + "STR_UPDATE_SUCCESS":"გილოცავთ!#@Ventoy წარმატებით განახლდა თქვენს მოწყობილობაზე.", + "STR_UPDATE_FAILED":"Ventoy-ის განახლებისას მოხდა შეცდომა. ხელახლა შეაერთეთ თქვენი მოწყობილობა და სცადეთ ხელახლა. შეამოწმეთ log.txt შეცდომებისთვის.", + "STR_WAIT_PROCESS":"პროცესი დაიწყო, გთხოვთ დაელოდოთ...", + "STR_MENU_OPTION":"Პარამეტრები", + "STR_MENU_SECURE_BOOT":"Secure Boot-ის მხარდაჭერა", + "STR_MENU_PART_CFG":"დამატებითი განყოფილება", + "STR_BTN_OK":"ОК", + "STR_BTN_CANCEL":"უარყოფა", + "STR_PRESERVE_SPACE":"შექმენით დამატებითი დანაყოფი დისკის ბოლოს", + "STR_SPACE_VAL_INVALID":"დანაყოფის ზომა არასწორია", + "STR_MENU_CLEAR":"Ventoy-ს წაშლა", + "STR_CLEAR_SUCCESS":"Ventoy წარმატებით წაიშალა მოწყობილობიდან.", + "STR_CLEAR_FAILED":"Ventoy-ის დეინსტალაციისას მოხდა შეცდომა. ხელახლა შეაერთეთ თქვენი მოწყობილობა და სცადეთ ხელახლა. შეამოწმეთ log.txt შეცდომებზე.", + "STR_MENU_PART_STYLE":"განყოფილების განლაგების სტილი", + "STR_DISK_2TB_MBR_ERROR":"გთხოვთ, აირჩიოთ GPT 2 ტბაიტზე მეტი დისკებისთვის", + "STR_SHOW_ALL_DEV":"ყველა მოწყობილობის ჩვენება", + "STR_PART_ALIGN_4KB":"ტიხრების გასწორება 4 KB ზომით", + "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":"ამჯერად Ventoy არ დაინსტალირდება მოწყობილობაზე, მაგრამ შეიქმნება მხოლოდ VTSI ფაილი#@გაგრძელება?", + "STR_VTSI_CREATE_SUCCESS":"VTSI ფაილი წარმატებით შეიქმნა!#@შეგიძლიათ გამოიყენოთ Rufus(3.15+) ჩაწეროთ მოწყობილობაზე Ventoy ინსტალაციის დასასრულებლად.", + "STR_VTSI_CREATE_FAILED":"VTSI ფაილის შექმნის შეცდომა.", + "STR_MENU_PART_RESIZE":"Non-destructive Install", + "STR_PART_RESIZE_TIP":"Ventoy will try non-destructive installation if possible. #@Continue?", + "STR_PART_RESIZE_SUCCESS":"Congratulations!#@Ventoy non-destructive installation successfully finished.", + "STR_PART_RESIZE_FAILED":"Non-destructive installation failed, Check log.txt for details.", + "STR_PART_RESIZE_UNSUPPORTED":"Ventoy non-destructive installation stopped because some conditions cannot be met. Check log.txt for details.", + "STRXXX":"" } ] diff --git a/Plugson/src/Web/ventoy_http.c b/Plugson/src/Web/ventoy_http.c index be24e375..259dcdb9 100644 --- a/Plugson/src/Web/ventoy_http.c +++ b/Plugson/src/Web/ventoy_http.c @@ -485,6 +485,7 @@ void ventoy_data_default_control(data_control *data) { memset(data, 0, sizeof(data_control)); + data->default_menu_mode = 1; data->filter_dot_underscore = 1; data->max_search_level = -1; data->menu_timeout = 0; diff --git a/Plugson/vs/VentoyPlugson/Release/VentoyPlugson.exe b/Plugson/vs/VentoyPlugson/Release/VentoyPlugson.exe index 21fcdbac..6e562321 100644 Binary files a/Plugson/vs/VentoyPlugson/Release/VentoyPlugson.exe and b/Plugson/vs/VentoyPlugson/Release/VentoyPlugson.exe differ diff --git a/Vlnk/VentoyVlnk.sh b/Vlnk/VentoyVlnk.sh new file mode 100644 index 00000000..5037df15 --- /dev/null +++ b/Vlnk/VentoyVlnk.sh @@ -0,0 +1,271 @@ +#!/bin/sh + +print_usage() { + echo 'Usage: sudo sh VentoyVlnk.sh CMD FILE' + echo ' CMD:' + echo ' -c FILE create vlnk for FILE' + echo ' -l VLNK parse vlnk file' + echo ' -v print verbose info' + echo ' -h print this help' + echo '' +} + +verbose_flag=0 + +vlog() { + if [ $verbose_flag -eq 1 ]; then + echo "$@" + fi +} + +vlnk_suffix() { + echo $1 | egrep -q '.*(.vlnk.iso|.vlnk.img|.vlnk.wim|.vlnk.vhd|.vlnk.vhdx|.vlnk.efi|.vlnk.vtoy|.vlnk.dat)$' +} + + +uid=$(id -u) +if [ $uid -ne 0 ]; then + echo "Please use sudo or run the script as root." + exit 1 +fi + +#check system tools used bellow +for t in 'mountpoint' 'readlink' 'xzcat'; do + if ! which "$t" > /dev/null 2>&1; then + echo "$t command not found in current system!" + exit 1 + fi +done + +machine=$(uname -m) +if echo $machine | egrep -q 'aarch64|arm64'; then + TOOLDIR=aarch64 +elif echo $machine | egrep -q 'x86_64|amd64'; then + TOOLDIR=x86_64 +elif echo $machine | egrep -q 'mips64'; then + TOOLDIR=mips64el +elif echo $machine | egrep -q 'i[3-6]86'; then + TOOLDIR=i386 +else + echo "Unsupported machine type $machine" + exit 1 +fi + +fullsh=$(readlink -f "$0") +vtoydir=${fullsh%/*} + +if [ -f "$vtoydir/tool/$TOOLDIR/vlnk.xz" ]; then + xzcat "$vtoydir/tool/$TOOLDIR/vlnk.xz" > "$vtoydir/tool/$TOOLDIR/vlnk" + rm -f "$vtoydir/tool/$TOOLDIR/vlnk.xz" +fi + +if [ -f "$vtoydir/tool/$TOOLDIR/vlnk" ]; then + chmod +x "$vtoydir/tool/$TOOLDIR/vlnk" +else + echo "$vtoydir/tool/$TOOLDIR/vlnk does not exist! " + exit 1 +fi + +PATH="$vtoydir/tool/$TOOLDIR":$PATH + +VLNKCMD=vlnk +while [ -n "$1" ]; do + if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then + print_usage + exit 0 + elif [ "$1" = "-c" ]; then + shift + CMD='c' + IMG="$1" + elif [ "$1" = "-o" ]; then + shift + OUT="$1" + elif [ "$1" = "-l" ]; then + shift + CMD='l' + VLNK="$1" + elif [ "$1" = "-v" ]; then + verbose_flag=1 + VLNKCMD="vlnk -v" + else + echo "invalid option $1" + exit 1 + fi + + shift +done + +if [ "$CMD" = "c" ]; then + vlog "Create vlnk for $IMG" + + if [ ! -f "$IMG" ]; then + echo "$IMG does not exist!" + exit 1 + fi + + if echo $IMG | egrep -q -i '.*(.iso|.img|.wim|.vhd|.vhdx|.efi|.vtoy|.dat)$'; then + : + else + echo "This file is not supported for vlnk!" + exit 1 + fi + + if vlnk_suffix "$IMG"; then + echo "This is already a vlnk file!" + exit 1 + fi + + if $VLNKCMD -t "$IMG"; then + echo "This is already a vlnk file!" + exit 1 + fi + + FULLIMG=$(readlink -f "$IMG") + if [ ! -f "$FULLIMG" ]; then + echo "$FULLIMG does not exist!" + exit 1 + fi + vlog "Full file path is $FULLIMG" + + + #check img file position is a valid mountpoint + FULLDIR=${FULLIMG%/*} + while [ -n "${FULLDIR}" ]; do + if mountpoint -q "${FULLDIR}"; then + break + fi + FULLDIR="${FULLDIR%/*}" + done + + if [ -z "${FULLDIR}" ]; then + FULLDIR=/ + IMGPATH="${FULLIMG}" + else + IMGPATH="${FULLIMG#$FULLDIR}" + fi + + IMGFILE=$(basename "$IMGPATH") + vlog "IMGPATH=$IMGPATH IMGFILE=$IMGFILE" + + + mntdev=$(mountpoint -d "${FULLDIR}") + vlog "mountpoint is ${FULLDIR} dev $mntdev" + + #check fs + if grep -q " ${FULLDIR} " /proc/mounts; then + FS=$(grep " ${FULLDIR} " /proc/mounts | awk '{print $3}') + vlog "File system is $FS" + + if echo $FS | egrep -q "ext2|ext3|ext4|exfat|vfat|fat32|fat16|fat12|ntfs|xfs|udf"; then + vlog "FS OK" + else + echo "$FS is not supported!" + exit 1 + fi + else + echo "${FULLDIR} not found in /proc/mounts" + exit 1 + fi + + + Major=$(echo $mntdev | awk -F: '{print $1}') + Minor=$(echo $mntdev | awk -F: '{print $2}') + vlog "Major=$Major Minor=$Minor" + + IMGPARTITION="" + while read line; do + M1=$(echo $line | awk '{print $1}') + M2=$(echo $line | awk '{print $2}') + if [ "$Major" = "$M1" -a "$Minor" = "$M2" ]; then + IMGPARTITION=$(echo $line | awk '{print $4}') + vlog "disk partition is $IMGPARTITION" + break + fi + done < /proc/partitions + + if [ -z "$IMGPARTITION" ]; then + echo "Disk partition not found for $FULLDIR" + grep " $FULLDIR " /proc/mounts + exit 1 + fi + + if [ -f "/sys/class/block/$IMGPARTITION/start" ]; then + PARTSTART=$(cat "/sys/class/block/$IMGPARTITION/start") + if echo $IMGPARTITION | egrep -q 'mmc|nbd|nvme'; then + DISK=$(echo /dev/$IMGPARTITION | sed "s/^\(.*\)p[0-9][0-9]*$/\1/") + else + DISK=$(echo /dev/$IMGPARTITION | sed "s/^\(.*[^0-9]\)[0-9][0-9]*$/\1/") + fi + + if [ ! -b $DISK ]; then + echo "Device $DISK not exist!" + exit 1 + fi + + vlog "PARTSTART=$PARTSTART DISK=$DISK" + else + if echo $IMGPARTITION | grep -q '^dm-[0-9][0-9]*'; then + echo "LVM/DM is not supported!" + fi + echo "/sys/class/block/$IMGPARTITION/start not exist!" + exit 1 + fi + + + if [ -n "$OUT" ]; then + lowersuffix=$(echo ${IMG##*.} | tr 'A-Z' 'a-z') + OUT="${OUT}.vlnk.${lowersuffix}" + else + name=${IMGFILE%.*} + lowersuffix=$(echo ${IMGFILE##*.} | tr 'A-Z' 'a-z') + OUT="${name}.vlnk.${lowersuffix}" + fi + + echo "Output VLNK file is $OUT" + [ -f "${OUT}" ] && rm -f "${OUT}" + + touch "${OUT}" + if [ -f "${OUT}" ]; then + rm -f "${OUT}" + else + echo "Failed to create ${OUT}" + exit 1 + fi + + if $VLNKCMD -c "$IMGPATH" -d $DISK -p $PARTSTART -o "${OUT}"; then + echo "====== Vlnk file create success =========" + echo "" + else + echo "====== Vlnk file create failed =========" + echo "" + exit 1 + fi +elif [ "$CMD" = "l" ]; then + vlog "Parse vlnk for $VLNK" + + if [ ! -f "$VLNK" ]; then + echo "$VLNK does not exist!" + exit 1 + fi + + if vlnk_suffix "$VLNK"; then + : + else + echo "Invalid vlnk file suffix!" + exit 1 + fi + + if $VLNKCMD -t "$VLNK"; then + vlog "Vlnk data check OK" + else + echo "This is not a valid vlnk file!" + exit 1 + fi + + $VLNKCMD -l "$VLNK" + echo "" +else + echo "invalid cmd" + print_usage + exit 1 +fi diff --git a/Vlnk/build.sh b/Vlnk/build.sh new file mode 100644 index 00000000..c00eb176 --- /dev/null +++ b/Vlnk/build.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +rm -f vlnk_64 +rm -f vlnk_32 +rm -f vlnk_aa64 +rm -f vlnk_m64e + +SRCS="src/crc32.c src/main_linux.c src/vlnk.c" + +gcc -specs "/usr/local/musl/lib/musl-gcc.specs" -Os -static -D_FILE_OFFSET_BITS=64 $SRCS -Isrc -o vlnk_64 + +/opt/diet32/bin/diet -Os gcc -D_FILE_OFFSET_BITS=64 -m32 -static $SRCS -Isrc -o vlnk_32 + +aarch64-buildroot-linux-uclibc-gcc -static -O2 -D_FILE_OFFSET_BITS=64 $SRCS -Isrc -o vlnk_aa64 +mips64el-linux-musl-gcc -mips64r2 -mabi=64 -static -O2 -D_FILE_OFFSET_BITS=64 $SRCS -Isrc -o vlnk_m64e + +if [ -e vlnk_64 ] && [ -e vlnk_32 ] && [ -e vlnk_aa64 ] && [ -e vlnk_m64e ]; then + echo -e "\n===== success =======\n" + + strip --strip-all vlnk_32 + strip --strip-all vlnk_64 + aarch64-buildroot-linux-uclibc-strip --strip-all vlnk_aa64 + mips64el-linux-musl-strip --strip-all vlnk_m64e + + [ -d ../INSTALL/tool/i386/ ] && mv vlnk_32 ../INSTALL/tool/i386/vlnk + [ -d ../INSTALL/tool/x86_64/ ] && mv vlnk_64 ../INSTALL/tool/x86_64/vlnk + [ -d ../INSTALL/tool/aarch64/ ] && mv vlnk_aa64 ../INSTALL/tool/aarch64/vlnk + [ -d ../INSTALL/tool/mips64el/ ] && mv vlnk_m64e ../INSTALL/tool/mips64el/vlnk +else + echo -e "\n===== failed =======\n" + exit 1 +fi diff --git a/Vlnk/pack.sh b/Vlnk/pack.sh new file mode 100644 index 00000000..7f657d49 --- /dev/null +++ b/Vlnk/pack.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +rm -f ../INSTALL/VentoyVlnk.sh +cp -a ./VentoyVlnk.sh ../INSTALL/VentoyVlnk.sh + +rm -f ../INSTALL/VentoyVlnk.exe +cp -a ./vs/VentoyVlnk/Release/VentoyVlnk.exe ../INSTALL/VentoyVlnk.exe diff --git a/Vlnk/src/crc32.c b/Vlnk/src/crc32.c new file mode 100644 index 00000000..831a6050 --- /dev/null +++ b/Vlnk/src/crc32.c @@ -0,0 +1,77 @@ +/****************************************************************************** + * crc32.c ---- + * + * Copyright (c) 2022, longpanda + * + * 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 . + * + */ +#include +#include +#include +#include +#include "vlnk.h" + +static uint32_t crc32c_table [256]; + +/* Helper for init_crc32c_table. */ +static uint32_t reflect (uint32_t ref, int len) +{ + uint32_t result = 0; + int i; + + for (i = 1; i <= len; i++) + { + if (ref & 1) + result |= 1 << (len - i); + ref >>= 1; + } + + return result; +} + +static void init_crc32c_table (void) +{ + uint32_t polynomial = 0x1edc6f41; + int i, j; + + for(i = 0; i < 256; i++) + { + crc32c_table[i] = reflect(i, 8) << 24; + for (j = 0; j < 8; j++) + crc32c_table[i] = (crc32c_table[i] << 1) ^ + (crc32c_table[i] & (1 << 31) ? polynomial : 0); + crc32c_table[i] = reflect(crc32c_table[i], 32); + } +} + +uint32_t ventoy_getcrc32c (uint32_t crc, const void *buf, int size) +{ + int i; + const uint8_t *data = buf; + + if (! crc32c_table[1]) + init_crc32c_table (); + + crc^= 0xffffffff; + + for (i = 0; i < size; i++) + { + crc = (crc >> 8) ^ crc32c_table[(crc & 0xFF) ^ *data]; + data++; + } + + return crc ^ 0xffffffff; +} + diff --git a/Vlnk/src/main_linux.c b/Vlnk/src/main_linux.c new file mode 100644 index 00000000..fa276002 --- /dev/null +++ b/Vlnk/src/main_linux.c @@ -0,0 +1,457 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "vlnk.h" + +#ifndef PATH_MAX +#define PATH_MAX 4096 +#endif + +#define IS_DIGIT(x) ((x) >= '0' && (x) <= '9') + +static int verbose = 0; +#define debug(fmt, args...) if(verbose) printf(fmt, ##args) + +static uint8_t g_vlnk_buf[VLNK_FILE_LEN]; + +static int64_t get_file_size(char *file) +{ + struct stat stStat; + + if (stat(file, &stStat) < 0) + { + return -1; + } + + return (int64_t)(stStat.st_size); +} + +static int get_disk_sig(char *diskname, uint32_t *sig) +{ + int fd; + uint8_t buf[512] = {0}; + + fd = open(diskname, O_RDONLY); + if (fd < 0) + { + printf("Failed to open %s\n", diskname); + return 1; + } + + read(fd, buf, 512); + close(fd); + + memcpy(sig, buf + 0x1b8, 4); + return 0; +} + +static int vtoy_get_disk_guid(const char *diskname, uint8_t *vtguid, uint8_t *vtsig) +{ + int i = 0; + int fd = 0; + char devdisk[128] = {0}; + + snprintf(devdisk, sizeof(devdisk) - 1, "/dev/%s", diskname); + + fd = open(devdisk, O_RDONLY); + if (fd >= 0) + { + lseek(fd, 0x180, SEEK_SET); + read(fd, vtguid, 16); + + lseek(fd, 0x1b8, SEEK_SET); + read(fd, vtsig, 4); + close(fd); + return 0; + } + else + { + debug("failed to open %s %d\n", devdisk, errno); + return errno; + } +} + +static int vtoy_is_possible_blkdev(const char *name) +{ + if (name[0] == '.') + { + return 0; + } + + /* /dev/ramX */ + if (name[0] == 'r' && name[1] == 'a' && name[2] == 'm') + { + return 0; + } + + /* /dev/loopX */ + if (name[0] == 'l' && name[1] == 'o' && name[2] == 'o' && name[3] == 'p') + { + return 0; + } + + /* /dev/dm-X */ + if (name[0] == 'd' && name[1] == 'm' && name[2] == '-' && IS_DIGIT(name[3])) + { + return 0; + } + + /* /dev/srX */ + if (name[0] == 's' && name[1] == 'r' && IS_DIGIT(name[2])) + { + return 0; + } + + return 1; +} + + +static int find_disk_by_sig(uint8_t *sig, char *diskname) +{ + int rc = 0; + int count = 0; + DIR* dir = NULL; + struct dirent* p = NULL; + uint8_t vtguid[16]; + uint8_t vtsig[16]; + + dir = opendir("/sys/block"); + if (!dir) + { + return 0; + } + + while ((p = readdir(dir)) != NULL) + { + if (!vtoy_is_possible_blkdev(p->d_name)) + { + continue; + } + + rc = vtoy_get_disk_guid(p->d_name, vtguid, vtsig); + if (rc == 0 && memcmp(vtsig, sig, 4) == 0) + { + sprintf(diskname, "%s", p->d_name); + count++; + } + } + closedir(dir); + + return count; +} + +static uint64_t get_part_offset(char *partname) +{ + int fd; + uint64_t offset; + char buf[32] = {0}; + char path[PATH_MAX]; + + snprintf(path, PATH_MAX - 1, "/sys/class/block/%s/start", partname); + + fd = open(path, O_RDONLY); + if (fd < 0) + { + return 0; + } + + read(fd, buf, sizeof(buf)); + close(fd); + + offset = (uint64_t)strtoull(buf, NULL, 10); + offset *= 512; + + return offset; +} + +static int create_vlnk(char *infile, char *diskname, uint64_t partoff, char *outfile) +{ + FILE *fp; + int len; + uint32_t sig = 0; + + debug("create vlnk\n"); + + if (infile[0] == 0 || outfile[0] == 0 || diskname[0] == 0 || partoff == 0) + { + debug("Invalid parameters: %d %d %d %llu\n", infile[0], outfile[0], diskname[0], (unsigned long long)partoff); + return 1; + } + + len = (int)strlen(infile); + if (len >= VLNK_NAME_MAX) + { + printf("File name length %d is too long for vlnk!\n", len); + return 1; + } + + if (get_disk_sig(diskname, &sig)) + { + printf("Failed to read disk sig\n"); + return 1; + } + + fp = fopen(outfile, "wb+"); + if (!fp) + { + printf("Failed to create file %s\n", outfile); + return 1; + } + + memset(g_vlnk_buf, 0, sizeof(g_vlnk_buf)); + ventoy_create_vlnk(sig, partoff, infile, (ventoy_vlnk *)g_vlnk_buf); + fwrite(g_vlnk_buf, 1, VLNK_FILE_LEN, fp); + fclose(fp); + + return 0; +} + +static int get_mount_point(char *partname, char *mntpoint) +{ + int i; + int len; + int rc = 1; + FILE *fp = NULL; + char line[PATH_MAX]; + + fp = fopen("/proc/mounts", "r"); + if (!fp) + { + return 1; + } + + len = (int)strlen(partname); + while (fgets(line, sizeof(line), fp)) + { + if (strncmp(line, partname, len) == 0) + { + for (i = len; i < PATH_MAX && line[i]; i++) + { + if (line[i] == ' ') + { + line[i] = 0; + rc = 0; + strncpy(mntpoint, line + len, PATH_MAX - 1); + break; + } + } + break; + } + } + + fclose(fp); + return rc; +} + +static int parse_vlnk(char *infile) +{ + int i; + int fd; + int cnt; + int pflag = 0; + char diskname[128] = {0}; + char partname[128] = {0}; + char partpath[256] = {0}; + char mntpoint[PATH_MAX]; + ventoy_vlnk vlnk; + + debug("parse vlnk\n"); + + if (infile[0] == 0) + { + debug("input file null\n"); + return 1; + } + + fd = open(infile, O_RDONLY); + if (fd < 0) + { + printf("Failed to open file %s error %d\n", infile, errno); + return 1; + } + + memset(&vlnk, 0, sizeof(vlnk)); + read(fd, &vlnk, sizeof(vlnk)); + close(fd); + + debug("disk_signature:%08X\n", vlnk.disk_signature); + debug("file path:<%s>\n", vlnk.filepath); + debug("part offset: %llu\n", (unsigned long long)vlnk.part_offset); + + cnt = find_disk_by_sig((uint8_t *)&(vlnk.disk_signature), diskname); + if (cnt != 1) + { + printf("Disk in vlnk not found!\n"); + return 1; + } + + debug("Disk is <%s>\n", diskname); + + if (strstr(diskname, "nvme") || strstr(diskname, "mmc") || strstr(diskname, "nbd")) + { + pflag = 1; + } + + for (i = 1; i <= 128; i++) + { + if (pflag) + { + snprintf(partname, sizeof(partname) - 1, "%sp%d", diskname, i); + } + else + { + snprintf(partname, sizeof(partname) - 1, "%s%d", diskname, i); + } + + if (get_part_offset(partname) == vlnk.part_offset) + { + debug("Find correct partition \n", partname); + break; + } + } + + if (i > 128) + { + printf("Partition in vlnk not found!"); + return 1; + } + + snprintf(partpath, sizeof(partpath), "/dev/%s ", partname); + if (get_mount_point(partpath, mntpoint)) + { + printf("Mountpoint of %s is not found!\n", partpath); + return 1; + } + debug("moutpoint of %s is <%s>\n", partpath, mntpoint); + + strcat(mntpoint, vlnk.filepath); + printf("Vlnk Point: %s\n", mntpoint); + if (access(mntpoint, F_OK) >= 0) + { + printf("File Exist: YES\n"); + } + else + { + printf("File Exist: NO\n"); + } + + return 0; +} + +static int check_vlnk(char *infile) +{ + int fd; + int64_t size; + ventoy_vlnk vlnk; + + debug("check vlnk\n"); + + if (infile[0] == 0) + { + debug("input file null\n"); + return 1; + } + + size = get_file_size(infile); + if (size != VLNK_FILE_LEN) + { + debug("file size %lld is not a vlnk file size\n", (long long)size); + return 1; + } + + fd = open(infile, O_RDONLY); + if (fd < 0) + { + debug("Failed to open file %s error %d\n", infile, errno); + return 1; + } + + memset(&vlnk, 0, sizeof(vlnk)); + read(fd, &vlnk, sizeof(vlnk)); + close(fd); + + if (CheckVlnkData(&vlnk)) + { + return 0; + } + + return 1; +} + +int main(int argc, char **argv) +{ + int ch = 0; + int cmd = 0; + uint64_t partoff = 0; + char infile[PATH_MAX] = {0}; + char outfile[PATH_MAX] = {0}; + char diskname[256] = {0}; + + while ((ch = getopt(argc, argv, "c:t:l:d:p:o:v::")) != -1) + { + if (ch == 'c') + { + cmd = 1; + strncpy(infile, optarg, sizeof(infile) - 1); + } + else if (ch == 'o') + { + strncpy(outfile, optarg, sizeof(outfile) - 1); + } + else if (ch == 'l') + { + cmd = 2; + strncpy(infile, optarg, sizeof(infile) - 1); + } + else if (ch == 't') + { + cmd = 3; + strncpy(infile, optarg, sizeof(infile) - 1); + } + else if (ch == 'd') + { + strncpy(diskname, optarg, sizeof(diskname) - 1); + } + else if (ch == 'p') + { + partoff = (uint64_t)strtoull(optarg, NULL, 10); + partoff *= 512; + } + else if (ch == 'v') + { + verbose = 1; + } + else + { + return 1; + } + } + + if (cmd == 1) + { + return create_vlnk(infile, diskname, partoff, outfile); + } + else if (cmd == 2) + { + return parse_vlnk(infile); + } + else if (cmd == 3) + { + return check_vlnk(infile); + } + else + { + printf("Invalid command %d\n", cmd); + return 1; + } +} + diff --git a/Vlnk/src/main_windows.c b/Vlnk/src/main_windows.c new file mode 100644 index 00000000..6596c29b --- /dev/null +++ b/Vlnk/src/main_windows.c @@ -0,0 +1,711 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +static WCHAR g_CurDirW[MAX_PATH]; +static CHAR g_CurDirA[MAX_PATH]; +static CHAR g_LogFile[MAX_PATH]; +static HWND g_create_button; +static HWND g_parse_button; + +typedef enum MSGID +{ + MSGID_ERROR = 0, + MSGID_INFO, + MSGID_BTN_CREATE, + MSGID_BTN_PARSE, + MSGID_SRC_UNSUPPORTED, + MSGID_FS_UNSUPPORTED, + MSGID_SUFFIX_UNSUPPORTED, + MSGID_DISK_INFO_ERR, + MSGID_VLNK_SUCCESS, + MSGID_RUNNING_TIP, + MSGID_CREATE_FILE_ERR, + MSGID_ALREADY_VLNK, + MSGID_INVALID_VLNK, + MSGID_VLNK_POINT_TO, + MSGID_VLNK_NO_DST, + MSGID_FILE_NAME_TOO_LONG, + + MSGID_BUTT +}MSGID; + + +const WCHAR *g_msg_cn[MSGID_BUTT] = +{ + L"", + L"", + L"", + L"", + L"֧Ϊļvlnk", + L"ֵ֧ļϵͳ", + L"ֵ֧ļ׺", + L"ȡϢʱ", + L"Vlnk ļɹ", + L"ȹرе VentoyVlnk ", + L"ļʧ", + L"ļѾһvlnkļˣ", + L"Ƿvlnkļ!", + L" vlnk ļָ ", + L" vlnk ָļڣ", + L"ļ·̫", +}; +const WCHAR *g_msg_en[MSGID_BUTT] = +{ + L"Error", + L"Info", + L"Create", + L"Parse", + L"This file is not supported for vlnk", + L"Unsupported file system!", + L"Unsupported file suffix!", + L"Error when getting disk info", + L"Vlnk file successfully created!", + L"Please close another running VentoyVlnk instance!", + L"Failed to create file!", + L"This file is already a vlnk file!", + L"Invalid vlnk file!", + L"The vlnk file point to ", + L"The file pointed by the vlnk does NOT exist!", + L"The file full path is too long!", +}; + +const WCHAR **g_msg_lang = NULL; + +HINSTANCE g_hInst; + +static void Log2File(const char *log) +{ + time_t stamp; + struct tm ttm; + FILE *fp; + + time(&stamp); + localtime_s(&ttm, &stamp); + + fopen_s(&fp, g_LogFile, "a+"); + if (fp) + { + fprintf_s(fp, "[%04u/%02u/%02u %02u:%02u:%02u] %s", + ttm.tm_year + 1900, ttm.tm_mon + 1, ttm.tm_mday, + ttm.tm_hour, ttm.tm_min, ttm.tm_sec, log); + fclose(fp); + } +} + +void LogW(const WCHAR *Fmt, ...) +{ + WCHAR log[512]; + CHAR alog[2048]; + va_list arg; + + if (g_LogFile[0] == 0) + { + return; + } + + va_start(arg, Fmt); + vswprintf_s(log, 512, Fmt, arg); + va_end(arg); + + WideCharToMultiByte(CP_UTF8, 0, log, -1, alog, 2048, 0, 0); + + Log2File(alog); +} + + +void LogA(const CHAR *Fmt, ...) +{ + CHAR log[512]; + va_list arg; + + if (g_LogFile[0] == 0) + { + return; + } + + va_start(arg, Fmt); + vsprintf_s(log, 512, Fmt, arg); + va_end(arg); + + Log2File(log); +} + +static int Utf8ToUtf16(const char* src, WCHAR * dst) +{ + int size = MultiByteToWideChar(CP_UTF8, 0, src, -1, dst, 0); + return MultiByteToWideChar(CP_UTF8, 0, src, -1, dst, size + 1); +} + +static BOOL OnDestroyDialog() +{ + return TRUE; +} + + +static BOOL InitDialog(HWND hWnd, WPARAM wParam, LPARAM lParam) +{ + HICON hIcon; + + g_create_button = GetDlgItem(hWnd, IDC_BUTTON1); + g_parse_button = GetDlgItem(hWnd, IDC_BUTTON2); + + hIcon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_ICON1)); + SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)hIcon); + SendMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM)hIcon); + + SetWindowTextW(g_create_button, g_msg_lang[MSGID_BTN_CREATE]); + SetWindowTextW(g_parse_button, g_msg_lang[MSGID_BTN_PARSE]); + + return TRUE; +} + +static int GetPhyDiskInfo(const char LogicalDrive, UINT32 *DiskSig, DISK_EXTENT *DiskExtent) +{ + BOOL Ret; + DWORD dwSize; + HANDLE Handle; + VOLUME_DISK_EXTENTS DiskExtents; + CHAR PhyPath[128]; + UINT8 SectorBuf[512]; + + LogA("GetPhyDiskInfo %C\n", LogicalDrive); + + sprintf_s(PhyPath, sizeof(PhyPath), "\\\\.\\%C:", LogicalDrive); + Handle = CreateFileA(PhyPath, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0); + if (Handle == INVALID_HANDLE_VALUE) + { + LogA("Could not open the disk %C: error:%u\n", LogicalDrive, GetLastError()); + return 1; + } + + Ret = DeviceIoControl(Handle, + IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS, + NULL, + 0, + &DiskExtents, + (DWORD)(sizeof(DiskExtents)), + (LPDWORD)&dwSize, + NULL); + if (!Ret || DiskExtents.NumberOfDiskExtents == 0) + { + LogA("DeviceIoControl IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS failed, error:%u\n", GetLastError()); + CloseHandle(Handle); + return 1; + } + CloseHandle(Handle); + + memcpy(DiskExtent, DiskExtents.Extents, sizeof(DISK_EXTENT)); + LogA("%C: is in PhysicalDrive%d Offset:%llu\n", LogicalDrive, DiskExtents.Extents[0].DiskNumber, + (ULONGLONG)(DiskExtents.Extents[0].StartingOffset.QuadPart)); + + sprintf_s(PhyPath, sizeof(PhyPath), "\\\\.\\PhysicalDrive%d", DiskExtents.Extents[0].DiskNumber); + Handle = CreateFileA(PhyPath, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0); + if (Handle == INVALID_HANDLE_VALUE) + { + LogA("Could not open the disk, error:%u\n", DiskExtents.Extents[0].DiskNumber, GetLastError()); + return 1; + } + + if (!ReadFile(Handle, SectorBuf, sizeof(SectorBuf), &dwSize, NULL)) + { + LogA("ReadFile failed, dwSize:%u error:%u\n", dwSize, GetLastError()); + CloseHandle(Handle); + return 1; + } + + memcpy(DiskSig, SectorBuf + 0x1B8, 4); + + CloseHandle(Handle); + return 0; +} + + +static int SaveBuffer2File(const WCHAR *Fullpath, void *Buffer, DWORD Length) +{ + int rc = 1; + DWORD dwSize; + HANDLE Handle; + + LogW(L"SaveBuffer2File <%ls> len:%u\n", Fullpath, Length); + + Handle = CreateFileW(Fullpath, GENERIC_READ | GENERIC_WRITE, + FILE_SHARE_READ | FILE_SHARE_WRITE, 0, CREATE_ALWAYS, 0, 0); + if (Handle == INVALID_HANDLE_VALUE) + { + LogA("Could not create new file, error:%u\n", GetLastError()); + goto End; + } + + WriteFile(Handle, Buffer, Length, &dwSize, NULL); + + rc = 0; + +End: + + if (Handle != INVALID_HANDLE_VALUE) + { + CloseHandle(Handle); + } + + + return rc; +} + +static int DefaultVlnkDstFullPath(WCHAR *Src, WCHAR *Dir, WCHAR *Dst) +{ + int i, j; + int len; + int wrlen; + WCHAR C; + + len = (int)lstrlen(Src); + for (i = len - 1; i >= 0; i--) + { + if (Src[i] == '.') + { + C = Src[i]; + Src[i] = 0; + wrlen = swprintf_s(Dst, MAX_PATH, L"%ls\\%ls.vlnk.%ls", Dir, Src, Src + i + 1); + Src[i] = C; + + for (j = wrlen - (len - i); j < wrlen; j++) + { + if (Dst[j] >= 'A' && Dst[j] <= 'Z') + { + Dst[j] = 'a' + (Dst[j] - 'A'); + } + } + + break; + } + } + + return 0; +} + +static BOOL IsVlnkFile(WCHAR *path, ventoy_vlnk *outvlnk) +{ + BOOL bRet; + BOOL bVlnk = FALSE; + DWORD dwSize; + LARGE_INTEGER FileSize; + HANDLE Handle; + ventoy_vlnk vlnk; + + Handle = CreateFileW(path, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0); + if (Handle == INVALID_HANDLE_VALUE) + { + LogA("Could not open this file, error:%u\n", GetLastError()); + return FALSE; + } + + if (!GetFileSizeEx(Handle, &FileSize)) + { + LogA("Failed to get vlnk file size\n"); + goto End; + } + + if (FileSize.QuadPart != VLNK_FILE_LEN) + { + LogA("Invalid vlnk file length %llu\n", (unsigned long long)FileSize.QuadPart); + goto End; + } + + memset(&vlnk, 0, sizeof(vlnk)); + bRet = ReadFile(Handle, &vlnk, sizeof(vlnk), &dwSize, NULL); + if (bRet && CheckVlnkData(&vlnk)) + { + if (outvlnk) + { + memcpy(outvlnk, &vlnk, sizeof(vlnk)); + } + + bVlnk = TRUE; + } + +End: + + if (Handle != INVALID_HANDLE_VALUE) + { + CloseHandle(Handle); + } + + return bVlnk; +} + + +static int CreateVlnk(HWND hWnd, WCHAR *Dir) +{ + int i; + int end; + int len; + UINT32 DiskSig; + DISK_EXTENT DiskExtend; + OPENFILENAME ofn = { 0 }; + CHAR UTF8Path[MAX_PATH]; + WCHAR DstFullPath[MAX_PATH]; + WCHAR szFile[MAX_PATH] = { 0 }; + CHAR suffix[8] = { 0 }; + CHAR Drive[8] = { 0 }; + CHAR FsName[64] = { 0 }; + CHAR *Buf = NULL; + WCHAR *Pos = NULL; + ventoy_vlnk *vlnk = NULL; + + ofn.lStructSize = sizeof(ofn); + ofn.hwndOwner = hWnd; + ofn.lpstrFile = szFile; + ofn.nMaxFile = sizeof(szFile); + ofn.lpstrFilter = L"Vlnk Source File\0*.iso;*.img;*.wim;*.vhd;*.vhdx;*.vtoy;*.efi;*.dat\0"; + ofn.nFilterIndex = 1; + ofn.lpstrFileTitle = NULL; + ofn.nMaxFileTitle = 0; + ofn.lpstrInitialDir = NULL; + ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST; + + if (GetOpenFileName(&ofn) != TRUE) + { + return 1; + } + + LogW(L"Create vlnk for <%ls>\n", szFile); + + len = lstrlen(szFile); + + if (len < 5 || szFile[0] == '.' || szFile[1] != ':') + { + MessageBox(hWnd, g_msg_lang[MSGID_SRC_UNSUPPORTED], g_msg_lang[MSGID_ERROR], MB_OK | MB_ICONERROR); + return 1; + } + + Drive[0] = (CHAR)szFile[0]; + Drive[1] = ':'; + Drive[2] = '\\'; + if (0 == GetVolumeInformationA(Drive, NULL, 0, NULL, NULL, NULL, FsName, sizeof(FsName) - 1)) + { + LogA("GetVolumeInformationA failed %u\n", GetLastError()); + return 1; + } + + LogA("Partition filesystem of <%s> is <%s>\n", Drive, FsName); + if (_stricmp(FsName, "NTFS") == 0 || + _stricmp(FsName, "exFAT") == 0 || + _stricmp(FsName, "FAT") == 0 || + _stricmp(FsName, "FAT32") == 0 || + _stricmp(FsName, "FAT16") == 0 || + _stricmp(FsName, "FAT12") == 0 || + _stricmp(FsName, "UDF") == 0) + { + LogA("FS Check OK\n"); + } + else + { + MessageBox(hWnd, g_msg_lang[MSGID_FS_UNSUPPORTED], g_msg_lang[MSGID_ERROR], MB_OK | MB_ICONERROR); + return 1; + } + + + end = (szFile[len - 5] == '.') ? 5 : 4; + for (i = 0; i < end; i++) + { + suffix[i] = (CHAR)szFile[len - (end - i)]; + } + + if (!IsSupportedImgSuffix(suffix)) + { + MessageBox(hWnd, g_msg_lang[MSGID_SUFFIX_UNSUPPORTED], g_msg_lang[MSGID_ERROR], MB_OK | MB_ICONERROR); + return 1; + } + + if (IsVlnkFile(szFile, NULL)) + { + MessageBox(hWnd, g_msg_lang[MSGID_ALREADY_VLNK], g_msg_lang[MSGID_ERROR], MB_OK | MB_ICONERROR); + return 1; + } + + for (i = 0; i < MAX_PATH && szFile[i]; i++) + { + if (szFile[i] == '\\' || szFile[i] == '/') + { + Pos = szFile + i; + } + } + + if (!Pos) + { + LogA("name part not found\n"); + return 1; + } + LogW(L"File Name is <%ls>\n", Pos + 1); + + memset(UTF8Path, 0, sizeof(UTF8Path)); + WideCharToMultiByte(CP_UTF8, 0, szFile + 2, -1, UTF8Path, MAX_PATH, NULL, 0); + + for (i = 0; i < MAX_PATH && UTF8Path[i]; i++) + { + if (UTF8Path[i] == '\\') + { + UTF8Path[i] = '/'; + } + } + + len = (int)strlen(UTF8Path); + if (len >= VLNK_NAME_MAX) + { + LogA("File name length %d overflow\n", len); + MessageBox(hWnd, g_msg_lang[MSGID_FILE_NAME_TOO_LONG], g_msg_lang[MSGID_ERROR], MB_OK | MB_ICONERROR); + return 1; + } + + DiskExtend.StartingOffset.QuadPart = 0; + if (GetPhyDiskInfo((char)szFile[0], &DiskSig, &DiskExtend)) + { + MessageBox(hWnd, g_msg_lang[MSGID_DISK_INFO_ERR], g_msg_lang[MSGID_ERROR], MB_OK | MB_ICONERROR); + return 1; + } + + Buf = malloc(VLNK_FILE_LEN); + if (Buf) + { + memset(Buf, 0, VLNK_FILE_LEN); + vlnk = (ventoy_vlnk *)Buf; + ventoy_create_vlnk(DiskSig, (uint64_t)DiskExtend.StartingOffset.QuadPart, UTF8Path, vlnk); + + DefaultVlnkDstFullPath(Pos + 1, Dir, DstFullPath); + LogW(L"vlnk output file path is <%ls>\n", DstFullPath); + + if (SaveBuffer2File(DstFullPath, Buf, VLNK_FILE_LEN) == 0) + { + WCHAR Msg[1024]; + + swprintf_s(Msg, 1024, L"%ls\r\n\r\n%ls", g_msg_lang[MSGID_VLNK_SUCCESS], DstFullPath + lstrlen(Dir) + 1); + + LogW(L"Vlnk file create success <%ls>\n", DstFullPath); + MessageBox(hWnd, Msg, g_msg_lang[MSGID_INFO], MB_OK | MB_ICONINFORMATION); + } + else + { + LogA("Vlnk file save failed\n"); + MessageBox(hWnd, g_msg_lang[MSGID_CREATE_FILE_ERR], g_msg_lang[MSGID_ERROR], MB_OK | MB_ICONERROR); + } + + free(Buf); + } + + return 0; +} + +static CHAR GetDriveLetter(UINT32 disksig, UINT64 PartOffset) +{ + CHAR Letter; + DWORD Drives; + UINT32 Sig; + DISK_EXTENT DiskExtent; + + Letter = 'A'; + Drives = GetLogicalDrives(); + LogA("Logic Drives: 0x%x", Drives); + + while (Drives) + { + if (Drives & 0x01) + { + Sig = 0; + DiskExtent.StartingOffset.QuadPart = 0; + if (GetPhyDiskInfo(Letter, &Sig, &DiskExtent) == 0) + { + if (Sig == disksig && DiskExtent.StartingOffset.QuadPart == PartOffset) + { + return Letter; + } + } + } + + Drives >>= 1; + Letter++; + } + + return 0; +} + + +static int ParseVlnk(HWND hWnd) +{ + int i; + CHAR Letter; + ventoy_vlnk vlnk; + OPENFILENAME ofn = { 0 }; + WCHAR szFile[MAX_PATH] = { 0 }; + WCHAR szDst[MAX_PATH + 2] = { 0 }; + WCHAR Msg[1024]; + CHAR *suffix = NULL; + HANDLE hFile; + + ofn.lStructSize = sizeof(ofn); + ofn.hwndOwner = hWnd; + ofn.lpstrFile = szFile; + ofn.nMaxFile = sizeof(szFile); + ofn.lpstrFilter = L"Vlnk File\0*.vlnk.iso;*.vlnk.img;*.vlnk.wim;*.vlnk.efi;*.vlnk.vhd;*.vlnk.vhdx;*.vlnk.vtoy;*.vlnk.dat\0"; + ofn.nFilterIndex = 1; + ofn.lpstrFileTitle = NULL; + ofn.nMaxFileTitle = 0; + ofn.lpstrInitialDir = NULL; + ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST; + + if (GetOpenFileName(&ofn) != TRUE) + { + return 1; + } + + LogW(L"Parse vlnk for <%ls>\n", szFile); + + if (!IsVlnkFile(szFile, &vlnk)) + { + MessageBox(hWnd, g_msg_lang[MSGID_INVALID_VLNK], g_msg_lang[MSGID_ERROR], MB_OK | MB_ICONERROR); + return 1; + } + + for (i = 0; i < sizeof(vlnk.filepath) && vlnk.filepath[i]; i++) + { + if (vlnk.filepath[i] == '.') + { + suffix = vlnk.filepath + i; + } + } + + if (!IsSupportedImgSuffix(suffix)) + { + MessageBox(hWnd, g_msg_lang[MSGID_SUFFIX_UNSUPPORTED], g_msg_lang[MSGID_ERROR], MB_OK | MB_ICONERROR); + return 1; + } + + Utf8ToUtf16(vlnk.filepath, szDst + 2); + for (i = 2; i < MAX_PATH && szDst[i]; i++) + { + if (szDst[i] == '/') + { + szDst[i] = '\\'; + } + } + + + Letter = GetDriveLetter(vlnk.disk_signature, vlnk.part_offset); + if (Letter == 0) + { + MessageBox(hWnd, g_msg_lang[MSGID_VLNK_NO_DST], g_msg_lang[MSGID_ERROR], MB_OK | MB_ICONERROR); + return 1; + } + + szDst[0] = toupper(Letter); + szDst[1] = ':'; + LogW(L"vlnk dst is %ls\n", szDst); + + hFile = CreateFileW(szDst, FILE_READ_EA, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0); + if (INVALID_HANDLE_VALUE == hFile) + { + MessageBox(hWnd, g_msg_lang[MSGID_VLNK_NO_DST], g_msg_lang[MSGID_ERROR], MB_OK | MB_ICONERROR); + return 1; + } + CloseHandle(hFile); + + swprintf_s(Msg, 1024, L"%ls %ls", g_msg_lang[MSGID_VLNK_POINT_TO], szDst); + MessageBox(hWnd, Msg, g_msg_lang[MSGID_INFO], MB_OK | MB_ICONINFORMATION); + + return 0; +} + +INT_PTR CALLBACK DialogProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam) +{ + WORD NotifyCode; + WORD CtrlID; + + switch (Message) + { + case WM_COMMAND: + { + NotifyCode = HIWORD(wParam); + CtrlID = LOWORD(wParam); + + if (NotifyCode == BN_CLICKED) + { + if (CtrlID == IDC_BUTTON1) + { + EnableWindow(g_create_button, FALSE); + CreateVlnk(hWnd, g_CurDirW); + EnableWindow(g_create_button, TRUE); + } + else if (CtrlID == IDC_BUTTON2) + { + EnableWindow(g_parse_button, FALSE); + ParseVlnk(hWnd); + EnableWindow(g_parse_button, TRUE); + } + } + break; + } + case WM_INITDIALOG: + { + InitDialog(hWnd, wParam, lParam); + break; + } + case WM_CLOSE: + { + OnDestroyDialog(); + EndDialog(hWnd, 0); + } + } + + return 0; +} + +int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, INT nCmdShow) +{ + int i; + HANDLE hMutex; + + UNREFERENCED_PARAMETER(hPrevInstance); + + if (GetUserDefaultUILanguage() == 0x0804) + { + g_msg_lang = g_msg_cn; + } + else + { + g_msg_lang = g_msg_en; + } + + hMutex = CreateMutexA(NULL, TRUE, "VtoyVlnkMUTEX"); + if ((hMutex != NULL) && (GetLastError() == ERROR_ALREADY_EXISTS)) + { + MessageBoxW(NULL, g_msg_lang[MSGID_RUNNING_TIP], g_msg_lang[MSGID_ERROR], MB_OK | MB_ICONERROR); + return 1; + } + + GetCurrentDirectoryA(MAX_PATH, g_CurDirA); + GetCurrentDirectoryW(MAX_PATH, g_CurDirW); + sprintf_s(g_LogFile, sizeof(g_LogFile), "%s\\VentoyVlnk.log", g_CurDirA); + + for (i = 0; i < __argc; i++) + { + if (strncmp(__argv[i], "-Q", 2) == 0 || + strncmp(__argv[i], "-q", 2) == 0) + { + g_LogFile[0] = 0; + break; + } + } + + + LogA("========= VentoyVlnk =========\n"); + + g_hInst = hInstance; + DialogBoxA(hInstance, MAKEINTRESOURCEA(IDD_DIALOG1), NULL, DialogProc); + + return 0; +} diff --git a/Vlnk/src/vlnk.c b/Vlnk/src/vlnk.c new file mode 100644 index 00000000..5252e756 --- /dev/null +++ b/Vlnk/src/vlnk.c @@ -0,0 +1,80 @@ +#include +#include +#include +#include +#include "vlnk.h" + +int ventoy_create_vlnk(uint32_t disksig, uint64_t partoffset, const char *path, ventoy_vlnk *vlnk) +{ + uint32_t crc; + ventoy_guid guid = VENTOY_GUID; + + memcpy(&(vlnk->guid), &guid, sizeof(ventoy_guid)); + vlnk->disk_signature = disksig; + vlnk->part_offset = partoffset; + +#ifdef WIN32 + strcpy_s(vlnk->filepath, sizeof(vlnk->filepath) - 1, path); +#else + strncpy(vlnk->filepath, path, sizeof(vlnk->filepath) - 1); +#endif + + crc = ventoy_getcrc32c(0, vlnk, sizeof(ventoy_vlnk)); + vlnk->crc32 = crc; + + return 0; +} + + +int CheckVlnkData(ventoy_vlnk *vlnk) +{ + uint32_t readcrc, calccrc; + ventoy_guid guid = VENTOY_GUID; + + if (memcmp(&vlnk->guid, &guid, sizeof(guid))) + { + return 0; + } + + readcrc = vlnk->crc32; + vlnk->crc32 = 0; + calccrc = ventoy_getcrc32c(0, vlnk, sizeof(ventoy_vlnk)); + + if (readcrc != calccrc) + { + return 0; + } + + return 1; +} + +int IsSupportedImgSuffix(char *suffix) +{ + int i = 0; + const char *suffixs[] = + { + ".iso", ".img", ".wim", ".efi", ".vhd", ".vhdx", ".dat", ".vtoy", NULL + }; + + if (!suffix) + { + return 0; + } + + while (suffixs[i]) + { + +#ifdef WIN32 + if (_stricmp(suffixs[i], suffix) == 0) +#else + if (strcasecmp(suffixs[i], suffix) == 0) +#endif + { + return 1; + } + + i++; + } + + return 0; +} diff --git a/Vlnk/src/vlnk.h b/Vlnk/src/vlnk.h new file mode 100644 index 00000000..7734c8e2 --- /dev/null +++ b/Vlnk/src/vlnk.h @@ -0,0 +1,38 @@ + +#ifndef __VLNK_H__ +#define __VLNK_H__ + +#define VLNK_FILE_LEN 32768 + +#define VLNK_NAME_MAX 384 + +#define VENTOY_GUID { 0x77772020, 0x2e77, 0x6576, { 0x6e, 0x74, 0x6f, 0x79, 0x2e, 0x6e, 0x65, 0x74 }} + +#pragma pack(1) + +typedef struct ventoy_guid +{ + uint32_t data1; + uint16_t data2; + uint16_t data3; + uint8_t data4[8]; +}ventoy_guid; + +typedef struct ventoy_vlnk +{ + ventoy_guid guid; // VENTOY_GUID + uint32_t crc32; // crc32 + uint32_t disk_signature; + uint64_t part_offset; // in bytes + char filepath[VLNK_NAME_MAX]; + uint8_t reserverd[96]; +}ventoy_vlnk; +#pragma pack() + +uint32_t ventoy_getcrc32c (uint32_t crc, const void *buf, int size); +int ventoy_create_vlnk(uint32_t disksig, uint64_t partoffset, const char *path, ventoy_vlnk *vlnk); +int CheckVlnkData(ventoy_vlnk *vlnk); +int IsSupportedImgSuffix(char *suffix); + +#endif + diff --git a/Vlnk/vs/VentoyVlnk/Release/VentoyVlnk.exe b/Vlnk/vs/VentoyVlnk/Release/VentoyVlnk.exe new file mode 100644 index 00000000..879304d3 Binary files /dev/null and b/Vlnk/vs/VentoyVlnk/Release/VentoyVlnk.exe differ diff --git a/Vlnk/vs/VentoyVlnk/VentoyVlnk.sln b/Vlnk/vs/VentoyVlnk/VentoyVlnk.sln new file mode 100644 index 00000000..cb217b1a --- /dev/null +++ b/Vlnk/vs/VentoyVlnk/VentoyVlnk.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VentoyVlnk", "VentoyVlnk\VentoyVlnk.vcxproj", "{9987D9FE-1A40-4C5F-835C-D66B0FEADA26}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9987D9FE-1A40-4C5F-835C-D66B0FEADA26}.Debug|Win32.ActiveCfg = Debug|Win32 + {9987D9FE-1A40-4C5F-835C-D66B0FEADA26}.Debug|Win32.Build.0 = Debug|Win32 + {9987D9FE-1A40-4C5F-835C-D66B0FEADA26}.Release|Win32.ActiveCfg = Release|Win32 + {9987D9FE-1A40-4C5F-835C-D66B0FEADA26}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Vlnk/vs/VentoyVlnk/VentoyVlnk/Res/Vlnk32.manifest b/Vlnk/vs/VentoyVlnk/VentoyVlnk/Res/Vlnk32.manifest new file mode 100644 index 00000000..ba90274a --- /dev/null +++ b/Vlnk/vs/VentoyVlnk/VentoyVlnk/Res/Vlnk32.manifest @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Vlnk/vs/VentoyVlnk/VentoyVlnk/Res/Vlnk64.manifest b/Vlnk/vs/VentoyVlnk/VentoyVlnk/Res/Vlnk64.manifest new file mode 100644 index 00000000..a0559d75 --- /dev/null +++ b/Vlnk/vs/VentoyVlnk/VentoyVlnk/Res/Vlnk64.manifest @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Vlnk/vs/VentoyVlnk/VentoyVlnk/Res/VlnkArm.manifest b/Vlnk/vs/VentoyVlnk/VentoyVlnk/Res/VlnkArm.manifest new file mode 100644 index 00000000..18561788 --- /dev/null +++ b/Vlnk/vs/VentoyVlnk/VentoyVlnk/Res/VlnkArm.manifest @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Vlnk/vs/VentoyVlnk/VentoyVlnk/Res/VlnkArm64.manifest b/Vlnk/vs/VentoyVlnk/VentoyVlnk/Res/VlnkArm64.manifest new file mode 100644 index 00000000..067e7f6d --- /dev/null +++ b/Vlnk/vs/VentoyVlnk/VentoyVlnk/Res/VlnkArm64.manifest @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Vlnk/vs/VentoyVlnk/VentoyVlnk/Res/vlnk.ico b/Vlnk/vs/VentoyVlnk/VentoyVlnk/Res/vlnk.ico new file mode 100644 index 00000000..615f2ae6 Binary files /dev/null and b/Vlnk/vs/VentoyVlnk/VentoyVlnk/Res/vlnk.ico differ diff --git a/Vlnk/vs/VentoyVlnk/VentoyVlnk/VentoyVlnk.aps b/Vlnk/vs/VentoyVlnk/VentoyVlnk/VentoyVlnk.aps new file mode 100644 index 00000000..b6021a95 Binary files /dev/null and b/Vlnk/vs/VentoyVlnk/VentoyVlnk/VentoyVlnk.aps differ diff --git a/Vlnk/vs/VentoyVlnk/VentoyVlnk/VentoyVlnk.rc b/Vlnk/vs/VentoyVlnk/VentoyVlnk/VentoyVlnk.rc new file mode 100644 index 00000000..13fc94be Binary files /dev/null and b/Vlnk/vs/VentoyVlnk/VentoyVlnk/VentoyVlnk.rc differ diff --git a/Vlnk/vs/VentoyVlnk/VentoyVlnk/VentoyVlnk.vcxproj b/Vlnk/vs/VentoyVlnk/VentoyVlnk/VentoyVlnk.vcxproj new file mode 100644 index 00000000..62de30c4 --- /dev/null +++ b/Vlnk/vs/VentoyVlnk/VentoyVlnk/VentoyVlnk.vcxproj @@ -0,0 +1,110 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {9987D9FE-1A40-4C5F-835C-D66B0FEADA26} + Win32Proj + VentoyVlnk + + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + true + $(ProjectDir);$(SolutionDir)/../../src;$(IncludePath) + + + false + $(SolutionDir)/../../src;$(ProjectDir);$(IncludePath) + + + + + + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreadedDebug + + + Windows + true + RequireAdministrator + + + $(ProjectDir)\Res\Vlnk32.manifest %(AdditionalManifestFiles) + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreaded + + + Windows + true + true + true + RequireAdministrator + + + $(ProjectDir)\Res\Vlnk32.manifest %(AdditionalManifestFiles) + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Vlnk/vs/VentoyVlnk/VentoyVlnk/VentoyVlnk.vcxproj.filters b/Vlnk/vs/VentoyVlnk/VentoyVlnk/VentoyVlnk.vcxproj.filters new file mode 100644 index 00000000..0a1deb66 --- /dev/null +++ b/Vlnk/vs/VentoyVlnk/VentoyVlnk/VentoyVlnk.vcxproj.filters @@ -0,0 +1,46 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + 头文件 + + + 源文件 + + + + + 资源文件 + + + + + 源文件 + + + 源文件 + + + 源文件 + + + + + 资源文件 + + + \ No newline at end of file diff --git a/Vlnk/vs/VentoyVlnk/VentoyVlnk/VentoyVlnk.vcxproj.user b/Vlnk/vs/VentoyVlnk/VentoyVlnk/VentoyVlnk.vcxproj.user new file mode 100644 index 00000000..418af1c2 --- /dev/null +++ b/Vlnk/vs/VentoyVlnk/VentoyVlnk/VentoyVlnk.vcxproj.user @@ -0,0 +1,7 @@ + + + + K:\test\ventoy\ventoy-1.0.57 + WindowsLocalDebugger + + \ No newline at end of file diff --git a/Vlnk/vs/VentoyVlnk/VentoyVlnk/resource.h b/Vlnk/vs/VentoyVlnk/VentoyVlnk/resource.h new file mode 100644 index 00000000..449c71b5 Binary files /dev/null and b/Vlnk/vs/VentoyVlnk/VentoyVlnk/resource.h differ diff --git a/VtoyTool/vtoydm.c b/VtoyTool/vtoydm.c index e830ce73..10308b2e 100644 --- a/VtoyTool/vtoydm.c +++ b/VtoyTool/vtoydm.c @@ -30,11 +30,13 @@ #include #include #include +#include #include "biso.h" #include "biso_list.h" #include "biso_util.h" #include "biso_plat.h" #include "biso_9660.h" +#include "vtoytool.h" #ifndef O_BINARY #define O_BINARY 0 @@ -484,7 +486,7 @@ static int vtoydm_print_extract_iso -static int vtoydm_print_linear_table(const char *img_map_file, const char *diskname) +static int vtoydm_print_linear_table(const char *img_map_file, const char *diskname, int part, uint64_t offset) { int i; int len; @@ -511,15 +513,15 @@ static int vtoydm_print_linear_table(const char *img_map_file, const char *diskn #else if (strstr(diskname, "nvme") || strstr(diskname, "mmc") || strstr(diskname, "nbd")) { - printf("%u %u linear %sp1 %llu\n", + printf("%u %u linear %sp%d %llu\n", (sector_start << 2), disk_sector_num, - diskname, (unsigned long long)chunk[i].disk_start_sector - 2048); + diskname, part, (unsigned long long)chunk[i].disk_start_sector - offset); } else { - printf("%u %u linear %s1 %llu\n", + printf("%u %u linear %s%d %llu\n", (sector_start << 2), disk_sector_num, - diskname, (unsigned long long)chunk[i].disk_start_sector - 2048); + diskname, part, (unsigned long long)chunk[i].disk_start_sector - offset); } #endif } @@ -539,10 +541,98 @@ static int vtoydm_print_help(FILE *fp) return 0; } +static uint64_t vtoydm_get_part_start(const char *diskname, int part) +{ + int fd; + unsigned long long size = 0; + char diskpath[256] = {0}; + char sizebuf[64] = {0}; + + if (strstr(diskname, "nvme") || strstr(diskname, "mmc") || strstr(diskname, "nbd")) + { + snprintf(diskpath, sizeof(diskpath) - 1, "/sys/class/block/%sp%d/start", diskname, part); + } + else + { + snprintf(diskpath, sizeof(diskpath) - 1, "/sys/class/block/%s%d/start", diskname, part); + } + + if (access(diskpath, F_OK) >= 0) + { + debug("get part start from sysfs for %s %d\n", diskname, part); + + fd = open(diskpath, O_RDONLY | O_BINARY); + if (fd >= 0) + { + read(fd, sizebuf, sizeof(sizebuf)); + size = strtoull(sizebuf, NULL, 10); + close(fd); + return size; + } + } + else + { + debug("%s not exist \n", diskpath); + } + + return size; +} + +static int vtoydm_vlnk_convert(char *disk, int len, int *part, uint64_t *offset) +{ + int rc = 1; + int cnt = 0; + int rdlen; + FILE *fp = NULL; + ventoy_os_param param; + char diskname[128] = {0}; + + fp = fopen("/ventoy/ventoy_os_param", "rb"); + if (!fp) + { + debug("dm vlnk convert not exist %d\n", errno); + goto end; + } + + memset(¶m, 0, sizeof(param)); + rdlen = (int)fread(¶m, 1, sizeof(param), fp); + if (rdlen != (int)sizeof(param)) + { + debug("fread failed %d %d\n", rdlen, errno); + goto end; + } + + debug("dm vlnk convert vtoy_reserved=%d\n", param.vtoy_reserved[6]); + + if (param.vtoy_reserved[6]) + { + cnt = vtoy_find_disk_by_guid(¶m, diskname); + debug("vtoy_find_disk_by_guid cnt=%d\n", cnt); + if (cnt == 1) + { + *part = param.vtoy_disk_part_id; + *offset = vtoydm_get_part_start(diskname, *part); + + debug("VLNK <%s> <%s> <%llu>\n", disk, diskname, *part, (unsigned long long)(*offset)); + + snprintf(disk, len, "/dev/%s", diskname); + + rc = 0; + } + } + +end: + if (fp) + fclose(fp); + return rc; +} + int vtoydm_main(int argc, char **argv) { int ch; int cmd = 0; + int part = 1; + uint64_t offset = 2048; unsigned long first_sector = 0; unsigned long long file_size = 0; char diskname[128] = {0}; @@ -615,11 +705,13 @@ int vtoydm_main(int argc, char **argv) debug("cmd=%d file=<%s> disk=<%s> first_sector=%lu file_size=%llu\n", cmd, filepath, diskname, first_sector, file_size); + vtoydm_vlnk_convert(diskname, sizeof(diskname), &part, &offset); + switch (cmd) { case CMD_PRINT_TABLE: { - return vtoydm_print_linear_table(filepath, diskname); + return vtoydm_print_linear_table(filepath, diskname, part, offset); } case CMD_CREATE_DM: { diff --git a/VtoyTool/vtoydump.c b/VtoyTool/vtoydump.c index e58cc868..c090b7e6 100644 --- a/VtoyTool/vtoydump.c +++ b/VtoyTool/vtoydump.c @@ -31,103 +31,7 @@ #include #include #include - -#define IS_DIGIT(x) ((x) >= '0' && (x) <= '9') - -#ifndef USE_DIET_C -#ifndef __mips__ -typedef unsigned long long uint64_t; -#endif -typedef unsigned int uint32_t; -typedef unsigned short uint16_t; -typedef unsigned char uint8_t; -#endif - -#define VENTOY_GUID { 0x77772020, 0x2e77, 0x6576, { 0x6e, 0x74, 0x6f, 0x79, 0x2e, 0x6e, 0x65, 0x74 }} - -typedef enum ventoy_fs_type -{ - ventoy_fs_exfat = 0, /* 0: exfat */ - ventoy_fs_ntfs, /* 1: NTFS */ - ventoy_fs_ext, /* 2: ext2/ext3/ext4 */ - ventoy_fs_xfs, /* 3: XFS */ - ventoy_fs_udf, /* 4: UDF */ - ventoy_fs_fat, /* 5: FAT */ - - ventoy_fs_max -}ventoy_fs_type; - -#pragma pack(1) - -typedef struct ventoy_guid -{ - uint32_t data1; - uint16_t data2; - uint16_t data3; - uint8_t data4[8]; -}ventoy_guid; - - -typedef struct ventoy_image_disk_region -{ - uint32_t image_sector_count; /* image sectors contained in this region */ - uint32_t image_start_sector; /* image sector start */ - uint64_t disk_start_sector; /* disk sector start */ -}ventoy_image_disk_region; - -typedef struct ventoy_image_location -{ - ventoy_guid guid; - - /* image sector size, currently this value is always 2048 */ - uint32_t image_sector_size; - - /* disk sector size, normally the value is 512 */ - uint32_t disk_sector_size; - - uint32_t region_count; - - /* - * disk region data - * If the image file has more than one fragments in disk, - * there will be more than one region data here. - * You can calculate the region count by - */ - ventoy_image_disk_region regions[1]; - - /* ventoy_image_disk_region regions[2~region_count-1] */ -}ventoy_image_location; - -typedef struct ventoy_os_param -{ - ventoy_guid guid; // VENTOY_GUID - uint8_t chksum; // checksum - - uint8_t vtoy_disk_guid[16]; - uint64_t vtoy_disk_size; // disk size in bytes - uint16_t vtoy_disk_part_id; // begin with 1 - uint16_t vtoy_disk_part_type; // 0:exfat 1:ntfs other: reserved - char vtoy_img_path[384]; // It seems to be enough, utf-8 format - 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. - * Address will be aligned by 4KB. - * - */ - uint64_t vtoy_img_location_addr; - uint32_t vtoy_img_location_len; - - uint64_t vtoy_reserved[4]; // Internal use by ventoy - - uint8_t vtoy_disk_signature[4]; - - uint8_t reserved[27]; -}ventoy_os_param; - -#pragma pack() +#include "vtoytool.h" #ifndef O_BINARY #define O_BINARY 0 @@ -234,8 +138,16 @@ static void vtoy_dump_os_param(ventoy_os_param *param) printf("param->vtoy_img_size = <%llu>\n", (unsigned long long)param->vtoy_img_size); printf("param->vtoy_img_location_addr = <0x%llx>\n", (unsigned long long)param->vtoy_img_location_addr); printf("param->vtoy_img_location_len = <%u>\n", param->vtoy_img_location_len); - printf("param->vtoy_reserved[0] = 0x%llx\n", (unsigned long long)param->vtoy_reserved[0]); - printf("param->vtoy_reserved[1] = 0x%llx\n", (unsigned long long)param->vtoy_reserved[1]); + printf("param->vtoy_reserved = %02x %02x %02x %02x %02x %02x %02x %02x\n", + param->vtoy_reserved[0], + param->vtoy_reserved[1], + param->vtoy_reserved[2], + param->vtoy_reserved[3], + param->vtoy_reserved[4], + param->vtoy_reserved[5], + param->vtoy_reserved[6], + param->vtoy_reserved[7] + ); printf("\n"); } @@ -392,7 +304,7 @@ static int vtoy_find_disk_by_size(unsigned long long size, char *diskname) return rc; } -static int vtoy_find_disk_by_guid(ventoy_os_param *param, char *diskname) +int vtoy_find_disk_by_guid(ventoy_os_param *param, char *diskname) { int rc = 0; int count = 0; @@ -416,6 +328,7 @@ static int vtoy_find_disk_by_guid(ventoy_os_param *param, char *diskname) } memset(vtguid, 0, sizeof(vtguid)); + memset(vtsig, 0, sizeof(vtsig)); rc = vtoy_get_disk_guid(p->d_name, vtguid, vtsig); if (rc == 0 && memcmp(vtguid, param->vtoy_disk_guid, 16) == 0 && memcmp(vtsig, param->vtoy_disk_signature, 4) == 0) @@ -429,6 +342,43 @@ static int vtoy_find_disk_by_guid(ventoy_os_param *param, char *diskname) return count; } +static int vtoy_find_disk_by_sig(uint8_t *sig, char *diskname) +{ + int rc = 0; + int count = 0; + DIR* dir = NULL; + struct dirent* p = NULL; + uint8_t vtguid[16]; + uint8_t vtsig[16]; + + dir = opendir("/sys/block"); + if (!dir) + { + return 0; + } + + while ((p = readdir(dir)) != NULL) + { + if (!vtoy_is_possible_blkdev(p->d_name)) + { + debug("disk %s is filted by name\n", p->d_name); + continue; + } + + memset(vtguid, 0, sizeof(vtguid)); + memset(vtsig, 0, sizeof(vtsig)); + rc = vtoy_get_disk_guid(p->d_name, vtguid, vtsig); + if (rc == 0 && memcmp(vtsig, sig, 4) == 0) + { + sprintf(diskname, "%s", p->d_name); + count++; + } + } + closedir(dir); + + return count; +} + static int vtoy_printf_iso_path(ventoy_os_param *param) { printf("%s\n", param->vtoy_img_path); @@ -453,6 +403,47 @@ static int vtoy_printf_fs(ventoy_os_param *param) return 0; } +static int vtoy_vlnk_printf(ventoy_os_param *param, char *diskname) +{ + int cnt = 0; + uint8_t disk_sig[4]; + uint8_t mbr[512]; + int fd = -1; + char diskpath[128]; + uint8_t check[8] = { 0x56, 0x54, 0x00, 0x47, 0x65, 0x00, 0x48, 0x44 }; + + memcpy(disk_sig, param->vtoy_reserved + 7, 4); + + debug("vlnk disk sig: %02x %02x %02x %02x \n", disk_sig[0], disk_sig[1], disk_sig[2], disk_sig[3]); + + cnt = vtoy_find_disk_by_sig(disk_sig, diskname); + if (cnt == 1) + { + snprintf(diskpath, sizeof(diskpath), "/dev/%s", diskname); + fd = open(diskpath, O_RDONLY | O_BINARY); + if (fd >= 0) + { + memset(mbr, 0, sizeof(mbr)); + read(fd, mbr, sizeof(mbr)); + close(fd); + + if (memcmp(mbr + 0x190, check, 8) == 0) + { + printf("/dev/%s", diskname); + return 0; + } + else + { + debug("check data failed /dev/%s\n", diskname); + } + } + } + + debug("find count=%d\n", cnt); + printf("unknown"); + return 1; +} + static int vtoy_check_device(ventoy_os_param *param, const char *device) { unsigned long long size; @@ -524,7 +515,7 @@ static int vtoy_print_os_param(ventoy_os_param *param, char *diskname) snprintf(diskpath, sizeof(diskpath) - 1, "/sys/class/block/%s2/size", diskname); } - if (access(diskpath, F_OK) >= 0) + if (param->vtoy_reserved[6] == 0 && access(diskpath, F_OK) >= 0) { debug("get part size from sysfs for %s\n", diskpath); @@ -570,12 +561,13 @@ int vtoydump_main(int argc, char **argv) int ch; int print_path = 0; int print_fs = 0; + int vlnk_print = 0; char filename[256] = {0}; char diskname[256] = {0}; char device[64] = {0}; ventoy_os_param *param = NULL; - while ((ch = getopt(argc, argv, "c:f:p:s:v::")) != -1) + while ((ch = getopt(argc, argv, "c:f:p:t:s:v::")) != -1) { if (ch == 'f') { @@ -594,6 +586,11 @@ int vtoydump_main(int argc, char **argv) print_path = 1; strncpy(filename, optarg, sizeof(filename) - 1); } + else if (ch == 't') + { + vlnk_print = 1; + strncpy(filename, optarg, sizeof(filename) - 1); + } else if (ch == 's') { print_fs = 1; @@ -655,6 +652,10 @@ int vtoydump_main(int argc, char **argv) { rc = vtoy_printf_fs(param); } + else if (vlnk_print) + { + rc = vtoy_vlnk_printf(param, diskname); + } else if (device[0]) { rc = vtoy_check_device(param, device); diff --git a/VtoyTool/vtoytool.h b/VtoyTool/vtoytool.h new file mode 100644 index 00000000..e2ddce34 --- /dev/null +++ b/VtoyTool/vtoytool.h @@ -0,0 +1,123 @@ +/****************************************************************************** + * vtoytool.h + * + * Copyright (c) 2022, longpanda + * + * 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 . + * + */ + +#ifndef __VTOYTOOL_H__ +#define __VTOYTOOL_H__ + +#define IS_DIGIT(x) ((x) >= '0' && (x) <= '9') + +#ifndef USE_DIET_C +#ifndef __mips__ +typedef unsigned long long uint64_t; +#endif +typedef unsigned int uint32_t; +typedef unsigned short uint16_t; +typedef unsigned char uint8_t; +#endif + +#define VENTOY_GUID { 0x77772020, 0x2e77, 0x6576, { 0x6e, 0x74, 0x6f, 0x79, 0x2e, 0x6e, 0x65, 0x74 }} + +typedef enum ventoy_fs_type +{ + ventoy_fs_exfat = 0, /* 0: exfat */ + ventoy_fs_ntfs, /* 1: NTFS */ + ventoy_fs_ext, /* 2: ext2/ext3/ext4 */ + ventoy_fs_xfs, /* 3: XFS */ + ventoy_fs_udf, /* 4: UDF */ + ventoy_fs_fat, /* 5: FAT */ + + ventoy_fs_max +}ventoy_fs_type; + +#pragma pack(1) + +typedef struct ventoy_guid +{ + uint32_t data1; + uint16_t data2; + uint16_t data3; + uint8_t data4[8]; +}ventoy_guid; + + +typedef struct ventoy_image_disk_region +{ + uint32_t image_sector_count; /* image sectors contained in this region */ + uint32_t image_start_sector; /* image sector start */ + uint64_t disk_start_sector; /* disk sector start */ +}ventoy_image_disk_region; + +typedef struct ventoy_image_location +{ + ventoy_guid guid; + + /* image sector size, currently this value is always 2048 */ + uint32_t image_sector_size; + + /* disk sector size, normally the value is 512 */ + uint32_t disk_sector_size; + + uint32_t region_count; + + /* + * disk region data + * If the image file has more than one fragments in disk, + * there will be more than one region data here. + * You can calculate the region count by + */ + ventoy_image_disk_region regions[1]; + + /* ventoy_image_disk_region regions[2~region_count-1] */ +}ventoy_image_location; + +typedef struct ventoy_os_param +{ + ventoy_guid guid; // VENTOY_GUID + uint8_t chksum; // checksum + + uint8_t vtoy_disk_guid[16]; + uint64_t vtoy_disk_size; // disk size in bytes + uint16_t vtoy_disk_part_id; // begin with 1 + uint16_t vtoy_disk_part_type; // 0:exfat 1:ntfs other: reserved + char vtoy_img_path[384]; // It seems to be enough, utf-8 format + 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. + * Address will be aligned by 4KB. + * + */ + uint64_t vtoy_img_location_addr; + uint32_t vtoy_img_location_len; + + uint8_t vtoy_reserved[32]; // Internal use by ventoy + + uint8_t vtoy_disk_signature[4]; + + uint8_t reserved[27]; +}ventoy_os_param; + +#pragma pack() + +int vtoy_find_disk_by_guid(ventoy_os_param *param, char *diskname); +#endif + diff --git a/VtoyTool/vtoytool/00/vtoytool_32 b/VtoyTool/vtoytool/00/vtoytool_32 index 0b430bd9..aeddab28 100644 Binary files a/VtoyTool/vtoytool/00/vtoytool_32 and b/VtoyTool/vtoytool/00/vtoytool_32 differ diff --git a/VtoyTool/vtoytool/00/vtoytool_64 b/VtoyTool/vtoytool/00/vtoytool_64 index 7680fe37..dab47d6a 100644 Binary files a/VtoyTool/vtoytool/00/vtoytool_64 and b/VtoyTool/vtoytool/00/vtoytool_64 differ diff --git a/VtoyTool/vtoytool/00/vtoytool_aa64 b/VtoyTool/vtoytool/00/vtoytool_aa64 index c3ce4004..2debdf7f 100644 Binary files a/VtoyTool/vtoytool/00/vtoytool_aa64 and b/VtoyTool/vtoytool/00/vtoytool_aa64 differ diff --git a/VtoyTool/vtoytool/00/vtoytool_m64e b/VtoyTool/vtoytool/00/vtoytool_m64e index d4d03d52..a410f17f 100644 Binary files a/VtoyTool/vtoytool/00/vtoytool_m64e and b/VtoyTool/vtoytool/00/vtoytool_m64e differ diff --git a/vtoyjump/vtoyjump/vtoyjump.c b/vtoyjump/vtoyjump/vtoyjump.c index b9d82cb0..c2ab0a12 100644 --- a/vtoyjump/vtoyjump/vtoyjump.c +++ b/vtoyjump/vtoyjump/vtoyjump.c @@ -40,6 +40,10 @@ static CHAR g_prog_full_path[MAX_PATH]; static CHAR g_prog_dir[MAX_PATH]; static CHAR g_prog_name[MAX_PATH]; +#define VTOY_PECMD_PATH "X:\\Windows\\system32\\ventoy\\PECMD.EXE" +#define ORG_PECMD_PATH "X:\\Windows\\system32\\PECMD.EXE" +#define ORG_PECMD_BK_PATH "X:\\Windows\\system32\\PECMD.EXE_BACK.EXE" + #define AUTO_RUN_BAT "X:\\VentoyAutoRun.bat" #define AUTO_RUN_LOG "X:\\VentoyAutoRun.log" @@ -431,7 +435,7 @@ out: return bRet; } -static int GetPhyDiskUUID(const char LogicalDrive, UINT8 *UUID, DISK_EXTENT *DiskExtent) +static int GetPhyDiskUUID(const char LogicalDrive, UINT8 *UUID, UINT32 *DiskSig, DISK_EXTENT *DiskExtent) { BOOL Ret; DWORD dwSize; @@ -466,8 +470,9 @@ static int GetPhyDiskUUID(const char LogicalDrive, UINT8 *UUID, DISK_EXTENT *Dis } CloseHandle(Handle); - memcpy(DiskExtent, DiskExtents.Extents, sizeof(DiskExtent)); - Log("%C: is in PhysicalDrive%d ", LogicalDrive, DiskExtents.Extents[0].DiskNumber); + memcpy(DiskExtent, DiskExtents.Extents, sizeof(DISK_EXTENT)); + Log("%C: is in PhysicalDrive%d Offset:%llu", LogicalDrive, DiskExtents.Extents[0].DiskNumber, + (ULONGLONG)(DiskExtents.Extents[0].StartingOffset.QuadPart)); sprintf_s(PhyPath, sizeof(PhyPath), "\\\\.\\PhysicalDrive%d", DiskExtents.Extents[0].DiskNumber); Handle = CreateFileA(PhyPath, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0); @@ -485,6 +490,11 @@ static int GetPhyDiskUUID(const char LogicalDrive, UINT8 *UUID, DISK_EXTENT *Dis } memcpy(UUID, SectorBuf + 0x180, 16); + if (DiskSig) + { + memcpy(DiskSig, SectorBuf + 0x1B8, 4); + } + CloseHandle(Handle); return 0; } @@ -1413,11 +1423,16 @@ static int VentoyHook(ventoy_os_param *param) int i; int rc; BOOL find = FALSE; + BOOL vtoyfind = FALSE; CHAR Letter; CHAR MntLetter; + CHAR VtoyLetter; DWORD Drives; DWORD NewDrives; + UINT32 DiskSig; + UINT32 VtoySig; DISK_EXTENT DiskExtent; + DISK_EXTENT VtoyDiskExtent; UINT8 UUID[16]; CHAR IsoPath[MAX_PATH]; @@ -1442,7 +1457,7 @@ static int VentoyHook(ventoy_os_param *param) if (IsFileExist("%s", IsoPath)) { Log("File exist under %C:", Letter); - if (GetPhyDiskUUID(Letter, UUID, &DiskExtent) == 0) + if (GetPhyDiskUUID(Letter, UUID, NULL, &DiskExtent) == 0) { if (memcmp(UUID, param->vtoy_disk_guid, 16) == 0) { @@ -1481,6 +1496,60 @@ static int VentoyHook(ventoy_os_param *param) Log("Find ISO file <%s>", IsoPath); + //Find VtoyLetter in Vlnk Mode + if (g_os_param_reserved[6] == 1) + { + memcpy(&VtoySig, g_os_param_reserved + 7, 4); + for (i = 0; i < 5; i++) + { + VtoyLetter = 'A'; + Drives = GetLogicalDrives(); + Log("Logic Drives: 0x%x VentoySig:%08X", Drives, VtoySig); + + while (Drives) + { + if (Drives & 0x01) + { + if (GetPhyDiskUUID(VtoyLetter, UUID, &DiskSig, &VtoyDiskExtent) == 0) + { + Log("DiskSig=%08X PartStart=%lld", DiskSig, VtoyDiskExtent.StartingOffset.QuadPart); + if (DiskSig == VtoySig && VtoyDiskExtent.StartingOffset.QuadPart == SIZE_1MB) + { + Log("Ventoy Disk Sig match"); + vtoyfind = TRUE; + break; + } + } + } + + Drives >>= 1; + VtoyLetter++; + } + + if (vtoyfind) + { + Log("Find Ventoy Letter: %C", VtoyLetter); + break; + } + else + { + Log("Now wait and retry ..."); + Sleep(1000); + } + } + + if (vtoyfind == FALSE) + { + Log("Failed to find ventoy disk"); + return 1; + } + } + else + { + VtoyLetter = Letter; + Log("No vlnk mode %C", Letter); + } + Drives = GetLogicalDrives(); Log("Drives before mount: 0x%x", Drives); @@ -1519,12 +1588,12 @@ static int VentoyHook(ventoy_os_param *param) } // for protect - rc = DeleteVentoyPart2MountPoint(DiskExtent.DiskNumber); + rc = DeleteVentoyPart2MountPoint(VtoyDiskExtent.DiskNumber); Log("Delete ventoy mountpoint: %s", rc == 0 ? "SUCCESS" : "NO NEED"); if (g_windows_data.auto_install_script[0]) { - sprintf_s(IsoPath, sizeof(IsoPath), "%C:%s", Letter, g_windows_data.auto_install_script); + sprintf_s(IsoPath, sizeof(IsoPath), "%C:%s", VtoyLetter, g_windows_data.auto_install_script); if (IsFileExist("%s", IsoPath)) { Log("use auto install script %s...", IsoPath); @@ -1542,11 +1611,11 @@ static int VentoyHook(ventoy_os_param *param) if (g_windows_data.injection_archive[0]) { - sprintf_s(IsoPath, sizeof(IsoPath), "%C:%s", Letter, g_windows_data.injection_archive); + sprintf_s(IsoPath, sizeof(IsoPath), "%C:%s", VtoyLetter, g_windows_data.injection_archive); if (IsFileExist("%s", IsoPath)) { Log("decompress injection archive %s...", IsoPath); - DecompressInjectionArchive(IsoPath, DiskExtent.DiskNumber); + DecompressInjectionArchive(IsoPath, VtoyDiskExtent.DiskNumber); if (IsFileExist("%s", AUTO_RUN_BAT)) { @@ -1886,6 +1955,14 @@ int real_main(int argc, char **argv) return 0; } +static void VentoyToUpper(CHAR *str) +{ + int i; + for (i = 0; str[i]; i++) + { + str[i] = (CHAR)toupper(str[i]); + } +} int main(int argc, char **argv) { @@ -1920,12 +1997,24 @@ int main(int argc, char **argv) } else if (_stricmp(g_prog_name, "PECMD.exe") == 0) { - Log("We need to rejump for pecmd ..."); + strcpy_s(NewArgv0, sizeof(NewArgv0), g_prog_dir); + VentoyToUpper(NewArgv0); + + if (NULL == strstr(NewArgv0, "SYSTEM32") && IsFileExist(ORG_PECMD_BK_PATH)) + { + Log("Just call original pecmd.exe"); + strcpy_s(CallParam, sizeof(CallParam), ORG_PECMD_PATH); + } + else + { + Log("We need to rejump for pecmd ..."); - ventoy_check_create_directory(); - CopyFileA(g_prog_full_path, "ventoy\\WinLogon.exe", TRUE); + ventoy_check_create_directory(); + CopyFileA(g_prog_full_path, "ventoy\\WinLogon.exe", TRUE); - sprintf_s(CallParam, sizeof(CallParam), "ventoy\\WinLogon.exe %s", g_prog_full_path); + sprintf_s(CallParam, sizeof(CallParam), "ventoy\\WinLogon.exe %s", g_prog_full_path); + } + for (i = 1; i < argc; i++) { strcat_s(CallParam, sizeof(CallParam), " ");