X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/Ventoy.git/blobdiff_plain/17f9e2fd09d973d39885348fee4906da3aa190ac..96f11252d942e93515c2041240497b6a265e3c78:/INSTALL/grub/grub.cfg diff --git a/INSTALL/grub/grub.cfg b/INSTALL/grub/grub.cfg index 8b5396f..e867f8a 100644 --- a/INSTALL/grub/grub.cfg +++ b/INSTALL/grub/grub.cfg @@ -16,6 +16,11 @@ # #************************************************************************************ +if [ "$grub_platform" = "pc" ]; then + insmod setkey + insmod regexp +fi + function ventoy_pause { echo "press Enter to continue ......" read vtTmpPause @@ -65,6 +70,10 @@ function ventoy_vcfg_proc { fi } +function ventoy_language { + configfile $prefix/menulang.cfg +} + function ventoy_diagnosis { vt_enum_video_mode configfile $prefix/debug.cfg @@ -81,7 +90,7 @@ function ventoy_ext_menu { unset ventoy_new_context else echo "ventoy_grub.cfg NOT exist." - echo -e "\npress ENTER to exit ..." + echo -en "\n$VTLANG_ENTER_EXIT ..." read vtInputKey fi } @@ -99,8 +108,9 @@ function ventoy_show_help { fi loopback vt_help_tarfs mem:${vtoy_help_txt_mem_addr}:size:${vtoy_help_txt_mem_size} - if [ -f "(vt_help_tarfs)/help/${VTOY_HELP_TXT_LANGUAGE}.txt" ]; then - cat "(vt_help_tarfs)/help/${VTOY_HELP_TXT_LANGUAGE}.txt" + vt_cur_menu_lang vtCurLang + if [ -f "(vt_help_tarfs)/help/${vtCurLang}.txt" ]; then + cat "(vt_help_tarfs)/help/${vtCurLang}.txt" else cat "(vt_help_tarfs)/help/en_US.txt" fi @@ -108,9 +118,15 @@ function ventoy_show_help { fi } +function ventoy_load_menu_lang_file { + vt_load_file_to_mem "auto" $prefix/menu.tar.gz vtoy_menu_lang_mem + loopback vt_menu_tarfs mem:${vtoy_menu_lang_mem_addr}:size:${vtoy_menu_lang_mem_size} +} + function get_os_type { set vtoy_os=Linux - + export vtoy_os + if vt_str_begin "$vt_volume_id" "DLC Boot"; then if [ -f (loop)/DLCBoot.exe ]; then set vtoy_os=Windows @@ -211,6 +227,8 @@ function distro_specify_wim_patch { function distro_specify_wim_patch_phase2 { if [ -f (loop)/boot/boot.wim ]; then vt_windows_collect_wim_patch wim /boot/boot.wim + elif [ -f (loop)/sources/boot.wim ]; then + vt_windows_collect_wim_patch wim /sources/boot.wim fi if vt_str_begin "$vt_volume_id" "DLC Boot"; then @@ -383,20 +401,25 @@ function distro_specify_initrd_file_phase2 { vt_linux_specify_initrd_file /boot/full.cz elif [ -f (loop)/images/pxeboot/initrd.img ]; then vt_linux_specify_initrd_file /images/pxeboot/initrd.img - + elif [ -f (loop)/live/initrd ]; then + vt_linux_specify_initrd_file /live/initrd + elif [ -f (loop)/initramfs-linux.img ]; then + vt_linux_specify_initrd_file /initramfs-linux.img + elif [ -f (loop)/boot/isolinux/initrd.gz ]; then + vt_linux_specify_initrd_file /boot/isolinux/initrd.gz fi } + function ventoy_get_ghostbsd_ver { # fallback to parse version from elf /boot/kernel/kernel set vt_freebsd_ver=xx } function ventoy_get_furybsd_ver { - if regexp "13\.[0-9]" "$2"; then - set vt_freebsd_ver=13.x - else - set vt_freebsd_ver=12.x + set vt_freebsd_ver=12.x + if regexp --set 1:vtFuryVer "(14|13)\.[0-9]" "$2"; then + set vt_freebsd_ver=${vtFuryVer}.x fi } @@ -405,12 +428,8 @@ function ventoy_get_freenas_ver { if [ -e (loop)/FreeNAS-MANIFEST ]; then vt_parse_freenas_ver (loop)/FreeNAS-MANIFEST vt_freenas_ver - if regexp "^13\.[0-9]" "$vt_freenas_ver"; then - set vt_freebsd_ver=13.x - elif regexp "^12\.[0-9]" "$vt_freenas_ver"; then - set vt_freebsd_ver=12.x - elif regexp "^11\.[0-9]" "$vt_freenas_ver"; then - set vt_freebsd_ver=11.x + if regexp --set 1:vtNasVer "^(14|13|12|11)\.[0-9]" "$vt_freenas_ver"; then + set vt_freebsd_ver=${vtNasVer}.x fi fi } @@ -420,12 +439,8 @@ function ventoy_get_truenas_ver { if [ -e (loop)/TrueNAS-MANIFEST ]; then vt_parse_freenas_ver (loop)/TrueNAS-MANIFEST vt_truenas_ver - if regexp "^13\.[0-9]" "$vt_truenas_ver"; then - set vt_freebsd_ver=13.x - elif regexp "^12\.[0-9]" "$vt_truenas_ver"; then - set vt_freebsd_ver=12.x - elif regexp "^11\.[0-9]" "$vt_truenas_ver"; then - set vt_freebsd_ver=11.x + if regexp --set 1:vtTNasVer "^(14|13|12|11)\.[0-9]" "$vt_truenas_ver"; then + set vt_freebsd_ver=${vtTNasVer}.x fi fi } @@ -457,49 +472,25 @@ function ventoy_freebsd_proc { ventoy_get_truenas_ver "$1" "${chosen_path}" elif vt_strstr "$vt_volume_id" "FURYBSD"; then ventoy_get_furybsd_ver "$1" "${chosen_path}" - elif regexp "^13_[0-9]" "$vt_volume_id"; then - set vt_freebsd_ver=13.x - elif regexp "^12_[0-9]" "$vt_volume_id"; then - set vt_freebsd_ver=12.x - elif regexp "^11_[0-9]" "$vt_volume_id"; then - set vt_freebsd_ver=11.x - elif regexp "^10_[0-9]" "$vt_volume_id"; then - set vt_freebsd_ver=10.x - elif regexp "^9_[0-9]" "$vt_volume_id"; then - set vt_freebsd_ver=9.x + elif regexp --set 1:vtBsdVerNum "^(14|13|12|11|10|9)_[0-9]" "$vt_volume_id"; then + set vt_freebsd_ver=${vtBsdVerNum}.x elif [ -d (loop)/usr/midnightbsd-dist ]; then ventoy_get_midnightbsd_ver "$1" "${chosen_path}" set vtFreeBsdDistro=MidnightBSD elif [ -e (loop)/bin/freebsd-version ]; then - vt_unix_parse_freebsd_ver (loop)/bin/freebsd-version vt_userland_ver - if regexp "\"13\.[0-9]-" "$vt_userland_ver"; then - set vt_freebsd_ver=13.x - elif regexp "\"12\.[0-9]-" "$vt_userland_ver"; then - set vt_freebsd_ver=12.x - elif regexp "\"11\.[0-9]-" "$vt_userland_ver"; then - set vt_freebsd_ver=11.x - elif regexp "\"10\.[0-9]-" "$vt_userland_ver"; then - set vt_freebsd_ver=10.x - elif regexp "\"9\.[0-9]-" "$vt_userland_ver"; then - set vt_freebsd_ver=9.x - fi + vt_unix_parse_freebsd_ver (loop)/bin/freebsd-version vt_userland_ver + if regexp --set 1:vtBsdVerNum "\"(14|13|12|11|10|9)\.[0-9]-" "$vt_userland_ver"; then + set vt_freebsd_ver=${vtBsdVerNum}.x + fi elif [ -e (loop)/README.TXT ]; then vt_1st_line (loop)/README.TXT vt_freebsd_line1 - if regexp "FreeBSD 13\.[0-9]-" "$vt_freebsd_line1"; then - set vt_freebsd_ver=13.x - elif regexp "FreeBSD 12\.[0-9]-" "$vt_freebsd_line1"; then - set vt_freebsd_ver=12.x - elif regexp "FreeBSD 11\.[0-9]-" "$vt_freebsd_line1"; then - set vt_freebsd_ver=11.x - elif regexp "FreeBSD 10\.[0-9]-" "$vt_freebsd_line1"; then - set vt_freebsd_ver=10.x - elif regexp "FreeBSD 9\.[0-9]-" "$vt_freebsd_line1"; then - set vt_freebsd_ver=9.x + if regexp --set 1:vtBsdVerNum "FreeBSD (14|13|12|11|10|9)\.[0-9]-" "$vt_freebsd_line1"; then + set vt_freebsd_ver=${vtBsdVerNum}.x fi elif vt_strstr "${chosen_path}" "MidnightBSD"; then set vt_freebsd_ver=9.x fi - + if [ -e (loop)/usr/freebsd-dist/cloninst.sh ]; then set vtFreeBsdDistro=ClonOS @@ -523,10 +514,17 @@ function ventoy_freebsd_proc { fi if [ "$vt_freebsd_ver" = "xx" ]; then - set vt_freebsd_ver=13.x + set vt_freebsd_ver=14.x + fi + fi + + if [ "$vt_freebsd_ver" = "14.x" ]; then + if [ -e (loop)/boot/lua/brand-pfSense.lua ]; then + set vtFreeBsdDistro=pfSense fi fi + if [ -n "${vtdebug_flag}" ]; then echo "This is $vtFreeBsdDistro $vt_freebsd_ver ${vt_freebsd_bit}bit" fi @@ -675,7 +673,7 @@ function uefi_linux_menu_func { if [ -d (loop)/pmagic ]; then vt_linux_specify_initrd_file /pmagic/initrd.img else - for file in "boot/grub/grub.cfg" "EFI/BOOT/grub.cfg" "EFI/boot/grub.cfg" "efi/boot/grub.cfg" "EFI/BOOT/BOOTX64.conf" "/grub/grub.cfg"; do + for file in "boot/grub/grub.cfg" "EFI/BOOT/grub.cfg" "EFI/boot/grub.cfg" "efi/boot/grub.cfg" "EFI/BOOT/BOOTX64.conf" "/grub/grub.cfg" "EFI/BOOT/grub/grub.cfg"; do if [ -e (loop)/$file ]; then vt_linux_parse_initrd_grub file (loop)/$file fi @@ -836,6 +834,16 @@ function uefi_linux_menu_func { configfile "mem:${vt_sys_menu_mem_addr}:size:${vt_sys_menu_mem_size}" fi fi + + if [ $vtback_cfg_find -eq 0 ]; then + if [ -f (loop)/boot/isolinux/syslnx64.cfg ]; then + syslinux_configfile (loop)/boot/isolinux/syslnx64.cfg + set vtback_cfg_find=1 + elif [ -f (loop)/boot/syslinux/porteus.cfg ]; then + syslinux_configfile (loop)/boot/syslinux/porteus.cfg + set vtback_cfg_find=1 + fi + fi if [ "$vtback_cfg_find" = "0" ]; then echo " " @@ -881,11 +889,6 @@ function ventoy_reset_nojoliet { } function uefi_iso_menu_func { - - if [ -d (loop)/ ]; then - loopback -d loop - fi - if [ -n "$vtisouefi" ]; then set LoadIsoEfiDriver=on unset vtisouefi @@ -899,21 +902,13 @@ function uefi_iso_menu_func { vt_select_auto_install "${chosen_path}" vt_select_persistence "${chosen_path}" - if vt_is_udf "${1}${chosen_path}"; then - set ventoy_fs_probe=udf - else - set ventoy_fs_probe=iso9660 - ventoy_reset_nojoliet - + if ! vt_is_udf "${1}${chosen_path}"; then # Lenovo EasyStartup need an addional sector for boundary check if vt_str_begin "$vt_volume_id" "EasyStartup"; then vt_skip_svd "${vtoy_iso_part}${vt_chosen_path}" vt_append_extra_sector 1 fi fi - - loopback loop "${1}${chosen_path}" - get_os_type (loop) if [ -d (loop)/EFI ]; then set vt_efi_dir=YES @@ -932,14 +927,6 @@ function uefi_iso_menu_func { vt_check_compatible (loop) fi - if vt_need_secondary_menu "$vt_chosen_name"; then - vt_show_secondary_menu "$vt_chosen_path" "$vtoy_os" $vt_chosen_size - if vt_check_mode 0 "$vt_chosen_name"; then - uefi_iso_memdisk $vtoy_iso_part "$vt_chosen_path" - return - fi - fi - vt_img_sector "${1}${chosen_path}" if [ "$ventoy_fs_probe" = "iso9660" ]; then @@ -956,7 +943,7 @@ function uefi_iso_menu_func { uefi_linux_menu_func "$1" "${chosen_path}" fi - ventoy_gui_console + ventoy_gui_console } function uefi_iso_memdisk { @@ -1301,6 +1288,16 @@ function legacy_linux_menu_func { configfile "mem:${vt_sys_menu_mem_addr}:size:${vt_sys_menu_mem_size}" fi fi + + if [ $vtback_cfg_find -eq 0 ]; then + if [ -f (loop)/boot/isolinux/syslnx64.cfg ]; then + syslinux_configfile (loop)/boot/isolinux/syslnx64.cfg + set vtback_cfg_find=1 + elif [ -f (loop)/boot/syslinux/porteus.cfg ]; then + syslinux_configfile (loop)/boot/syslinux/porteus.cfg + set vtback_cfg_find=1 + fi + fi vt_unset_boot_opt set root=$vtback_root @@ -1334,26 +1331,10 @@ function legacy_unix_menu_func { function legacy_iso_menu_func { - - if [ -d (loop)/ ]; then - loopback -d loop - fi - set chosen_path="$2" vt_select_auto_install "${chosen_path}" vt_select_persistence "${chosen_path}" - - if vt_is_udf "${1}${chosen_path}"; then - set ventoy_fs_probe=udf - else - set ventoy_fs_probe=iso9660 - ventoy_reset_nojoliet - fi - - loopback loop "${1}${chosen_path}" - - get_os_type (loop) if [ -n "$vtcompat" ]; then set ventoy_compatible=YES @@ -1364,14 +1345,6 @@ function legacy_iso_menu_func { vt_check_compatible (loop) fi - if vt_need_secondary_menu "$vt_chosen_name"; then - vt_show_secondary_menu "$vt_chosen_path" "$vtoy_os" $vt_chosen_size - if vt_check_mode 0 "$vt_chosen_name"; then - legacy_iso_memdisk $vtoy_iso_part "$vt_chosen_path" - return - fi - fi - vt_img_sector "${1}${chosen_path}" if [ "$ventoy_fs_probe" = "iso9660" ]; then @@ -1387,6 +1360,7 @@ function legacy_iso_menu_func { vt_check_compatible_linux (loop) legacy_linux_menu_func "$1" "${chosen_path}" fi + vt_secondary_recover_mode } function legacy_iso_memdisk { @@ -1448,6 +1422,8 @@ function ventoy_iso_busybox_ver { set ventoy_busybox_ver=64 elif vt_str_begin "$vt_volume_id" "LDiagBootable"; then set ventoy_busybox_ver=64 + elif vt_str_begin "$vt_volume_id" "KAOS_"; then + set ventoy_busybox_ver=64 fi fi @@ -1467,7 +1443,7 @@ function iso_common_menuentry { echo -e "\n $vt_volume_space $vt_chosen_size $vt_chosen_size_mod\n" echo -e "\n The size of the iso file \"$vt_chosen_size\" is invalid. File corrupted ?\n" echo -e " 此ISO文件的大小 \"$vt_chosen_size\" 有问题,请确认文件是否损坏。\n" - echo -e "\n press ENTER to continue (请按 回车 键继续) ..." + echo -en "\n$VTLANG_ENTER_CONTINUE ..." read vtInputKey fi fi @@ -1479,6 +1455,33 @@ function iso_common_menuentry { if ventoy_vcfg_proc "${vt_chosen_path}"; then return fi + + + + #secondary boot menu + if vt_is_udf "${vtoy_iso_part}${vt_chosen_path}"; then + set ventoy_fs_probe=udf + else + set ventoy_fs_probe=iso9660 + ventoy_reset_nojoliet + fi + + if [ -d (loop)/ ]; then + loopback -d loop + fi + loopback loop "${vtoy_iso_part}${vt_chosen_path}" + + get_os_type (loop) + + ventoy_debug_pause + + if vt_need_secondary_menu "$vt_chosen_name"; then + vt_show_secondary_menu "$vt_chosen_path" "$vtoy_os" $vt_chosen_size + if [ "$VTOY_SECOND_EXIT" = "1" ]; then + return + fi + fi + if vt_str_begin "$vt_volume_id" "Avira"; then vt_skip_svd "${vtoy_iso_part}${vt_chosen_path}" @@ -1530,7 +1533,9 @@ function iso_common_menuentry { else uefi_iso_menu_func $vtoy_iso_part "$vt_chosen_path" fi - fi + fi + + vt_secondary_recover_mode } function miso_common_menuentry { @@ -1555,7 +1560,7 @@ function miso_common_menuentry { function common_unsupport_menuentry { echo -e "\n The name of the iso file could NOT contain space or non-ascii characters. \n" echo -e " 文件名中不能有中文或空格 \n" - echo -e "\npress ENTER to exit (请按 回车 键返回) ..." + echo -en "\n$VTLANG_ENTER_EXIT ..." read vtInputKey } @@ -1702,7 +1707,7 @@ function vhd_common_menuentry { 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 (请按 回车 键继续) ..." + echo -en "\n$VTLANG_ENTER_CONTINUE ..." read vtInputKey fi fi @@ -1811,7 +1816,7 @@ function vtoy_unsupport_menuentry { function only_uefi_tip { echo -e "\n This IMG file is only supported in UEFI mode. \n" - echo -e "\n press ENTER to exit ..." + echo -en "\n$VTLANG_ENTER_EXIT ..." read vtInputKey } @@ -1843,6 +1848,41 @@ function ventoy_img_easyos { loopback -d easysfs } +function ventoy_img_easyos2 { + 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,2)/easyos/easy.sfs ]; then + loopback easysfs (vtimghd,2)/easyos/easy.sfs + elif [ -d (vtimghd,2)/easyos/releases ]; then + vt_fs_enum_1st_dir (vtimghd,2) /easyos/releases/ vt_dir_name + loopback easysfs (vtimghd,2)/easyos/releases/$vt_dir_name/easy.sfs + fi + + vt_get_lib_module_ver (easysfs) /lib/modules/ vt_module_ver + + if [ -n "$vt_module_ver" ]; then + for mod in "kernel/drivers/md/dm-mod.ko" "kernel/drivers/dax/dax.ko"; do + if [ -e (easysfs)/lib/modules/$vt_module_ver/$mod ]; then + vt_img_extra_initrd_append (easysfs)/lib/modules/$vt_module_ver/$mod + fi + done + fi + + ventoy_debug_pause + + #boot image file + vt_set_boot_opt rdinit=/vtoy/vtoy + vt_img_hook_root + + vt_limine_menu (vtimghd,1)/limine.cfg vt_sys_menu_mem + configfile "mem:${vt_sys_menu_mem_addr}:size:${vt_sys_menu_mem_size}" + + vt_img_unhook_root + vt_unset_boot_opt + loopback -d easysfs +} + function ventoy_img_volumio { 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 @@ -1868,6 +1908,20 @@ function ventoy_img_openelec { loopback vtloopex $vtoy_efi_part/ventoy/vtloopex.cpio vt_img_extra_initrd_append (vtloopex)/$elec_ver/vtloopex.tar.xz + if [ "$elec_ver" = "LibreELEC" ]; then + if [ -f (vtimghd,1)/system ]; then + loopback elecsfs (vtimghd,1)/system + vt_get_lib_module_ver (elecsfs) /usr/lib/kernel-overlays/base/lib/modules/ vt_module_ver + if [ -n "$vt_module_ver" ]; then + for mod in "kernel/drivers/md/dm-mod.ko"; do + if [ -e (elecsfs)/usr/lib/kernel-overlays/base/lib/modules/$vt_module_ver/$mod ]; then + vt_img_extra_initrd_append (elecsfs)/usr/lib/kernel-overlays/base/lib/modules/$vt_module_ver/$mod + fi + done + fi + fi + fi + ventoy_debug_pause #boot image file @@ -1880,6 +1934,7 @@ function ventoy_img_openelec { vt_img_unhook_root vt_unset_boot_opt loopback -d vtloopex + loopback -d elecsfs } @@ -2034,7 +2089,7 @@ function ventoy_img_openwrt { ventoy_gui_console echo -e "\n ventoy_openwrt.xz not found. Please refer https://www.ventoy.net/en/doc_openwrt.html.\n" echo -e " 未找到 ventoy_openwrt.xz 文件。请参考 https://www.ventoy.net/cn/doc_openwrt.html\n" - echo -e "\n press ENTER to exit (请按 回车 键返回) ..." + echo -en "\n$VTLANG_ENTER_EXIT ..." read vtInputKey ventoy_cli_console return @@ -2158,6 +2213,23 @@ function ventoy_img_cloudready { unset linuxpartB } + +function ventoy_img_fwts { + 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 + + ventoy_debug_pause + + #boot image file + vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=fwts + vt_img_hook_root + + configfile $prefix/distro/fwts.cfg + + vt_img_unhook_root + vt_unset_boot_opt +} + function ventoy_img_memtest86 { chainloader (vtimghd,1)/efi/boot/BOOTX64.efi boot @@ -2166,7 +2238,7 @@ function ventoy_img_memtest86 { function img_unsupport_tip { echo -e "\n This IMG file is NOT supported now. \n" echo -e " 当前不支持启动此 IMG 文件 \n" - echo -e "\npress ENTER to exit (请按 回车 键返回) ..." + echo -en "\n$VTLANG_ENTER_EXIT ..." read vtInputKey } @@ -2223,6 +2295,14 @@ function img_common_menuentry { vt_get_fs_label (vtimghd,2) vtImgHd2Label fi + if [ -z "$vtImgHd1Label" ]; then + if [ -d (vtimghd,2)/efi ]; then + vt_get_fs_label (vtimghd,3) vtImgHd3Label + elif [ -d (vtimghd,12)/efi ]; then + vt_get_fs_label (vtimghd,3) vtImgHd3Label + fi + fi + if [ -e (vtimghd,1)/etc/hostname ]; then vt_1st_line (vtimghd,1)/etc/hostname vtImgHostname fi @@ -2240,6 +2320,8 @@ function img_common_menuentry { elif [ -f (vtimghd,3)/etc/chrome_dev.conf ]; then ventoy_img_cloudready fi + elif vt_str_begin "$vtImgHd3Label" "fwts-result"; then + ventoy_img_fwts elif vt_str_begin "$vtImgHd1Label" "LAKKA"; then ventoy_img_openelec lakka elif vt_str_begin "$vtImgHd1Label" "LIBREELEC"; then @@ -2258,19 +2340,22 @@ function img_common_menuentry { ventoy_img_esysrescue elif [ -e (vtimghd,1)/easy.sfs ]; then ventoy_img_easyos + elif [ -d (vtimghd,2)/easyos ]; then + ventoy_img_easyos2 elif [ -e (vtimghd,1)/volumio.initrd ]; then ventoy_img_volumio elif [ -f (vtimghd,2)/loader/entries/ubos.conf ]; then ventoy_img_ubos elif [ -f (vtimghd,2)/etc/openwrt_version ]; then - ventoy_img_openwrt - elif [ -f (vtimghd,1)/efi/boot/mt86.png ]; then - if [ "$grub_platform" = "pc" ]; then - img_unsupport_tip - else - ventoy_img_memtest86 - fi + ventoy_img_openwrt else + if [ -f (vtimghd,1)/efi/boot/mt86.png ]; then + if [ "$grub_platform" = "pc" ]; then + img_unsupport_tip + fi + fi + + #common chain vt_linux_chain_data "${vtoy_iso_part}${vt_chosen_path}" ventoy_acpi_param ${vtoy_chain_mem_addr} 512 if [ "$grub_platform" = "pc" ]; then @@ -2295,6 +2380,28 @@ function img_unsupport_menuentry { common_unsupport_menuentry } +function mimg_common_menuentry { + vt_chosen_img_path vt_chosen_path vt_chosen_size vt_chosen_name + + if vt_check_password "${vt_chosen_path}"; then + return + fi + + echo "memdisk mode boot for $vt_chosen_path" + echo "" + ventoy_debug_pause + + if [ "$grub_platform" = "pc" ]; then + legacy_img_memdisk $vtoy_iso_part "$vt_chosen_path" + else + vt_load_img_memdisk "$vtoy_iso_part$vt_chosen_path" vtoy_img_buf + ventoy_cli_console + chainloader ${vtoy_path}/ventoy_${VTOY_EFI_ARCH}.efi memdisk env_param=${env_param} isoefi=${LoadIsoEfiDriver} ${vtdebug_flag} mem:${vtoy_img_buf_addr}:size:${vtoy_img_buf_size} + boot + ventoy_gui_console + fi +} + ############################################################# ############################################################# ############################################################# @@ -2303,7 +2410,7 @@ function img_unsupport_menuentry { ############################################################# ############################################################# -set VENTOY_VERSION="1.0.80" +set VENTOY_VERSION="1.1.04" #ACPI not compatible with Window7/8, so disable by default set VTOY_PARAM_NO_ACPI=1 @@ -2327,6 +2434,7 @@ set VTOY_HELP_CMD="ventoy_show_help" set VTOY_CHKSUM_CMD="ventoy_checksum" set VTOY_HELP_TXT_LANGUAGE="en_US" set VTOY_CHKSUM_FILE_PATH="X" +set VTOY_LANG_CMD="ventoy_language" if [ "$grub_platform" = "pc" ]; then @@ -2392,6 +2500,9 @@ fi #Load Partition Table vt_load_part_table $vtoydev +#Load menu lang file +ventoy_load_menu_lang_file + #Load Plugin if [ -f $vtoy_iso_part/ventoy/ventoy.json ]; then clear @@ -2401,6 +2512,12 @@ else vt_check_json_path_case $vtoy_iso_part fi +if [ -n "$VTOY_MENU_LANGUAGE" ]; then + vt_init_menu_lang "$VTOY_MENU_LANGUAGE" +else + vt_init_menu_lang en_US +fi + if [ -n "$VTOY_MENU_TIMEOUT" ]; then set timeout=$VTOY_MENU_TIMEOUT else @@ -2422,10 +2539,8 @@ fi if [ $VTOY_DEFAULT_MENU_MODE -eq 0 ]; then set VTOY_F3_CMD="vt_dynamic_menu 1 1" - set VTOY_HOTKEY_TIP="h:Help F1:Memdisk F2:Browser F3:TreeView F4:Localboot F5:Tools F6:ExMenu" else set VTOY_F3_CMD="vt_dynamic_menu 1 0" - set VTOY_HOTKEY_TIP="h:Help F1:Memdisk F2:Browser F3:ListView F4:Localboot F5:Tools F6:ExMenu" fi terminal_output console @@ -2453,7 +2568,20 @@ elif [ "$vtoy_display_mode" = "serial_console" ]; then fi terminal_input serial console terminal_output serial console -else +else + if [ "$vtoy_gfxmode" = "max" ]; then + set gfxmode=1024x768 + terminal_output gfxterm + + vt_enum_video_mode + vt_get_video_mode 0 vtCurMode + terminal_output console + set gfxmode=$vtCurMode + terminal_output gfxterm + elif [ "$vtoy_res_fit" = "1" ]; then + terminal_output gfxterm + fi + if [ -n "$vtoy_theme" ]; then vt_set_theme else @@ -2534,6 +2662,7 @@ export VTOY_HELP_CMD export VTOY_CHKSUM_CMD export VTOY_HELP_TXT_LANGUAGE export VTOY_CHKSUM_FILE_PATH +export VTOY_LANG_CMD #colect all image files (iso files)