]> glassweightruler.freedombox.rocks Git - Ventoy.git/commitdiff
1.0.09 release v1.0.09
authorlongpanda <admin@ventoy.net>
Sat, 9 May 2020 14:15:06 +0000 (22:15 +0800)
committerlongpanda <admin@ventoy.net>
Sat, 9 May 2020 14:15:14 +0000 (22:15 +0800)
36 files changed:
GRUB2/grub-2.04/grub-core/ventoy/ventoy.c
GRUB2/grub-2.04/grub-core/ventoy/ventoy_def.h
GRUB2/grub-2.04/grub-core/ventoy/ventoy_linux.c
GRUB2/grub-2.04/grub-core/ventoy/ventoy_plugin.c
GRUB2/grub-2.04/grub-core/ventoy/ventoy_windows.c
GRUB2/grub-2.04/include/grub/ventoy.h
IMG/cpio/ventoy/hook/arch/ventoy-disk.sh [new file with mode: 0644]
IMG/cpio/ventoy/hook/arch/ventoy-hook.sh
IMG/cpio/ventoy/hook/debian/default-hook.sh
IMG/cpio/ventoy/hook/gobo/ventoy-hook.sh [new file with mode: 0644]
IMG/cpio/ventoy/hook/gobo/ventoy-inotifyd-hook.sh [new file with mode: 0644]
IMG/cpio/ventoy/hook/gobo/ventoy-inotifyd-start.sh [new file with mode: 0644]
IMG/cpio/ventoy/hook/guix/ventoy-disk.sh [new file with mode: 0644]
IMG/cpio/ventoy/hook/guix/ventoy-hook.sh [new file with mode: 0644]
IMG/cpio/ventoy/hook/guix/ventoy-waitdev.sh [new file with mode: 0644]
IMG/cpio/ventoy/hook/nutyx/ventoy-disk.sh [new file with mode: 0644]
IMG/cpio/ventoy/hook/nutyx/ventoy-hook.sh [new file with mode: 0644]
IMG/cpio/ventoy/hook/rhel7/ventoy-hook.sh
IMG/cpio/ventoy/hook/rhel7/ventoy-inotifyd-hook.sh
IMG/cpio/ventoy/hook/rhel7/ventoy-timeout.sh [new file with mode: 0644]
IMG/cpio/ventoy/hook/suse/ventoy-hook.sh
IMG/cpio/ventoy/ventoy.sh
INSTALL/EFI/BOOT/grubx64_real.efi
INSTALL/Ventoy2Disk.exe
INSTALL/grub/grub.cfg
INSTALL/grub/i386-pc/core.img
INSTALL/ventoy/ventoy.cpio
INSTALL/ventoy/vtoyjump32.exe
INSTALL/ventoy/vtoyjump64.exe
LANGUAGES/languages.ini
Ventoy2Disk/Ventoy2Disk/Language.c
Ventoy2Disk/Ventoy2Disk/Language.h
Ventoy2Disk/Ventoy2Disk/PhyDrive.c
Ventoy2Disk/Ventoy2Disk/WinDialog.c
vtoyjump/vtoyjump/vtoyjump.c
vtoyjump/vtoyjump/vtoyjump.h

index 97b349032e07af8cb62d1bf8153541cfbeb94a14..459464d1bcd3491e5c13a14fbb10795c87d8632a 100644 (file)
@@ -1358,6 +1358,17 @@ static grub_err_t ventoy_cmd_dump_menu(grub_extcmd_context_t ctxt, int argc, cha
     return 0;
 }
 
     return 0;
 }
 
+static grub_err_t ventoy_cmd_dump_auto_install(grub_extcmd_context_t ctxt, int argc, char **args)
+{
+    (void)ctxt;
+    (void)argc;
+    (void)args;
+
+    ventoy_plugin_dump_auto_install();
+
+    return 0;
+}
+
 static grub_err_t ventoy_cmd_check_mode(grub_extcmd_context_t ctxt, int argc, char **args)
 {
     (void)ctxt;
 static grub_err_t ventoy_cmd_check_mode(grub_extcmd_context_t ctxt, int argc, char **args)
 {
     (void)ctxt;
@@ -1387,22 +1398,58 @@ static grub_err_t ventoy_cmd_check_mode(grub_extcmd_context_t ctxt, int argc, ch
 
 static grub_err_t ventoy_cmd_dynamic_menu(grub_extcmd_context_t ctxt, int argc, char **args)
 {
 
 static grub_err_t ventoy_cmd_dynamic_menu(grub_extcmd_context_t ctxt, int argc, char **args)
 {
+    static int configfile_mode = 0;
     char memfile[128] = {0};
     
     (void)ctxt;
     (void)argc;
     (void)args;
 
     char memfile[128] = {0};
     
     (void)ctxt;
     (void)argc;
     (void)args;
 
-    if (argc == 0)
+    /* 
+     * args[0]:  0:normal     1:configfile
+     * args[1]:  0:list_buf   1:tree_buf
+     */
+
+    if (argc != 2)
+    {
+        debug("Invlaid argc %d\n", argc);
+        return 0;
+    }    
+
+    if (args[0][0] == '0')
     {
     {
-        grub_script_execute_sourcecode(g_list_script_buf);
+        if (args[1][0] == '0')
+        {
+            grub_script_execute_sourcecode(g_list_script_buf);            
+        }
+        else
+        {
+            grub_script_execute_sourcecode(g_tree_script_buf); 
+        }
     }
     else
     {
     }
     else
     {
-        g_ventoy_last_entry = -1;
-        grub_snprintf(memfile, sizeof(memfile), "configfile mem:0x%llx:size:%d", 
-            (ulonglong)(ulong)g_tree_script_buf, g_tree_script_pos); 
+        if (configfile_mode)
+        {
+            debug("Now already in F3 mode %d\n", configfile_mode);
+            return 0;
+        }
+
+        if (args[1][0] == '0')
+        {
+            grub_snprintf(memfile, sizeof(memfile), "configfile mem:0x%llx:size:%d", 
+                (ulonglong)(ulong)g_list_script_buf, g_list_script_pos);
+        }
+        else
+        {
+             g_ventoy_last_entry = -1;
+            grub_snprintf(memfile, sizeof(memfile), "configfile mem:0x%llx:size:%d", 
+                (ulonglong)(ulong)g_tree_script_buf, g_tree_script_pos); 
+        }
+
+        configfile_mode = 1;
         grub_script_execute_sourcecode(memfile);
         grub_script_execute_sourcecode(memfile);
+        configfile_mode = 0;
     }
     
     return 0;
     }
     
     return 0;
@@ -1567,6 +1614,7 @@ static cmd_para ventoy_cmds[] =
     { "vt_dump_menu", ventoy_cmd_dump_menu, 0, NULL, "", "", NULL },
     { "vt_dynamic_menu", ventoy_cmd_dynamic_menu, 0, NULL, "", "", NULL },
     { "vt_check_mode", ventoy_cmd_check_mode, 0, NULL, "", "", NULL },
     { "vt_dump_menu", ventoy_cmd_dump_menu, 0, NULL, "", "", NULL },
     { "vt_dynamic_menu", ventoy_cmd_dynamic_menu, 0, NULL, "", "", NULL },
     { "vt_check_mode", ventoy_cmd_check_mode, 0, NULL, "", "", NULL },
+    { "vt_dump_auto_install", ventoy_cmd_dump_auto_install, 0, NULL, "", "", NULL },
 
     { "vt_is_udf", ventoy_cmd_is_udf, 0, NULL, "", "", NULL },
     { "vt_file_size", ventoy_cmd_file_size, 0, NULL, "", "", NULL },
 
     { "vt_is_udf", ventoy_cmd_is_udf, 0, NULL, "", "", NULL },
     { "vt_file_size", ventoy_cmd_file_size, 0, NULL, "", "", NULL },
index 27a315131bb21aa220563ceac1cfe9f452dc6b45..085fd1e8ba6722f90928447ee9e4feec447395d3 100644 (file)
@@ -418,7 +418,7 @@ grub_err_t ventoy_cmd_linux_locate_initrd(grub_extcmd_context_t ctxt, int argc,
 grub_err_t ventoy_cmd_initrd_count(grub_extcmd_context_t ctxt, int argc, char **args);
 grub_err_t ventoy_cmd_valid_initrd_count(grub_extcmd_context_t ctxt, int argc, char **args);
 grub_err_t ventoy_cmd_load_cpio(grub_extcmd_context_t ctxt, int argc, char **args);
 grub_err_t ventoy_cmd_initrd_count(grub_extcmd_context_t ctxt, int argc, char **args);
 grub_err_t ventoy_cmd_valid_initrd_count(grub_extcmd_context_t ctxt, int argc, char **args);
 grub_err_t ventoy_cmd_load_cpio(grub_extcmd_context_t ctxt, int argc, char **args);
-int ventoy_cpio_newc_fill_head(void *buf, int filesize, void *filedata, const char *name);
+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, ...);
 int ventoy_is_file_exist(const char *fmt, ...);
 int ventoy_fill_data(grub_uint32_t buflen, char *buffer);
 grub_file_t ventoy_grub_file_open(enum grub_file_type type, const char *fmt, ...);
 int ventoy_is_file_exist(const char *fmt, ...);
 int ventoy_fill_data(grub_uint32_t buflen, char *buffer);
@@ -550,6 +550,15 @@ typedef struct ventoy_mbr_head
 }ventoy_mbr_head;
 #pragma pack()
 
 }ventoy_mbr_head;
 #pragma pack()
 
+
+typedef struct install_template
+{
+    char isopath[256];
+    char templatepath[256];
+
+    struct install_template *next;
+}install_template;
+
 extern int g_ventoy_last_entry;
 extern int g_ventoy_memdisk_mode;
 extern int g_ventoy_iso_raw;
 extern int g_ventoy_last_entry;
 extern int g_ventoy_memdisk_mode;
 extern int g_ventoy_iso_raw;
@@ -557,6 +566,10 @@ extern int g_ventoy_iso_uefi_drv;
 
 int ventoy_cmp_img(img_info *img1, img_info *img2);
 void ventoy_swap_img(img_info *img1, img_info *img2);
 
 int ventoy_cmp_img(img_info *img1, img_info *img2);
 void ventoy_swap_img(img_info *img1, img_info *img2);
+char * ventoy_plugin_get_install_template(const char *isopath);
+void ventoy_plugin_dump_auto_install(void);
+int ventoy_fill_windows_rtdata(void *buf, char *isopath);
+
 
 #endif /* __VENTOY_DEF_H__ */
 
 
 #endif /* __VENTOY_DEF_H__ */
 
index 798f5b16dc6448f7c26294da002e6607c18cbce8..06cd046e56f5fbc4c3360f1bea2125f1ab5e1c69 100644 (file)
@@ -588,7 +588,7 @@ static void ventoy_cpio_newc_fill_int(grub_uint32_t value, char *buf, int buflen
     }
 }
 
     }
 }
 
