X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/Ventoy.git/blobdiff_plain/b347c1b5da1852eabaf0c3a15476ea0cd6b28e2e..faa0e46d3a10c1aef321ac024a7cb1dc86ee08d4:/INSTALL/grub/grub.cfg diff --git a/INSTALL/grub/grub.cfg b/INSTALL/grub/grub.cfg index 7f3347d..1d72aa2 100644 --- a/INSTALL/grub/grub.cfg +++ b/INSTALL/grub/grub.cfg @@ -130,9 +130,7 @@ function get_os_type { function vt_check_compatible_pe { #Check for PE without external tools - if [ -f "$1/HBCD_PE.ini" ]; then - set ventoy_compatible=YES - fi + return } function locate_initrd { @@ -638,6 +636,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 @@ -1399,7 +1399,7 @@ function vtoyboot_common_func { ventoy_pause fi fi - + vt_img_sector "${1}" vt_raw_chain_data "${1}" @@ -1627,13 +1627,15 @@ function ventoy_img_openwrt { fi vt_fs_enum_1st_dir (vtimghd,2) /lib/modules/ vt_dir_name - + if [ -f (vtimghd,2)/lib/modules/$vt_dir_name/dm-mod.ko ]; then + set openwrt_plugin_need=0 vt_img_extra_initrd_append (vtimghd,2)/lib/modules/$vt_dir_name/dm-mod.ko if [ -f (vtimghd,2)/lib/modules/$vt_dir_name/dax.ko ]; then vt_img_extra_initrd_append (vtimghd,2)/lib/modules/$vt_dir_name/dax.ko fi else + set openwrt_plugin_need=1 if [ ! -f ${vtoy_iso_part}/ventoy/ventoy_openwrt.xz ]; then ventoy_gui_console echo -e "\n ventoy_openwrt.xz not found. Please refer https://www.ventoy.net/en/doc_openwrt.html.\n" @@ -1657,12 +1659,14 @@ function ventoy_img_openwrt { 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 - vt_img_extra_initrd_append ${vtoy_iso_part}/ventoy/ventoy_openwrt.xz - + if [ $openwrt_plugin_need -eq 1 ]; then + if [ -f ${vtoy_iso_part}/ventoy/ventoy_openwrt.xz ]; then + vt_img_extra_initrd_append ${vtoy_iso_part}/ventoy/ventoy_openwrt.xz + fi + fi #boot image file vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=openwrt @@ -1704,6 +1708,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,8 +1731,11 @@ function img_common_menuentry { return fi - if [ -d (vtimghd)/ ]; then - loopback -d vtimghd + if [ "$grub_platform" = "pc" ]; then + if vt_check_mode 0; then + legacy_img_memdisk $vtoy_iso_part "$vt_chosen_path" + return + fi fi loopback vtimghd "${vtoy_iso_part}${vt_chosen_path}" @@ -1786,6 +1802,8 @@ function img_common_menuentry { fi fi + loopback -d vtimghd + set root=$vtback_root vt_pop_last_entry set theme=$vtback_theme @@ -1805,7 +1823,7 @@ function img_unsupport_menuentry { ############################################################# ############################################################# -set VENTOY_VERSION="1.0.46" +set VENTOY_VERSION="1.0.47" #ACPI not compatible with Window7/8, so disable by default set VTOY_PARAM_NO_ACPI=1