]> glassweightruler.freedombox.rocks Git - Ventoy.git/commitdiff
1.0.16 release v1.0.16
authorlongpanda <admin@ventoy.net>
Thu, 23 Jul 2020 10:45:02 +0000 (18:45 +0800)
committerlongpanda <admin@ventoy.net>
Thu, 23 Jul 2020 10:45:08 +0000 (18:45 +0800)
47 files changed:
EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/Ventoy/Ventoy.c
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy.c
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_def.h
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_plugin.c
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_windows.c
IMG/cpio/ventoy/init
INSTALL/EFI/BOOT/grubx64_real.efi
INSTALL/grub/debug.cfg
INSTALL/grub/grub.cfg
INSTALL/grub/i386-pc/core.img
INSTALL/grub/i386-pc/file.mod [deleted file]
INSTALL/plugin/ventoy/theme/background.png [new file with mode: 0644]
INSTALL/plugin/ventoy/theme/icons/deepin.png [new file with mode: 0644]
INSTALL/plugin/ventoy/theme/icons/red-hat.png [new file with mode: 0644]
INSTALL/plugin/ventoy/theme/icons/ubuntu.png [new file with mode: 0644]
INSTALL/plugin/ventoy/theme/icons/vtoyiso.png [new file with mode: 0644]
INSTALL/plugin/ventoy/theme/menu_c.png [new file with mode: 0644]
INSTALL/plugin/ventoy/theme/menu_e.png [new file with mode: 0644]
INSTALL/plugin/ventoy/theme/menu_n.png [new file with mode: 0644]
INSTALL/plugin/ventoy/theme/menu_ne.png [new file with mode: 0644]
INSTALL/plugin/ventoy/theme/menu_nw.png [new file with mode: 0644]
INSTALL/plugin/ventoy/theme/menu_s.png [new file with mode: 0644]
INSTALL/plugin/ventoy/theme/menu_se.png [new file with mode: 0644]
INSTALL/plugin/ventoy/theme/menu_sw.png [new file with mode: 0644]
INSTALL/plugin/ventoy/theme/menu_w.png [new file with mode: 0644]
INSTALL/plugin/ventoy/theme/select_c.png [new file with mode: 0644]
INSTALL/plugin/ventoy/theme/slider_c.png [new file with mode: 0644]
INSTALL/plugin/ventoy/theme/slider_n.png [new file with mode: 0644]
INSTALL/plugin/ventoy/theme/slider_s.png [new file with mode: 0644]
INSTALL/plugin/ventoy/theme/terminal_box_c.png [new file with mode: 0644]
INSTALL/plugin/ventoy/theme/terminal_box_e.png [new file with mode: 0644]
INSTALL/plugin/ventoy/theme/terminal_box_n.png [new file with mode: 0644]
INSTALL/plugin/ventoy/theme/terminal_box_ne.png [new file with mode: 0644]
INSTALL/plugin/ventoy/theme/terminal_box_nw.png [new file with mode: 0644]
INSTALL/plugin/ventoy/theme/terminal_box_s.png [new file with mode: 0644]
INSTALL/plugin/ventoy/theme/terminal_box_se.png [new file with mode: 0644]
INSTALL/plugin/ventoy/theme/terminal_box_sw.png [new file with mode: 0644]
INSTALL/plugin/ventoy/theme/terminal_box_w.png [new file with mode: 0644]
INSTALL/plugin/ventoy/theme/theme.txt [new file with mode: 0644]
INSTALL/plugin/ventoy/ventoy.json [new file with mode: 0644]
INSTALL/plugin/ventoy/ventoy_grub.cfg [new file with mode: 0644]
INSTALL/ventoy/ventoy.cpio
INSTALL/ventoy/vtoyjump32.exe
INSTALL/ventoy/vtoyjump64.exe
INSTALL/ventoy_pack.sh
vtoyjump/vtoyjump/vtoyjump.c
vtoyjump/vtoyjump/vtoyjump.h

index 2eeaa7a29589f0987fb17d04f2ac2e0180f40ee2..bd28ca268993583f1c448cd0721db237ff254b7b 100644 (file)
@@ -70,7 +70,7 @@ CONST CHAR16 *gEfiBootFileName[] =
     L"\\EFI\\BOOT\\GRUBX64.EFI",
     L"\\EFI\\BOOT\\BOOTx64.EFI",
     L"\\EFI\\BOOT\\bootx64.efi",
