]> glassweightruler.freedombox.rocks Git - Ventoy.git/blobdiff - INSTALL/grub/grub.cfg
Optimization for booting memtest86-usb.img.
[Ventoy.git] / INSTALL / grub / grub.cfg
index 71750eef5537dfcd584691cf8b6386acaa3fb24c..4c9a15dbf258288ac1852b856b2dfdb31fb68fe0 100644 (file)
 # 
 #************************************************************************************
 
+if [ "$grub_platform" = "pc" ]; then
+    insmod setkey
+    insmod regexp
+    insmod video_fb
+fi
+
 function ventoy_pause {
     echo "press Enter to continue ......"
     read vtTmpPause
@@ -2314,14 +2320,15 @@ function img_common_menuentry {
     elif [ -f (vtimghd,2)/loader/entries/ubos.conf ]; then
         ventoy_img_ubos
     elif [ -f (vtimghd,2)/etc/openwrt_version ]; then
-        ventoy_img_openwrt
-    elif [ -f (vtimghd,1)/efi/boot/mt86.png ]; then 
-        if [ "$grub_platform" = "pc" ]; then
-            img_unsupport_tip
-        else
-            ventoy_img_memtest86            
-        fi    
+        ventoy_img_openwrt    
     else
+        if [ -f (vtimghd,1)/efi/boot/mt86.png ]; then 
+            if [ "$grub_platform" = "pc" ]; then
+                img_unsupport_tip
+            fi 
+        fi
+
+        #common chain
         vt_linux_chain_data "${vtoy_iso_part}${vt_chosen_path}"
         ventoy_acpi_param ${vtoy_chain_mem_addr} 512
         if [ "$grub_platform" = "pc" ]; then 
@@ -2346,6 +2353,28 @@ function img_unsupport_menuentry {
     common_unsupport_menuentry
 }
 
+function mimg_common_menuentry {
+    vt_chosen_img_path vt_chosen_path vt_chosen_size vt_chosen_name
+
+    if vt_check_password "${vt_chosen_path}"; then
+        return
+    fi
+
+    echo "memdisk mode boot for $vt_chosen_path"
+    echo ""
+    ventoy_debug_pause
+
+    if [ "$grub_platform" = "pc" ]; then
+        legacy_img_memdisk $vtoy_iso_part "$vt_chosen_path"
+    else
+        vt_load_img_memdisk "$vtoy_iso_part$vt_chosen_path" vtoy_img_buf
+        ventoy_cli_console
+        chainloader ${vtoy_path}/ventoy_${VTOY_EFI_ARCH}.efi memdisk env_param=${env_param} isoefi=${LoadIsoEfiDriver} ${vtdebug_flag} mem:${vtoy_img_buf_addr}:size:${vtoy_img_buf_size}
+        boot
+        ventoy_gui_console    
+    fi      
+}
+
 #############################################################
 #############################################################
 #############################################################
@@ -2354,7 +2383,7 @@ function img_unsupport_menuentry {
 #############################################################
 #############################################################
 
-set VENTOY_VERSION="1.0.83"
+set VENTOY_VERSION="1.0.84"
 
 #ACPI not compatible with Window7/8, so disable by default
 set VTOY_PARAM_NO_ACPI=1
@@ -2457,9 +2486,9 @@ else
 fi
 
 if [ -n "$VTOY_MENU_LANGUAGE" ]; then
-    vt_load_menu_lang "$VTOY_MENU_LANGUAGE"
+    vt_init_menu_lang "$VTOY_MENU_LANGUAGE"
 else
-    vt_load_menu_lang en_US
+    vt_init_menu_lang en_US
 fi
 
 if [ -n "$VTOY_MENU_TIMEOUT" ]; then