]> glassweightruler.freedombox.rocks Git - Ventoy.git/blobdiff - INSTALL/grub/grub.cfg
Fix a bug that Windows ISO in local disk can not install when boot through F2 browser...
[Ventoy.git] / INSTALL / grub / grub.cfg
index e2998ceba9480180e7654117625e156d585689b0..c44ff105862bb0cb347144f0155459e66659fd73 100644 (file)
@@ -113,7 +113,7 @@ function get_os_type {
     
     for file in "efi/microsoft/boot/bcd" "sources/boot.wim" "boot/bcd" "bootmgr.efi" "boot/etfsboot.com" ; do        
         if vt_file_exist_nocase (loop)/$file; then        
-            set vtoy_os=Windows
+            set vtoy_os=Windows            
             break
         fi
     done
@@ -500,6 +500,8 @@ function ventoy_freebsd_proc {
     if [ "$vt_freebsd_ver" = "xx" ]; then
         if [ -e (loop)/boot/kernel/kernel ]; then
             vt_unix_parse_freebsd_ver_elf (loop)/boot/kernel/kernel $vt_freebsd_bit vt_freebsd_ver
+        elif [ -e (loop)/boot/kernel/kernel.gz ]; then
+            vt_unix_parse_freebsd_ver_elf (loop)/boot/kernel/kernel.gz $vt_freebsd_bit vt_freebsd_ver
         fi
         
         if [ "$vt_freebsd_ver" = "xx" ]; then
@@ -551,6 +553,8 @@ function ventoy_dragonfly_proc {
 function ventoy_unix_comm_proc {
     vt_unix_reset
     
+    vt_unix_check_vlnk "${1}${chosen_path}"
+    
     if [ "$ventoy_compatible" = "NO" ]; then
         loopback vtunix $vtoy_efi_part/ventoy/ventoy_unix.cpio
         
@@ -1441,22 +1445,22 @@ function efi_common_menuentry {
         vt_vlnk_dst="${vtoy_iso_part}${vt_chosen_path}"
     fi
     
-    vt_concat_efi_iso "${vt_vlnk_dst}" vtoy_iso_buf
-    
     ventoy_debug_pause
-    
+
     ventoy_cli_console
+    
+    #first try with chainload
+    set vtOldRoot=$root
+    set root=$vtoy_iso_part
+    chainloader "${vt_vlnk_dst}"
+    boot
 
-    unset vtoy_dotefi_retry
+    #retry with isoboot
+    set root=$vtOldRoot
+    vt_concat_efi_iso "${vt_vlnk_dst}" vtoy_iso_buf    
     chainloader ${vtoy_path}/ventoy_${VTOY_EFI_ARCH}.efi memdisk env_param=${env_param} dotefi isoefi=on ${vtdebug_flag} mem:${vtoy_iso_buf_addr}:size:${vtoy_iso_buf_size}
-    boot
-    
-    if [ -n "$vtoy_dotefi_retry" ]; then
-        unset vtoy_dotefi_retry
-        chainloader "${vt_vlnk_dst}"
-        boot
-    fi
-    
+    boot    
+
     ventoy_gui_console
 }
 
@@ -2109,7 +2113,7 @@ function img_unsupport_menuentry {
 #############################################################
 #############################################################
 
-set VENTOY_VERSION="1.0.70"
+set VENTOY_VERSION="1.0.73"
 
 #ACPI not compatible with Window7/8, so disable by default
 set VTOY_PARAM_NO_ACPI=1
@@ -2263,6 +2267,11 @@ else
     terminal_output  gfxterm
 fi
 
+if [ "$grub_platform" = "efi" ]; then
+    set mouse_delta=4000
+    # terminal_input --append mouse
+fi
+
 if [ -n "$VTOY_DEFAULT_KBD_LAYOUT" ]; then
     set_keyboard_layout "$VTOY_DEFAULT_KBD_LAYOUT"
 fi
@@ -2345,11 +2354,11 @@ if [ $ventoy_img_count -gt 0 ]; then
     fi
 else
     if [ -n "$VTOY_NO_ISO_TIP" ]; then
-        NO_ISO_MENU="No ISO files found, $VTOY_NO_ISO_TIP"
+        NO_ISO_MENU="No ISO or supported IMG files found, $VTOY_NO_ISO_TIP"
     elif [ -n "$VTOY_DEFAULT_SEARCH_ROOT" ]; then
-        NO_ISO_MENU="No ISO files found, please check VTOY_DEFAULT_SEARCH_ROOT"
+        NO_ISO_MENU="No ISO or supported IMG files found, please check VTOY_DEFAULT_SEARCH_ROOT"
     else
-        NO_ISO_MENU="No ISO files found"
+        NO_ISO_MENU="No ISO or supported IMG files found"
     fi
     menuentry "$NO_ISO_MENU (Press enter to reboot ...)" {
         echo -e "\n    Rebooting ... "
@@ -2372,6 +2381,8 @@ if [ -n "$VTOY_DEFAULT_IMAGE" ]; then
         export timeout
         export default
 
+        vt_fn_mutex_lock 1
+
         if [ "$vtHotkey" = "F2" ]; then
             unset timeout
             vt_browser_disk
@@ -2383,6 +2394,8 @@ if [ -n "$VTOY_DEFAULT_IMAGE" ]; then
             ventoy_ext_menu
         fi
         
+        vt_fn_mutex_lock 0
+        
         unset timeout
         unset default
     fi