]> glassweightruler.freedombox.rocks Git - Ventoy.git/blobdiff - INSTALL/grub/grub.cfg
Add VTOY_MAX_SEARCH_LEVEL option in global control plugin
[Ventoy.git] / INSTALL / grub / grub.cfg
index 70c97b2afc6b25a235f42f27bda3eb1513d6f803..9edba9e1cce97cdecd9fe4bc8f528b0f9549783e 100644 (file)
@@ -646,8 +646,35 @@ function uefi_linux_menu_func {
     if [ -n "$vtoy_chain_mem_addr" ]; then
         ventoy_acpi_param ${vtoy_chain_mem_addr} 2048
         ventoy_cli_console       
-        chainloader ${vtoy_path}/ventoy_${VTOY_EFI_ARCH}.efi  env_param=${env_param} isoefi=${LoadIsoEfiDriver} FirstTry=${FirstTryBootFile} ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
+        chainloader ${vtoy_path}/ventoy_${VTOY_EFI_ARCH}.efi fallback env_param=${env_param} isoefi=${LoadIsoEfiDriver} FirstTry=${FirstTryBootFile} ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
         boot
+        
+        # fallback
+        set vtback_root=$root        
+        vt_push_last_entry
+        set vtback_theme=$theme
+        unset theme
+        
+        vt_trailer_cpio "$vtoy_iso_part" "$vt_chosen_path" noinit
+        vt_set_boot_opt rdinit=/vtoy/vtoy
+
+        set root=(loop)
+        for cfg in "/boot/grub/grub.cfg" "/EFI/BOOT/grub.cfg" "/EFI/debian/grub.cfg" "EFI/boot/grub.cfg" "efi/boot/grub.cfg" "/grub/grub.cfg" "EFI/BOOT/BOOTX64.conf"; do
+            if [ -e "$cfg" ]; then
+                configfile "$cfg"
+                break
+            fi
+        done
+
+        vt_unset_boot_opt
+        set root=$vtback_root        
+        set theme=$vtback_theme
+        vt_pop_last_entry
+        ventoy_gui_console
+
+        echo "No bootfile found for UEFI!"
+        echo "Maybe the image does not support $VTOY_EFI_ARCH UEFI"
+        echo " "
     else
         echo "chain empty failed"
         ventoy_pause
@@ -1546,7 +1573,7 @@ function img_unsupport_menuentry {
 #############################################################
 #############################################################
 
-set VENTOY_VERSION="1.0.34"
+set VENTOY_VERSION="1.0.36"
 
 #ACPI not compatible with Window7/8, so disable by default
 set VTOY_PARAM_NO_ACPI=1