]> glassweightruler.freedombox.rocks Git - Ventoy.git/blobdiff - INSTALL/grub/grub.cfg
Merge branch 'master' of https://github.com/ventoy/Ventoy
[Ventoy.git] / INSTALL / grub / grub.cfg
index 4840c576f262a20dad92b09c08fa4438b4327eed..e110bc869fa39900f7afd6fc65dbc3455de407ab 100644 (file)
@@ -1390,7 +1390,19 @@ function efi_common_menuentry {
         return
     fi
     
-    vt_concat_efi_iso "${vtoy_iso_part}${vt_chosen_path}" vtoy_iso_buf
+    unset vt_vlnk_dst
+    if vt_is_vlnk_name "${vt_chosen_path}"; then
+        vt_get_vlnk_dst "${vtoy_iso_part}${vt_chosen_path}" vt_vlnk_dst
+        if [ -z "$vt_vlnk_dst" ]; then
+            echo -e "\n### VLNK FILE NOT FOUND ###\n### VLNK 文件不存在 ###\n"            
+            ventoy_pause
+            return
+        fi
+    else
+        vt_vlnk_dst="${vtoy_iso_part}${vt_chosen_path}"
+    fi
+    
+    vt_concat_efi_iso "${vt_vlnk_dst}" vtoy_iso_buf
     
     ventoy_debug_pause
     
@@ -1402,7 +1414,7 @@ function efi_common_menuentry {
     
     if [ -n "$vtoy_dotefi_retry" ]; then
         unset vtoy_dotefi_retry
-        chainloader "${vtoy_iso_part}${vt_chosen_path}"
+        chainloader "${vt_vlnk_dst}"
         boot
     fi
     
@@ -1438,17 +1450,6 @@ function vhdboot_common_func {
 }
 
 function vhd_common_menuentry {
-
-    if [ "$VTOY_VHD_NO_WARNING" != "1" ]; then
-        if [ "$vtoy_iso_fs" != "ntfs" ]; then
-            echo -e "!!! WARNING !!!\n"
-            echo -e "\nPartition1 ($vtoy_iso_fs) is NOT ntfs, the VHD(x) file may not boot normally \n"
-            echo -e "\nVHD(x) 文件所在分区不是 ntfs 格式, 可能无法正常启动 \n\n"
-            echo -n "press ENTER to continue boot (请按 回车 键继续) ..."    
-            read vtInputKey
-        fi
-    fi
-
     vt_chosen_img_path vt_chosen_path vt_chosen_size
     
     if vt_check_password "${vt_chosen_path}"; then
@@ -1459,7 +1460,28 @@ function vhd_common_menuentry {
         return
     fi
     
-    vhdboot_common_func "${vt_chosen_path}"
+    unset vt_vlnk_dst
+    if vt_is_vlnk_name "${vt_chosen_path}"; then
+        vt_get_vlnk_dst "${vtoy_iso_part}${vt_chosen_path}" vt_vlnk_dst
+        if [ -z "$vt_vlnk_dst" ]; then
+            echo -e "\n### VLNK FILE NOT FOUND ###\n### VLNK 文件不存在 ###\n"            
+            ventoy_pause
+            return
+        fi
+    else
+        vt_vlnk_dst="${vt_chosen_path}"
+        if [ "$VTOY_VHD_NO_WARNING" != "1" ]; then
+            if [ "$vtoy_iso_fs" != "ntfs" ]; then
+                echo -e "!!! WARNING !!!\n"
+                echo -e "\nPartition1 ($vtoy_iso_fs) is NOT ntfs, the VHD(x) file may not boot normally \n"
+                echo -e "\nVHD(x) 文件所在分区不是 ntfs 格式, 可能无法正常启动 \n\n"
+                echo -n "press ENTER to continue boot (请按 回车 键继续) ..."    
+                read vtInputKey
+            fi
+        fi
+    fi
+    
+    vhdboot_common_func "${vt_vlnk_dst}"
 }
 
 function vhd_unsupport_menuentry {
@@ -1535,7 +1557,19 @@ function vtoy_common_menuentry {
         return
     fi
     
-    vtoyboot_common_func "${vtoy_iso_part}${vt_chosen_path}"
+    unset vt_vlnk_dst
+    if vt_is_vlnk_name "${vt_chosen_path}"; then
+        vt_get_vlnk_dst "${vtoy_iso_part}${vt_chosen_path}" vt_vlnk_dst
+        if [ -z "$vt_vlnk_dst" ]; then
+            echo -e "\n### VLNK FILE NOT FOUND ###\n### VLNK 文件不存在 ###\n"            
+            ventoy_pause
+            return
+        fi
+    else
+        vt_vlnk_dst="${vtoy_iso_part}${vt_chosen_path}"
+    fi
+    
+    vtoyboot_common_func "${vt_vlnk_dst}"
 }
 
 function vtoy_unsupport_menuentry {
@@ -1688,9 +1722,23 @@ function ventoy_img_ubos {
 }
 
 function ventoy_img_recalbox {
+    if [ $vtoy_img_max_part_end -gt $vt_chosen_size ]; then
+        echo -e "\nPlease extend the img file size before boot it. \n"
+        ventoy_pause
+        return
+    fi
+
     vt_load_cpio  $vtoy_path  "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
     vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit
 
+    if [ -e (vtimghd,1)/boot/recalbox ]; then
+        loopback recalbox (vtimghd,1)/boot/recalbox
+        vt_get_lib_module_ver (recalbox) /lib/modules/ vt_module_ver
+        if [ -n "$vt_module_ver" ]; then        
+            vt_img_extra_initrd_append  (recalbox)/lib/modules/$vt_module_ver/kernel/drivers/md/dm-mod.ko
+        fi
+    fi
+
     ventoy_debug_pause
 
     #boot image file
@@ -1971,7 +2019,7 @@ function img_common_menuentry {
         ventoy_img_batocera
     elif vt_str_begin "$vtImgHd1Label" "Tails"; then
         ventoy_img_tails
-    elif [ "$vtImgHd2Label" = "RECALBOX" ]; then
+    elif [ "$vtImgHd2Label" = "RECALBOX" -o "$vtImgHd1Label" = "RECALBOX" ]; then
         ventoy_img_recalbox
     elif [ "$vtImgHd1Label" = "ESYSRESCUE" ]; then
         ventoy_img_esysrescue
@@ -2022,7 +2070,7 @@ function img_unsupport_menuentry {
 #############################################################
 #############################################################
 
-set VENTOY_VERSION="1.0.65"
+set VENTOY_VERSION="1.0.66"
 
 #ACPI not compatible with Window7/8, so disable by default
 set VTOY_PARAM_NO_ACPI=1
@@ -2030,7 +2078,7 @@ set VTOY_PARAM_NO_ACPI=1
 # Default menu display mode, you can change it as you want.
 #    0: List mode   
 #    1: TreeView mode
-set VTOY_DEFAULT_MENU_MODE=0
+set VTOY_DEFAULT_MENU_MODE=1
 
 set VTOY_MEM_DISK_STR="[Memdisk]"
 set VTOY_ISO_RAW_STR="Compatible Mode"
@@ -2142,6 +2190,7 @@ else
     set VTOY_HOTKEY_TIP="h:Help  F1:Memdisk  F2:Power  F3:ListView  F4:Localboot  F5:Tools  F6:ExMenu"
 fi
 
+terminal_output  console
 
 if [ -n "$vtoy_gfxmode" ]; then
     set gfxmode=$vtoy_gfxmode