-    L"\\efi\\boot\\bootx64.efi"
+    L"\\efi\\boot\\bootx64.efi",
 };
 
 VOID EFIAPI VtoyDebug(IN CONST CHAR8  *Format, ...)
index 1a433edb5c4e6d4338d3417e5bf99159a4bf933e..43bdff5dc0866864ef24ca3e10f64b6940449c41 100644 (file)
@@ -2017,6 +2017,17 @@ static grub_err_t ventoy_cmd_dump_img_list(grub_extcmd_context_t ctxt, int argc,
     return 0;
 }
 
+static grub_err_t ventoy_cmd_dump_injection(grub_extcmd_context_t ctxt, int argc, char **args)
+{
+    (void)ctxt;
+    (void)argc;
+    (void)args;
+
+    ventoy_plugin_dump_injection();
+
+    return 0;
+}
+
 static grub_err_t ventoy_cmd_dump_auto_install(grub_extcmd_context_t ctxt, int argc, char **args)
 {
     (void)ctxt;
@@ -2361,6 +2372,7 @@ static cmd_para ventoy_cmds[] =
     { "vt_dynamic_menu", ventoy_cmd_dynamic_menu, 0, NULL, "", "", NULL },
     { "vt_check_mode", ventoy_cmd_check_mode, 0, NULL, "", "", NULL },
     { "vt_dump_img_list", ventoy_cmd_dump_img_list, 0, NULL, "", "", NULL },
+    { "vt_dump_injection", ventoy_cmd_dump_injection, 0, NULL, "", "", NULL },
     { "vt_dump_auto_install", ventoy_cmd_dump_auto_install, 0, NULL, "", "", NULL },
     { "vt_dump_persistence", ventoy_cmd_dump_persistence, 0, NULL, "", "", NULL },
     { "vt_select_auto_install", ventoy_cmd_sel_auto_install, 0, NULL, "", "", NULL },
index 7584f2a8887d7f5ba9f996ec9d31f616ba9dbffc..2bf4fec4e8eaefb472c119f517a08e916033813b 100644 (file)
@@ -672,6 +672,7 @@ void ventoy_swap_img(img_info *img1, img_info *img2);
 char * ventoy_plugin_get_cur_install_template(const char *isopath);
 install_template * ventoy_plugin_find_install_template(const char *isopath);
 persistence_config * ventoy_plugin_find_persistent(const char *isopath);
+void ventoy_plugin_dump_injection(void);
 void ventoy_plugin_dump_auto_install(void);
 int ventoy_fill_windows_rtdata(void *buf, char *isopath);
 int ventoy_plugin_get_persistent_chunklist(const char *isopath, int index, ventoy_img_chunk_list *chunk_list);
index a0ffde37d2f914d52695daa56f7517fe7173ae37..7fbe9db749b34cf8e506ce630fd84309fcaa08c3 100644 (file)
@@ -1087,6 +1087,20 @@ grub_err_t ventoy_cmd_load_plugin(grub_extcmd_context_t ctxt, int argc, char **a
     VENTOY_CMD_RETURN(GRUB_ERR_NONE);
 }
 
+void ventoy_plugin_dump_injection(void)
+{
+    injection_config *node = NULL;
+
+    for (node = g_injection_head; node; node = node->next)
+    {
+        grub_printf("\nIMAGE:<%s>\n", node->isopath);
+        grub_printf("ARCHIVE:<%s>\n", node->archive);
+    }
+
+    return;
+}
+
+
 void ventoy_plugin_dump_auto_install(void)
 {
     int i;
index 9dc3cc1cc690282264ba85c40ebb83a1f9273232..a9d3c81f63ad914473c7d81e7bfcfb29b5f35666 100644 (file)
@@ -726,8 +726,15 @@ int ventoy_fill_windows_rtdata(void *buf, char *isopath)
     script = (char *)ventoy_plugin_get_injection(pos);
     if (script)
     {
-        debug("injection archive <%s>\n", script);
-        grub_snprintf(data->injection_archive, sizeof(data->injection_archive) - 1, "%s", script);
+        if (ventoy_check_file_exist("%s%s", ventoy_get_env("vtoy_iso_part"), script))
+        {
+            debug("injection archive <%s> OK\n", script);
+            grub_snprintf(data->injection_archive, sizeof(data->injection_archive) - 1, "%s", script);
+        }
+        else
+        {
+            debug("injection archive <%s> NOT exist\n", script);
+        }
     }
     else
     {
index ff64a39a544a5f98abc81718030c1b46b4b8423a..ad5ac3a9ef149d8569a39017646f920a420ac22e 100644 (file)
@@ -186,21 +186,31 @@ fi
 # Step 3 : Extract injection archive                               #
 #                                                                  #
 ####################################################################
-if [ -e $VTOY_PATH/ventoy_injection ]; then
-    echo "decompress injection ..." >>$VTLOG
-    
+ventoy_unpack_injection() {
     vtmagic=$(hexdump -n 2 -e '2/1 "%02X"' $VTOY_PATH/ventoy_injection)
-    echo "vtmagic=$vtmagic ..." >>$VTLOG
+    echo "ventoy_unpack_injection  vtmagic=$vtmagic ..."
     
-    if [ "1F8B" = "vtmagic" ] || [ "1F9E" = "vtmagic" ]; then
-        zcat $VTOY_PATH/ventoy_injection | tar -xf -C /
-    elif [ "425A" = "vtmagic" ]; then
-        bzcat $VTOY_PATH/ventoy_injection | tar -xf -C /
-    elif [ "FD37" = "vtmagic" ]; then
-        xzcat $VTOY_PATH/ventoy_injection | tar -xf -C /
+    if [ "1F8B" = "$vtmagic" ] || [ "1F9E" = "$vtmagic" ]; then
+        echo "tar.gz  tar -xzvf"
+        tar -xzvf $VTOY_PATH/ventoy_injection -C /
+    elif [ "425A" = "$vtmagic" ]; then
+        echo "tar.bz2  tar -xjvf"
+        tar -xjvf $VTOY_PATH/ventoy_injection -C / 
+    elif [ "FD37" = "$vtmagic" ]; then
+        echo "tar.xz  tar -xJvf"
+        tar -xJvf $VTOY_PATH/ventoy_injection -C /
+    elif [ "5D00" = "$vtmagic" ]; then
+        echo "tar.lzma  tar -xavf"
+        tar -xavf $VTOY_PATH/ventoy_injection -C /
     else
-        unzip -o -q $VTOY_PATH/ventoy_injection -d /
+        echo "unzip -o"
+        unzip -o $VTOY_PATH/ventoy_injection -d /
     fi
+}
+
+if [ -e $VTOY_PATH/ventoy_injection ]; then
+    echo "### decompress injection ... ###" >>$VTLOG
+    ventoy_unpack_injection > $VTOY_PATH/injection.log 2>&1
 fi
 
 
index 4bf13df09dc42bf7a72449d3571a7bff421a142f..c87f356de4a4a7b0ff46f4a5ab616bba354c6609 100644 (file)
Binary files a/INSTALL/EFI/BOOT/grubx64_real.efi and b/INSTALL/EFI/BOOT/grubx64_real.efi differ
index d3c44c8adeaf4e2a3ae1fc78711d66b6543c789c..5abb39549d6a7bb07e858d3d17ee12745002c313 100644 (file)
@@ -54,7 +54,16 @@ submenu 'Check plugin json configuration (ventoy.json)' --class=debug_json {
         echo -e "\npress ENTER to exit ..."
         read vtInputKey
         unset pager
-    }    
+    }  
+
+    menuentry 'Check injection plugin configuration' --class=debug_injection {
+        set pager=1
+        vt_check_plugin_json $vt_plugin_path injection $vtoy_iso_part
+        
+        echo -e "\npress ENTER to exit ..."
+        read vtInputKey
+        unset pager
+    }      
     
     menuentry 'Return to previous menu [Esc]' --class=vtoyret VTOY_RET {
         echo 'Return ...'
index 91ec7e06e383c7fb7d381ad18c16ce3028ea2218..a4b8f85d6d1d3b0b90d91a4230c40cc6cb35e94d 100644 (file)
@@ -68,15 +68,15 @@ function ventoy_localboot {
 }
 
 function ventoy_ext_menu {    
-    #if [ -e $vt_plugin_path/ventoy/ventoy_grub.cfg ]; then
+    if [ -e $vt_plugin_path/ventoy/ventoy_grub.cfg ]; then
         set ventoy_new_context=1
         configfile $vt_plugin_path/ventoy/ventoy_grub.cfg
         unset ventoy_new_context
-    #else
-       echo "ventoy_grub.cfg NOT exist."
-       echo -e "\npress ENTER to exit ..."
-       read vtInputKey
-    #fi
+    else
+       echo "ventoy_grub.cfg NOT exist."
+       echo -e "\npress ENTER to exit ..."
+       read vtInputKey
+    fi
 }
 
 function get_os_type {
index d76bbafeeed81ba0d14307aae24f16bb65b2777f..0f4689ad966c4e45ac70e6e3b5cd205e029c2af8 100644 (file)
Binary files a/INSTALL/grub/i386-pc/core.img and b/INSTALL/grub/i386-pc/core.img differ
diff --git a/INSTALL/grub/i386-pc/file.mod b/INSTALL/grub/i386-pc/file.mod
deleted file mode 100644 (file)
index 29488fc..0000000
Binary files a/INSTALL/grub/i386-pc/file.mod and /dev/null differ
diff --git a/INSTALL/plugin/ventoy/theme/background.png b/INSTALL/plugin/ventoy/theme/background.png
new file mode 100644 (file)
index 0000000..5a5c771
Binary files /dev/null and b/INSTALL/plugin/ventoy/theme/background.png differ
diff --git a/INSTALL/plugin/ventoy/theme/icons/deepin.png b/INSTALL/plugin/ventoy/theme/icons/deepin.png
new file mode 100644 (file)
index 0000000..a071b75
Binary files /dev/null and b/INSTALL/plugin/ventoy/theme/icons/deepin.png differ
diff --git a/INSTALL/plugin/ventoy/theme/icons/red-hat.png b/INSTALL/plugin/ventoy/theme/icons/red-hat.png
new file mode 100644 (file)
index 0000000..df19452
Binary files /dev/null and b/INSTALL/plugin/ventoy/theme/icons/red-hat.png differ
diff --git a/INSTALL/plugin/ventoy/theme/icons/ubuntu.png b/INSTALL/plugin/ventoy/theme/icons/ubuntu.png
new file mode 100644 (file)
index 0000000..a8ad283
Binary files /dev/null and b/INSTALL/plugin/ventoy/theme/icons/ubuntu.png differ
diff --git a/INSTALL/plugin/ventoy/theme/icons/vtoyiso.png b/INSTALL/plugin/ventoy/theme/icons/vtoyiso.png
new file mode 100644 (file)
index 0000000..b4e8077
Binary files /dev/null and b/INSTALL/plugin/ventoy/theme/icons/vtoyiso.png differ
diff --git a/INSTALL/plugin/ventoy/theme/menu_c.png b/INSTALL/plugin/ventoy/theme/menu_c.png
new file mode 100644 (file)
index 0000000..75c165b
Binary files /dev/null and b/INSTALL/plugin/ventoy/theme/menu_c.png differ
diff --git a/INSTALL/plugin/ventoy/theme/menu_e.png b/INSTALL/plugin/ventoy/theme/menu_e.png
new file mode 100644 (file)
index 0000000..d4c7421
Binary files /dev/null and b/INSTALL/plugin/ventoy/theme/menu_e.png differ
diff --git a/INSTALL/plugin/ventoy/theme/menu_n.png b/INSTALL/plugin/ventoy/theme/menu_n.png
new file mode 100644 (file)
index 0000000..5af3469
Binary files /dev/null and b/INSTALL/plugin/ventoy/theme/menu_n.png differ
diff --git a/INSTALL/plugin/ventoy/theme/menu_ne.png b/INSTALL/plugin/ventoy/theme/menu_ne.png
new file mode 100644 (file)
index 0000000..8757868
Binary files /dev/null and b/INSTALL/plugin/ventoy/theme/menu_ne.png differ
diff --git a/INSTALL/plugin/ventoy/theme/menu_nw.png b/INSTALL/plugin/ventoy/theme/menu_nw.png
new file mode 100644 (file)
index 0000000..8757868
Binary files /dev/null and b/INSTALL/plugin/ventoy/theme/menu_nw.png differ
diff --git a/INSTALL/plugin/ventoy/theme/menu_s.png b/INSTALL/plugin/ventoy/theme/menu_s.png
new file mode 100644 (file)
index 0000000..6ba2734
Binary files /dev/null and b/INSTALL/plugin/ventoy/theme/menu_s.png differ
diff --git a/INSTALL/plugin/ventoy/theme/menu_se.png b/INSTALL/plugin/ventoy/theme/menu_se.png
new file mode 100644 (file)
index 0000000..959b609
Binary files /dev/null and b/INSTALL/plugin/ventoy/theme/menu_se.png differ
diff --git a/INSTALL/plugin/ventoy/theme/menu_sw.png b/INSTALL/plugin/ventoy/theme/menu_sw.png
new file mode 100644 (file)
index 0000000..959b609
Binary files /dev/null and b/INSTALL/plugin/ventoy/theme/menu_sw.png differ
diff --git a/INSTALL/plugin/ventoy/theme/menu_w.png b/INSTALL/plugin/ventoy/theme/menu_w.png
new file mode 100644 (file)
index 0000000..d4c7421
Binary files /dev/null and b/INSTALL/plugin/ventoy/theme/menu_w.png differ
diff --git a/INSTALL/plugin/ventoy/theme/select_c.png b/INSTALL/plugin/ventoy/theme/select_c.png
new file mode 100644 (file)
index 0000000..245259a
Binary files /dev/null and b/INSTALL/plugin/ventoy/theme/select_c.png differ
diff --git a/INSTALL/plugin/ventoy/theme/slider_c.png b/INSTALL/plugin/ventoy/theme/slider_c.png
new file mode 100644 (file)
index 0000000..7d630fd
Binary files /dev/null and b/INSTALL/plugin/ventoy/theme/slider_c.png differ
diff --git a/INSTALL/plugin/ventoy/theme/slider_n.png b/INSTALL/plugin/ventoy/theme/slider_n.png
new file mode 100644 (file)
index 0000000..41482c9
Binary files /dev/null and b/INSTALL/plugin/ventoy/theme/slider_n.png differ
diff --git a/INSTALL/plugin/ventoy/theme/slider_s.png b/INSTALL/plugin/ventoy/theme/slider_s.png
new file mode 100644 (file)
index 0000000..17adc2a
Binary files /dev/null and b/INSTALL/plugin/ventoy/theme/slider_s.png differ
diff --git a/INSTALL/plugin/ventoy/theme/terminal_box_c.png b/INSTALL/plugin/ventoy/theme/terminal_box_c.png
new file mode 100644 (file)
index 0000000..d0dd52a
Binary files /dev/null and b/INSTALL/plugin/ventoy/theme/terminal_box_c.png differ
diff --git a/INSTALL/plugin/ventoy/theme/terminal_box_e.png b/INSTALL/plugin/ventoy/theme/terminal_box_e.png
new file mode 100644 (file)
index 0000000..394cbe4
Binary files /dev/null and b/INSTALL/plugin/ventoy/theme/terminal_box_e.png differ
diff --git a/INSTALL/plugin/ventoy/theme/terminal_box_n.png b/INSTALL/plugin/ventoy/theme/terminal_box_n.png
new file mode 100644 (file)
index 0000000..476f8bc
Binary files /dev/null and b/INSTALL/plugin/ventoy/theme/terminal_box_n.png differ
diff --git a/INSTALL/plugin/ventoy/theme/terminal_box_ne.png b/INSTALL/plugin/ventoy/theme/terminal_box_ne.png
new file mode 100644 (file)
index 0000000..9e26959
Binary files /dev/null and b/INSTALL/plugin/ventoy/theme/terminal_box_ne.png differ
diff --git a/INSTALL/plugin/ventoy/theme/terminal_box_nw.png b/INSTALL/plugin/ventoy/theme/terminal_box_nw.png
new file mode 100644 (file)
index 0000000..5c3cba8
Binary files /dev/null and b/INSTALL/plugin/ventoy/theme/terminal_box_nw.png differ
diff --git a/INSTALL/plugin/ventoy/theme/terminal_box_s.png b/INSTALL/plugin/ventoy/theme/terminal_box_s.png
new file mode 100644 (file)
index 0000000..85a8901
Binary files /dev/null and b/INSTALL/plugin/ventoy/theme/terminal_box_s.png differ
diff --git a/INSTALL/plugin/ventoy/theme/terminal_box_se.png b/INSTALL/plugin/ventoy/theme/terminal_box_se.png
new file mode 100644 (file)
index 0000000..d8627ee
Binary files /dev/null and b/INSTALL/plugin/ventoy/theme/terminal_box_se.png differ
diff --git a/INSTALL/plugin/ventoy/theme/terminal_box_sw.png b/INSTALL/plugin/ventoy/theme/terminal_box_sw.png
new file mode 100644 (file)
index 0000000..67c600c
Binary files /dev/null and b/INSTALL/plugin/ventoy/theme/terminal_box_sw.png differ
diff --git a/INSTALL/plugin/ventoy/theme/terminal_box_w.png b/INSTALL/plugin/ventoy/theme/terminal_box_w.png
new file mode 100644 (file)
index 0000000..d066e2d
Binary files /dev/null and b/INSTALL/plugin/ventoy/theme/terminal_box_w.png differ
diff --git a/INSTALL/plugin/ventoy/theme/theme.txt b/INSTALL/plugin/ventoy/theme/theme.txt
new file mode 100644 (file)
index 0000000..dda7f27
--- /dev/null
@@ -0,0 +1,80 @@
+
+desktop-image: "background.png"
+title-text: " "
+title-color: "#ffffff"
+message-color: "#f2f2f2"
+
+terminal-box: "terminal_box_*.png"
+
++ boot_menu {
+  left = 10%
+  width = 80%
+  top = 30%
+  height = 50%
+
+  menu_pixmap_style = "menu_*.png"
+
+  item_color = "#ffffff"  
+  item_height = 30
+  
+  item_spacing = 1
+  item_padding = 1
+
+  selected_item_color= "#f2f2f2"
+  selected_item_pixmap_style = "select_*.png"
+
+  item_icon_space = 0
+
+  scrollbar = true
+  scrollbar_width = 10
+  scrollbar_thumb = "slider_*.png"
+}
+
++ progress_bar {
+  id = "__timeout__"
+  text = "@TIMEOUT_NOTIFICATION_SHORT@"
+
+  left = 20%
+  width = 60%
+  top = 85%
+
+  text_color = "red"
+  bar_style = "*"
+  highlight_style = "*"
+}
+
++ hbox{ 
+    left = 30%
+    top = 95%
+    width = 10%
+    height = 25
+    + label {text = "@VTOY_HOTKEY_TIP@" color = "blue" align = "left"} 
+}
+
+
++ hbox{ 
+    left = 30%
+    top = 95%-25
+    width = 10%
+    height = 25
+    + label {text = "@VTOY_MEM_DISK@" color = "red" align = "left"} 
+}
+
+
++ hbox{ 
+    left = 30%
+    top = 95%-50
+    width = 10%
+    height = 25
+    + label {text = "@VTOY_ISO_RAW@" color = "red" align = "left"} 
+}
+
+
++ hbox{ 
+    left = 90%
+    top = 55 
+    width = 10%
+    height = 25
+    + label {text = "@VTOY_ISO_UEFI_DRV@" color = "red" align = "left"} 
+}
+
diff --git a/INSTALL/plugin/ventoy/ventoy.json b/INSTALL/plugin/ventoy/ventoy.json
new file mode 100644 (file)
index 0000000..0452aab
--- /dev/null
@@ -0,0 +1,60 @@
+{
+    "control": [
+        { "VTOY_DEFAULT_MENU_MODE": "1" },
+        { "VTOY_FILT_DOT_UNDERSCORE_FILE": "1" }        
+    ],
+    
+    "theme": {
+        "file": "/ventoy/theme/theme.txt",        
+        "display_mode": "GUI",
+        "ventoy_left": "5%",
+        "ventoy_top": "95%",
+        "ventoy_color": "#0000ff"
+    },
+    
+    
+    "menu_class": [        
+        {
+            "key": "ubuntu",
+            "class": "ubuntu"
+        },        
+        {
+            "key": "deepin",
+            "class": "deepin"
+        },
+        {
+            "dir": "rhel",
+            "class": "red-hat"
+        }
+    ],
+    
+    "menu_alias": [
+        {
+            "image": "/ISO/MX-19.1_x64.iso",
+            "alias": "MX 19.1 ISO file For me"
+        },
+        {
+            "image": "/cn_windows_10_enterprise_ltsc_2019_x64_dvd_9c09ff24.iso",
+            "alias": "我的 Windows 10 系统"
+        }
+    ],
+    
+    "auto_install": [
+        {
+            "image": "/ISO/cn_windows_10.iso",
+            "template": "/ventoy/script/windows_unattended.cfg"
+        },
+        {
+            "image": "/ISO/cn_windows_server_2012_r2_vl_x64_dvd_2979220.iso",
+            "template": [
+                "/ventoy/script/windows_unattended1.xml",
+                "/ventoy/script/windows_unattended2.xml",
+                "/ventoy/script/windows_unattended3.xml",
+                "/ventoy/script/windows_unattended4.xml",
+                "/ventoy/script/windows_unattended5.xml",
+                "/ventoy/script/windows_unattended6.xml"
+            ]
+        }
+    ]
+    
+}
diff --git a/INSTALL/plugin/ventoy/ventoy_grub.cfg b/INSTALL/plugin/ventoy/ventoy_grub.cfg
new file mode 100644 (file)
index 0000000..f736fb9
--- /dev/null
@@ -0,0 +1,19 @@
+menuentry "My Custom Menu" --class=custom {\r
+    echo 'This is custom menu ... '\r
+    sleep 1    \r
+}\r
+\r
+submenu 'My Custom SubMenu -->' --class=customsub {        \r
+    menuentry "My Custom Menu2" --class=custom2 {\r
+        echo 'This is custom menu2 ... '\r
+        sleep 1    \r
+    }\r
+    \r
+    menuentry '<-- Return to previous menu [Esc]' --class=vtoyret VTOY_RET {\r
+        echo 'Return ...'\r
+    }\r
+}\r
+\r
+menuentry '<-- Return to previous menu [Esc]' --class=vtoyret VTOY_RET {\r
+    echo 'Return ...'\r
+}\r
index 82db8c5f2996593b9b4fc0bf6ce39c1faf17ee90..79d9b33c6e2486c48f10fbfb7a179f21a4c5dccf 100644 (file)
Binary files a/INSTALL/ventoy/ventoy.cpio and b/INSTALL/ventoy/ventoy.cpio differ
index c88bb8dcbda031efad48a004954b6e3ea625617d..5cf9f3501b533b772efc923f18811e98a4f444a7 100644 (file)
Binary files a/INSTALL/ventoy/vtoyjump32.exe and b/INSTALL/ventoy/vtoyjump32.exe differ
index f4cb00963b23e95b9b482e5bee27e50c57daa2c1..d03af3c2c88165145012fca2bd27da74aab4ce7b 100644 (file)
Binary files a/INSTALL/ventoy/vtoyjump64.exe and b/INSTALL/ventoy/vtoyjump64.exe differ
index 91c7840d8529f3a431702906ce1d6640c2d62817..73eb819c5da32c375921ec7257904b314ff5255b 100644 (file)
@@ -80,6 +80,7 @@ cp -a ./tool $tmpdir/
 rm -f $tmpdir/ENROLL_THIS_KEY_IN_MOKMANAGER.cer
 cp -a Ventoy2Disk.sh $tmpdir/
 cp -a README $tmpdir/
+cp -a plugin $tmpdir/
 cp -a CreatePersistentImg.sh $tmpdir/
 dos2unix -q $tmpdir/Ventoy2Disk.sh
 dos2unix -q $tmpdir/CreatePersistentImg.sh
index 66efff6ab802472bcc31f3ad3541051e0e493d0f..e4abc4f9095bb286a6c5b1f85ad855fc4eee0d81 100644 (file)
@@ -704,31 +704,76 @@ static int DeleteVentoyPart2MountPoint(DWORD PhyDrive)
     return 1;
 }
 
+static BOOL check_tar_archive(const char *archive, CHAR *tarName)
+{
+    int len;
+    int nameLen;
+    const char *pos = archive;
+    const char *slash = archive;
+
+    while (*pos)
+    {
+        if (*pos == '\\' || *pos == '/')
+        {
+            slash = pos;
+        }
+        pos++;
+    }
+
+    len = (int)strlen(slash);
+
+    if (len > 7 && (strncmp(slash + len - 7, ".tar.gz", 7) == 0 || strncmp(slash + len - 7, ".tar.xz", 7) == 0))
+    {
+        nameLen = (int)sprintf_s(tarName, MAX_PATH, "X:%s", slash);
+        tarName[nameLen - 3] = 0;
+        return TRUE;
+    }
+    else if (len > 8 && strncmp(slash + len - 8, ".tar.bz2", 8) == 0)
+    {
+        nameLen = (int)sprintf_s(tarName, MAX_PATH, "X:%s", slash);
+        tarName[nameLen - 4] = 0;
+        return TRUE;
+    }
+    else if (len > 9 && strncmp(slash + len - 9, ".tar.lzma", 9) == 0)
+    {
+        nameLen = (int)sprintf_s(tarName, MAX_PATH, "X:%s", slash);
+        tarName[nameLen - 5] = 0;
+        return TRUE;
+    }
+
+    return FALSE;
+}
+
 static int DecompressInjectionArchive(const char *archive, DWORD PhyDrive)
 {
     int rc = 1;
     BOOL bRet;
     DWORD dwBytes;
     HANDLE hDrive;
-    CHAR PhyPath[MAX_PATH];
+    HANDLE hOut;
+    DWORD flags = CREATE_NO_WINDOW;
+    CHAR StrBuf[MAX_PATH];
+    CHAR tarName[MAX_PATH];
     STARTUPINFOA Si;
     PROCESS_INFORMATION Pi;
+    PROCESS_INFORMATION NewPi;
     GET_LENGTH_INFORMATION LengthInfo;
+    SECURITY_ATTRIBUTES Sa = { sizeof(SECURITY_ATTRIBUTES), NULL, TRUE };
 
     Log("DecompressInjectionArchive %s", archive);
 
-    sprintf_s(PhyPath, sizeof(PhyPath), "\\\\.\\PhysicalDrive%d", PhyDrive);
-    hDrive = CreateFileA(PhyPath, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0);
+    sprintf_s(StrBuf, sizeof(StrBuf), "\\\\.\\PhysicalDrive%d", PhyDrive);
+    hDrive = CreateFileA(StrBuf, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0);
     if (hDrive == INVALID_HANDLE_VALUE)
     {
-        Log("Could not open the disk<%s>, error:%u", PhyPath, GetLastError());
+        Log("Could not open the disk<%s>, error:%u", StrBuf, GetLastError());
         goto End;
     }
 
     bRet = DeviceIoControl(hDrive, IOCTL_DISK_GET_LENGTH_INFO, NULL, 0, &LengthInfo, sizeof(LengthInfo), &dwBytes, NULL);
     if (!bRet)
     {
-        Log("Could not get phy disk %s size, error:%u", PhyPath, GetLastError());
+        Log("Could not get phy disk %s size, error:%u", StrBuf, GetLastError());
         goto End;
     }
 
@@ -750,17 +795,49 @@ static int DecompressInjectionArchive(const char *archive, DWORD PhyDrive)
             CopyFileFromFatDisk("/ventoy/7z/32/7za.exe", "ventoy\\7za.exe");
         }
 
-        sprintf_s(PhyPath, sizeof(PhyPath), "ventoy\\7za.exe x -y -aoa -oX:\\ %s", archive);
+        sprintf_s(StrBuf, sizeof(StrBuf), "ventoy\\7za.exe x -y -aoa -oX:\\ %s", archive);
 
         Log("extract inject to X:");
+        Log("cmdline:<%s>", StrBuf);
 
         GetStartupInfoA(&Si);
 
-        Si.dwFlags |= STARTF_USESHOWWINDOW;
-        Si.wShowWindow = SW_HIDE;
+        hOut = CreateFileA("ventoy\\7z.log",
+            FILE_APPEND_DATA,
+            FILE_SHARE_WRITE | FILE_SHARE_READ,
+            &Sa,
+            OPEN_ALWAYS,
+            FILE_ATTRIBUTE_NORMAL,
+            NULL);
+
+        Si.dwFlags |= STARTF_USESTDHANDLES;
+
+        if (hOut != INVALID_HANDLE_VALUE)
+        {
+            Si.hStdError = hOut;
+            Si.hStdOutput = hOut;
+        }
 
-        CreateProcessA(NULL, PhyPath, NULL, NULL, FALSE, 0, NULL, NULL, &Si, &Pi);
+        CreateProcessA(NULL, StrBuf, NULL, NULL, TRUE, flags, NULL, NULL, &Si, &Pi);
         WaitForSingleObject(Pi.hProcess, INFINITE);
+
+        //
+        // decompress tar archive, for tar.gz/tar.xz/tar.bz2
+        //
+        if (check_tar_archive(archive, tarName))
+        {
+            Log("Decompress tar archive...<%s>", tarName);
+
+            sprintf_s(StrBuf, sizeof(StrBuf), "ventoy\\7za.exe x -y -aoa -oX:\\ %s", tarName);
+
+            CreateProcessA(NULL, StrBuf, NULL, NULL, TRUE, flags, NULL, NULL, &Si, &NewPi);
+            WaitForSingleObject(NewPi.hProcess, INFINITE);
+
+            Log("Now delete %s", tarName);
+            DeleteFileA(tarName);
+        }
+
+        SAFE_CLOSE_HANDLE(hOut);
     }
     fl_shutdown();
 
index b3bd22fbdb497682c4966f4029f16293eefcd5c2..b3699e646f2566c913af55c586f71decdc57d6f4 100644 (file)
@@ -69,7 +69,7 @@ typedef struct ventoy_windows_data
 {
     char auto_install_script[384];
     char injection_archive[384];
-    UINT8 reserved[128];
+    UINT8 reserved[256];
 }ventoy_windows_data;
 
 #pragma pack()