Improvement for UEFI boot compatibility.

This commit is contained in:
longpanda
2021-03-02 15:39:27 +08:00
parent 3c35345e38
commit 324c97883a
7 changed files with 1181 additions and 19 deletions

View 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