]> glassweightruler.freedombox.rocks Git - Ventoy.git/blobdiff - INSTALL/grub/grub.cfg
Auto use memdisk mode for Memtest86+ iso file.
[Ventoy.git] / INSTALL / grub / grub.cfg
index 1107c78ee29a8dd737281dcd95fe9adff53f0129..3cf4778987663bc055f57524c39bca1c7e6e276b 100644 (file)
@@ -257,6 +257,10 @@ function distro_specify_initrd_file {
         vt_linux_specify_initrd_file /isolinux/initrd.gz
     fi
     
         vt_linux_specify_initrd_file /isolinux/initrd.gz
     fi
     
+    if vt_str_begin "$vt_volume_id" "QUBES"; then 
+        vt_linux_specify_initrd_file /images/pxeboot/initrd.img
+    fi
+    
     if [ "$vt_chosen_size" = "1133375488" ]; then
         if [ -d (loop)/boot/grub/x86_64-efi ]; then
             vt_cpio_busybox64 "64h"
     if [ "$vt_chosen_size" = "1133375488" ]; then
         if [ -d (loop)/boot/grub/x86_64-efi ]; then
             vt_cpio_busybox64 "64h"
@@ -742,7 +746,16 @@ function uefi_linux_menu_func {
         ventoy_acpi_param ${vtoy_chain_mem_addr} 2048
         ventoy_cli_console     
 
         ventoy_acpi_param ${vtoy_chain_mem_addr} 2048
         ventoy_cli_console     
 
+        unset vtGrub2Mode
         if vt_check_mode 3; then
         if vt_check_mode 3; then
+            set vtGrub2Mode=1
+        elif vt_str_begin "$vt_volume_id" "KRD"; then
+            if [ -f (loop)/boot/grub/grub.cfg.sig ]; then
+                set vtGrub2Mode=1
+            fi
+        fi
+
+        if [ -n "$vtGrub2Mode" ]; then
             ventoy_debug_pause
         else
             if [ "$VTOY_EFI_ARCH" != "mips" ]; then
             ventoy_debug_pause
         else
             if [ "$VTOY_EFI_ARCH" != "mips" ]; then
@@ -1290,14 +1303,30 @@ function iso_common_menuentry {
         set vtcompat=1
     fi
 
         set vtcompat=1
     fi
 
+
+    # auto memdisk mode for some special ISO files
+    vt_iso_vd_id_parse "${vtoy_iso_part}${vt_chosen_path}"    
+    unset vtMemDiskBoot
+    if vt_check_mode 0; then
+        set vtMemDiskBoot=1
+    else
+        if [ "$grub_platform" = "pc" ]; then
+            if vt_iso_vd_id_begin 1 0 "Memtest86+"; then
+                set vtMemDiskBoot=1
+            fi
+        fi 
+    fi
+    vt_iso_vd_id_clear
+        
+
     if [ "$grub_platform" = "pc" ]; then
     if [ "$grub_platform" = "pc" ]; then
-        if vt_check_mode 0; then
+        if [ -n "$vtMemDiskBoot" ]; then
             legacy_iso_memdisk $vtoy_iso_part "$vt_chosen_path"
         else
             legacy_iso_menu_func $vtoy_iso_part "$vt_chosen_path"
         fi
     else
             legacy_iso_memdisk $vtoy_iso_part "$vt_chosen_path"
         else
             legacy_iso_menu_func $vtoy_iso_part "$vt_chosen_path"
         fi
     else
-        if vt_check_mode 0; then
+        if [ -n "$vtMemDiskBoot" ]; then
             uefi_iso_memdisk $vtoy_iso_part  "$vt_chosen_path"
         else
             uefi_iso_menu_func $vtoy_iso_part  "$vt_chosen_path"
             uefi_iso_memdisk $vtoy_iso_part  "$vt_chosen_path"
         else
             uefi_iso_menu_func $vtoy_iso_part  "$vt_chosen_path"
@@ -2069,7 +2098,7 @@ function img_unsupport_menuentry {
 #############################################################
 #############################################################
 
 #############################################################
 #############################################################
 
-set VENTOY_VERSION="1.0.67"
+set VENTOY_VERSION="1.0.70"
 
 #ACPI not compatible with Window7/8, so disable by default
 set VTOY_PARAM_NO_ACPI=1
 
 #ACPI not compatible with Window7/8, so disable by default
 set VTOY_PARAM_NO_ACPI=1
@@ -2305,8 +2334,11 @@ if [ -n "$VTOY_DEFAULT_IMAGE" ]; then
         
         export timeout
         export default
         
         export timeout
         export default
-        
-        if [ "$vtHotkey" = "F4" ]; then
+
+        if [ "$vtHotkey" = "F2" ]; then
+            unset timeout
+            vt_browser_disk
+        elif [ "$vtHotkey" = "F4" ]; then
             ventoy_localboot
         elif [ "$vtHotkey" = "F5" ]; then
             ventoy_diagnosis
             ventoy_localboot
         elif [ "$vtHotkey" = "F5" ]; then
             ventoy_diagnosis