-int ventoy_cpio_newc_fill_head(void *buf, int filesize, void *filedata, const char *name)
+int ventoy_cpio_newc_fill_head(void *buf, int filesize, const void *filedata, const char *name)
 {
     int namelen = 0;
     int headlen = 0;
 {
     int namelen = 0;
     int headlen = 0;
@@ -852,18 +852,22 @@ grub_err_t ventoy_cmd_linux_locate_initrd(grub_extcmd_context_t ctxt, int argc,
 
 grub_err_t ventoy_cmd_load_cpio(grub_extcmd_context_t ctxt, int argc, char **args)
 {
 
 grub_err_t ventoy_cmd_load_cpio(grub_extcmd_context_t ctxt, int argc, char **args)
 {
-    grub_uint8_t *buf;
+    char *template_file = NULL;
+    char *template_buf = NULL;
+    grub_uint8_t *buf = NULL;
     grub_uint32_t mod;
     grub_uint32_t headlen;
     grub_uint32_t initrd_head_len;
     grub_uint32_t padlen;
     grub_uint32_t img_chunk_size;
     grub_uint32_t mod;
     grub_uint32_t headlen;
     grub_uint32_t initrd_head_len;
     grub_uint32_t padlen;
     grub_uint32_t img_chunk_size;
+    grub_uint32_t template_size = 0;
     grub_file_t file;
     grub_file_t file;
+    grub_file_t scriptfile;
         
     (void)ctxt;
     (void)argc;
 
         
     (void)ctxt;
     (void)argc;
 
-    if (argc != 1)
+    if (argc != 3)
     {
         return grub_error(GRUB_ERR_BAD_ARGUMENT, "Usage: %s cpiofile\n", cmd_raw_name); 
     }
     {
         return grub_error(GRUB_ERR_BAD_ARGUMENT, "Usage: %s cpiofile\n", cmd_raw_name); 
     }
@@ -888,7 +892,30 @@ grub_err_t ventoy_cmd_load_cpio(grub_extcmd_context_t ctxt, int argc, char **arg
         g_ventoy_cpio_size = 0;
     }
 
         g_ventoy_cpio_size = 0;
     }
 
-    g_ventoy_cpio_buf = grub_malloc(file->size + 4096 + img_chunk_size);
+    template_file = ventoy_plugin_get_install_template(args[1]);
+    if (template_file)
+    {
+        debug("auto install template: <%s>\n", template_file);
+        scriptfile = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s%s", args[2], template_file);
+        if (scriptfile)
+        {
+            debug("auto install script size %d\n", (int)scriptfile->size);
+            template_size = scriptfile->size;
+            template_buf = grub_malloc(template_size);
+            if (template_buf)
+            {
+                grub_file_read(scriptfile, template_buf, template_size);
+            }
+
+            grub_file_close(scriptfile);
+        }
+        else
+        {
+            debug("Failed to open install script %s%s\n", args[2], template_file);
+        }
+    }
+
+    g_ventoy_cpio_buf = grub_malloc(file->size + 4096 + template_size + img_chunk_size);
     if (NULL == g_ventoy_cpio_buf)
     {
         grub_file_close(file);
     if (NULL == g_ventoy_cpio_buf)
     {
         grub_file_close(file);
@@ -910,6 +937,12 @@ grub_err_t ventoy_cmd_load_cpio(grub_extcmd_context_t ctxt, int argc, char **arg
     headlen = ventoy_cpio_newc_fill_head(buf, img_chunk_size, g_img_chunk_list.chunk, "ventoy/ventoy_image_map");
     buf += headlen + ventoy_align(img_chunk_size, 4);
 
     headlen = ventoy_cpio_newc_fill_head(buf, img_chunk_size, g_img_chunk_list.chunk, "ventoy/ventoy_image_map");
     buf += headlen + ventoy_align(img_chunk_size, 4);
 
+    if (template_buf)
+    {
+        headlen = ventoy_cpio_newc_fill_head(buf, template_size, template_buf, "ventoy/autoinstall");
+        buf += headlen + ventoy_align(template_size, 4);
+    }
+
     /* step2: insert os param to cpio */
     headlen = ventoy_cpio_newc_fill_head(buf, 0, NULL, "ventoy/ventoy_os_param");
     padlen = sizeof(ventoy_os_param);
     /* step2: insert os param to cpio */
     headlen = ventoy_cpio_newc_fill_head(buf, 0, NULL, "ventoy/ventoy_os_param");
     padlen = sizeof(ventoy_os_param);
index cd1a1d8168bc901d185edcaf7d1b19e5911d5a9b..827e142d4d830a7c568b80908729367a4ba7c1fc 100644 (file)
@@ -38,6 +38,8 @@
 
 GRUB_MOD_LICENSE ("GPLv3+");
 
 
 GRUB_MOD_LICENSE ("GPLv3+");
 
+static install_template *g_install_template_head = NULL;
+
 static int ventoy_plugin_theme_entry(VTOY_JSON *json, const char *isodisk)
 {
     const char *value;
 static int ventoy_plugin_theme_entry(VTOY_JSON *json, const char *isodisk)
 {
     const char *value;
@@ -46,7 +48,15 @@ static int ventoy_plugin_theme_entry(VTOY_JSON *json, const char *isodisk)
     value = vtoy_json_get_string_ex(json->pstChild, "file");
     if (value)
     {
     value = vtoy_json_get_string_ex(json->pstChild, "file");
     if (value)
     {
-        grub_snprintf(filepath, sizeof(filepath), "%s/ventoy/%s", isodisk, value);
+        if (value[0] == '/')
+        {
+            grub_snprintf(filepath, sizeof(filepath), "%s%s", isodisk, value);
+        }
+        else
+        {
+            grub_snprintf(filepath, sizeof(filepath), "%s/ventoy/%s", isodisk, value);
+        }
+        
         if (ventoy_is_file_exist(filepath) == 0)
         {
             debug("Theme file %s does not exist\n", filepath);
         if (ventoy_is_file_exist(filepath) == 0)
         {
             debug("Theme file %s does not exist\n", filepath);
@@ -67,9 +77,67 @@ static int ventoy_plugin_theme_entry(VTOY_JSON *json, const char *isodisk)
     return 0;
 }
 
     return 0;
 }
 
+
+static int ventoy_plugin_auto_install_entry(VTOY_JSON *json, const char *isodisk)
+{
+    const char *iso = NULL;
+    const char *script = NULL;
+    VTOY_JSON *pNode = NULL;
+    install_template *node = NULL;
+    install_template *next = NULL;
+
+    (void)isodisk;
+
+    if (json->enDataType != JSON_TYPE_ARRAY)
+    {
+        debug("Not array %d\n", json->enDataType);
+        return 0;
+    }
+
+    if (g_install_template_head)
+    {
+        for (node = g_install_template_head; node; node = next)
+        {
+            next = node->next;
+            grub_free(node);
+        }
+
+        g_install_template_head = NULL;
+    }
+
+    for (pNode = json->pstChild; pNode; pNode = pNode->pstNext)
+    {
+        iso = vtoy_json_get_string_ex(pNode->pstChild, "image");
+        if (iso && iso[0] == '/')
+        {
+            script = vtoy_json_get_string_ex(pNode->pstChild, "template");
+            if (script && script[0] == '/')
+            {
+                node = grub_zalloc(sizeof(install_template));
+                if (node)
+                {
+                    grub_snprintf(node->isopath, sizeof(node->isopath), "%s", iso);
+                    grub_snprintf(node->templatepath, sizeof(node->templatepath), "%s", script);
+
+                    if (g_install_template_head)
+                    {
+                        node->next = g_install_template_head;
+                    }
+                    
+                    g_install_template_head = node;
+                }
+            }
+        }
+    }
+
+    return 0;
+}
+
+
 static plugin_entry g_plugin_entries[] = 
 {
     { "theme", ventoy_plugin_theme_entry },
 static plugin_entry g_plugin_entries[] = 
 {
     { "theme", ventoy_plugin_theme_entry },
+    { "auto_install", ventoy_plugin_auto_install_entry },
 };
 
 static int ventoy_parse_plugin_config(VTOY_JSON *json, const char *isodisk)
 };
 
 static int ventoy_parse_plugin_config(VTOY_JSON *json, const char *isodisk)
@@ -149,3 +217,33 @@ grub_err_t ventoy_cmd_load_plugin(grub_extcmd_context_t ctxt, int argc, char **a
     VENTOY_CMD_RETURN(GRUB_ERR_NONE);
 }
 
     VENTOY_CMD_RETURN(GRUB_ERR_NONE);
 }
 
+
+void ventoy_plugin_dump_auto_install(void)
+{
+    install_template *node = NULL;
+
+    for (node = g_install_template_head; node; node = node->next)
+    {
+        grub_printf("IMAGE:<%s>\n", node->isopath);
+        grub_printf("SCRIPT:<%s>\n\n", node->templatepath);
+    }
+
+    return;
+}
+
+
+char * ventoy_plugin_get_install_template(const char *isopath)
+{
+    install_template *node = NULL;
+
+    for (node = g_install_template_head; node; node = node->next)
+    {
+        if (grub_strcmp(node->isopath, isopath) == 0)
+        {
+            return node->templatepath;
+        }
+    }
+
+    return NULL;
+}
+
index 7ec7b085cb65ff5be9d488d0212a76647b86ea25..e2b4eed9de2c1ad65a5f8b0ddd8a93aed1ee33b5 100644 (file)
@@ -440,14 +440,14 @@ static int ventoy_cat_exe_file_data(grub_uint32_t exe_len, grub_uint8_t *exe_dat
     jump_align = ventoy_align(jump_len, 16);
     
     g_wim_data.jump_exe_len = jump_len;
     jump_align = ventoy_align(jump_len, 16);
     
     g_wim_data.jump_exe_len = jump_len;
-    g_wim_data.bin_raw_len = jump_align + sizeof(ventoy_os_param) + exe_len;
+    g_wim_data.bin_raw_len = jump_align + sizeof(ventoy_os_param) + sizeof(ventoy_windows_data) + exe_len;
     g_wim_data.bin_align_len = ventoy_align(g_wim_data.bin_raw_len, 2048);
     
     g_wim_data.jump_bin_data = grub_malloc(g_wim_data.bin_align_len);
     if (g_wim_data.jump_bin_data)
     {
         grub_memcpy(g_wim_data.jump_bin_data, jump_data, jump_len);
     g_wim_data.bin_align_len = ventoy_align(g_wim_data.bin_raw_len, 2048);
     
     g_wim_data.jump_bin_data = grub_malloc(g_wim_data.bin_align_len);
     if (g_wim_data.jump_bin_data)
     {
         grub_memcpy(g_wim_data.jump_bin_data, jump_data, jump_len);
-        grub_memcpy(g_wim_data.jump_bin_data + jump_align + sizeof(ventoy_os_param), exe_data, exe_len);
+        grub_memcpy(g_wim_data.jump_bin_data + jump_align + sizeof(ventoy_os_param) + sizeof(ventoy_windows_data), exe_data, exe_len);
     }
 
     debug("jump_exe_len:%u bin_raw_len:%u bin_align_len:%u\n", 
     }
 
     debug("jump_exe_len:%u bin_raw_len:%u bin_align_len:%u\n", 
@@ -456,7 +456,35 @@ static int ventoy_cat_exe_file_data(grub_uint32_t exe_len, grub_uint8_t *exe_dat
     return 0;
 }
 
     return 0;
 }
 
-static int ventoy_update_before_chain(ventoy_os_param *param)
+int ventoy_fill_windows_rtdata(void *buf, char *isopath)
+{
+    char *pos = NULL;
+    char *script = NULL;
+    ventoy_windows_data *data = (ventoy_windows_data *)buf;
+
+    grub_memset(data, 0, sizeof(ventoy_windows_data));
+
+    pos = grub_strstr(isopath, "/");
+    if (!pos)
+    {
+        return 1;
+    }
+
+    script = ventoy_plugin_get_install_template(pos);
+    if (script)
+    {
+        debug("auto install script <%s>\n", script);
+        grub_snprintf(data->auto_install_script, sizeof(data->auto_install_script) - 1, "%s", script);
+    }
+    else
+    {
+        debug("auto install script not found %p\n", pos);
+    }
+    
+    return 0;
+}
+
+static int ventoy_update_before_chain(ventoy_os_param *param, char *isopath)
 {
     grub_uint32_t jump_align = 0;
     wim_lookup_entry *meta_look = NULL;
 {
     grub_uint32_t jump_align = 0;
     wim_lookup_entry *meta_look = NULL;
@@ -469,6 +497,7 @@ static int ventoy_update_before_chain(ventoy_os_param *param)
     if (g_wim_data.jump_bin_data)
     {
         grub_memcpy(g_wim_data.jump_bin_data + jump_align, param, sizeof(ventoy_os_param));        
     if (g_wim_data.jump_bin_data)
     {
         grub_memcpy(g_wim_data.jump_bin_data + jump_align, param, sizeof(ventoy_os_param));        
+        ventoy_fill_windows_rtdata(g_wim_data.jump_bin_data + jump_align + sizeof(ventoy_os_param), isopath);
     }
 
     grub_crypto_hash(GRUB_MD_SHA1, g_wim_data.bin_hash.sha1, g_wim_data.jump_bin_data, g_wim_data.bin_raw_len);
     }
 
     grub_crypto_hash(GRUB_MD_SHA1, g_wim_data.bin_hash.sha1, g_wim_data.jump_bin_data, g_wim_data.bin_raw_len);
@@ -878,7 +907,7 @@ grub_err_t ventoy_cmd_windows_chain_data(grub_extcmd_context_t ctxt, int argc, c
 
     if (g_wim_data.jump_bin_data && g_wim_data.new_meta_data)
     {
 
     if (g_wim_data.jump_bin_data && g_wim_data.new_meta_data)
     {
-        ventoy_update_before_chain(&(chain->os_param));
+        ventoy_update_before_chain(&(chain->os_param), args[0]);
     }
 
     /* part 2: chain head */
     }
 
     /* part 2: chain head */
index 1044005d1c36121a259263d74fabb556912a856a..4f3de66583ff35250fd38aa9da04e596c7b24603 100644 (file)
@@ -104,6 +104,15 @@ typedef struct ventoy_os_param
     grub_uint8_t   reserved[31];
 }ventoy_os_param;
 
     grub_uint8_t   reserved[31];
 }ventoy_os_param;
 
+
+typedef struct ventoy_windows_data
+{
+    char auto_install_script[384];
+    grub_uint8_t reserved[128];
+}ventoy_windows_data;
+
+
+
 #pragma pack()
 
 // compile assert check : sizeof(ventoy_os_param) must be 512
 #pragma pack()
 
 // compile assert check : sizeof(ventoy_os_param) must be 512
diff --git a/IMG/cpio/ventoy/hook/arch/ventoy-disk.sh b/IMG/cpio/ventoy/hook/arch/ventoy-disk.sh
new file mode 100644 (file)
index 0000000..356c77f
--- /dev/null
@@ -0,0 +1,48 @@
+#!/ventoy/busybox/sh
+#************************************************************************************
+# Copyright (c) 2020, longpanda <admin@ventoy.net>
+# 
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3 of the
+# License, or (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# 
+#************************************************************************************
+
+. /ventoy/hook/ventoy-hook-lib.sh
+
+vtlog "######### $0 $* ############"
+
+if is_ventoy_hook_finished; then
+    exit 0
+fi
+
+wait_for_usb_disk_ready
+
+vtdiskname=$(get_ventoy_disk_name)
+if [ "$vtdiskname" = "unknown" ]; then
+    vtlog "ventoy disk not found"
+    exit 0
+fi
+
+ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
+
+if [ -n "$1" ]; then
+    blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/')
+    vtDM=$(ventoy_find_dm_id ${blkdev_num})
+    
+    vtlog "ln -s /dev/$vtDM $1"
+    ln -s /dev/$vtDM "$1"
+fi 
+
+# OK finish
+set_ventoy_hook_finish
+
index 32ee137fbdbf8e52d5ff0fc3054df3c0beeff1f7..7d842e2fbd3953a147d797201cf39aed7ab029c0 100644 (file)
 
 . $VTOY_PATH/hook/ventoy-os-lib.sh
 
 
 . $VTOY_PATH/hook/ventoy-os-lib.sh
 
-# some archlinux initramfs doesn't contain device-mapper udev rules file
-ARCH_UDEV_DIR=$(ventoy_get_udev_conf_dir)
-if [ -s "$ARCH_UDEV_DIR/13-dm-disk.rules" ]; then
-    echo 'dm-disk rule exist' >> $VTLOG
+if $GREP -q '^"$mount_handler"' /init; then
+    echo 'use mount_handler ...' >> $VTLOG
+    $SED "/^\"\$mount_handler\"/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/arch/ventoy-disk.sh \"\$archisodevice\"" -i /init
 else
 else
-    echo 'Copy dm-disk rule file' >> $VTLOG
-    $CAT $VTOY_PATH/hook/default/13-dm-disk.rules > "$ARCH_UDEV_DIR/13-dm-disk.rules"
-fi
+    # some archlinux initramfs doesn't contain device-mapper udev rules file
+    ARCH_UDEV_DIR=$(ventoy_get_udev_conf_dir)
+    if [ -s "$ARCH_UDEV_DIR/13-dm-disk.rules" ]; then
+        echo 'dm-disk rule exist' >> $VTLOG
+    else
+        echo 'Copy dm-disk rule file' >> $VTLOG
+        $CAT $VTOY_PATH/hook/default/13-dm-disk.rules > "$ARCH_UDEV_DIR/13-dm-disk.rules"
+    fi
 
 
-# use default proc
-ventoy_systemd_udevd_work_around
+    # use default proc
+    ventoy_systemd_udevd_work_around
 
 
-ventoy_add_udev_rule "$VTOY_PATH/hook/default/udev_disk_hook.sh %k"
+    ventoy_add_udev_rule "$VTOY_PATH/hook/default/udev_disk_hook.sh %k"
+fi
index d7d0eac4a6acadbecb772f913651af7ec0d190e8..706173b229bae6d2274605ffa707eb55cf5d5372 100644 (file)
@@ -23,6 +23,12 @@ if [ -e /init ] && $GREP -q '^mountroot$' /init; then
     $SED  "/^mountroot$/i\\$BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/disk_mount_hook.sh"  -i /init
     $SED  "/^mountroot$/i\\export LIVEMEDIA=/dev/mapper/ventoy"  -i /init
     $SED  "/^mountroot$/i\\export LIVE_MEDIA=/dev/mapper/ventoy"  -i /init    
     $SED  "/^mountroot$/i\\$BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/disk_mount_hook.sh"  -i /init
     $SED  "/^mountroot$/i\\export LIVEMEDIA=/dev/mapper/ventoy"  -i /init
     $SED  "/^mountroot$/i\\export LIVE_MEDIA=/dev/mapper/ventoy"  -i /init    
+
+    if $GREP -q 'live-media=' /proc/cmdline; then
+        if [ -f /scripts/casper ] && $GREP -q '^  *LIVEMEDIA=' /scripts/casper; then
+            $SED "s#^  *LIVEMEDIA=.*#LIVEMEDIA=/dev/mapper/ventoy#" -i /scripts/casper
+        fi
+    fi
     
 elif [ -e /init ] && $GREP -q '/start-udev$' /init; then
     echo "Here use notify ..." >> $VTLOG
     
 elif [ -e /init ] && $GREP -q '/start-udev$' /init; then
     echo "Here use notify ..." >> $VTLOG
@@ -35,3 +41,15 @@ else
     ventoy_systemd_udevd_work_around
     ventoy_add_udev_rule "$VTOY_PATH/hook/debian/udev_disk_hook.sh %k"
 fi
     ventoy_systemd_udevd_work_around
     ventoy_add_udev_rule "$VTOY_PATH/hook/debian/udev_disk_hook.sh %k"
 fi
+
+if [ -f $VTOY_PATH/autoinstall ]; then
+    echo "Do auto install ..." >> $VTLOG
+    
+    if $GREP -q "^mount /proc$" /init; then
+        $SED "/^mount \/proc/a export file=$VTOY_PATH/autoinstall; export auto='true'; export priority='critical'"  -i /init
+    fi
+fi
+
+
+
+
diff --git a/IMG/cpio/ventoy/hook/gobo/ventoy-hook.sh b/IMG/cpio/ventoy/hook/gobo/ventoy-hook.sh
new file mode 100644 (file)
index 0000000..eb22a28
--- /dev/null
@@ -0,0 +1,26 @@
+#!/ventoy/busybox/sh
+#************************************************************************************
+# Copyright (c) 2020, longpanda <admin@ventoy.net>
+# 
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3 of the
+# License, or (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# 
+#************************************************************************************
+
+. $VTOY_PATH/hook/ventoy-os-lib.sh
+
+$SED "s#printf\(.*\)\$CMDLINE#printf\1\$CMDLINE root=live:/dev/mapper/ventoy#" -i /lib/dracut-lib.sh
+
+ventoy_set_inotify_script  gobo/ventoy-inotifyd-hook.sh
+
+$BUSYBOX_PATH/cp -a $VTOY_PATH/hook/gobo/ventoy-inotifyd-start.sh /lib/dracut/hooks/pre-udev/01-ventoy-inotifyd-start.sh
diff --git a/IMG/cpio/ventoy/hook/gobo/ventoy-inotifyd-hook.sh b/IMG/cpio/ventoy/hook/gobo/ventoy-inotifyd-hook.sh
new file mode 100644 (file)
index 0000000..ff52bbb
--- /dev/null
@@ -0,0 +1,47 @@
+#!/ventoy/busybox/sh
+#************************************************************************************
+# Copyright (c) 2020, longpanda <admin@ventoy.net>
+# 
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3 of the
+# License, or (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# 
+#************************************************************************************
+
+. /ventoy/hook/ventoy-hook-lib.sh
+
+if is_ventoy_hook_finished; then
+    exit 0
+fi
+
+vtlog "##### INOTIFYD: $2/$3 is created ..."
+
+VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
+
+if is_inotify_ventoy_part $3; then
+    vtlog "find ventoy partition $3 ..."
+    $BUSYBOX_PATH/sh $VTOY_PATH/hook/default/udev_disk_hook.sh $3 noreplace
+    
+    # blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/')  
+    # vtDM=$(ventoy_find_dm_id ${blkdev_num})
+    # 
+    # if [ "$vtDM" = "dm-0" ]; then
+    #     vtlog "This is dm-0, OK ..."
+    # else
+    #     vtlog "####### This is $vtDM ####### this is abnormal ..."
+    #     ventoy_swap_device /dev/dm-0 /dev/$vtDM
+    # fi
+    
+    set_ventoy_hook_finish
+fi
+
+PATH=$VTPATH_OLD
diff --git a/IMG/cpio/ventoy/hook/gobo/ventoy-inotifyd-start.sh b/IMG/cpio/ventoy/hook/gobo/ventoy-inotifyd-start.sh
new file mode 100644 (file)
index 0000000..6be8155
--- /dev/null
@@ -0,0 +1,31 @@
+#!/ventoy/busybox/sh
+#************************************************************************************
+# Copyright (c) 2020, longpanda <admin@ventoy.net>
+# 
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3 of the
+# License, or (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# 
+#************************************************************************************
+
+. /ventoy/hook/ventoy-hook-lib.sh
+
+vtHook=$($CAT $VTOY_PATH/inotifyd-hook-script.txt)
+
+vtdisk=$(get_ventoy_disk_name)
+if [ "$vtdisk" = "unknown" ]; then
+    vtlog "... start inotifyd listen $vtHook ..."
+    $BUSYBOX_PATH/nohup $VTOY_PATH/tool/inotifyd $vtHook  /dev:n  2>&-  & 
+else
+    vtlog "... $vtdisk already exist ..."
+    $BUSYBOX_PATH/sh $vtHook n /dev "${vtdisk#/dev/}2"
+fi
diff --git a/IMG/cpio/ventoy/hook/guix/ventoy-disk.sh b/IMG/cpio/ventoy/hook/guix/ventoy-disk.sh
new file mode 100644 (file)
index 0000000..6d67941
--- /dev/null
@@ -0,0 +1,42 @@
+#!/ventoy/busybox/sh
+#************************************************************************************
+# Copyright (c) 2020, longpanda <admin@ventoy.net>
+# 
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3 of the
+# License, or (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# 
+#************************************************************************************
+
+. /ventoy/hook/ventoy-hook-lib.sh
+
+if is_ventoy_hook_finished; then
+    exit 0
+fi
+
+vtlog "##### INOTIFYD: $2/$3 is created ..."
+
+VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
+
+if is_inotify_ventoy_part $3; then
+    vtlog "find ventoy partition ..."
+    $BUSYBOX_PATH/sh $VTOY_PATH/hook/default/udev_disk_hook.sh $3
+    
+    blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/')  
+    vtDM=$(ventoy_find_dm_id ${blkdev_num})
+
+    vtlog "This is $vtDM ..."
+
+    set_ventoy_hook_finish
+fi
+
+PATH=$VTPATH_OLD
diff --git a/IMG/cpio/ventoy/hook/guix/ventoy-hook.sh b/IMG/cpio/ventoy/hook/guix/ventoy-hook.sh
new file mode 100644 (file)
index 0000000..4678c83
--- /dev/null
@@ -0,0 +1,25 @@
+#!/ventoy/busybox/sh
+#************************************************************************************
+# Copyright (c) 2020, longpanda <admin@ventoy.net>
+# 
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3 of the
+# License, or (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# 
+#************************************************************************************
+
+. $VTOY_PATH/hook/ventoy-os-lib.sh
+
+$BUSYBOX_PATH/mkdir /dev
+$BUSYBOX_PATH/mknode -m 0666 /dev/null c 1 3
+
+$BUSYBOX_PATH/nohup $VTOY_PATH/hook/guix/ventoy-waitdev.sh &
diff --git a/IMG/cpio/ventoy/hook/guix/ventoy-waitdev.sh b/IMG/cpio/ventoy/hook/guix/ventoy-waitdev.sh
new file mode 100644 (file)
index 0000000..22cdd92
--- /dev/null
@@ -0,0 +1,37 @@
+#!/ventoy/busybox/sh
+#************************************************************************************
+# Copyright (c) 2020, longpanda <admin@ventoy.net>
+# 
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3 of the
+# License, or (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# 
+#************************************************************************************
+
+. /ventoy/hook/ventoy-hook-lib.sh
+
+vtlog "####### $0 $* ########"
+
+VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
+
+while ! [ -e /dev/null ]; do
+    echo 'xxxxxxxxxx'
+    echo 'xxxxxxxxxx' > /dev/console
+    sleep 1
+done
+
+vtlog "... start inotifyd listen $vtHook ..."
+$BUSYBOX_PATH/nohup $VTOY_PATH/tool/inotifyd  $VTOY_PATH/hook/guix/ventoy-disk.sh  /dev:n  2>&-  & 
+
+
+PATH=$VTPATH_OLD
+
diff --git a/IMG/cpio/ventoy/hook/nutyx/ventoy-disk.sh b/IMG/cpio/ventoy/hook/nutyx/ventoy-disk.sh
new file mode 100644 (file)
index 0000000..44c5038
--- /dev/null
@@ -0,0 +1,50 @@
+#!/ventoy/busybox/sh
+#************************************************************************************
+# Copyright (c) 2020, longpanda <admin@ventoy.net>
+# 
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3 of the
+# License, or (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# 
+#************************************************************************************
+
+. /ventoy/hook/ventoy-hook-lib.sh
+
+vtlog "####### $0 $* ########"
+
+VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
+
+if is_ventoy_hook_finished; then
+    exit 0
+fi
+
+wait_for_usb_disk_ready
+
+vtdiskname=$(get_ventoy_disk_name)
+if [ "$vtdiskname" = "unknown" ]; then
+    vtlog "ventoy disk not found"
+    PATH=$VTPATH_OLD
+    exit 0
+fi
+
+ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" 
+
+blkdev_num=$(dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/')  
+vtDM=$(ventoy_find_dm_id ${blkdev_num})
+
+vtlog "link /dev/$vtDM $VTOY_DM_PATH"
+ln -s /dev/$vtDM $VTOY_DM_PATH
+
+set_ventoy_hook_finish
+
+PATH=$VTPATH_OLD
+
diff --git a/IMG/cpio/ventoy/hook/nutyx/ventoy-hook.sh b/IMG/cpio/ventoy/hook/nutyx/ventoy-hook.sh
new file mode 100644 (file)
index 0000000..17bf538
--- /dev/null
@@ -0,0 +1,22 @@
+#!/ventoy/busybox/sh
+#************************************************************************************
+# Copyright (c) 2020, longpanda <admin@ventoy.net>
+# 
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3 of the
+# License, or (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# 
+#************************************************************************************
+
+. $VTOY_PATH/hook/ventoy-os-lib.sh
+
+$SED "/find_media$/i $BUSYBOX_PATH/sh $VTOY_PATH/hook/nutyx/ventoy-disk.sh" -i /init
index 705582bc9ea293e6c8c3bd3ef725fbcf72ee0bc1..431d58a4a41e075c201e9050e2036a7952929b0d 100644 (file)
 #ventoy_systemd_udevd_work_around
 #ventoy_add_udev_rule "$VTOY_PATH/hook/default/udev_disk_hook.sh %k noreplace"
 
 #ventoy_systemd_udevd_work_around
 #ventoy_add_udev_rule "$VTOY_PATH/hook/default/udev_disk_hook.sh %k noreplace"
 
+if [ -f $VTOY_PATH/autoinstall ]; then
+    VTKS="inst.ks=file:$VTOY_PATH/autoinstall"
+else
+    for vtParam in $($CAT /proc/cmdline); do
+        if echo $vtParam | $GREP -q 'inst.ks=hd:LABEL='; then
+            vtRawKs=$(echo $vtParam | $AWK -F: '{print $NF}')
+            VTKS="inst.ks=hd:/dev/dm-0:$vtRawKs"
+            break
+        fi
+    done    
+fi
+
+echo "VTKS=$VTKS" >> $VTLOG
+
 if $GREP -q 'root=live' /proc/cmdline; then
 if $GREP -q 'root=live' /proc/cmdline; then
-    $SED "s#printf\(.*\)\$CMDLINE#printf\1\$CMDLINE root=live:/dev/dm-0#" -i /lib/dracut-lib.sh
+    $SED "s#printf\(.*\)\$CMDLINE#printf\1\$CMDLINE root=live:/dev/dm-0 $VTKS#" -i /lib/dracut-lib.sh
 else
 else
-    $SED "s#printf\(.*\)\$CMDLINE#printf\1\$CMDLINE inst.stage2=hd:/dev/dm-0#" -i /lib/dracut-lib.sh
+    $SED "s#printf\(.*\)\$CMDLINE#printf\1\$CMDLINE inst.stage2=hd:/dev/dm-0 $VTKS#" -i /lib/dracut-lib.sh
 fi
 
 ventoy_set_inotify_script  rhel7/ventoy-inotifyd-hook.sh
 
 $BUSYBOX_PATH/cp -a $VTOY_PATH/hook/rhel7/ventoy-inotifyd-start.sh /lib/dracut/hooks/pre-udev/01-ventoy-inotifyd-start.sh
 fi
 
 ventoy_set_inotify_script  rhel7/ventoy-inotifyd-hook.sh
 
 $BUSYBOX_PATH/cp -a $VTOY_PATH/hook/rhel7/ventoy-inotifyd-start.sh /lib/dracut/hooks/pre-udev/01-ventoy-inotifyd-start.sh
+$BUSYBOX_PATH/cp -a $VTOY_PATH/hook/rhel7/ventoy-timeout.sh /lib/dracut/hooks/initqueue/timeout/01-ventoy-timeout.sh
 
 # suppress write protected mount warning
 if [ -e /usr/sbin/anaconda-diskroot ]; then
 
 # suppress write protected mount warning
 if [ -e /usr/sbin/anaconda-diskroot ]; then
index bf81445cd65bf58cb6b7122909e17e3e7113f4e1..5787f5e4034cd0a099388eb46a0664187b34f94e 100644 (file)
@@ -41,6 +41,9 @@ if is_inotify_ventoy_part $3; then
         ventoy_swap_device /dev/dm-0 /dev/$vtDM
     fi
     
         ventoy_swap_device /dev/dm-0 /dev/$vtDM
     fi
     
+    vtlog "set anaconda-diskroot ..."
+    /sbin/initqueue --settled --onetime --name anaconda-diskroot anaconda-diskroot  /dev/dm-0
+    
     set_ventoy_hook_finish
 fi
 
     set_ventoy_hook_finish
 fi
 
diff --git a/IMG/cpio/ventoy/hook/rhel7/ventoy-timeout.sh b/IMG/cpio/ventoy/hook/rhel7/ventoy-timeout.sh
new file mode 100644 (file)
index 0000000..5fa98f8
--- /dev/null
@@ -0,0 +1,32 @@
+#!/ventoy/busybox/sh
+#************************************************************************************
+# Copyright (c) 2020, longpanda <admin@ventoy.net>
+# 
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3 of the
+# License, or (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# 
+#************************************************************************************
+
+. /ventoy/hook/ventoy-hook-lib.sh
+
+vtlog "##### $0 $* ..."
+
+VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
+
+blkdev_num=$(dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/')  
+vtDM=$(ventoy_find_dm_id ${blkdev_num})
+
+vtlog "diskroot $vtDM ..."
+/sbin/initqueue --settled --onetime --name anaconda-diskroot anaconda-diskroot  /dev/$vtDM
+
+PATH=$VTPATH_OLD
index a281df9acc2041b98ec0920c4a4f0b14377f52c0..19b90687886ee7a926a79083d4c698829abdfa83 100644 (file)
 
 . $VTOY_PATH/hook/ventoy-os-lib.sh
 
 
 . $VTOY_PATH/hook/ventoy-os-lib.sh
 
-ventoy_systemd_udevd_work_around
+if [ -f $VTOY_PATH/autoinstall ]; then    
+    if [ -f /linuxrc.config ]; then
+        echo "AutoYaST: file:///ventoy/autoinstall" >> /info-ventoy
+        $SED "1 iinfo: file:/info-ventoy" -i /linuxrc.config
+    fi
+fi
+
 
 
+#echo "Exec: /bin/sh $VTOY_PATH/hook/suse/cdrom-hook.sh" >> /info-ventoy
+#echo "install: hd:/?device=/dev/mapper/ventoy" >> /info-ventoy
+#$SED "1 iinfo: file:/info-ventoy" -i /linuxrc.config
+
+ventoy_systemd_udevd_work_around
 ventoy_add_udev_rule "$VTOY_PATH/hook/suse/udev_disk_hook.sh %k"
 ventoy_add_udev_rule "$VTOY_PATH/hook/suse/udev_disk_hook.sh %k"
index 543543d9e1d921052f488dae435bdd1419ded613..5beb46df8602cf337529997740183ffd2e349b6e 100644 (file)
@@ -169,7 +169,20 @@ ventoy_get_os_type() {
         echo 'berry'; return
     fi
     
         echo 'berry'; return
     fi
     
+    if $GREP -q 'Gobo ' /proc/version; then
+        echo 'gobo'; return
+    fi
+    
+    if $GREP -q 'NuTyX' /proc/version; then
+        echo 'nutyx'; return
+    fi
     
     
+    if [ -d /gnu ]; then
+        vtLineNum=$($FIND /gnu/ -name guix | $BUSYBOX_PATH/wc -l)
+        if [ $vtLineNum -gt 0 ]; then
+            echo 'guix'; return
+        fi
+    fi
     
     echo "default"
 }
     
     echo "default"
 }
index f7179af24e9a11501b19a1e061eff2e307e96d0b..9d9ce3b9c869833b9a5064cc100dfeaad02995ba 100644 (file)
Binary files a/INSTALL/EFI/BOOT/grubx64_real.efi and b/INSTALL/EFI/BOOT/grubx64_real.efi differ
index f3f3ca486ce4e4ca617e554f7defd3da86393b0f..441c04c7b4442f1d6b90124eaba519822cd3714a 100644 (file)
Binary files a/INSTALL/Ventoy2Disk.exe and b/INSTALL/Ventoy2Disk.exe differ
index be1697a545b4c4535660318b31d4bb73606860d7..da81008a19597eb49520c4dbaf734f11108a6247 100644 (file)
@@ -110,6 +110,10 @@ function distro_specify_initrd_file_phase2 {
         vt_linux_specify_initrd_file /boot/initrd.img
     elif [ -f (loop)/Setup/initrd.gz ]; then
         vt_linux_specify_initrd_file /Setup/initrd.gz
         vt_linux_specify_initrd_file /boot/initrd.img
     elif [ -f (loop)/Setup/initrd.gz ]; then
         vt_linux_specify_initrd_file /Setup/initrd.gz
+    elif [ -f (loop)/isolinux/initramfs ]; then
+        vt_linux_specify_initrd_file /isolinux/initramfs
+    elif [ -f (loop)/boot/iniramfs.igz ]; then
+        vt_linux_specify_initrd_file /boot/iniramfs.igz
         
     fi
 }
         
     fi
 }
@@ -142,15 +146,15 @@ function uefi_windows_menu_func {
 
 function uefi_linux_menu_func {
     if [ "$ventoy_compatible" = "NO" ]; then    
 
 function uefi_linux_menu_func {
     if [ "$ventoy_compatible" = "NO" ]; then    
-        vt_load_cpio  ${vtoy_path}/ventoy.cpio
+        vt_load_cpio  ${vtoy_path}/ventoy.cpio   $2 $1
 
         vt_linux_clear_initrd
         
         if [ -d (loop)/pmagic ]; then
             vt_linux_specify_initrd_file /pmagic/initrd.img
         else
 
         vt_linux_clear_initrd
         
         if [ -d (loop)/pmagic ]; then
             vt_linux_specify_initrd_file /pmagic/initrd.img
         else
-            for file in "boot/grub/grub.cfg" "EFI/BOOT/grub.cfg" "EFI/boot/grub.cfg" "efi/boot/grub.cfg" "EFI/BOOT/BOOTX64.conf"; do
-                if [ -e (loop)/$file ]; then
+            for file in "boot/grub/grub.cfg" "EFI/BOOT/grub.cfg" "EFI/boot/grub.cfg" "efi/boot/grub.cfg" "EFI/BOOT/BOOTX64.conf" "/grub/grub.cfg"; do
+                if [ -e (loop)/$file ]; then                    
                     vt_linux_parse_initrd_grub  file  (loop)/$file
                 fi
             done
                     vt_linux_parse_initrd_grub  file  (loop)/$file
                 fi
             done
@@ -250,9 +254,9 @@ function uefi_iso_menu_func {
             set ventoy_compatible=YES
         fi
     
             set ventoy_compatible=YES
         fi
     
-        uefi_windows_menu_func  $1
+        uefi_windows_menu_func  $1 ${chosen_path}
     else
     else
-        uefi_linux_menu_func  $1
+        uefi_linux_menu_func  $1 ${chosen_path}
     fi
 
     terminal_output  gfxterm    
     fi
 
     terminal_output  gfxterm    
@@ -300,8 +304,7 @@ function legacy_windows_menu_func {
 
 function legacy_linux_menu_func {
     if [ "$ventoy_compatible" = "NO" ]; then
 
 function legacy_linux_menu_func {
     if [ "$ventoy_compatible" = "NO" ]; then
-    
-        vt_load_cpio  $vtoy_path/ventoy.cpio
+        vt_load_cpio  $vtoy_path/ventoy.cpio  $2 $1
 
         vt_linux_clear_initrd
         
 
         vt_linux_clear_initrd
         
@@ -392,9 +395,9 @@ function legacy_iso_menu_func {
             set ventoy_compatible=YES
         fi
         
             set ventoy_compatible=YES
         fi
         
-        legacy_windows_menu_func  $1
+        legacy_windows_menu_func  $1 ${chosen_path}
     else
     else
-        legacy_linux_menu_func  $1
+        legacy_linux_menu_func  $1 ${chosen_path}
     fi
 }
 
     fi
 }
 
@@ -432,7 +435,13 @@ function common_menuentry {
 #############################################################
 #############################################################
 
 #############################################################
 #############################################################
 
-set VENTOY_VERSION="1.0.08"
+set VENTOY_VERSION="1.0.09"
+
+
+# Default menu display mode, you can change it as you want.
+#    0: List mode   
+#    1: TreeView mode
+set VTOY_DEFAULT_MENU_MODE=0
 
 #disable timeout
 unset timeout
 
 #disable timeout
 unset timeout
@@ -442,9 +451,15 @@ set VTOY_ISO_RAW_STR="ISO RAW"
 set VTOY_ISO_UEFI_DRV_STR="UEFI FS"
 
 set VTOY_F2_CMD="ventoy_power"
 set VTOY_ISO_UEFI_DRV_STR="UEFI FS"
 
 set VTOY_F2_CMD="ventoy_power"
-set VTOY_F3_CMD="vt_dynamic_menu tree"
 
 
-set VTOY_HOTKEY_TIP="F1:Memdisk  F2:Power  F3:TreeView"
+if [ $VTOY_DEFAULT_MENU_MODE -eq 0 ]; then
+    set VTOY_F3_CMD="vt_dynamic_menu 1 1"
+    set VTOY_HOTKEY_TIP="F1:Memdisk  F2:Power  F3:TreeView"
+else
+    set VTOY_F3_CMD="vt_dynamic_menu 1 0"
+    set VTOY_HOTKEY_TIP="F1:Memdisk  F2:Power  F3:ListView"
+fi
+
 if [ "$grub_platform" = "pc" ]; then
     set VTOY_TEXT_MENU_VER="Ventoy $VENTOY_VERSION BIOS  www.ventoy.net"
 else
 if [ "$grub_platform" = "pc" ]; then
     set VTOY_TEXT_MENU_VER="Ventoy $VENTOY_VERSION BIOS  www.ventoy.net"
 else
@@ -492,7 +507,11 @@ vt_list_img $iso_path ventoy_img_count
 
 #Main menu
 if [ $ventoy_img_count -gt 0 ]; then
 
 #Main menu
 if [ $ventoy_img_count -gt 0 ]; then
-    vt_dynamic_menu
+    if [ $VTOY_DEFAULT_MENU_MODE -eq 0 ]; then
+        vt_dynamic_menu 0 0 
+    else
+        vt_dynamic_menu 0 1
+    fi
 else
     menuentry "No ISO files found (Press enter to reboot ...)" {
         echo -e "\n    Rebooting ... "
 else
     menuentry "No ISO files found (Press enter to reboot ...)" {
         echo -e "\n    Rebooting ... "
index d899233109d67e0b5cba5b8e4b0028ceed3cd9dd..a9464bc9958ca259d112fad8131f1b63eeb69835 100644 (file)
Binary files a/INSTALL/grub/i386-pc/core.img and b/INSTALL/grub/i386-pc/core.img differ
index bbaa290e1a9b27b7fbe346437a309ac1160f1d0e..dd750ec0cad9d566c72caab797d3eeb8781c7ef8 100644 (file)
Binary files a/INSTALL/ventoy/ventoy.cpio and b/INSTALL/ventoy/ventoy.cpio differ
index 3b86178f020a07144495f54dcb61641d5aba73ac..047610626347ac566f020cf0ae4cb666c5bdca52 100644 (file)
Binary files a/INSTALL/ventoy/vtoyjump32.exe and b/INSTALL/ventoy/vtoyjump32.exe differ
index 27e75825f8935f004cdf076ef6247fb4f088660a..698d816efff06e855385e8819501dcc73689e5da 100644 (file)
Binary files a/INSTALL/ventoy/vtoyjump64.exe and b/INSTALL/ventoy/vtoyjump64.exe differ
index 33a5254ef8e378acca61045a0db1844cb17989ca..6cd0ff8f4705f3111ccad806dd6e92ecf715a5db 100644 (file)
Binary files a/LANGUAGES/languages.ini and b/LANGUAGES/languages.ini differ
index 6f95c224da3671a714ae7506bb7263f2a62681e6..6bc75d69239242ee631aa5d76986dd0d8b5c8672 100644 (file)
 #include "Ventoy2Disk.h"
 #include "Language.h"
 
 #include "Ventoy2Disk.h"
 #include "Language.h"
 
-const TCHAR * g_Str_English[STR_ID_MAX] =
-{
-    TEXT("Error"),
-    TEXT("Warning"),
-    TEXT("Info"),
-    TEXT("Please run under the correct directory!"),
-    TEXT("Device"),
-    TEXT("Ventoy At Local"),
-    TEXT("Ventoy In Device"),
-    TEXT("Status - READY"),
-    TEXT("Install"),
-    TEXT("Update"),
-    TEXT("Upgrade operation is safe, ISO files will be unchanged.\r\nContinue?"),
-    TEXT("The disk will be formatted and all the data will be lost.\r\nContinue?"),
-    TEXT("The disk will be formatted and all the data will be lost.\r\nContinue? (Double Check)"),
-    TEXT("Congratulations!\r\nVentoy has been successfully installed to the device."),
-    TEXT("An error occurred during the installation. You can replug the USB and try again. Check log.txt for detail."),
-    TEXT("Congratulations!\r\nVentoy has been successfully updated to the device."),
-    TEXT("An error occurred during the update. You can replug the USB and try again. Check log.txt for detail."),
-
-    TEXT("A thread is running, please wait..."),
-};
-
-const TCHAR * g_Str_ChineseSimple[STR_ID_MAX] =
-{
-    TEXT("´íÎó"),
-    TEXT("¾¯¸æ"),
-    TEXT("ÌáÐÑ"),
-    TEXT("ÇëÔÚÕýÈ·µÄĿ¼ÏÂÔËÐÐ!"),
-    TEXT("É豸"),
-    TEXT("°²×°°üÄÚ Ventoy °æ±¾"),
-    TEXT("É豸ÄÚ²¿ Ventoy °æ±¾"),
-    TEXT("״̬ - ×¼±¸¾ÍÐ÷"),
-    TEXT("°²×°"),
-    TEXT("Éý¼¶"),
-    TEXT("Éý¼¶²Ù×÷Êǰ²È«µÄ, ISOÎļþ²»»á¶ªÊ§\r\nÊÇ·ñ¼ÌÐø£¿"),
-    TEXT("´ÅÅ̻ᱻ¸ñʽ»¯, ËùÓÐÊý¾Ý¶¼»á¶ªÊ§!\r\nÊÇ·ñ¼ÌÐø£¿"),
-    TEXT("´ÅÅ̻ᱻ¸ñʽ»¯, ËùÓÐÊý¾Ý¶¼»á¶ªÊ§!\r\nÔÙ´ÎÈ·ÈÏÊÇ·ñ¼ÌÐø£¿"),
-    TEXT("¹§Ï²Äã! Ventoy ÒѾ­³É¹¦°²×°µ½´ËÉ豸ÖÐ."),
-    TEXT("°²×° Ventoy ¹ý³ÌÖз¢Éú´íÎó. Äã¿ÉÒÔÖØÐ°βåÒ»ÏÂUÅÌÈ»ºóÖØÊÔÒ»´Î, ÏêϸÐÅÏ¢Çë²éÔÄ log.txt Îļþ."),
-    TEXT("¹§Ï²Äã! Ð°汾µÄ Ventoy ÒѾ­³É¹¦¸üе½´ËÉ豸ÖÐ."),
-    TEXT("¸üРVentoy ¹ý³ÌÖÐÓöµ½´íÎó. Äã¿ÉÒÔÖØÐ°βåÒ»ÏÂUÅÌÈ»ºóÖØÊÔÒ»´Î, ÏêϸÐÅÏ¢Çë²éÔÄ log.txt Îļþ."),
-
-    TEXT("µ±Ç°ÓÐÈÎÎñÕýÔÚÔËÐÐ, ÇëµÈ´ý..."),
-};
-
 const TCHAR * GetString(enum STR_ID ID)
 {
        return g_cur_lang_data->MsgString[ID];
 const TCHAR * GetString(enum STR_ID ID)
 {
        return g_cur_lang_data->MsgString[ID];
index 2a4a6b3d9682c977ba23fe68da8898a356a68d4b..5fb41ff946caf3c1ecf0bb25d830c392dead472a 100644 (file)
@@ -61,7 +61,8 @@ extern BOOL g_SecureBoot;
 
 
 #define VENTOY_LANGUAGE_INI  TEXT(".\\ventoy\\languages.ini")
 
 
 #define VENTOY_LANGUAGE_INI  TEXT(".\\ventoy\\languages.ini")
-#define VENTOY_CFG_INI  TEXT(".\\Ventoy2Disk.ini")
+#define VENTOY_CFG_INI     TEXT(".\\Ventoy2Disk.ini")
+#define VENTOY_CFG_INI_A   ".\\Ventoy2Disk.ini"
 #define VENTOY_MAX_LANGUAGE     200
 
 #define GET_INI_STRING(Section, Key, Buf) GetPrivateProfileString(Section, Key, TEXT("#"), Buf, sizeof(Buf), VENTOY_LANGUAGE_INI)
 #define VENTOY_MAX_LANGUAGE     200
 
 #define GET_INI_STRING(Section, Key, Buf) GetPrivateProfileString(Section, Key, TEXT("#"), Buf, sizeof(Buf), VENTOY_LANGUAGE_INI)
index b35a2d503296fc7341c8c046463d24f8aa094e7b..a9b41ce84ab2f9c4431ec154106fc27b60d8ba8b 100644 (file)
@@ -928,10 +928,19 @@ int VentoyProcSecureBoot(BOOL SecureBoot)
                        Log("Open bootx64 efi file %p ", file);
                        if (file)
                        {
                        Log("Open bootx64 efi file %p ", file);
                        if (file)
                        {
-                               fl_fwrite(filebuf, 1, size, file);
+                               if (filebuf)
+                               {
+                                       fl_fwrite(filebuf, 1, size, file);
+                               }
+                               
                                fl_fflush(file);
                                fl_fclose(file);
                        }
                                fl_fflush(file);
                                fl_fclose(file);
                        }
+
+                       if (filebuf)
+                       {
+                               free(filebuf);
+                       }
                }
        }
        else
                }
        }
        else
index f59276b3585d6ec3114d71a32da5608f31514bae..6c562373bfd15d84224c633431151d0ca6551d94 100644 (file)
Binary files a/Ventoy2Disk/Ventoy2Disk/WinDialog.c and b/Ventoy2Disk/Ventoy2Disk/WinDialog.c differ
index 9e38b80d704164c859b0035ae2c4b06a427e8059..ffc31210eadedf25a192fb498554a42c6f48a1c2 100644 (file)
@@ -29,6 +29,7 @@
 #include "fat_filelib.h"
 
 static ventoy_os_param g_os_param;
 #include "fat_filelib.h"
 
 static ventoy_os_param g_os_param;
+static ventoy_windows_data g_windows_data;
 static UINT8 g_os_param_reserved[32];
 static BOOL g_64bit_system = FALSE;
 static ventoy_guid g_ventoy_guid = VENTOY_GUID;
 static UINT8 g_os_param_reserved[32];
 static BOOL g_64bit_system = FALSE;
 static ventoy_guid g_ventoy_guid = VENTOY_GUID;
@@ -703,6 +704,40 @@ static int DeleteVentoyPart2MountPoint(DWORD PhyDrive)
     return 1;
 }
 
     return 1;
 }
 
+static int ProcessUnattendedInstallation(const char *script)
+{
+    DWORD dw;
+    HKEY hKey;
+    LSTATUS Ret;
+    CHAR Letter;
+    CHAR CurDir[MAX_PATH];
+
+    Log("Copy unattended XML ...");
+    
+    GetCurrentDirectory(sizeof(CurDir), CurDir);
+    Letter = CurDir[0];
+    if ((Letter >= 'A' && Letter <= 'Z') || (Letter >= 'a' && Letter <= 'z'))
+    {
+        Log("Current Drive Letter: %C", Letter);
+    }
+    else
+    {
+        Letter = 'X';
+    }
+
+    sprintf_s(CurDir, sizeof(CurDir), "%C:\\Autounattend.xml", Letter);
+    Log("Copy file <%s> --> <%s>", script, CurDir);
+    CopyFile(script, CurDir, FALSE);
+
+    Ret = RegCreateKeyEx(HKEY_LOCAL_MACHINE, "System\\Setup", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &dw);
+    if (ERROR_SUCCESS == Ret)
+    {
+        Ret = RegSetValueEx(hKey, "UnattendFile", 0, REG_SZ, CurDir, (DWORD)(strlen(CurDir) + 1));
+    }
+
+    return 0;
+}
+
 static int VentoyHook(ventoy_os_param *param)
 {
     int rc;
 static int VentoyHook(ventoy_os_param *param)
 {
     int rc;
@@ -755,6 +790,24 @@ static int VentoyHook(ventoy_os_param *param)
     // for protect
     rc = DeleteVentoyPart2MountPoint(DiskExtent.DiskNumber);
     Log("Delete ventoy mountpoint: %s", rc == 0 ? "SUCCESS" : "NO NEED");
     // for protect
     rc = DeleteVentoyPart2MountPoint(DiskExtent.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);
+        if (IsPathExist(FALSE, "%s", IsoPath))
+        {
+            Log("use auto install script %s...", IsoPath);
+            ProcessUnattendedInstallation(IsoPath);
+        }
+        else
+        {
+            Log("auto install script %s not exist", IsoPath);
+        }
+    }
+    else
+    {
+        Log("auto install no need");
+    }
 
     return 0;
 }
 
     return 0;
 }
@@ -815,11 +868,12 @@ int VentoyJump(INT argc, CHAR **argv, CHAR *LunchFile)
        for (PeStart = 0; PeStart < FileSize; PeStart += 16)
        {
                if (CheckOsParam((ventoy_os_param *)(Buffer + PeStart)) && 
        for (PeStart = 0; PeStart < FileSize; PeStart += 16)
        {
                if (CheckOsParam((ventoy_os_param *)(Buffer + PeStart)) && 
-                       CheckPeHead(Buffer + PeStart + sizeof(ventoy_os_param)))
+            CheckPeHead(Buffer + PeStart + sizeof(ventoy_os_param) + sizeof(ventoy_windows_data)))
                {
                        Log("Find os pararm at %u", PeStart);
 
             memcpy(&g_os_param, Buffer + PeStart, sizeof(ventoy_os_param));
                {
                        Log("Find os pararm at %u", PeStart);
 
             memcpy(&g_os_param, Buffer + PeStart, sizeof(ventoy_os_param));
+            memcpy(&g_windows_data, Buffer + PeStart + sizeof(ventoy_os_param), sizeof(ventoy_windows_data));            
             memcpy(g_os_param_reserved, g_os_param.vtoy_reserved, sizeof(g_os_param_reserved));
 
             if (g_os_param_reserved[0] == 1)
             memcpy(g_os_param_reserved, g_os_param.vtoy_reserved, sizeof(g_os_param_reserved));
 
             if (g_os_param_reserved[0] == 1)
@@ -837,7 +891,7 @@ int VentoyJump(INT argc, CHAR **argv, CHAR *LunchFile)
                                }
                        }
 
                                }
                        }
 
-                       PeStart += sizeof(ventoy_os_param);
+                       PeStart += sizeof(ventoy_os_param) + sizeof(ventoy_windows_data);
                        sprintf_s(LunchFile, MAX_PATH, "ventoy\\%s", GetFileNameInPath(ExeFileName));
                        SaveBuffer2File(LunchFile, Buffer + PeStart, FileSize - PeStart);
                        break;
                        sprintf_s(LunchFile, MAX_PATH, "ventoy\\%s", GetFileNameInPath(ExeFileName));
                        SaveBuffer2File(LunchFile, Buffer + PeStart, FileSize - PeStart);
                        break;
index ba20270ddb33c58aae2bf6a2dda465db81b0b859..35fa72768a343e794e7f881d29b1a3d786994878 100644 (file)
@@ -65,6 +65,12 @@ typedef struct ventoy_os_param
        UINT8   reserved[31];
 }ventoy_os_param;
 
        UINT8   reserved[31];
 }ventoy_os_param;
 
+typedef struct ventoy_windows_data
+{
+    char auto_install_script[384];
+    UINT8 reserved[128];
+}ventoy_windows_data;
+
 #pragma pack()
 
 
 #pragma pack()