]> glassweightruler.freedombox.rocks Git - Ventoy.git/commitdiff
1.0.80 release v1.0.80
authorlongpanda <admin@ventoy.net>
Wed, 21 Sep 2022 11:41:51 +0000 (19:41 +0800)
committerlongpanda <admin@ventoy.net>
Wed, 21 Sep 2022 11:41:51 +0000 (19:41 +0800)
31 files changed:
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_def.h
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_linux.c
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_windows.c
INSTALL/ExtendPersistentImg.sh
INSTALL/VentoyPlugson.sh
INSTALL/VentoyWeb.sh
INSTALL/grub/arm64-efi/normal.mod
INSTALL/grub/grub.cfg
INSTALL/grub/i386-efi/normal.mod
INSTALL/grub/mips64el-efi/normal.mod
INSTALL/grub/x86_64-efi/normal.mod
INSTALL/ventoy/common_bcd.xz [new file with mode: 0644]
INSTALL/ventoy/common_bootmgr.xz [new file with mode: 0644]
INSTALL/ventoy/ventoy.cpio
INSTALL/ventoy/ventoy_arm64.cpio
INSTALL/ventoy/ventoy_mips64.cpio
INSTALL/ventoy/ventoy_unix.cpio
INSTALL/ventoy/ventoy_x86.cpio
INSTALL/ventoy/vtloopex.cpio
INSTALL/ventoy/wimboot.i386.efi.xz
INSTALL/ventoy/wimboot.x86_64.xz
Plugson/src/Web/ventoy_http.c
Plugson/src/Web/ventoy_http.h
Plugson/vs/VentoyPlugson/Release/VentoyPlugson.exe
Plugson/www/buildtime
Plugson/www/index.html
Plugson/www/plugson_control.html
README.md
wimboot/wimboot-2.7.3/src/wim.c
wimboot/wimboot-2.7.3/src/xca.c

index e4f4275052c4a86b23f68fe6c0de06d40cf6c3b9..2c4e0e063558574a2bcaac02776ba68d58bfe2a6 100644 (file)
@@ -3659,12 +3659,12 @@ static grub_err_t ventoy_cmd_sel_auto_install(grub_extcmd_context_t ctxt, int ar
         vtoy_ssprintf(buf, pos, "set timeout=%d\n", node->timeout);        
     }
     
