]> glassweightruler.freedombox.rocks Git - Ventoy.git/blobdiff - INSTALL/grub/grub.cfg
1.0.04 release
[Ventoy.git] / INSTALL / grub / grub.cfg
index d89f45e0c242a96d18daeb5e0915ca777d0fb8f4..2a71af3664243b0e8baa1a401e2edb0dfe9df7f4 100644 (file)
@@ -146,6 +146,9 @@ function uefi_iso_menu_func {
 
     if [ -n "$vtisouefi" ]; then
         set LoadIsoEfiDriver=on
+        unset vtisouefi
+    elif [ -n "$VTOY_ISO_UEFI_DRV" ]; then
+        set LoadIsoEfiDriver=on
     else
         unset LoadIsoEfiDriver
     fi
@@ -161,7 +164,14 @@ function uefi_iso_menu_func {
     loopback loop ${1}${chosen_path}
     get_os_type (loop)
     
-    vt_check_compatible (loop)
+    if [ -n "$vtcompat" ]; then
+        set ventoy_compatible=YES
+        unset vtcompat
+    elif [ -n "$VTOY_ISO_RAW" ]; then
+        set ventoy_compatible=YES
+    else
+        vt_check_compatible (loop)
+    fi
     
     vt_img_sector ${1}${chosen_path}
     
@@ -178,6 +188,21 @@ function uefi_iso_menu_func {
     terminal_output  gfxterm    
 }
 
+function uefi_iso_memdisk {    
+    vt_chosen_img_path chosen_path
+
+    echo 'Loading ISO file to memory ...'
+    vt_load_iso_to_mem ${1}${chosen_path} vtoy_iso_buf
+    
+    terminal_output  console
+    chainloader ${vtoy_path}/ventoy_x64.efi memdisk env_param=${env_param} isoefi=${LoadIsoEfiDriver} ${vtdebug_flag} mem:${vtoy_iso_buf_addr}:size:${vtoy_iso_buf_size}
+    boot
+}
+
+
+
+
+
 function legacy_windows_menu_func {
     vt_windows_reset
     
@@ -280,7 +305,14 @@ function legacy_iso_menu_func {
     
     get_os_type (loop)
     
-    vt_check_compatible (loop)
+    if [ -n "$vtcompat" ]; then
+        set ventoy_compatible=YES
+        unset vtcompat
+    elif [ -n "$VTOY_ISO_RAW" ]; then
+        set ventoy_compatible=YES
+    else
+        vt_check_compatible (loop)
+    fi
     
     vt_img_sector ${1}${chosen_path}
 
@@ -294,8 +326,14 @@ function legacy_iso_menu_func {
     fi
 }
 
+function legacy_iso_memdisk {
+    vt_chosen_img_path chosen_path
 
-
+    linux16   $vtoy_path/memdisk iso raw    
+    echo "Loading ISO file to memory ..."
+    initrd16  ${1}${chosen_path}
+    boot
+}
 
 
 #############################################################
@@ -306,11 +344,15 @@ function legacy_iso_menu_func {
 #############################################################
 #############################################################
 
-set VENTOY_VERSION="1.0.02"
+set VENTOY_VERSION="1.0.04"
 
 #disable timeout
 unset timeout
 
+set VTOY_MEM_DISK_STR="MEMDISK"
+set VTOY_ISO_RAW_STR="ISO RAW"
+set VTOY_ISO_UEFI_DRV_STR="UEFI FS"
+
 vt_device $root  vtoy_dev
 
 if [ "$vtoy_dev" = "tftp" ]; then
@@ -357,9 +399,17 @@ if vt_cmp $ventoy_img_count ne 0; then
         vt_img_name $imgid img_name
         menuentry "$img_name" {  
             if [ "$grub_platform" = "pc" ]; then
-                legacy_iso_menu_func $iso_path
+                if [ -n "$VTOY_MEM_DISK" ]; then
+                    legacy_iso_memdisk $iso_path
+                else
+                    legacy_iso_menu_func $iso_path
+                fi
             else
-                uefi_iso_menu_func $iso_path                
+                if [ -n "$VTOY_MEM_DISK" ]; then
+                    uefi_iso_memdisk $iso_path 
+                else
+                    uefi_iso_menu_func $iso_path                
+                fi
             fi            
         }