]> glassweightruler.freedombox.rocks Git - Ventoy.git/blobdiff - INSTALL/grub/grub.cfg
Update README.md
[Ventoy.git] / INSTALL / grub / grub.cfg
index 7f3347dac08c2d7a306458c5c7184fa004791384..6c3c10d4def6f204af04f6596a5e7dd1ba7bf3eb 100644 (file)
@@ -638,6 +638,8 @@ function uefi_linux_menu_func {
                 vt_add_replace_file 0 "EFI\\hyperiso\\hyperiso.img"
             fi
         elif [ -d (loop)/EFI/BOOT/entries ]; then
+            vt_linux_get_main_initrd_index vtindex
+
             if [ -f (loop)/parabola/boot/x86_64/parabolaiso.img ]; then
                 vt_add_replace_file 0 "EFI\\parabolaiso\\parabolaiso.img"
             elif [ -f (loop)/parabola/boot/x86_64/initramfs-linux-libre.img ]; then
@@ -1704,6 +1706,15 @@ function img_unsupport_tip {
     read vtInputKey 
 }
 
+function legacy_img_memdisk {
+    linux16   $vtoy_path/memdisk
+    echo "Loading img file to memory ..."
+    initrd16  "${1}${2}"
+    
+    ventoy_cli_console
+    boot
+}
+
 function img_common_menuentry {
     set ventoy_compatible=YES
     set ventoy_busybox_ver=32
@@ -1718,6 +1729,13 @@ function img_common_menuentry {
         return
     fi
 
+    if [ "$grub_platform" = "pc" ]; then
+        if vt_check_mode 0; then
+            legacy_img_memdisk $vtoy_iso_part "$vt_chosen_path"
+            return
+        fi
+    fi
+
     if [ -d (vtimghd)/ ]; then
         loopback -d vtimghd
     fi