-    vtoy_ssprintf(buf, pos, "menuentry \"Boot without auto installation template\" {\n"
+    vtoy_ssprintf(buf, pos, "menuentry \"Boot without auto installation template\" --class=\"sel_auto_install\" {\n"
                   "  echo %s\n}\n", "");
 
     for (i = 0; i < node->templatenum; i++)
     {
-        vtoy_ssprintf(buf, pos, "menuentry \"Boot with %s\"{\n"
+        vtoy_ssprintf(buf, pos, "menuentry \"Boot with %s\" --class=\"sel_auto_install\" {\n"
                   "  echo \"\"\n}\n",
                   node->templatepath[i].path);
     }
@@ -3765,12 +3765,12 @@ static grub_err_t ventoy_cmd_sel_persistence(grub_extcmd_context_t ctxt, int arg
         vtoy_ssprintf(buf, pos, "set timeout=%d\n", node->timeout);        
     }
 
-    vtoy_ssprintf(buf, pos, "menuentry \"Boot without persistence\" {\n"
+    vtoy_ssprintf(buf, pos, "menuentry \"Boot without persistence\" --class=\"sel_persistence\" {\n"
                   "  echo %s\n}\n", "");
     
     for (i = 0; i < node->backendnum; i++)
     {
-        vtoy_ssprintf(buf, pos, "menuentry \"Boot with %s\" {\n"
+        vtoy_ssprintf(buf, pos, "menuentry \"Boot with %s\" --class=\"sel_persistence\" {\n"
                       "  echo \"\"\n}\n",
                       node->backendpath[i].path);
         
@@ -5958,6 +5958,145 @@ static grub_err_t ventoy_cmd_dump_rsv_page(grub_extcmd_context_t ctxt, int argc,
     VENTOY_CMD_RETURN(GRUB_ERR_NONE);
 }
 
+static grub_err_t ventoy_cmd_need_secondary_menu(grub_extcmd_context_t ctxt, int argc, char **args)
+{
+    const char *env = NULL;
+    
+    (void)ctxt;
+    (void)argc;
+
+    if (g_ventoy_memdisk_mode || g_ventoy_grub2_mode || g_ventoy_wimboot_mode || g_ventoy_iso_raw)
+    {
+        return 1;
+    }
+
+    if (ventoy_check_mode_by_name(args[0], "vtmemdisk") ||
+        ventoy_check_mode_by_name(args[0], "vtgrub2") ||
+        ventoy_check_mode_by_name(args[0], "vtwimboot"))
+    {
+        return 1;
+    }
+
+    env = grub_env_get("VTOY_SECONDARY_BOOT_MENU");
+    if (env && env[0] == '0' && env[1] == 0)
+    {
+        return 1;
+    }
+
+    return 0;
+}
+
+static grub_err_t ventoy_cmd_show_secondary_menu(grub_extcmd_context_t ctxt, int argc, char **args)
+{
+    int n = 0;
+    int pos = 0;
+    int len = 0;
+    int select = 0;
+    int timeout = 0;
+    char *cmd = NULL;
+    const char *env = NULL;
+    ulonglong fsize = 0;
+    char cfgfile[128];
+    int seldata[16] = {0};
+
+    (void)ctxt;
+    (void)argc;
+
+    len = 8 * VTOY_SIZE_1KB;
+    cmd = (char *)grub_malloc(len);
+    if (!cmd)
+    {
+        return 1;
+    }
+
+    grub_env_unset("VTOY_CHKSUM_FILE_PATH");
+
+    env = grub_env_get("VTOY_SECONDARY_TIMEOUT");
+    if (env)
+    {
+        timeout = (int)grub_strtol(env, NULL, 10);
+    }
+
+    if (timeout > 0)
+    {
+        vtoy_len_ssprintf(cmd, pos, len, "set timeout=%d\n", timeout);
+    }
+
+    fsize = grub_strtoull(args[2], NULL, 10);
+
+    vtoy_dummy_menuentry(cmd, pos, len, "Boot in normal mode", "second_normal"); seldata[n++] = 1;
+
+    if (grub_strcmp(args[1], "Unix") != 0)
+    {
+        if (grub_strcmp(args[1], "Windows") == 0)
+        {
+            vtoy_dummy_menuentry(cmd, pos, len, "Boot in wimboot mode", "second_wimboot"); seldata[n++] = 2;
+        }
+        else
+        {
+            vtoy_dummy_menuentry(cmd, pos, len, "Boot in grub2 mode", "second_grub2"); seldata[n++] = 3;
+        }
+
+        if (fsize <= VTOY_SIZE_1GB)
+        {
+            vtoy_dummy_menuentry(cmd, pos, len, "Boot in memdisk mode", "second_memdisk"); seldata[n++] = 4;
+        }
+    }
+
+    vtoy_dummy_menuentry(cmd, pos, len, "File checksum", "second_checksum"); seldata[n++] = 5;
+
+    do {
+        g_ventoy_menu_esc = 1;
+        g_ventoy_suppress_esc = 1;
+        g_ventoy_suppress_esc_default = 0;
+        grub_snprintf(cfgfile, sizeof(cfgfile), "configfile mem:0x%llx:size:%d", (ulonglong)(ulong)cmd, pos);
+        grub_script_execute_sourcecode(cfgfile);
+        g_ventoy_menu_esc = 0;
+        g_ventoy_suppress_esc = 0;
+        g_ventoy_suppress_esc_default = 1;
+
+        select = seldata[g_ventoy_last_entry];
+        
+        if (select == 2)
+        {
+            g_ventoy_wimboot_mode = 1;
+        }
+        else if (select == 3)
+        {
+            g_ventoy_grub2_mode = 1;
+        }
+        else if (select == 4)
+        {
+            g_ventoy_memdisk_mode = 1;
+        }
+        else if (select == 5)
+        {
+            grub_env_set("VTOY_CHKSUM_FILE_PATH", args[0]);
+            grub_script_execute_sourcecode("configfile $vtoy_efi_part/grub/checksum.cfg");
+        }
+    }while (select == 5);
+
+    grub_free(cmd);
+    return 0;
+}
+
+static grub_err_t ventoy_cmd_fs_ignore_case(grub_extcmd_context_t ctxt, int argc, char **args)
+{
+    (void)ctxt;
+    (void)argc;
+
+    if (args[0][0] == '0')
+    {
+        g_ventoy_case_insensitive = 0;
+    }
+    else
+    {
+        g_ventoy_case_insensitive = 1;
+    }
+
+    return 0;
+}
+
 int ventoy_env_init(void)
 {
     int i;
@@ -6158,6 +6297,12 @@ static cmd_para ventoy_cmds[] =
     { "vt_iso_vd_id_begin", ventoy_cmd_iso_vd_id_begin, 0, NULL, "", "", NULL },
     { "vt_fn_mutex_lock", ventoy_cmd_fn_mutex_lock, 0, NULL, "", "", NULL },
     { "vt_efi_dump_rsv_page", ventoy_cmd_dump_rsv_page, 0, NULL, "", "", NULL },
+    { "vt_is_standard_winiso", ventoy_cmd_is_standard_winiso, 0, NULL, "", "", NULL },
+    { "vt_sel_winpe_wim", ventoy_cmd_sel_winpe_wim, 0, NULL, "", "", NULL },
+    { "vt_need_secondary_menu", ventoy_cmd_need_secondary_menu, 0, NULL, "", "", NULL },
+    { "vt_show_secondary_menu", ventoy_cmd_show_secondary_menu, 0, NULL, "", "", NULL },
+    { "vt_fs_ignore_case", ventoy_cmd_fs_ignore_case, 0, NULL, "", "", NULL },
+    { "vt_systemd_menu", ventoy_cmd_linux_systemd_menu, 0, NULL, "", "", NULL },
 };
 
 int ventoy_register_all_cmd(void)
index 2f4d140603e5dbead5bcd5d6d785eaa57be4d4ff..42235c67cb484e6a6ce795fcd1596b8eb7cf08e0 100644 (file)
@@ -29,6 +29,8 @@
 
 #define VTOY_FILT_MIN_FILE_SIZE  32768
 
+#define VTOY_LINUX_SYSTEMD_MENU_MAX_BUF    16384
+
 #define VTOY_SIZE_1GB     1073741824
 #define VTOY_SIZE_1MB     (1024 * 1024)
 #define VTOY_SIZE_2MB     (2 * 1024 * 1024)
@@ -329,9 +331,16 @@ void ventoy_debug(const char *fmt, ...);
 #define vtoy_ssprintf(buf, pos, fmt, args...) \
     pos += grub_snprintf(buf + pos, VTOY_MAX_SCRIPT_BUF - pos, fmt, ##args)
 
+#define vtoy_len_ssprintf(buf, pos, len, fmt, args...) \
+    pos += grub_snprintf(buf + pos, len - pos, fmt, ##args)
+
 #define browser_ssprintf(mbuf, fmt, args...) \
     (mbuf)->pos += grub_snprintf((mbuf)->buf + (mbuf)->pos, (mbuf)->max - (mbuf)->pos, fmt, ##args)
 
+#define vtoy_dummy_menuentry(buf, pos, len, title, class) \
+    vtoy_len_ssprintf(buf, pos, len, "menuentry \"%s\" --class=\"%s\" {\n  echo \"\"\n}\n", title, class)
+
+
 #define FLAG_HEADER_RESERVED          0x00000001
 #define FLAG_HEADER_COMPRESSION       0x00000002
 #define FLAG_HEADER_READONLY          0x00000004
@@ -613,6 +622,7 @@ grub_err_t ventoy_cmd_clear_initrd_list(grub_extcmd_context_t ctxt, int argc, ch
 grub_uint32_t ventoy_get_iso_boot_catlog(grub_file_t file);
 int ventoy_has_efi_eltorito(grub_file_t file, grub_uint32_t sector);
 grub_err_t ventoy_cmd_linux_chain_data(grub_extcmd_context_t ctxt, int argc, char **args);
+grub_err_t ventoy_cmd_linux_systemd_menu(grub_extcmd_context_t ctxt, int argc, char **args);
 grub_err_t ventoy_cmd_linux_locate_initrd(grub_extcmd_context_t ctxt, int argc, char **args);
 grub_err_t ventoy_cmd_initrd_count(grub_extcmd_context_t ctxt, int argc, char **args);
 grub_err_t ventoy_cmd_valid_initrd_count(grub_extcmd_context_t ctxt, int argc, char **args);
@@ -633,6 +643,7 @@ grub_err_t ventoy_cmd_windows_chain_data(grub_extcmd_context_t ctxt, int argc, c
 grub_err_t ventoy_cmd_windows_wimboot_data(grub_extcmd_context_t ctxt, int argc, char **args);
 grub_err_t ventoy_cmd_wim_chain_data(grub_extcmd_context_t ctxt, int argc, char **args);
 grub_err_t ventoy_cmd_wim_check_bootable(grub_extcmd_context_t ctxt, int argc, char **args);
+grub_err_t ventoy_cmd_is_standard_winiso(grub_extcmd_context_t ctxt, int argc, char **args);
 grub_err_t ventoy_cmd_dump_wim_patch(grub_extcmd_context_t ctxt, int argc, char **args);
 grub_err_t ventoy_cmd_sel_wimboot(grub_extcmd_context_t ctxt, int argc, char **args);
 grub_err_t ventoy_cmd_set_wim_prompt(grub_extcmd_context_t ctxt, int argc, char **args);
@@ -1111,6 +1122,7 @@ grub_err_t ventoy_cmd_linux_get_main_initrd_index(grub_extcmd_context_t ctxt, in
 grub_err_t ventoy_cmd_collect_wim_patch(grub_extcmd_context_t ctxt, int argc, char **args);
 grub_err_t ventoy_cmd_wim_patch_count(grub_extcmd_context_t ctxt, int argc, char **args);
 grub_err_t ventoy_cmd_locate_wim_patch(grub_extcmd_context_t ctxt, int argc, char **args);
+grub_err_t ventoy_cmd_sel_winpe_wim(grub_extcmd_context_t ctxt, int argc, char **args);
 grub_err_t ventoy_cmd_unix_chain_data(grub_extcmd_context_t ctxt, int argc, char **args);
 int ventoy_get_disk_guid(const char *filename, grub_uint8_t *guid, grub_uint8_t *signature);
 grub_err_t ventoy_cmd_unix_reset(grub_extcmd_context_t ctxt, int argc, char **args);
@@ -1218,6 +1230,16 @@ typedef struct var_node
     struct var_node *next;
 }var_node;
 
+typedef struct systemd_menu_ctx
+{
+    char *dev;
+    char *buf;
+    int pos;
+    int len;
+}systemd_menu_ctx;
+
+#define vtoy_check_goto_out(p)  if (!p) goto out
+
 extern char *g_tree_script_buf;
 extern int g_tree_script_pos;
 extern int g_tree_script_pre;
index e32ff02f584d2350a9b7d43fd78fa43509394aaa..bfeb85893e08b916fb7fa5f0c3e7e783d5476d12 100644 (file)
@@ -1811,3 +1811,173 @@ grub_err_t ventoy_cmd_linux_chain_data(grub_extcmd_context_t ctxt, int argc, cha
     VENTOY_CMD_RETURN(GRUB_ERR_NONE);
 }
 
+static char *ventoy_systemd_conf_tag(char *buf, const char *tag, int optional)
+{
+    int taglen = 0;
+    char *start = NULL;
+    char *nextline = NULL;
+
+    taglen = grub_strlen(tag);
+    for (start = buf; start; start = nextline)
+    {
+        nextline = ventoy_get_line(start);
+        while (ventoy_isspace(*start))
+        {
+            start++;
+        }
+
+        if (grub_strncmp(start, tag, taglen) == 0 && (start[taglen] == ' ' || start[taglen] == '\t'))
+        {
+            start += taglen;
+            while (ventoy_isspace(*start))
+            {
+                start++;
+            } 
+            return start;
+        }
+    }
+
+    if (optional == 0)
+    {
+        debug("tag<%s> NOT found\n", tag);        
+    }
+    return NULL;
+}
+
+static int ventoy_systemd_conf_hook(const char *filename, const struct grub_dirhook_info *info, void *data)
+{
+    int oldpos = 0;
+    char *tag = NULL;
+    char *bkbuf = NULL;
+    char *filebuf = NULL;
+    grub_file_t file = NULL;
+    systemd_menu_ctx *ctx = (systemd_menu_ctx *)data;
+
+    debug("ventoy_systemd_conf_hook %s\n", filename);
+
+    if (info->dir || NULL == grub_strstr(filename, ".conf"))
+    {
+        return 0;
+    }
+
+
+    file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s/loader/entries/%s", ctx->dev, filename);
+    if (!file)
+    {
+        return 0;
+    }
+
+    filebuf = grub_zalloc(2 * file->size + 8);
+    if (!filebuf)
+    {
+        goto out;
+    }
+
+    bkbuf = filebuf + file->size + 4;
+    grub_file_read(file, bkbuf, file->size);
+
+    oldpos = ctx->pos;
+
+    /* title --> menuentry */
+    grub_memcpy(filebuf, bkbuf, file->size);
+    tag = ventoy_systemd_conf_tag(filebuf, "title", 0);
+    vtoy_check_goto_out(tag);
+    vtoy_len_ssprintf(ctx->buf, ctx->pos, ctx->len, "menuentry \"%s\" {\n", tag);
+
+    /* linux xxx */
+    grub_memcpy(filebuf, bkbuf, file->size);
+    tag = ventoy_systemd_conf_tag(filebuf, "linux", 0);
+    if (!tag)
+    {
+        ctx->pos = oldpos;
+        goto out;
+    }
+    vtoy_len_ssprintf(ctx->buf, ctx->pos, ctx->len, "  echo \"Downloading kernel ...\"\n  linux %s ", tag);
+
+    /* kernel options */
+    grub_memcpy(filebuf, bkbuf, file->size);
+    tag = ventoy_systemd_conf_tag(filebuf, "options", 0);
+    vtoy_len_ssprintf(ctx->buf, ctx->pos, ctx->len, "%s \n", tag ? tag : "");
+
+    
+    /* initrd xxx xxx xxx */
+    vtoy_len_ssprintf(ctx->buf, ctx->pos, ctx->len, "  echo \"Downloading initrd ...\"\n  initrd ");
+    grub_memcpy(filebuf, bkbuf, file->size);
+    tag = ventoy_systemd_conf_tag(filebuf, "initrd", 1);
+    while (tag)
+    {
+        vtoy_len_ssprintf(ctx->buf, ctx->pos, ctx->len, "%s ", tag);
+        tag = ventoy_systemd_conf_tag(tag + grub_strlen(tag) + 1, "initrd", 1);
+    }
+
+    vtoy_len_ssprintf(ctx->buf, ctx->pos, ctx->len, "\n  boot\n}\n");
+
+out:
+    grub_check_free(filebuf);
+    grub_file_close(file);
+    return 0;
+}
+
+grub_err_t ventoy_cmd_linux_systemd_menu(grub_extcmd_context_t ctxt, int argc, char **args)
+{
+    static char *buf = NULL;
+    char name[128];
+    char value[64];
+    grub_fs_t fs;
+    char *device_name = NULL;
+    grub_device_t dev = NULL;
+    systemd_menu_ctx ctx;
+    
+    (void)ctxt;
+    (void)argc;
+
+    if (!buf)
+    {
+        buf = grub_malloc(VTOY_LINUX_SYSTEMD_MENU_MAX_BUF);
+        if (!buf)
+        {
+            goto end;
+        }        
+    }
+
+    device_name = grub_file_get_device_name(args[0]);
+    if (!device_name)
+    {
+        debug("failed to get device name %s\n", args[0]);
+        goto end;
+    }
+
+    dev = grub_device_open(device_name);
+    if (!dev)
+    {
+        debug("failed to open device %s\n", device_name);
+        goto end;        
+    }
+
+    fs = grub_fs_probe(dev);
+    if (!fs)
+    {
+        debug("failed to probe fs %d\n", grub_errno);
+        goto end;
+    }
+
+    ctx.dev = args[0];
+    ctx.buf = buf;
+    ctx.pos = 0;
+    ctx.len = VTOY_LINUX_SYSTEMD_MENU_MAX_BUF;
+    fs->fs_dir(dev, "/loader/entries", ventoy_systemd_conf_hook, &ctx);
+
+    grub_snprintf(name, sizeof(name), "%s_addr", args[1]);
+    grub_snprintf(value, sizeof(value), "0x%llx", (ulonglong)(ulong)buf);
+    grub_env_set(name, value);
+    
+    grub_snprintf(name, sizeof(name), "%s_size", args[1]);
+    grub_snprintf(value, sizeof(value), "%d", ctx.pos);
+    grub_env_set(name, value);
+
+end:
+    grub_check_free(device_name);
+    check_free(dev, grub_device_close);
+    VENTOY_CMD_RETURN(GRUB_ERR_NONE);
+}
+
index 2fc7f20acfc20f815e1ce473eb3d316c1429276a..8105e0e3562d64f36d3a0dcf9b56df51a97185bc 100644 (file)
@@ -1364,6 +1364,110 @@ static int ventoy_wimdows_locate_wim(const char *disk, wim_patch *patch, int win
     return 0;
 }
 
+grub_err_t ventoy_cmd_sel_winpe_wim(grub_extcmd_context_t ctxt, int argc, char **args)
+{
+    int i = 0;
+    int pos = 0;
+    int len = 0;
+    int find = 0;
+    char *cmd = NULL;
+    wim_patch *node = NULL;
+    wim_patch *tmp = NULL;
+    grub_file_t file = NULL;
+    wim_header *head = NULL;
+    char cfgfile[128];
+
+    (void)ctxt;
+    (void)argc;
+
+    len = 8 * VTOY_SIZE_1KB;
+    cmd = (char *)grub_malloc(len + sizeof(wim_header));
+    if (!cmd)
+    {
+        return 1;
+    }
+
+    head = (wim_header *)(cmd + len);
+    grub_env_unset("vtoy_pe_wim_path");
+
+    for (node = g_wim_patch_head; node; node = node->next)
+    {
+        find = 0;
+        for (tmp = g_wim_patch_head; tmp != node; tmp = tmp->next)
+        {
+            if (tmp->valid && grub_strcasecmp(tmp->path, node->path) == 0)
+            {
+                find = 1;
+                break;
+            }
+        }
+
+        if (find)
+        {
+            continue;
+        }
+        
+        g_ventoy_case_insensitive = 1;
+        file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s%s", args[0], node->path);
+        g_ventoy_case_insensitive = 0;
+        if (!file)
+        {
+            debug("File %s%s NOT exist\n", args[0], node->path);
+            continue;
+        }
+
+        grub_file_read(file, head, sizeof(wim_header));
+        if (grub_memcmp(head->signature, WIM_HEAD_SIGNATURE, sizeof(head->signature)))
+        {
+            debug("Not a valid wim file %s\n", (char *)head->signature);
+            grub_file_close(file);
+            continue;
+        }
+
+        if (head->flags & FLAG_HEADER_COMPRESS_LZMS)
+        {
+            debug("LZMS compress is not supported 0x%x\n", head->flags);
+            grub_file_close(file);
+            continue;
+        }
+
+        grub_file_close(file);
+        node->valid = 1;
+
+        vtoy_len_ssprintf(cmd, pos, len, "menuentry \"%s\" --class=\"sel_wim\"  {\n  echo \"\"\n}\n", node->path);
+    }
+
+    if (pos > 0)
+    {
+        g_ventoy_menu_esc = 1;
+        g_ventoy_suppress_esc = 1;
+        g_ventoy_suppress_esc_default = 0;
+
+        grub_snprintf(cfgfile, sizeof(cfgfile), "configfile mem:0x%llx:size:%d", (ulonglong)(ulong)cmd, pos);
+        grub_script_execute_sourcecode(cfgfile);   
+
+        g_ventoy_menu_esc = 0;
+        g_ventoy_suppress_esc = 0;
+        g_ventoy_suppress_esc_default = 1;
+
+        for (node = g_wim_patch_head; node; node = node->next)
+        {
+            if (node->valid)
+            {
+                if (i == g_ventoy_last_entry)
+                {
+                    grub_env_set("vtoy_pe_wim_path", node->path);
+                    break;
+                }
+                i++;
+            }
+        }
+    }
+
+    grub_free(cmd);
+    return 0;
+}
+
 grub_err_t ventoy_cmd_locate_wim_patch(grub_extcmd_context_t ctxt, int argc, char **args)
 {
     int datalen = 0;
@@ -1919,6 +2023,7 @@ out:
 grub_err_t ventoy_cmd_windows_wimboot_data(grub_extcmd_context_t ctxt, int argc, char **args)
 {
     int rc = 0;
+    int wim64 = 0;
     int datalen = 0;
     int dataflag = 0;
     grub_uint32_t exe_len = 0;
@@ -1957,6 +2062,7 @@ grub_err_t ventoy_cmd_windows_wimboot_data(grub_extcmd_context_t ctxt, int argc,
     {
         return 1;
     }
+    wim64 = ventoy_is_pe64(exe_data);
 
     grub_memset(&wim_data, 0, sizeof(wim_data));
     ventoy_cat_exe_file_data(&wim_data, exe_len, exe_data, datalen);
@@ -1979,6 +2085,7 @@ grub_err_t ventoy_cmd_windows_wimboot_data(grub_extcmd_context_t ctxt, int argc,
     debug("vtoy_wimboot_mem_size: %s\n", envbuf);
 
     grub_env_set(args[1], exename);
+    grub_env_set(args[2], wim64 ? "64" : "32");
 
     VENTOY_CMD_RETURN(GRUB_ERR_NONE);
 }
@@ -2020,7 +2127,10 @@ grub_err_t ventoy_cmd_windows_chain_data(grub_extcmd_context_t ctxt, int argc, c
     if (0 == ventoy_compatible && g_wim_valid_patch_count == 0)
     {
         unknown_image = 1;
-        debug("Warning: %s was not recognized by Ventoy\n", args[0]);
+        if (!g_ventoy_wimboot_mode)
+        {
+            debug("Warning: %s was not recognized by Ventoy\n", args[0]);            
+        }
     }
 
     file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s", args[0]);
@@ -2212,6 +2322,67 @@ static int ventoy_get_wim_chunklist(grub_file_t wimfile, ventoy_img_chunk_list *
     return 0;
 }
 
+grub_err_t ventoy_cmd_is_standard_winiso(grub_extcmd_context_t ctxt, int argc, char **args)
+{
+    int i;
+    int ret = 1;
+    char prefix[32] = {0};
+    const char *chkfile[] = 
+    {
+        "boot/bcd", "boot/boot.sdi", NULL
+    };
+
+    (void)ctxt;
+    (void)argc;
+
+    if (ventoy_check_file_exist("%s/sources/boot.wim", args[0]))
+    {
+        prefix[0] = 0;
+    }
+    else if (ventoy_check_file_exist("%s/x86/sources/boot.wim", args[0]))
+    {
+        grub_snprintf(prefix, sizeof(prefix), "/x86");
+    }
+    else if (ventoy_check_file_exist("%s/x64/sources/boot.wim", args[0]))
+    {
+        grub_snprintf(prefix, sizeof(prefix), "/x64");
+    }
+    else
+    {
+        debug("No boot.wim found.\n");
+        goto out;
+    }
+
+    for (i = 0; chkfile[i]; i++)
+    {
+        if (!ventoy_check_file_exist("%s%s/%s", args[0], prefix, chkfile[i]))
+        {
+            debug("%s not found.\n", chkfile[i]);
+            goto out;
+        }
+    }
+
+    if ((!ventoy_check_file_exist("%s%s/sources/install.wim", args[0], prefix)) && 
+        (!ventoy_check_file_exist("%s%s/sources/install.esd", args[0], prefix)))
+    {
+        debug("No install.wim(esd) found.\n");
+        goto out;
+    }
+
+    if (!ventoy_check_file_exist("%s/setup.exe", args[0]))
+    {
+        debug("No setup.exe found.\n");
+        goto out;
+    }
+
+    ret = 0;
+    debug("This is standard Windows ISO.\n");
+
+out:
+
+    return ret;
+}
+
 grub_err_t ventoy_cmd_wim_check_bootable(grub_extcmd_context_t ctxt, int argc, char **args)
 {
     grub_uint32_t boot_index;
index bd51912c00e8f3a9a83ba20e0a875cf35903e315..87afd08126cabf3ec2df79dd32b2c314689fcf80 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 print_usage() {
     echo 'Usage:  ExtendPersistentImg.sh file size'
@@ -19,6 +19,18 @@ if [ -z "$2" ]; then
     exit 1
 fi
 
+
+if [ "$1" = "__vbash__" ]; then
+    shift
+else
+    if readlink /bin/sh | grep -q bash; then
+        :
+    else
+        exec /bin/bash $0 "__vbash__" "$@"
+    fi
+fi
+
+
 file=$1
 size=$2
 
index b23218af62d8096a5f41caf5311a56a734e0bf60..5ded1863842dc1e68333e8817def5af6c9a403a9 100644 (file)
@@ -1,9 +1,9 @@
-#!/bin/sh
+#!/bin/bash
 
 . ./tool/ventoy_lib.sh
 
 print_usage() {    
-    echo 'Usage:  sudo sh VentoyPlugson.sh [OPTION] /dev/sdX'
+    echo 'Usage:  sudo bash VentoyPlugson.sh [OPTION] /dev/sdX'
     echo '  OPTION: (optional)'
     echo '   -H x.x.x.x  http server IP address (default is 127.0.0.1)'
     echo '   -P PORT     http server PORT (default is 24681)'
index 76ed0d567e5903ba8eaafd0f89c69c0c777400ea..f06ae066f3f81874cdf88ebc1142e04663f48a6a 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 print_usage() {    
     echo 'Usage:  VentoyWeb.sh [ OPTION ]'   
index b056d85838924f56ad585e2f98a1fcc078082e5a..a1238fb89f2b7e1c4b52aab8287d12991041ce68 100644 (file)
Binary files a/INSTALL/grub/arm64-efi/normal.mod and b/INSTALL/grub/arm64-efi/normal.mod differ
index a53de0a05af0b95f8e0c1d7e152f75656269b2df..8b5396fad14f9dde03757c2892a4fef7027a16c0 100644 (file)
@@ -599,33 +599,36 @@ function ventoy_unix_comm_proc {
 function uefi_windows_menu_func {
     vt_windows_reset
 
+    unset vt_cur_wimboot_mode
     if vt_check_mode 4 "$vt_chosen_name"; then
-        vt_windows_chain_data "${1}${chosen_path}"
-        ventoy_debug_pause
-        vtoy_wimboot_func
-    else
-        if [ "$ventoy_compatible" = "NO" ]; then   
-            
-            if [ "$ventoy_fs_probe" = "iso9660" ]; then
-                loopback -d loop
-                vt_iso9660_nojoliet 1            
-                loopback loop "$1$2"
-            fi
-            
-            for file in "efi/microsoft/boot/bcd"; do
-                vt_windows_collect_wim_patch bcd (loop)/$file                
-            done
+        set vt_cur_wimboot_mode=1
+    fi
 
-            vt_windows_count_wim_patch vt_wim_cnt
-            if [ $vt_wim_cnt -eq 0 ]; then
-                distro_specify_wim_patch_phase2
-            fi
-            
-            ventoy_debug_pause        
-            locate_wim "${chosen_path}"
+    if [ "$ventoy_compatible" = "NO" -o "$vt_cur_wimboot_mode" = "1" ]; then
+        if [ "$ventoy_fs_probe" = "iso9660" ]; then
+            loopback -d loop
+            vt_iso9660_nojoliet 1            
+            loopback loop "$1$2"
         fi
-        vt_windows_chain_data "${1}${chosen_path}"
-        ventoy_debug_pause
+        
+        for file in "efi/microsoft/boot/bcd"; do
+            vt_windows_collect_wim_patch bcd (loop)/$file                
+        done
+
+        vt_windows_count_wim_patch vt_wim_cnt
+        if [ $vt_wim_cnt -eq 0 ]; then
+            distro_specify_wim_patch_phase2
+        fi
+        
+        ventoy_debug_pause        
+        locate_wim "${chosen_path}"
+    fi
+    
+    vt_windows_chain_data "${1}${chosen_path}"
+    ventoy_debug_pause
+
+    if [ "$vt_cur_wimboot_mode" = "1" ]; then
+        vtoy_wimboot_func
     fi
 
     if [ -n "$vtoy_chain_mem_addr" ]; then
@@ -784,6 +787,10 @@ function uefi_linux_menu_func {
         unset vtGrub2Mode
         if vt_check_mode 3 "$vt_chosen_name"; then
             set vtGrub2Mode=1
+        elif vt_str_begin "$vt_volume_id" "HOLO_"; then
+            if [ -d (loop)/loader/entries ]; then
+                set vtGrub2Mode=1
+            fi
         elif vt_str_begin "$vt_volume_id" "KRD"; then
             if [ -f (loop)/boot/grub/grub.cfg.sig ]; then
                 set vtGrub2Mode=1
@@ -817,6 +824,18 @@ function uefi_linux_menu_func {
                 break
             fi
         done
+        if [ $vtback_cfg_find -eq 0 ]; then
+            if [ -f (loop)/loader/loader.conf -a -d (loop)/loader/entries ]; then
+                if vt_str_begin "$vt_volume_id" "HOLO_"; then
+                    set root=(loop,2)
+                    vt_systemd_menu (loop,2) vt_sys_menu_mem
+                else
+                    vt_systemd_menu (loop) vt_sys_menu_mem
+                fi
+                set vtback_cfg_find=1
+                configfile "mem:${vt_sys_menu_mem_addr}:size:${vt_sys_menu_mem_size}"
+            fi
+        fi
 
         if [ "$vtback_cfg_find" = "0" ]; then
             echo " "
@@ -913,6 +932,14 @@ function uefi_iso_menu_func {
         vt_check_compatible (loop)        
     fi
     
+    if vt_need_secondary_menu "$vt_chosen_name"; then
+        vt_show_secondary_menu "$vt_chosen_path" "$vtoy_os" $vt_chosen_size
+        if vt_check_mode 0 "$vt_chosen_name"; then
+            uefi_iso_memdisk $vtoy_iso_part  "$vt_chosen_path"
+            return
+        fi
+    fi
+    
     vt_img_sector "${1}${chosen_path}"
     
     if [ "$ventoy_fs_probe" = "iso9660" ]; then
@@ -964,17 +991,7 @@ function vtoy_windows_wimboot {
         echo vtoy_wimboot_prefix=$vtoy_wimboot_prefix vtoy_wimboot_bit=$vtoy_wimboot_bit vt_wimkernel=$vt_wimkernel
     fi
 
-    for wmfile in sources/boot.wim boot/bcd boot/boot.sdi; do
-        if [ ! -f $vtoy_wimboot_prefix/$wmfile ]; then
-            return
-        fi
-    done
-
-    if [ -f $vtoy_wimboot_prefix/sources/install.wim -o -f $vtoy_wimboot_prefix/sources/install.esd ]; then
-        vt_windows_wimboot_data "$vtoy_wimboot_prefix/sources/boot.wim" vtoy_init_exe
-    else
-        return
-    fi
+    vt_windows_wimboot_data "$vtoy_wimboot_prefix/sources/boot.wim" vtoy_init_exe vtoy_wim_bit
     
     if [ "$grub_platform" = "pc" ]; then
         linux16  "$vtoy_path/$vt_wimkernel"  quiet
@@ -1014,39 +1031,42 @@ function vtoy_windows_wimboot {
 }
 
 function vtoy_winpe_wimboot {
-    unset vtoy_boot_mgr_exe
-    unset vtoy_boot_mgr_efi
-    set vtoy_wimboot_prefix=(loop)
-    set vtoy_bcd_path="$1"
-    set vtoy_sdi_path="$2"
-    set vtoy_wim_path="$3"
-    set vtoy_mgr_flag="$4"
+    unset vtoy_boot_sdi_legacy
+    unset vtoy_boot_sdi_efi
+    
+    set vtoy_wimboot_prefix=(loop)    
+    set vtoy_wim_path="$1"
     
-    if [ $vtoy_mgr_flag -eq 1 ]; then
-        set vtoy_boot_mgr_exe="newc:bootmgr.exe:$vtoy_wimboot_prefix/$5"
-    elif [ $vtoy_mgr_flag -eq 2 ]; then
-        set vtoy_boot_mgr_efi="vf=bootmgr.efi:$vtoy_wimboot_prefix/$5"
-    elif [ $vtoy_mgr_flag -eq 3 ]; then
-        set vtoy_boot_mgr_exe="newc:bootmgr.exe:$vtoy_wimboot_prefix/$5"
-        set vtoy_boot_mgr_efi="vf=bootmgr.efi:$vtoy_wimboot_prefix/$6"
+    if [ -n "${vtdebug_flag}" ]; then
+        echo "winpe_wimboot $1 $2 $3"
+    fi
+    
+    if [ "$2" != "0" ]; then
+        set vtoy_boot_sdi_legacy="newc:boot.sdi:$vtoy_wimboot_prefix/$2"
+        set vtoy_boot_sdi_efi="vf=boot.sdi:$vtoy_wimboot_prefix/$2"
     fi
 
-    vt_windows_wimboot_data $vtoy_wimboot_prefix/$vtoy_wim_path vtoy_init_exe
+    vt_windows_wimboot_data $vtoy_wimboot_prefix/$vtoy_wim_path vtoy_init_exe vtoy_wim_bit
     
     if [ "$grub_platform" = "pc" ]; then
-        linux16  "$vtoy_path/$vt_wimkernel"  quiet
+        linux16  "$vtoy_path/$vt_wimkernel" quiet
         ventoy_debug_pause
 
-        vt_set_wim_load_prompt 1 "Loading files......"        
+        vt_set_wim_load_prompt 1 "Loading files......"         
         initrd16 newc:$vtoy_init_exe:mem:${vtoy_wimboot_mem_addr}:size:${vtoy_wimboot_mem_size} \
-             $vtoy_boot_mgr_exe \
-             newc:vtoy_wimboot:$vtoy_wimboot_prefix/$vtoy_bcd_path \
-             newc:bcd:$vtoy_wimboot_prefix/$vtoy_bcd_path \
-             newc:boot.sdi:$vtoy_wimboot_prefix/$vtoy_sdi_path \
+             newc:vtoy_wimboot:$vtoy_path/$vt_wimkernel \
+             newc:bootmgr.exe:mem:${vtoy_pe_bootmgr_mem_addr}:size:${vtoy_pe_bootmgr_mem_size} \
+             newc:bcd:mem:${vtoy_pe_bcd_mem_addr}:size:${vtoy_pe_bcd_mem_size} \
+             $vtoy_boot_sdi_legacy \
              newc:boot.wim:$vtoy_wimboot_prefix/$vtoy_wim_path
-        vt_set_wim_load_prompt 0
+        vt_set_wim_load_prompt 0        
         boot
     else
+        if [ "$VTOY_EFI_ARCH" = "x64" -a "$vtoy_wim_bit" = "32" ]; then
+            echo -e "\nThis is 32bit Windows and does NOT support x86_64 UEFI firmware.\n"
+            echo -e "这是32位的 Windows 系统,不支持当前的64位 UEFI 环境。\n"
+        fi
+
         vt_set_wim_load_prompt 1 "Loading files......"
         vt_load_file_to_mem "nodecompress" $vtoy_wimboot_prefix/$vtoy_wim_path vtoy_wimfile_mem
         vt_set_wim_load_prompt 0
@@ -1056,14 +1076,19 @@ function vtoy_winpe_wimboot {
         else
             set vtoy_wimfile_path=$vtoy_wimboot_prefix/$vtoy_wim_path
         fi
+        
+        unset vtoy_boot_efi_path
+        if [ -F (loop)/efi/boot/boot${VTOY_EFI_ARCH}.efi ]; then
+            set vtoy_boot_efi_path="vf=bootx64.efi:(loop)/efi/boot/boot${VTOY_EFI_ARCH}.efi"
+        fi
 
         ventoy_cli_console
         chainloader "$vtoy_path/$vt_wimkernel" quiet \
             "vf=$vtoy_init_exe:mem:${vtoy_wimboot_mem_addr}:size:${vtoy_wimboot_mem_size}" \
-            "vf=vtoy_wimboot:$vtoy_wimboot_prefix/$vtoy_bcd_path" \
-            "$vtoy_boot_mgr_efi" \
-            "vf=bcd:$vtoy_wimboot_prefix/$vtoy_bcd_path" \
-            "vf=boot.sdi:$vtoy_wimboot_prefix/$vtoy_sdi_path" \
+            "vf=vtoy_wimboot:$vtoy_path/$vt_wimkernel" \
+            "vf=bcd:mem:${vtoy_pe_bcd_mem_addr}:size:${vtoy_pe_bcd_mem_size}" \
+            "$vtoy_boot_sdi_efi" \
+            "$vtoy_boot_efi_path" \
             "vf=boot.wim:$vtoy_wimfile_path" \
             pfsize=$vtoy_chain_file_size  \
             pfread=$vtoy_chain_file_read
@@ -1073,8 +1098,6 @@ function vtoy_winpe_wimboot {
 }
 
 function vtoy_wimboot_func {
-    echo -e "\n===================== VENTOY WIMBOOT ===================\n"
-
     if [ "$grub_platform" = "pc" ]; then
         set vt_wimkernel=wimboot.x86_64.xz        
     else
@@ -1085,46 +1108,75 @@ function vtoy_wimboot_func {
         fi
     fi
 
-    if vt_str_begin "$vt_volume_id" "Modified-Win10PEx64"; then
-        vtoy_winpe_wimboot 'Boot/bcd' 'Boot/boot.sdi' 'sources/boot.wim' 1 'bootmgr.exe'
-    else
+    if vt_is_standard_winiso (loop); then
+        echo -e "\n==================== VENTOY WIMBOOT ==================\n"
         vtoy_windows_wimboot
+    else
+        vt_sel_winpe_wim (loop)
+        if [ -n "$vtoy_pe_wim_path" ]; then            
+            echo -e "\n==================== VENTOY WIMBOOT ==================\n"
+            
+            vt_fs_ignore_case 1
+            vt_load_file_to_mem "auto" $vtoy_path/common_bcd.xz vtoy_pe_bcd_mem
+            
+            set vt_sdi_path=0
+            for vsdi in "boot/boot.sdi" "2K10/FONTS/boot.sdi" "SSTR/boot.sdi" "ISPE/BOOT.SDI" \
+            "boot/uqi.sdi" "ISYL/boot.sdi" "WEPE/WEPE.SDI" ; do
+                if [ -F "(loop)/$vsdi" ]; then
+                    set vt_sdi_path=$vsdi
+                    break
+                fi
+            done
+            
+            if [ "$grub_platform" = "pc" ]; then
+                vt_load_file_to_mem "auto" $vtoy_path/common_bootmgr.xz vtoy_pe_bootmgr_mem
+                vtoy_winpe_wimboot "$vtoy_pe_wim_path" "$vt_sdi_path" 1
+            else
+                vtoy_winpe_wimboot "$vtoy_pe_wim_path" "$vt_sdi_path" 0
+            fi
+            
+            vt_fs_ignore_case 0
+        fi
     fi
 }
 
 function legacy_windows_menu_func {
     vt_windows_reset
     
+    unset vt_cur_wimboot_mode
     if vt_check_mode 4 "$vt_chosen_name"; then
-        vt_windows_chain_data "${1}${chosen_path}"
-        ventoy_debug_pause
-        vtoy_wimboot_func
-    else
-        if [ "$ventoy_compatible" = "NO" ]; then   
-            
-            if [ "$ventoy_fs_probe" = "iso9660" ]; then
-                loopback -d loop
-                vt_iso9660_nojoliet 1
-                loopback loop "$1$2"
-            fi
-            
-            for file in "boot/bcd" "/efi/microsoft/boot/bcd" "SSTR/BCD" "boot/bce"; do
-                vt_windows_collect_wim_patch bcd (loop)/$file                
-            done
-            
-            distro_specify_wim_patch
+        set vt_cur_wimboot_mode=1
+    fi
+    
+    if [ "$ventoy_compatible" = "NO" -o "$vt_cur_wimboot_mode" = "1" ]; then
+        if [ "$ventoy_fs_probe" = "iso9660" ]; then
+            loopback -d loop
+            vt_iso9660_nojoliet 1
+            loopback loop "$1$2"
+        fi
+        
+        for file in "boot/bcd" "/efi/microsoft/boot/bcd" "SSTR/BCD" "boot/bce"; do
+            vt_windows_collect_wim_patch bcd (loop)/$file                
+        done
+        
+        distro_specify_wim_patch
 
-            vt_windows_count_wim_patch vt_wim_cnt
-            if [ $vt_wim_cnt -eq 0 ]; then
-                distro_specify_wim_patch_phase2
-            fi
-            
-            ventoy_debug_pause        
-            locate_wim "${chosen_path}"
+        vt_windows_count_wim_patch vt_wim_cnt
+        if [ $vt_wim_cnt -eq 0 ]; then
+            distro_specify_wim_patch_phase2
         fi
         
-        vt_windows_chain_data "${1}${chosen_path}"
         ventoy_debug_pause
+        if [ -z "$vt_cur_wimboot_mode" ]; then
+            locate_wim "${chosen_path}"
+        fi
+    fi
+    
+    vt_windows_chain_data "${1}${chosen_path}"
+    ventoy_debug_pause
+    
+    if [ "$vt_cur_wimboot_mode" = "1" ]; then
+        vtoy_wimboot_func
     fi
 
     if [ -n "$vtoy_chain_mem_addr" ]; then
@@ -1206,10 +1258,19 @@ function legacy_linux_menu_func {
     ventoy_debug_pause
     
     if [ -n "$vtoy_chain_mem_addr" ]; then
+        unset vtGrub2Mode
         if vt_check_mode 3 "$vt_chosen_name"; then
+            set vtGrub2Mode=1
+        elif vt_str_begin "$vt_volume_id" "HOLO_"; then
+            if [ -d (loop)/loader/entries ]; then
+                set vtGrub2Mode=1
+            fi        
+        fi
+    
+        if [ -n "$vtGrub2Mode" ]; then
             ventoy_acpi_param ${vtoy_chain_mem_addr} 2048
             ventoy_cli_console
-        
+
             # fallback
             set vtback_root=$root        
             vt_push_last_entry
@@ -1228,6 +1289,18 @@ function legacy_linux_menu_func {
                     break
                 fi
             done
+            if [ $vtback_cfg_find -eq 0 ]; then
+                if [ -f (loop)/loader/loader.conf -a -d (loop)/loader/entries ]; then                    
+                    if vt_str_begin "$vt_volume_id" "HOLO_"; then
+                        set root=(loop,2)
+                        vt_systemd_menu (loop,2) vt_sys_menu_mem
+                    else
+                        vt_systemd_menu (loop) vt_sys_menu_mem
+                    fi
+                    set vtback_cfg_find=1  
+                    configfile "mem:${vt_sys_menu_mem_addr}:size:${vt_sys_menu_mem_size}"
+                fi
+            fi
 
             vt_unset_boot_opt
             set root=$vtback_root        
@@ -1291,6 +1364,14 @@ function legacy_iso_menu_func {
         vt_check_compatible (loop)
     fi
     
+    if vt_need_secondary_menu "$vt_chosen_name"; then
+        vt_show_secondary_menu "$vt_chosen_path" "$vtoy_os" $vt_chosen_size  
+        if vt_check_mode 0 "$vt_chosen_name"; then
+            legacy_iso_memdisk $vtoy_iso_part  "$vt_chosen_path"
+            return
+        fi        
+    fi
+
     vt_img_sector "${1}${chosen_path}"
 
     if [ "$ventoy_fs_probe" = "iso9660" ]; then
@@ -2222,7 +2303,7 @@ function img_unsupport_menuentry {
 #############################################################
 #############################################################
 
-set VENTOY_VERSION="1.0.79"
+set VENTOY_VERSION="1.0.80"
 
 #ACPI not compatible with Window7/8, so disable by default
 set VTOY_PARAM_NO_ACPI=1
@@ -2280,6 +2361,11 @@ if [ "$vtoy_dev" = "tftp" ]; then
     done
     loadfont ascii
 
+    if [ -n "$vtoy_efi_part" ]; then
+        vt_load_file_to_mem "auto" $vtoy_efi_part/grub/fonts/unicode.pf2 vtoy_font_mem
+        loadfont mem:${vtoy_font_mem_addr}:size:${vtoy_font_mem_size}
+    fi
+
     if [ -f $vtoy_iso_part/ventoy/ventoy.json ]; then
         set vt_plugin_path=$vtoy_iso_part
     else
index c647ca645309342b00720776d690714a95f5d774..abd1ca600f06f6261958decfc75985b3d847c8ae 100644 (file)
Binary files a/INSTALL/grub/i386-efi/normal.mod and b/INSTALL/grub/i386-efi/normal.mod differ
index 9d625d3d67b877e4096fb833e6d988e7c9d79cab..6a954a7e4466377e99037f069154a918440ae764 100644 (file)
Binary files a/INSTALL/grub/mips64el-efi/normal.mod and b/INSTALL/grub/mips64el-efi/normal.mod differ
index 853d51571f984479839b351f451a0d0952d4df1a..fa921eb50f5e84b97edee76fabeeca8cdf35d7d4 100644 (file)
Binary files a/INSTALL/grub/x86_64-efi/normal.mod and b/INSTALL/grub/x86_64-efi/normal.mod differ
diff --git a/INSTALL/ventoy/common_bcd.xz b/INSTALL/ventoy/common_bcd.xz
new file mode 100644 (file)
index 0000000..b81f6c2
Binary files /dev/null and b/INSTALL/ventoy/common_bcd.xz differ
diff --git a/INSTALL/ventoy/common_bootmgr.xz b/INSTALL/ventoy/common_bootmgr.xz
new file mode 100644 (file)
index 0000000..bdaa0ef
Binary files /dev/null and b/INSTALL/ventoy/common_bootmgr.xz differ
index 5a514ccc40974151a3c16e3c4e9798333f3fb627..5b9822327f15c50c8dda0abebdabadcbfb3651b9 100644 (file)
Binary files a/INSTALL/ventoy/ventoy.cpio and b/INSTALL/ventoy/ventoy.cpio differ
index 76f065c2874994fd228a983e2cdb9e17f9e58b0f..b8c680965415dcab954423d4096bafbcfec311ea 100644 (file)
Binary files a/INSTALL/ventoy/ventoy_arm64.cpio and b/INSTALL/ventoy/ventoy_arm64.cpio differ
index ed2edeb99bbda71900c6f586fd10c1068c0191ce..4cbeda6888f3d2fb08b59de7316f09b2ebe91a1d 100644 (file)
Binary files a/INSTALL/ventoy/ventoy_mips64.cpio and b/INSTALL/ventoy/ventoy_mips64.cpio differ
index 7131cab963c501a0e4291db0e683a3166bf59780..c4e6ed9ecb98c91e0283cec1ce5a0b6063afcf3a 100644 (file)
Binary files a/INSTALL/ventoy/ventoy_unix.cpio and b/INSTALL/ventoy/ventoy_unix.cpio differ
index 205854385dab408dbb43dbc5cde7ecd9320a0673..61a106bb3c39429405a84dbd03b957f44fe4dcd9 100644 (file)
Binary files a/INSTALL/ventoy/ventoy_x86.cpio and b/INSTALL/ventoy/ventoy_x86.cpio differ
index bc99e27da23ff6bf2d6d82336f810fd24f653b82..ccf0bf80b04176cec92b78284787d5d0d7aa0e50 100644 (file)
Binary files a/INSTALL/ventoy/vtloopex.cpio and b/INSTALL/ventoy/vtloopex.cpio differ
index 42abe44d1e81cbdd32f0205a758c893a5c9b2f53..ca8ca6b304d65cc213e22512aee1145c3fdaba8a 100644 (file)
Binary files a/INSTALL/ventoy/wimboot.i386.efi.xz and b/INSTALL/ventoy/wimboot.i386.efi.xz differ
index 3f628676a57cece329806edc521c1fc12786cbc2..66fc5562bc72da8aca91057a976610bb81888582 100644 (file)
Binary files a/INSTALL/ventoy/wimboot.x86_64.xz and b/INSTALL/ventoy/wimboot.x86_64.xz differ
index a84ac426fd440c8cb2ecbc39052bb6a36ba028ee..1fbc1c975db66c796e6bf74d97c708f330d10574 100644 (file)
@@ -486,9 +486,11 @@ void ventoy_data_default_control(data_control *data)
 {
     memset(data, 0, sizeof(data_control));
 
+    data->secondary_menu = 1;
     data->filter_dot_underscore = 1;
     data->max_search_level = -1;
     data->menu_timeout = 0;
+    data->secondary_menu_timeout = 0;
     
     strlcpy(data->default_kbd_layout, "QWERTY_USA");
     strlcpy(data->help_text_language, "en_US");
@@ -510,7 +512,9 @@ int ventoy_data_cmp_control(data_control *data1, data_control *data2)
         data1->filter_vtoy != data2->filter_vtoy ||
         data1->win11_bypass_check != data2->win11_bypass_check ||
         data1->linux_remount != data2->linux_remount ||
-        data1->menu_timeout != data2->menu_timeout)
+        data1->secondary_menu != data2->secondary_menu ||
+        data1->menu_timeout != data2->menu_timeout ||
+        data1->secondary_menu_timeout != data2->secondary_menu_timeout)
     {
         return 1;
     }
@@ -555,7 +559,9 @@ int ventoy_data_save_control(data_control *data, const char *title, char *buf, i
     VTOY_JSON_FMT_CTRL_INT(L2, "VTOY_FILE_FLT_VTOY", filter_vtoy);
     VTOY_JSON_FMT_CTRL_INT(L2, "VTOY_WIN11_BYPASS_CHECK",  win11_bypass_check);
     VTOY_JSON_FMT_CTRL_INT(L2, "VTOY_LINUX_REMOUNT",  linux_remount);
+    VTOY_JSON_FMT_CTRL_INT(L2, "VTOY_SECONDARY_BOOT_MENU",  secondary_menu);
     VTOY_JSON_FMT_CTRL_INT(L2, "VTOY_MENU_TIMEOUT",  menu_timeout);
+    VTOY_JSON_FMT_CTRL_INT(L2, "VTOY_SECONDARY_TIMEOUT",  secondary_menu_timeout);
 
     VTOY_JSON_FMT_CTRL_STRN(L2, "VTOY_DEFAULT_KBD_LAYOUT", default_kbd_layout);        
     VTOY_JSON_FMT_CTRL_STRN(L2, "VTOY_HELP_TXT_LANGUAGE", help_text_language);  
@@ -600,7 +606,9 @@ int ventoy_data_json_control(data_control *ctrl, char *buf, int buflen)
     VTOY_JSON_FMT_SINT("filter_vtoy", ctrl->filter_vtoy);
     VTOY_JSON_FMT_SINT("win11_bypass_check",  ctrl->win11_bypass_check);
     VTOY_JSON_FMT_SINT("linux_remount",  ctrl->linux_remount);
+    VTOY_JSON_FMT_SINT("secondary_menu",  ctrl->secondary_menu);
     VTOY_JSON_FMT_SINT("menu_timeout",  ctrl->menu_timeout);
+    VTOY_JSON_FMT_SINT("secondary_menu_timeout",  ctrl->secondary_menu_timeout);
     VTOY_JSON_FMT_STRN("default_kbd_layout",  ctrl->default_kbd_layout);
     VTOY_JSON_FMT_STRN("help_text_language",  ctrl->help_text_language);
 
@@ -666,7 +674,9 @@ static int ventoy_api_save_control(struct mg_connection *conn, VTOY_JSON *json)
     VTOY_JSON_INT("filter_vtoy", ctrl->filter_vtoy);
     VTOY_JSON_INT("win11_bypass_check", ctrl->win11_bypass_check);
     VTOY_JSON_INT("linux_remount", ctrl->linux_remount);
+    VTOY_JSON_INT("secondary_menu", ctrl->secondary_menu);
     VTOY_JSON_INT("menu_timeout", ctrl->menu_timeout);
+    VTOY_JSON_INT("secondary_menu_timeout", ctrl->secondary_menu_timeout);
 
     VTOY_JSON_STR("default_image", ctrl->default_image);
     VTOY_JSON_STR("default_search_root", ctrl->default_search_root);
@@ -3808,6 +3818,10 @@ static int ventoy_parse_control(VTOY_JSON *json, void *p)
             {
                 CONTROL_PARSE_INT(child, data->linux_remount);
             }
+            else if (strcmp(child->pcName, "VTOY_SECONDARY_BOOT_MENU") == 0)
+            {
+                CONTROL_PARSE_INT(child, data->secondary_menu);
+            }
             else if (strcmp(child->pcName, "VTOY_TREE_VIEW_MENU_STYLE") == 0)
             {
                 CONTROL_PARSE_INT(child, data->treeview_style);
@@ -3865,6 +3879,10 @@ static int ventoy_parse_control(VTOY_JSON *json, void *p)
             {
                 data->menu_timeout = (int)strtol(child->unData.pcStrVal, NULL, 10);
             }
+            else if (strcmp(child->pcName, "VTOY_SECONDARY_TIMEOUT") == 0)
+            {
+                data->secondary_menu_timeout = (int)strtol(child->unData.pcStrVal, NULL, 10);
+            }
             else if (strcmp(child->pcName, "VTOY_VHD_NO_WARNING") == 0)
             {
                 CONTROL_PARSE_INT(child, data->vhd_no_warning);
index 17b21bf0e9a2fc5ce4a8daae9c2062373c5fb312..18447c165a5ff69374c5f5dba6083f373284561e 100644 (file)
@@ -58,7 +58,9 @@ typedef struct data_control
     int filter_vtoy;
     int win11_bypass_check;
     int menu_timeout;
+    int secondary_menu_timeout;
     int linux_remount;
+    int secondary_menu;
     char default_search_root[MAX_PATH];
     char default_image[MAX_PATH];
     char default_kbd_layout[32];
index ed09c29e8ab87fd5e7c385df7ec911f60bb025af..1aa6483f3f7ecef92ba52022efd7102ddfa4ad8d 100644 (file)
Binary files a/Plugson/vs/VentoyPlugson/Release/VentoyPlugson.exe and b/Plugson/vs/VentoyPlugson/Release/VentoyPlugson.exe differ
index 89141bd2eca60c7b569a2190f24f9e624fb6cd1e..fb13048de0d0a3db299cd3eb3b45987ee3d981e1 100644 (file)
@@ -1 +1 @@
-20220430 13:06:42
\ No newline at end of file
+20220921 18:42:35
\ No newline at end of file
index 49ce8e6b521648e1eca309491b0e2857f8e51c5b..b0cdca85357f1822cfea732ea62c2f1b8bc160c8 100644 (file)
 \r
         <footer class="main-footer">\r
             <div class="pull-right hidden-xs">\r
-                <b id="plugson_build_date">20220430 13:06:42</b>
+                <b id="plugson_build_date">20220921 18:42:35</b>
             </div>\r
             <strong><a href="https://www.ventoy.net" target="_blank">https://www.ventoy.net</a></strong>\r
         </footer>\r
index 0d05fd94e68eee8b29bb93bb02ef981721309b72..2452ac7cfb0de7e02cbc3c380c5fb89f80d18fc4 100644 (file)
         </div><!-- /.box -->\r
 \r
 \r
+\r
+        <div class="box box-primary box-solid">\r
+            <div class="box-header with-border">\r
+              <h3 class="box-title" style="font-size: 14px;font-weight: bold;">VTOY_SECONDARY_BOOT_MENU\r
+                <span id="id_span_desc_cn"> —— 二级启动菜单显示开关</span></h3>\r
+              <div class="box-tools pull-right">\r
+                <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>\r
+              </div><!-- /.box-tools -->\r
+            </div><!-- /.box-header -->\r
+            <div class="box-body no-padding">\r
+                <table class="table table-bordered  no-padding">                    \r
+                    <tr style="font-weight:bold;">\r
+                      <td class="td_ctrl_col" id="td_title_setting">选项设置</td>\r
+                      <td>\r
+                        <label class="radio-inline">\r
+                            <input type="radio" id="id_ctrl_secondary_radio0" name="id_ctrl_secondary_radio" data-type="0" value="0"> <span style="font-weight:bold;">0</span>\r
+                        </label>&nbsp;&nbsp;&nbsp;&nbsp;\r
+                        <label class="radio-inline">\r
+                            <input type="radio" id="id_ctrl_secondary_radio1" name="id_ctrl_secondary_radio" data-type="1" value="1"> <span style="font-weight:bold;">1</span>\r
+                        </label>\r
+                      </td>\r
+                    </tr>\r
+                    <tr id="tr_title_desc_cn">\r
+                      <td class="td_ctrl_col" id="td_title_desc">选项说明</td>\r
+                      <td>二级启动菜单控制开关\r
+                        <code style="font-weight: bold;">0</code> 不显示 &nbsp;&nbsp; \r
+                        <code style="font-weight: bold;">1</code> 显示\r
+                      </td>\r
+                    </tr>\r
+                    <tr id="tr_title_desc_en">\r
+                      <td class="td_ctrl_col" id="td_title_desc">Option Description</td>\r
+                      <td>\r
+                      Secondary boot menu display option\r
+                      <code style="font-weight: bold;">0</code> Don't display &nbsp;&nbsp;&nbsp;\r
+                      <code style="font-weight: bold;">1</code> Display\r
+                      </td>\r
+                    </tr>\r
+                </table>\r
+            </div><!-- /.box-body -->\r
+        </div><!-- /.box -->\r
+        \r
+        <div class="box box-primary box-solid">\r
+            <div class="box-header with-border">\r
+              <h3 class="box-title" style="font-size: 14px;font-weight: bold;">VTOY_SECONDARY_TIMEOUT\r
+                <span id="id_span_desc_cn"> —— 二级启动菜单倒计时</span></h3>\r
+              <div class="box-tools pull-right">\r
+                <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>\r
+              </div><!-- /.box-tools -->\r
+            </div><!-- /.box-header -->\r
+            <div class="box-body no-padding">\r
+                <table class="table table-bordered  no-padding">\r
+                    <tr style="font-weight:bold;">\r
+                      <td class="td_ctrl_col" id="td_title_setting">选项设置</td>\r
+                      <td>\r
+                        <div class="col-sm-9" style="padding-left:0px;">\r
+                            <input type="text" class="form-control" id="id_ctrl_text_secondary_timeout" name="name_ctrl_text_secondary_timeout"/>\r
+                        </div>                       \r
+                      </td>\r
+                    </tr>\r
+                    <tr id="tr_title_desc_cn">\r
+                      <td class="td_ctrl_col">选项说明</td>\r
+                      <td>\r
+                        二级菜单倒计时(秒)。只有当 <code>VTOY_SECONDARY_BOOT_MENU</code> 设置为1时才有效。<br/>\r
+                        默认不设置,设置之后,比如设置为10,则在倒计时10秒之后,会自动选择第一项,即:<code>Boot in normal mode</code> <br/>\r
+                        在倒计时的过程中按任意键会停止倒计时,等待用户操作。\r
+                      </td>\r
+                    </tr>\r
+                    <tr id="tr_title_desc_en">\r
+                      <td class="td_ctrl_col">Option Description</td>\r
+                      <td>\r
+                        Timeout seconds for the secondary boot menu. Only take effect when <code>VTOY_SECONDARY_BOOT_MENU</code> is 1.<br/>\r
+                        By default no timeout is set. When you set it to 10 for example, the first entry (<code>Boot in normal mode</code>) will be selected an run after 10 seconds.\r
+                      </td>\r
+                    </tr>\r
+                </table>\r
+            </div><!-- /.box-body -->\r
+        </div><!-- /.box -->\r
+        \r
+    \r
     \r
     \r
         <div class="box box-primary box-solid">\r
             </div><!-- /.box-body -->\r
         </div><!-- /.box -->\r
 \r
-\r
+        \r
 \r
     </div>\r
    \r
 \r
     data.win11_bypass_check = parseInt($('input:radio[name=id_ctrl_bypass_win11_radio]:checked').val());\r
     data.linux_remount = parseInt($('input:radio[name=id_ctrl_linux_remount_radio]:checked').val());\r
+    data.secondary_menu = parseInt($('input:radio[name=id_ctrl_secondary_radio]:checked').val());\r
     data.default_search_root = $('input:text[id=id_ctrl_text_search_root]').val();\r
     data.menu_timeout = parseInt($('input:text[id=id_ctrl_text_timeout]').val());\r
+    data.secondary_menu_timeout = parseInt($('input:text[id=id_ctrl_text_secondary_timeout]').val());\r
     data.default_image = $('input:text[id=id_ctrl_text_default_img]').val();\r
     \r
     level = $('select[id=id_ctrl_sel_max_depth').val();\r
     //VTOY_WIN11_BYPASS_CHECK\r
     $('input:radio[name=id_ctrl_bypass_win11_radio]')[data.win11_bypass_check].checked = true;\r
     $('input:radio[name=id_ctrl_linux_remount_radio]')[data.linux_remount].checked = true;\r
+    $('input:radio[name=id_ctrl_secondary_radio]')[data.secondary_menu].checked = true;\r
 \r
     //VTOY_DEFAULT_SEARCH_ROOT\r
     $('input:text[id=id_ctrl_text_search_root]').val(data.default_search_root);\r
 \r
     //VTOY_MENU_TIMEOUT\r
     $('input:text[id=id_ctrl_text_timeout]').val(data.menu_timeout);\r
+    \r
+    //VTOY_SECONDARY_TIMEOUT\r
+    $('input:text[id=id_ctrl_text_secondary_timeout]').val(data.secondary_menu_timeout);\r
 \r
 \r
     //VTOY_DEFAULT_IMAGE\r
       index: current_tab_index,\r
       win11_bypass_check: data.win11_bypass_check,\r
       linux_remount:data.linux_remount,\r
+      secondary_menu:data.secondary_menu,\r
       default_search_root: data.default_search_root,\r
       menu_timeout: data.menu_timeout,\r
+      secondary_menu_timeout: data.secondary_menu_timeout,\r
       default_image: data.default_image,\r
       max_search_level: data.max_search_level,\r
       default_kbd_layout: data.default_kbd_layout,\r
       $('input:text[id=id_ctrl_text_timeout]').val(m_data_control[current_tab_index].menu_timeout);\r
     }\r
   });\r
+  $('input[id=id_ctrl_text_secondary_timeout]').change(function() {\r
+    var value = $('input:text[id=id_ctrl_text_secondary_timeout]').val();\r
+    if (/^[0-9][0-9]*$/.test(value)) {\r
+      VtoySaveCurrentPage();\r
+    } else {\r
+      Message.error(g_vtoy_cur_language.STR_INVALID_TIMEOUT);\r
+      $('input:text[id=id_ctrl_text_secondary_timeout]').val(m_data_control[current_tab_index].secondary_menu_timeout);\r
+    }\r
+  });\r
 \r
   $('#id_tab_control a[href="#tab_0"]').click(OnClickMultiModeTab);\r
   $('#id_tab_control a[href="#tab_1"]').click(OnClickMultiModeTab);\r
index 7ae3a10ba4f98b5ffcaf17f35b142ab42449396a..d28a0dde11641529edd8a37d77924e19b3724ef8 100644 (file)
--- a/README.md
+++ b/README.md
@@ -18,7 +18,7 @@ You can also browse ISO/WIM/IMG/VHD(x)/EFI files in local disk and boot them.<br
 x86 Legacy BIOS, IA32 UEFI, x86_64 UEFI, ARM64 UEFI and MIPS64EL UEFI are supported in the same way.<br/>
 Both MBR and GPT partition style are supported in the same way.<br/>
 Most type of OS supported(Windows/WinPE/Linux/Unix/ChromeOS/Vmware/Xen...) <br/>
-  940+ ISO files are tested (<a href="https://www.ventoy.net/en/isolist.html">List</a>). 90%+ distros in <a href="https://distrowatch.com/">distrowatch.com</a> supported (<a href="https://www.ventoy.net/en/distrowatch.html">Details</a>). <br/>
+  1000+ ISO files are tested (<a href="https://www.ventoy.net/en/isolist.html">List</a>). 90%+ distros in <a href="https://distrowatch.com/">distrowatch.com</a> supported (<a href="https://www.ventoy.net/en/distrowatch.html">Details</a>). <br/>
 <br/>Official Website: <a href=https://www.ventoy.net>https://www.ventoy.net</a>
 </h4>
 
@@ -27,7 +27,7 @@ Most type of OS supported(Windows/WinPE/Linux/Unix/ChromeOS/Vmware/Xen...) <br/>
 Windows 7, Windows 8, Windows 8.1, Windows 10, Windows 11, Windows Server 2012, Windows Server 2012 R2, Windows Server 2016, Windows Server 2019, Windows Server 2022, WinPE
 
 **Linux**  
-Debian, Ubuntu, CentOS(6/7/8/9), RHEL(6/7/8/9), Deepin, Fedora, EuroLinux(6/7/8/9), Rocky Linux, AlmaLinux, openEuler, OpenAnolis, SLES, openSUSE, MX Linux, Manjaro, Linux Mint, Endless OS, Elementary OS, Solus, Linx, Zorin, antiX, PClinuxOS, Arch, ArcoLinux, ArchLabs, BlackArch, Obarun, Artix Linux, Puppy Linux, Tails, Slax, Kali, Mageia, Slackware, Q4OS, Archman, Gentoo, Pentoo, NixOS, Kylin, openKylin, Ubuntu Kylin, Lubuntu, Xubuntu, Kubuntu, Ubuntu MATE, Ubuntu Budgie, Ubuntu Studio, Bluestar, OpenMandriva, ExTiX, Netrunner, ALT Linux, Nitrux, Peppermint, KDE neon, Linux Lite, Parrot OS, Qubes, Pop OS, ROSA, Void Linux, Star Linux, EndeavourOS, MakuluLinux, Voyager, Feren, ArchBang, LXLE, Knoppix, Calculate Linux, Clear Linux, Pure OS, Oracle Linux, Trident, Septor, Porteus, Devuan, GoboLinux, 4MLinux, Simplicity Linux, Zeroshell, Android-x86, netboot.xyz, Slitaz, SuperGrub2Disk, Proxmox VE, Kaspersky Rescue, SystemRescueCD, MemTest86, MemTest86+, MiniTool Partition Wizard, Parted Magic, veket, Sabayon, Scientific, alpine, ClearOS, CloneZilla, Berry Linux, Trisquel, Ataraxia Linux, Minimal Linux Live, BackBox Linux, Emmabuntüs, ESET SysRescue Live,Nova Linux, AV Linux, RoboLinux, NuTyX, IPFire, SELKS, ZStack, Enso Linux, Security Onion, Network Security Toolkit, Absolute Linux, TinyCore, Springdale Linux, Frost Linux, Shark Linux, LinuxFX, Snail Linux, Astra Linux, Namib Linux, Resilient Linux, Virage Linux, Blackweb Security OS, R-DriveImage, O-O.DiskImage, Macrium, ToOpPy LINUX, GNU Guix, YunoHost, foxclone, siduction, Adelie Linux, Elive, Pardus, CDlinux, AcademiX, Austrumi, Zenwalk, Anarchy, DuZeru, BigLinux, OpenMediaVault, Ubuntu DP, Exe GNU/Linux, 3CX Phone System, KANOTIX, Grml, Karoshi, PrimTux, ArchStrike, CAELinux, Cucumber, Fatdog, ForLEx, Hanthana, Kwort, MiniNo, Redcore, Runtu, Asianux, Clu Linux Live, Uruk, OB2D, BlueOnyx, Finnix, HamoniKR, Parabola, LinHES, LinuxConsole, BEE free, Untangle, Pearl, Thinstation, TurnKey, tuxtrans, Neptune, HefftorLinux, GeckoLinux, Mabox Linux, Zentyal, Maui, Reborn OS, SereneLinux , SkyWave Linux, Kaisen Linux, Regata OS, TROM-Jaro, DRBL Linux, Chalet OS, Chapeau, Desa OS, BlankOn, OpenMamba, Frugalware, Kibojoe Linux, Revenge OS, Tsurugi Linux, Drauger OS, Hash Linux, gNewSense, Ikki Boot, SteamOS, Hyperbola, VyOS, EasyNAS, SuperGamer, Live Raizo, Swift Linux, RebeccaBlackOS, Daphile, CRUX, Univention, Ufficio Zero, Rescuezilla, Phoenix OS, Garuda Linux, Mll, NethServer, OSGeoLive, Easy OS, Volumio, FreedomBox, paldo, UBOS, Recalbox, batocera, Lakka, LibreELEC, Pardus Topluluk, Pinguy, KolibriOS, Elastix, Arya, Omoikane, Omarine, Endian Firewall, Hamara, Rocks Cluster, MorpheusArch, Redo, Slackel, SME Server, APODIO, Smoothwall, Dragora, Linspire, Secure-K OS, Peach OSI, Photon, Plamo, SuperX, Bicom, Ploplinux, HP SPP, LliureX, Freespire, DietPi, BOSS, Webconverger, Lunar, TENS, Source Mage, RancherOS, T2, Vine, Pisi, blackPanther, mAid, Acronis, Active.Boot, AOMEI, Boot.Repair, CAINE, DaRT, EasyUEFI, R-Drive, PrimeOS, Avira Rescue System, bitdefender, Checkra1n Linux, Lenovo Diagnostics, Clover, Bliss-OS, Lenovo BIOS Update, Arcabit Rescue Disk, MiyoLinux, TeLOS, Kerio Control, RED OS, OpenWrt, MocaccinoOS, EasyStartup, Pyabr, Refracta, Eset SysRescue, Linpack Xtreme, Archcraft, NHVBOOT, pearOS, SeaTools, Easy Recovery Essentional, iKuai, StorageCraft SCRE, ZFSBootMenu, TROMjaro, BunsenLabs, Todo en Uno, ......
+Debian, Ubuntu, CentOS(6/7/8/9), RHEL(6/7/8/9), Deepin, Fedora, EuroLinux(6/7/8/9), Rocky Linux, AlmaLinux, openEuler, OpenAnolis, SLES, openSUSE, MX Linux, Manjaro, Linux Mint, Endless OS, Elementary OS, Solus, Linx, Zorin, antiX, PClinuxOS, Arch, ArcoLinux, ArchLabs, BlackArch, Obarun, Artix Linux, Puppy Linux, Tails, Slax, Kali, Mageia, Slackware, Q4OS, Archman, Gentoo, Pentoo, NixOS, Kylin, openKylin, Ubuntu Kylin, Lubuntu, Xubuntu, Kubuntu, Ubuntu MATE, Ubuntu Budgie, Ubuntu Studio, Bluestar, OpenMandriva, ExTiX, Netrunner, ALT Linux, Nitrux, Peppermint, KDE neon, Linux Lite, Parrot OS, Qubes, Pop OS, ROSA, Void Linux, Star Linux, EndeavourOS, MakuluLinux, Voyager, Feren, ArchBang, LXLE, Knoppix, Calculate Linux, Clear Linux, Pure OS, Oracle Linux, Trident, Septor, Porteus, Devuan, GoboLinux, 4MLinux, Simplicity Linux, Zeroshell, Android-x86, netboot.xyz, Slitaz, SuperGrub2Disk, Proxmox VE, Kaspersky Rescue, SystemRescueCD, MemTest86, MemTest86+, MiniTool Partition Wizard, Parted Magic, veket, Sabayon, Scientific, alpine, ClearOS, CloneZilla, Berry Linux, Trisquel, Ataraxia Linux, Minimal Linux Live, BackBox Linux, Emmabuntüs, ESET SysRescue Live,Nova Linux, AV Linux, RoboLinux, NuTyX, IPFire, SELKS, ZStack, Enso Linux, Security Onion, Network Security Toolkit, Absolute Linux, TinyCore, Springdale Linux, Frost Linux, Shark Linux, LinuxFX, Snail Linux, Astra Linux, Namib Linux, Resilient Linux, Virage Linux, Blackweb Security OS, R-DriveImage, O-O.DiskImage, Macrium, ToOpPy LINUX, GNU Guix, YunoHost, foxclone, siduction, Adelie Linux, Elive, Pardus, CDlinux, AcademiX, Austrumi, Zenwalk, Anarchy, DuZeru, BigLinux, OpenMediaVault, Ubuntu DP, Exe GNU/Linux, 3CX Phone System, KANOTIX, Grml, Karoshi, PrimTux, ArchStrike, CAELinux, Cucumber, Fatdog, ForLEx, Hanthana, Kwort, MiniNo, Redcore, Runtu, Asianux, Clu Linux Live, Uruk, OB2D, BlueOnyx, Finnix, HamoniKR, Parabola, LinHES, LinuxConsole, BEE free, Untangle, Pearl, Thinstation, TurnKey, tuxtrans, Neptune, HefftorLinux, GeckoLinux, Mabox Linux, Zentyal, Maui, Reborn OS, SereneLinux , SkyWave Linux, Kaisen Linux, Regata OS, TROM-Jaro, DRBL Linux, Chalet OS, Chapeau, Desa OS, BlankOn, OpenMamba, Frugalware, Kibojoe Linux, Revenge OS, Tsurugi Linux, Drauger OS, Hash Linux, gNewSense, Ikki Boot, SteamOS, Hyperbola, VyOS, EasyNAS, SuperGamer, Live Raizo, Swift Linux, RebeccaBlackOS, Daphile, CRUX, Univention, Ufficio Zero, Rescuezilla, Phoenix OS, Garuda Linux, Mll, NethServer, OSGeoLive, Easy OS, Volumio, FreedomBox, paldo, UBOS, Recalbox, batocera, Lakka, LibreELEC, Pardus Topluluk, Pinguy, KolibriOS, Elastix, Arya, Omoikane, Omarine, Endian Firewall, Hamara, Rocks Cluster, MorpheusArch, Redo, Slackel, SME Server, APODIO, Smoothwall, Dragora, Linspire, Secure-K OS, Peach OSI, Photon, Plamo, SuperX, Bicom, Ploplinux, HP SPP, LliureX, Freespire, DietPi, BOSS, Webconverger, Lunar, TENS, Source Mage, RancherOS, T2, Vine, Pisi, blackPanther, mAid, Acronis, Active.Boot, AOMEI, Boot.Repair, CAINE, DaRT, EasyUEFI, R-Drive, PrimeOS, Avira Rescue System, bitdefender, Checkra1n Linux, Lenovo Diagnostics, Clover, Bliss-OS, Lenovo BIOS Update, Arcabit Rescue Disk, MiyoLinux, TeLOS, Kerio Control, RED OS, OpenWrt, MocaccinoOS, EasyStartup, Pyabr, Refracta, Eset SysRescue, Linpack Xtreme, Archcraft, NHVBOOT, pearOS, SeaTools, Easy Recovery Essentional, iKuai, StorageCraft SCRE, ZFSBootMenu, TROMjaro, BunsenLabs, Todo en Uno, ChallengerOS, Nobara, Holo, ......
 
 **Unix**  
 DragonFly FreeBSD pfSense GhostBSD FreeNAS TrueNAS XigmaNAS FuryBSD OPNsense HardenedBSD MidnightBSD ClonOS EmergencyBootKit
@@ -70,7 +70,7 @@ A GUI Ventoy plugin configurator. [VentoyPlugson](https://www.ventoy.net/en/plug
 * FAT32/exFAT/NTFS/UDF/XFS/Ext2(3)(4) supported for main partition
 * ISO files larger than 4GB supported
 * Native boot menu style for Legacy & UEFI
-* Most types of OS supported, 940+ iso files tested
+* Most types of OS supported, 1000+ iso files tested
 * Linux vDisk boot supported
 * Not only boot but also complete installation process
 * Menu dynamically switchable between List/TreeView mode
index 614305ca914755906fa63043fe86641287b1625f..3ccfa9e064f1b84db0885e31364dcea264ad128b 100644 (file)
@@ -32,6 +32,7 @@
 #include "wimboot.h"
 #include "vdisk.h"
 #include "lzx.h"
+#include "xca.h"
 #include "wim.h"
 
 /** WIM chunk buffer */
@@ -180,6 +181,8 @@ static int wim_chunk ( struct vdisk_file *file, struct wim_header *header,
                /* Identify decompressor */
                if ( header->flags & WIM_HDR_LZX ) {
                        decompress = lzx_decompress;
+        } else if (header->flags & WIM_HDR_XPRESS) {
+            decompress = xca_decompress;
                } else {
                        DBG ( "Can't handle unknown compression scheme %#08x "
                              "for %#llx chunk %d at [%#llx+%#llx)\n",
@@ -447,8 +450,10 @@ int wim_path ( struct vdisk_file *file, struct wim_header *header,
                return rc;
 
        /* Get root directory offset */
-       direntry->subdir = ( ( security.len + sizeof ( uint64_t ) - 1 ) &
-                            ~( sizeof ( uint64_t ) - 1 ) );
+    if (security.len > 0)
+       direntry->subdir = ( ( security.len + sizeof ( uint64_t ) - 1 ) & ~( sizeof ( uint64_t ) - 1 ) );
+    else
+        direntry->subdir = security.len + 8;
 
        /* Find directory entry */
        name = memcpy ( path_copy, path, sizeof ( path_copy ) );
index 52a691aab00520345531f0334401937f4f48c649..aaa030b14060114e02d5e690f94a4881bb032afb 100644 (file)
@@ -42,7 +42,7 @@
  */
 ssize_t xca_decompress ( const void *data, size_t len, void *buf ) {
        const void *src = data;
-       const void *end = ( src + len );
+       const void *end = ( uint8_t * ) src + len;
        uint8_t *out = buf;
        size_t out_len = 0;
        size_t out_len_threshold = 0;
@@ -67,11 +67,9 @@ ssize_t xca_decompress ( const void *data, size_t len, void *buf ) {
 
                        /* Construct symbol lengths */
                        lengths = src;
-                       src += sizeof ( *lengths );
+                       src = ( uint8_t * ) src + sizeof ( *lengths );
                        if ( src > end ) {
-                               DBG ( "XCA too short to hold Huffman lengths "
-                                     "table at input offset %#zx\n",
-                                     ( src - data ) );
+                               DBG ( "XCA too short to hold Huffman lengths table.\n");
                                return -1;
                        }
                        for ( raw = 0 ; raw < XCA_CODES ; raw++ )
@@ -113,7 +111,7 @@ ssize_t xca_decompress ( const void *data, size_t len, void *buf ) {
                        out_len++;
 
                } else if ( ( raw == XCA_END_MARKER ) &&
-                           ( src >= ( end - 1 ) ) ) {
+                           ( (uint8_t *) src >= ( ( uint8_t * ) end - 1 ) ) ) {
 
                        /* End marker symbol */
                        return out_len;
@@ -157,6 +155,5 @@ ssize_t xca_decompress ( const void *data, size_t len, void *buf ) {
                }
        }
 
-       DBG ( "XCA input overrun at output length %#zx\n", out_len );
-       return -1;
+       return out_len;
 }