X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/Ventoy.git/blobdiff_plain/07d4140cf45c2fb7f9d4f5823b2bd8d73626dfc9..0b7fa630a477204220c87eac8a4005ee9f205d64:/INSTALL/grub/grub.cfg diff --git a/INSTALL/grub/grub.cfg b/INSTALL/grub/grub.cfg index a447747..0ef39ea 100644 --- a/INSTALL/grub/grub.cfg +++ b/INSTALL/grub/grub.cfg @@ -130,9 +130,12 @@ function get_os_type { function vt_check_compatible_pe { #Check for PE without external tools - if [ -f "$1/HBCD_PE.ini" ]; then + #set compatible if ISO file is less than 80MB + if [ $vt_chosen_size -gt 33554432 -a $vt_chosen_size -le 83886080 ]; then set ventoy_compatible=YES fi + + return } function locate_initrd { @@ -161,7 +164,7 @@ function distro_specify_wim_patch { vt_windows_collect_wim_patch wim /BOOT/H3_7PE.WIM vt_windows_collect_wim_patch wim /BOOT/H3_8PE.WIM vt_windows_collect_wim_patch wim /BOOT/H3_81PE.WIM - fi + fi } function distro_specify_wim_patch_phase2 { @@ -550,6 +553,22 @@ function uefi_windows_menu_func { fi } +function uefi_find_replace_initrd { + if vt_get_efi_vdisk_offset "${1}${2}" vt_efivdisk_offset; then + loopback -s $vt_efivdisk_offset vtefivdisk "${1}${2}" + + unset vt_rp_initrd + vt_search_replace_initrd (vtefivdisk) vt_rp_initrd + + if [ -n "$vt_rp_initrd" ]; then + vt_add_replace_file $3 "$vt_rp_initrd" + fi + + loopback -d vtefivdisk + ventoy_debug_pause + fi +} + function uefi_linux_menu_func { if [ "$ventoy_compatible" = "NO" ]; then @@ -631,6 +650,11 @@ function uefi_linux_menu_func { elif [ -f (loop)/loader/entries/pisi-efi-x86_64.conf ]; then vt_add_replace_file $vtindex "EFI\\pisi\\initrd.img" fi + + vt_get_replace_file_cnt vt_replace_cnt + if [ $vt_replace_cnt -eq 0 ]; then + uefi_find_replace_initrd "$1" "$2" $vtindex + fi elif [ -d (loop)/EFI/boot/entries ]; then if [ -f (loop)/parabola/boot/x86_64/parabolaiso.img ]; then vt_add_replace_file 0 "EFI\\parabolaiso\\parabolaiso.img" @@ -902,7 +926,7 @@ function legacy_windows_menu_func { loopback loop "$1$2" fi - for file in "boot/bcd" "/efi/microsoft/boot/bcd" "SSTR/BCD"; do + for file in "boot/bcd" "/efi/microsoft/boot/bcd" "SSTR/BCD" "boot/bce"; do vt_windows_collect_wim_patch bcd (loop)/$file done @@ -942,6 +966,14 @@ function legacy_linux_menu_func { set ventoy_fs_probe=iso9660 loopback loop "$1$2" fi + + if [ -f (loop)/isolinux/isolinux.cfg ]; then + if vt_iso9660_isjoliet; then + vt_iso9660_nojoliet 1 + loopback -d loop + loopback loop "$1$2" + fi + fi vt_load_cpio $vtoy_path "$2" "$1" "busybox=$ventoy_busybox_ver" @@ -1740,10 +1772,6 @@ function img_common_menuentry { fi fi - if [ -d (vtimghd)/ ]; then - loopback -d vtimghd - fi - loopback vtimghd "${vtoy_iso_part}${vt_chosen_path}" vt_img_sector "${vtoy_iso_part}${vt_chosen_path}" @@ -1808,6 +1836,8 @@ function img_common_menuentry { fi fi + loopback -d vtimghd + set root=$vtback_root vt_pop_last_entry set theme=$vtback_theme @@ -1827,7 +1857,7 @@ function img_unsupport_menuentry { ############################################################# ############################################################# -set VENTOY_VERSION="1.0.46" +set VENTOY_VERSION="1.0.49" #ACPI not compatible with Window7/8, so disable by default set VTOY_PARAM_NO_ACPI=1