1 #************************************************************************************
2 # Copyright (c) 2020, longpanda <admin@ventoy.net>
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 3 of the
7 # License, or (at your option) any later version.
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, see <http://www.gnu.org/licenses/>.
17 #************************************************************************************
19 function ventoy_pause {
20 echo "press Enter to continue ......"
24 function ventoy_debug_pause {
25 if [ -n "${vtdebug_flag}" ]; then
26 echo "press Enter to continue ......"
31 function ventoy_cli_console {
32 if [ -z "$vtoy_display_mode" ]; then
33 terminal_output console
34 elif [ "$vtoy_display_mode" = "GUI" ]; then
35 terminal_output console
39 function ventoy_gui_console {
40 if [ -z "$vtoy_display_mode" ]; then
41 terminal_output gfxterm
42 elif [ "$vtoy_display_mode" = "GUI" ]; then
43 terminal_output gfxterm
47 function ventoy_power {
48 configfile $prefix/power.cfg
51 function ventoy_diagnosis {
53 configfile $prefix/debug.cfg
56 function ventoy_localboot {
57 configfile $prefix/localboot.cfg
60 function ventoy_ext_menu {
61 if [ -e $vt_plugin_path/ventoy/ventoy_grub.cfg ]; then
62 set ventoy_new_context=1
63 configfile $vt_plugin_path/ventoy/ventoy_grub.cfg
64 unset ventoy_new_context
66 echo "ventoy_grub.cfg NOT exist."
67 echo -e "\npress ENTER to exit ..."
72 function get_os_type {
75 for file in "efi/microsoft/boot/bcd" "sources/boot.wim" "boot/bcd" "bootmgr.efi" "boot/etfsboot.com" ; do
76 if vt_file_exist_nocase (loop)/$file; then
82 if [ "$vtoy_os" = "Linux" ]; then
83 if vt_strstr "$vt_system_id" "FreeBSD"; then
85 set vt_unix_type=FreeBSD
86 elif [ -e (loop)/bin/freebsd-version ]; then
88 set vt_unix_type=FreeBSD
91 elif [ -e (loop)/boot/kernel/kernel ]; then
92 if file --is-x86-kfreebsd (loop)/boot/kernel/kernel; then
94 set vt_unix_type=FreeBSD
95 elif file --is-x86-knetbsd (loop)/boot/kernel/kernel; then
97 set vt_unix_type=NetBSD
102 if [ -n "${vtdebug_flag}" ]; then
107 function vt_check_compatible_pe {
108 #Check for PE without external tools
109 if [ -f $1/HBCD_PE.ini ]; then
110 set ventoy_compatible=YES
114 function locate_initrd {
115 vt_linux_locate_initrd
117 if [ -n "${vtdebug_flag}" ]; then
123 function locate_wim {
124 vt_windows_locate_wim_patch (loop)
126 if [ -n "${vtdebug_flag}" ]; then
127 echo '###############################################'
129 echo '###############################################'
134 function distro_specify_wim_patch {
135 if [ -d (loop)/h3pe ]; then
136 vt_windows_collect_wim_patch wim /BOOT/H3_10PE.WIM
137 vt_windows_collect_wim_patch wim /BOOT/H3_7PE.WIM
138 vt_windows_collect_wim_patch wim /BOOT/H3_8PE.WIM
139 vt_windows_collect_wim_patch wim /BOOT/H3_81PE.WIM
143 function distro_specify_wim_patch_phase2 {
144 if [ -f (loop)/boot/boot.wim ]; then
145 vt_windows_collect_wim_patch wim /boot/boot.wim
150 function distro_specify_initrd_file {
151 if [ -e (loop)/boot/all.rdz ]; then
152 vt_linux_specify_initrd_file /boot/all.rdz
153 elif [ -e (loop)/boot/xen.gz ]; then
154 if [ -e (loop)/install.img ]; then
155 vt_linux_specify_initrd_file /install.img
157 elif [ -d (loop)/casper ]; then
158 if [ -e (loop)/casper/initrd ]; then
159 vt_linux_specify_initrd_file /casper/initrd
161 if [ -e (loop)/casper/initrd.gz ]; then
162 vt_linux_specify_initrd_file /casper/initrd.gz
164 if [ -e (loop)/casper/initrd-oem ]; then
165 vt_linux_specify_initrd_file /casper/initrd-oem
167 elif [ -e (loop)/boot/grub/initrd.xz ]; then
168 vt_linux_specify_initrd_file /boot/grub/initrd.xz
169 elif [ -e (loop)/initrd.gz ]; then
170 vt_linux_specify_initrd_file /initrd.gz
171 elif [ -e (loop)/slax/boot/initrfs.img ]; then
172 vt_linux_specify_initrd_file /slax/boot/initrfs.img
173 elif [ -e (loop)/pmagic/initrd.img ]; then
174 vt_linux_specify_initrd_file /pmagic/initrd.img
175 elif [ -e (loop)/boot/initrd.xz ]; then
176 vt_linux_specify_initrd_file /boot/initrd.xz
177 elif [ -e (loop)/boot/initrd.gz ]; then
178 vt_linux_specify_initrd_file /boot/initrd.gz
179 elif [ -f (loop)/boot/initrd ]; then
180 vt_linux_specify_initrd_file /boot/initrd
181 elif [ -f (loop)/boot/x86_64/loader/initrd ]; then
182 vt_linux_specify_initrd_file /boot/x86_64/loader/initrd
183 elif [ -f (loop)/boot/initramfs-x86_64.img ]; then
184 vt_linux_specify_initrd_file /boot/initramfs-x86_64.img
185 elif [ -f (loop)/boot/isolinux/initramfs_data64.cpio.gz ]; then
186 vt_linux_specify_initrd_file /boot/isolinux/initramfs_data64.cpio.gz
191 if [ -f (loop)/isolinux/initrd.gz ]; then
192 vt_linux_specify_initrd_file /isolinux/initrd.gz
195 if [ "$vt_chosen_size" = "1133375488" ]; then
196 if [ -d (loop)/boot/grub/x86_64-efi ]; then
203 function distro_specify_initrd_file_phase2 {
204 if [ -f (loop)/boot/initrd.img ]; then
205 vt_linux_specify_initrd_file /boot/initrd.img
206 elif [ -f (loop)/Setup/initrd.gz ]; then
207 vt_linux_specify_initrd_file /Setup/initrd.gz
208 elif [ -f (loop)/isolinux/initramfs ]; then
209 vt_linux_specify_initrd_file /isolinux/initramfs
210 elif [ -f (loop)/boot/iniramfs.igz ]; then
211 vt_linux_specify_initrd_file /boot/iniramfs.igz
212 elif [ -f (loop)/initrd-x86_64 ]; then
213 vt_linux_specify_initrd_file /initrd-x86_64
214 elif [ -f (loop)/live/initrd.img ]; then
215 vt_linux_specify_initrd_file /live/initrd.img
216 elif [ -f (loop)/initrd.img ]; then
217 vt_linux_specify_initrd_file /initrd.img
218 elif [ -f (loop)/sysresccd/boot/x86_64/sysresccd.img ]; then
219 vt_linux_specify_initrd_file /sysresccd/boot/x86_64/sysresccd.img
220 elif [ -f (loop)/CDlinux/initrd ]; then
221 vt_linux_specify_initrd_file /CDlinux/initrd
222 elif [ -f (loop)/parabola/boot/x86_64/parabolaiso.img ]; then
223 vt_linux_specify_initrd_file /parabola/boot/x86_64/parabolaiso.img
224 if [ -f (loop)/parabola/boot/i686/parabolaiso.img ]; then
225 vt_linux_specify_initrd_file /parabola/boot/i686/parabolaiso.img
227 elif [ -f (loop)/hyperbola/boot/x86_64/hyperiso.img ]; then
228 vt_linux_specify_initrd_file /hyperbola/boot/x86_64/hyperiso.img
229 if [ -f (loop)/hyperbola/boot/i686/hyperiso.img ]; then
230 vt_linux_specify_initrd_file /hyperbola/boot/i686/hyperiso.img
232 elif [ -f (loop)/EFI/BOOT/initrd.img ]; then
234 vt_linux_specify_initrd_file /EFI/BOOT/initrd.img
235 if [ "$grub_platform" != "pc" ]; then
236 vt_add_replace_file 0 "initrd.img"
238 elif [ -f (loop)/initrd ]; then
239 vt_linux_specify_initrd_file /initrd
240 elif [ -f (loop)/live/initrd1 ]; then
241 vt_linux_specify_initrd_file /live/initrd1
242 elif [ -f (loop)/isolinux/initrd.img ]; then
243 vt_linux_specify_initrd_file /isolinux/initrd.img
244 elif [ -f (loop)/isolinux/initrd.gz ]; then
245 vt_linux_specify_initrd_file /isolinux/initrd.gz
246 elif [ -f (loop)/syslinux/kernel/initramfs.gz ]; then
247 vt_linux_specify_initrd_file /syslinux/kernel/initramfs.gz
248 elif vt_strstr $vt_volume_id "Daphile"; then
249 vt_linux_parse_initrd_isolinux (loop)/isolinux/
250 elif [ -f (loop)/boot/rootfs.xz ]; then
251 vt_linux_specify_initrd_file /boot/rootfs.xz
252 if [ "$grub_platform" != "pc" ]; then
253 vt_add_replace_file 0 "minimal\\x86_64\\rootfs.xz"
255 elif [ -f (loop)/arch/boot/x86_64/archiso.img ]; then
256 vt_linux_specify_initrd_file /arch/boot/x86_64/archiso.img
257 if [ "$grub_platform" != "pc" ]; then
258 vt_add_replace_file 0 "EFI\\archiso\\archiso.img"
263 function ventoy_get_ghostbsd_ver {
265 # vt_parse_iso_create_date $1/${chosen_path} vt_create_date
266 # if regexp "^202005" "$vt_create_date"; then
267 # set vt_freebsd_ver=12.x
270 set vt_freebsd_ver=12.x
273 function ventoy_get_furybsd_ver {
274 if regexp "13\.[0-9]" "$2"; then
275 set vt_freebsd_ver=13.x
277 set vt_freebsd_ver=12.x
281 function ventoy_get_freenas_ver {
282 set vt_freebsd_ver=11.x
284 if [ -e (loop)/FreeNAS-MANIFEST ]; then
285 vt_parse_freenas_ver (loop)/FreeNAS-MANIFEST vt_freenas_ver
286 if regexp "^13\.[0-9]" "$vt_freenas_ver"; then
287 set vt_freebsd_ver=13.x
288 elif regexp "^12\.[0-9]" "$vt_freenas_ver"; then
289 set vt_freebsd_ver=12.x
290 elif regexp "^11\.[0-9]" "$vt_freenas_ver"; then
291 set vt_freebsd_ver=11.x
296 function ventoy_get_midnightbsd_ver {
297 set vt_freebsd_ver=11.x
300 function ventoy_freebsd_proc {
301 set vtFreeBsdDistro=FreeBSD
303 if vt_strstr "$vt_volume_id" "GHOSTBSD"; then
304 ventoy_get_ghostbsd_ver $1 ${chosen_path}
305 elif vt_strstr "$vt_volume_id" "FREENAS"; then
306 ventoy_get_freenas_ver $1 ${chosen_path}
307 elif vt_strstr "$vt_volume_id" "FURYBSD"; then
308 ventoy_get_furybsd_ver $1 ${chosen_path}
309 elif regexp "^13_[0-9]" "$vt_volume_id"; then
310 set vt_freebsd_ver=13.x
311 elif regexp "^12_[0-9]" "$vt_volume_id"; then
312 set vt_freebsd_ver=12.x
313 elif regexp "^11_[0-9]" "$vt_volume_id"; then
314 set vt_freebsd_ver=11.x
315 elif regexp "^10_[0-9]" "$vt_volume_id"; then
316 set vt_freebsd_ver=10.x
317 elif regexp "^9_[0-9]" "$vt_volume_id"; then
318 set vt_freebsd_ver=9.x
319 elif [ -d (loop)/usr/midnightbsd-dist ]; then
320 ventoy_get_midnightbsd_ver $1 ${chosen_path}
321 set vtFreeBsdDistro=MidnightBSD
322 elif [ -e (loop)/bin/freebsd-version ]; then
323 vt_unix_parse_freebsd_ver (loop)/bin/freebsd-version vt_userland_ver
324 if regexp "\"13\.[0-9]-" "$vt_userland_ver"; then
325 set vt_freebsd_ver=13.x
326 elif regexp "\"12\.[0-9]-" "$vt_userland_ver"; then
327 set vt_freebsd_ver=12.x
328 elif regexp "\"11\.[0-9]-" "$vt_userland_ver"; then
329 set vt_freebsd_ver=11.x
330 elif regexp "\"10\.[0-9]-" "$vt_userland_ver"; then
331 set vt_freebsd_ver=10.x
332 elif regexp "\"9\.[0-9]-" "$vt_userland_ver"; then
333 set vt_freebsd_ver=9.x
335 elif [ -e (loop)/README.TXT ]; then
336 vt_1st_line (loop)/README.TXT vt_freebsd_line1
337 if regexp "FreeBSD 13\.[0-9]-" "$vt_freebsd_line1"; then
338 set vt_freebsd_ver=13.x
339 elif regexp "FreeBSD 12\.[0-9]-" "$vt_freebsd_line1"; then
340 set vt_freebsd_ver=12.x
341 elif regexp "FreeBSD 11\.[0-9]-" "$vt_freebsd_line1"; then
342 set vt_freebsd_ver=11.x
343 elif regexp "FreeBSD 10\.[0-9]-" "$vt_freebsd_line1"; then
344 set vt_freebsd_ver=10.x
345 elif regexp "FreeBSD 9\.[0-9]-" "$vt_freebsd_line1"; then
346 set vt_freebsd_ver=9.x
348 elif vt_strstr "${chosen_path}" "MidnightBSD"; then
349 set vt_freebsd_ver=9.x
351 set vt_freebsd_ver=12.x
354 set vt_freebsd_bit=64
355 for file in "/boot/kernel/kernel" "/boot/kernel/kernel.gz"; do
356 if [ -e (loop)/$file ]; then
357 if file --is-i386-kfreebsd (loop)/$file; then
358 set vt_freebsd_bit=32
364 if [ -n "${vtdebug_flag}" ]; then
365 echo "This is FreeBSD $vt_freebsd_ver ${vt_freebsd_bit}bit"
368 unset vt_unix_mod_path
369 for file in "/COPYRIGHT" "/FreeNAS-MANIFEST" "/version" "/etc/fstab"; do
370 if [ -e (loop)${file} ]; then
371 set vt_unix_mod_path=${file}
376 if [ -e (loop)/usr/freebsd-dist/cloninst.sh ]; then
377 set vtFreeBsdDistro=ClonOS
380 vt_unix_replace_ko $vt_unix_mod_path (vtunix)/ventoy_unix/$vtFreeBsdDistro/geom_ventoy_ko/$vt_freebsd_ver/$vt_freebsd_bit/geom_ventoy.ko.xz
381 vt_unix_replace_conf FreeBSD ${1}${chosen_path}
384 function ventoy_unix_comm_proc {
387 if [ "$ventoy_compatible" = "NO" ]; then
388 loopback vtunix $vtoy_efi_part/ventoy/ventoy_unix.cpio
390 if [ "$vt_unix_type" = "FreeBSD" ]; then
391 ventoy_freebsd_proc $1 ${chosen_path}
392 elif [ "$vt_unix_type" = "NetBSD" ]; then
393 echo "NetBSD not supported"
398 if [ -n "${vtdebug_flag}" ]; then
399 echo "Unknown unix type"
404 vt_unix_chain_data ${1}${chosen_path}
409 function uefi_windows_menu_func {
412 if [ "$ventoy_compatible" = "NO" ]; then
414 if [ "$ventoy_fs_probe" = "iso9660" ]; then
416 vt_iso9660_nojoliet 1
420 for file in "efi/microsoft/boot/bcd"; do
421 vt_windows_collect_wim_patch bcd (loop)/$file
424 vt_windows_count_wim_patch vt_wim_cnt
425 if [ $vt_wim_cnt -eq 0 ]; then
426 distro_specify_wim_patch_phase2
433 vt_windows_chain_data ${1}${chosen_path}
436 if [ -n "$vtoy_chain_mem_addr" ]; then
438 chainloader ${vtoy_path}/ventoy_x64.efi env_param=${env_param} isoefi=${LoadIsoEfiDriver} ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
441 echo "chain empty failed"
446 function uefi_linux_menu_func {
448 if [ "$ventoy_compatible" = "NO" ]; then
450 if [ "$ventoy_fs_probe" = "udf" ]; then
452 set ventoy_fs_probe=iso9660
456 vt_load_cpio ${vtoy_path}/ventoy.cpio $2 $1 "busybox=$ventoy_busybox_ver"
458 vt_linux_clear_initrd
460 if [ -d (loop)/pmagic ]; then
461 vt_linux_specify_initrd_file /pmagic/initrd.img
463 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
464 if [ -e (loop)/$file ]; then
465 vt_linux_parse_initrd_grub file (loop)/$file
470 # special process for special distros
471 if [ -d (loop)/loader/entries ]; then
472 vt_linux_parse_initrd_grub dir (loop)/loader/entries/
473 elif [ -d (loop)/boot/grub ]; then
474 vt_linux_parse_initrd_grub dir (loop)/boot/grub/
477 distro_specify_initrd_file
479 vt_linux_initrd_count vtcount
480 if [ $vtcount -eq 0 ]; then
481 distro_specify_initrd_file_phase2
483 if [ "$vt_efi_dir" = "NO" ]; then
484 if [ -f (loop)/efi.img ]; then
485 vt_add_replace_file 0 "initrd"
492 if [ -d (loop)/loader/entries ]; then
493 vt_linux_get_main_initrd_index vtindex
495 if [ -d (loop)/arch ]; then
496 if [ -f (loop)/arch/boot/x86_64/archiso.img ]; then
497 vt_add_replace_file $vtindex "EFI\\archiso\\archiso.img"
498 elif [ -f (loop)/boot/initramfs_x86_64.img ]; then
499 vt_add_replace_file $vtindex "boot\\initramfs_x86_64.img"
501 elif [ -d (loop)/parabola ]; then
502 if [ -f (loop)/parabola/boot/x86_64/parabola.img ]; then
503 vt_add_replace_file $vtindex "EFI\\parabola\\parabola.img"
504 elif [ -f (loop)/boot/initramfs_x86_64.img ]; then
505 vt_add_replace_file $vtindex "boot\\initramfs_x86_64.img"
507 elif [ -f (loop)/EFI/BOOT/initrd.gz ]; then
508 vt_add_replace_file $vtindex "EFI\\BOOT\\initrd.gz"
509 elif [ -f (loop)/loader/entries/thinstation.conf ]; then
510 vt_add_replace_file $vtindex "boot\\initrd"
511 elif [ -f (loop)/loader/entries/pisi-efi-x86_64.conf ]; then
512 vt_add_replace_file $vtindex "EFI\\pisi\\initrd.img"
514 elif [ -d (loop)/EFI/boot/entries ]; then
515 if [ -f (loop)/parabola/boot/x86_64/parabolaiso.img ]; then
516 vt_add_replace_file 0 "EFI\\parabolaiso\\parabolaiso.img"
517 elif [ -f (loop)/hyperbola/boot/x86_64/hyperiso.img ]; then
518 vt_add_replace_file 0 "EFI\\hyperiso\\hyperiso.img"
520 elif [ -d (loop)/EFI/BOOT/entries ]; then
521 if [ -f (loop)/parabola/boot/x86_64/parabolaiso.img ]; then
522 vt_add_replace_file 0 "EFI\\parabolaiso\\parabolaiso.img"
524 elif [ -e (loop)/syslinux/alt0/full.cz ]; then
525 vt_add_replace_file 0 "EFI\\BOOT\\full.cz"
526 set FirstTryBootFile='@EFI@BOOT@grubx64.efi'
533 vt_linux_chain_data ${1}${chosen_path}
535 if [ -n "$vtoy_chain_mem_addr" ]; then
537 chainloader ${vtoy_path}/ventoy_x64.efi env_param=${env_param} isoefi=${LoadIsoEfiDriver} FirstTry=${FirstTryBootFile} ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
540 echo "chain empty failed"
545 function uefi_unix_menu_func {
546 ventoy_unix_comm_proc $1 ${chosen_path}
548 if [ -n "$vtoy_chain_mem_addr" ]; then
550 chainloader ${vtoy_path}/ventoy_x64.efi env_param=${env_param} isoefi=${LoadIsoEfiDriver} FirstTry=${FirstTryBootFile} ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
553 echo "chain empty failed"
558 function uefi_iso_menu_func {
560 if [ -d (loop)/ ]; then
564 if [ -n "$vtisouefi" ]; then
565 set LoadIsoEfiDriver=on
567 elif vt_check_mode 2; then
568 set LoadIsoEfiDriver=on
570 unset LoadIsoEfiDriver
574 vt_select_auto_install ${chosen_path}
575 vt_select_persistence ${chosen_path}
577 if vt_is_udf ${1}${chosen_path}; then
578 set ventoy_fs_probe=udf
580 set ventoy_fs_probe=iso9660
581 vt_iso9660_nojoliet 0
584 loopback loop ${1}${chosen_path}
587 if [ -d (loop)/EFI ]; then
589 elif [ -d (loop)/efi ]; then
595 if [ -n "$vtcompat" ]; then
596 set ventoy_compatible=YES
598 elif vt_check_mode 1; then
599 set ventoy_compatible=YES
601 vt_check_compatible (loop)
604 vt_img_sector ${1}${chosen_path}
606 if [ "$vtoy_os" = "Windows" ]; then
607 vt_check_compatible_pe (loop)
608 uefi_windows_menu_func $1 ${chosen_path}
609 elif [ "$vtoy_os" = "Unix" ]; then
610 uefi_unix_menu_func $1 ${chosen_path}
612 uefi_linux_menu_func $1 ${chosen_path}
618 function uefi_iso_memdisk {
619 echo 'Loading ISO file to memory ...'
620 vt_load_img_memdisk ${1}${2} vtoy_iso_buf
623 chainloader ${vtoy_path}/ventoy_x64.efi memdisk env_param=${env_param} isoefi=${LoadIsoEfiDriver} ${vtdebug_flag} mem:${vtoy_iso_buf_addr}:size:${vtoy_iso_buf_size}
630 function legacy_windows_menu_func {
633 if [ "$ventoy_compatible" = "NO" ]; then
635 if [ "$ventoy_fs_probe" = "iso9660" ]; then
637 vt_iso9660_nojoliet 1
641 for file in "boot/bcd" "/efi/microsoft/boot/bcd" "SSTR/BCD"; do
642 vt_windows_collect_wim_patch bcd (loop)/$file
645 distro_specify_wim_patch
647 vt_windows_count_wim_patch vt_wim_cnt
648 if [ $vt_wim_cnt -eq 0 ]; then
649 distro_specify_wim_patch_phase2
656 vt_windows_chain_data ${1}${chosen_path}
659 if [ -n "$vtoy_chain_mem_addr" ]; then
660 linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} ibft mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
663 echo "chain empty failed"
668 function legacy_linux_menu_func {
669 if [ "$ventoy_compatible" = "NO" ]; then
671 if [ "$ventoy_fs_probe" = "udf" ]; then
673 set ventoy_fs_probe=iso9660
677 vt_load_cpio $vtoy_path/ventoy.cpio $2 $1 "busybox=$ventoy_busybox_ver"
679 vt_linux_clear_initrd
681 if [ -d (loop)/pmagic ]; then
682 vt_linux_specify_initrd_file /pmagic/initrd.img
684 for dir in "isolinux" "boot/isolinux" "boot/x86_64/loader" "syslinux" "boot/syslinux"; do
685 if [ -d (loop)/$dir ]; then
686 vt_linux_parse_initrd_isolinux (loop)/$dir/
691 # special process for special distros
693 if [ -d (loop)/arch/boot/syslinux ]; then
694 vt_linux_parse_initrd_isolinux (loop)/arch/boot/syslinux/ /arch/
695 vt_linux_parse_initrd_isolinux (loop)/arch/boot/syslinux/ /arch/boot/syslinux/
698 elif [ -d (loop)/manjaro ]; then
699 if [ -e (loop)/boot/grub/kernels.cfg ]; then
700 vt_linux_parse_initrd_grub file (loop)/boot/grub/kernels.cfg
702 elif [ -e (loop)/boot/grub/grub.cfg ]; then
703 vt_linux_parse_initrd_grub file (loop)/boot/grub/grub.cfg
706 distro_specify_initrd_file
708 vt_linux_initrd_count vtcount
709 if [ $vtcount -eq 0 ]; then
710 if [ -d (loop)/rancheros ]; then
711 vt_linux_parse_initrd_isolinux (loop)/boot/ /boot/isolinux/
714 distro_specify_initrd_file_phase2
720 vt_linux_chain_data ${1}${chosen_path}
723 if [ -n "$vtoy_chain_mem_addr" ]; then
724 linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
727 echo "chain empty failed"
733 function legacy_unix_menu_func {
734 ventoy_unix_comm_proc $1 ${chosen_path}
736 if [ -n "$vtoy_chain_mem_addr" ]; then
737 linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
740 echo "chain empty failed"
746 function legacy_iso_menu_func {
748 if [ -d (loop)/ ]; then
753 vt_select_auto_install ${chosen_path}
754 vt_select_persistence ${chosen_path}
756 if vt_is_udf ${1}${chosen_path}; then
757 set ventoy_fs_probe=udf
759 set ventoy_fs_probe=iso9660
760 vt_iso9660_nojoliet 0
763 loopback loop ${1}${chosen_path}
767 if [ -n "$vtcompat" ]; then
768 set ventoy_compatible=YES
770 elif vt_check_mode 1; then
771 set ventoy_compatible=YES
773 vt_check_compatible (loop)
776 vt_img_sector ${1}${chosen_path}
778 if [ "$vtoy_os" = "Windows" ]; then
779 vt_check_compatible_pe (loop)
780 legacy_windows_menu_func $1 ${chosen_path}
781 elif [ "$vtoy_os" = "Unix" ]; then
782 legacy_unix_menu_func $1 ${chosen_path}
784 legacy_linux_menu_func $1 ${chosen_path}
788 function legacy_iso_memdisk {
790 linux16 $vtoy_path/memdisk iso raw
791 echo "Loading ISO file to memory ..."
797 function iso_endless_os_proc {
798 if [ -d (loop)/ ]; then
802 loopback loop ${1}${2}
803 vt_img_sector ${1}${2}
805 vt_load_cpio $vtoy_path/ventoy.cpio $2 $1 "busybox=$ventoy_busybox_ver"
806 vt_trailer_cpio $1 $2 noinit
810 vt_set_boot_opt '@kparams' rdinit=/vtoy/vtoy
813 set ventoy_bls_bootdev=/boot
814 set ventoy_loading_tip="Loading files ......"
817 configfile (loop)/endless/grub/grub.cfg
820 unset ventoy_bls_bootdev
821 unset ventoy_loading_tip
827 function ventoy_iso_busybox_ver {
828 set ventoy_busybox_ver=32
830 #special process for deepin-live iso
831 if [ "$vt_chosen_size" = "403701760" ]; then
832 if vt_str_str $vt_chosen_path "/deepin-live"; then
833 set ventoy_busybox_ver=64
835 elif vt_str_begin $vt_volume_id "PHOTON_"; then
836 set ventoy_busybox_ver=64
837 elif vt_str_begin $vt_volume_id "smgl-test-quinq-x86_64"; then
838 set ventoy_busybox_ver=64
843 function iso_common_menuentry {
847 vt_chosen_img_path vt_chosen_path vt_chosen_size
848 vt_parse_iso_volume ${vtoy_iso_part}${vt_chosen_path} vt_system_id vt_volume_id
850 ventoy_iso_busybox_ver
852 #special process for Endless OS
853 if vt_str_begin $vt_volume_id "Endless-OS"; then
854 iso_endless_os_proc $vtoy_iso_part $vt_chosen_path
855 elif vt_str_begin $vt_volume_id "TENS-Public"; then
859 if [ "$grub_platform" = "pc" ]; then
860 if vt_check_mode 0; then
861 legacy_iso_memdisk $vtoy_iso_part $vt_chosen_path
863 legacy_iso_menu_func $vtoy_iso_part $vt_chosen_path
866 if vt_check_mode 0; then
867 uefi_iso_memdisk $vtoy_iso_part $vt_chosen_path
869 uefi_iso_menu_func $vtoy_iso_part $vt_chosen_path
874 function miso_common_menuentry {
875 vt_chosen_img_path vt_chosen_path vt_chosen_size
877 echo "memdisk mode boot for $vt_chosen_path"
881 if [ "$grub_platform" = "pc" ]; then
882 legacy_iso_memdisk $vtoy_iso_part $vt_chosen_path
884 uefi_iso_memdisk $vtoy_iso_part $vt_chosen_path
889 function common_unsupport_menuentry {
890 echo -e "\n The name of the iso file could NOT contain space or non-ascii characters. \n"
891 echo -e " 文件名中不能有中文或空格 \n"
892 echo -e "\npress ENTER to exit (请按 回车 键返回) ..."
896 function miso_unsupport_menuentry {
897 common_unsupport_menuentry
900 function iso_unsupport_menuentry {
901 common_unsupport_menuentry
904 function wim_common_menuentry {
905 vt_chosen_img_path vt_chosen_path vt_chosen_size
906 vt_wim_chain_data ${vtoy_iso_part}${vt_chosen_path}
910 if [ -n "$vtoy_chain_mem_addr" ]; then
911 if [ "$grub_platform" = "pc" ]; then
912 linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
915 chainloader ${vtoy_path}/ventoy_x64.efi env_param=${env_param} isoefi=${LoadIsoEfiDriver} ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
920 echo "chain empty failed"
925 function wim_unsupport_menuentry {
926 common_unsupport_menuentry
929 function efi_common_menuentry {
930 vt_chosen_img_path vt_chosen_path vt_chosen_size
932 vt_concat_efi_iso ${vtoy_iso_part}${vt_chosen_path} vtoy_iso_buf
938 unset vtoy_dotefi_retry
939 chainloader ${vtoy_path}/ventoy_x64.efi memdisk env_param=${env_param} dotefi isoefi=on ${vtdebug_flag} mem:${vtoy_iso_buf_addr}:size:${vtoy_iso_buf_size}
942 if [ -n "$vtoy_dotefi_retry" ]; then
943 unset vtoy_dotefi_retry
944 chainloader ${vtoy_iso_part}${vt_chosen_path}
951 function efi_unsupport_menuentry {
952 common_unsupport_menuentry
955 function vhd_common_menuentry {
957 if [ "$VTOY_VHD_NO_WARNING" != "1" ]; then
958 if [ "$vtoy_iso_fs" != "ntfs" ]; then
959 echo -e "!!! WARNING !!!\n"
960 echo -e "\nPartition1 ($vtoy_iso_fs) is NOT ntfs, the VHD(x) file may not boot normally \n"
961 echo -e "\nVHD(x) 文件所在分区不是 ntfs 格式, 可能无法正常启动 \n\n"
962 echo -n "press ENTER to continue boot (请按 回车 键继续) ..."
967 vt_chosen_img_path vt_chosen_path vt_chosen_size
968 vt_patch_vhdboot $vt_chosen_path
972 if [ -n "$vtoy_vhd_buf_addr" ]; then
973 if [ "$grub_platform" = "pc" ]; then
974 linux16 $vtoy_path/memdisk iso raw
975 initrd16 mem:${vtoy_vhd_buf_addr}:size:${vtoy_vhd_buf_size}
979 chainloader ${vtoy_path}/ventoy_x64.efi memdisk env_param=${env_param} isoefi=${LoadIsoEfiDriver} ${vtdebug_flag} mem:${vtoy_vhd_buf_addr}:size:${vtoy_vhd_buf_size}
984 echo "Please put the right ventoy_vhdboot.img file to the 1st partition"
989 function vhd_unsupport_menuentry {
990 common_unsupport_menuentry
993 function vtoyboot_common_func {
997 vt_get_vtoy_type ${1} vtoytype parttype efigrubpart
999 if vt_str_begin $vtoytype vhd; then
1001 elif [ "$vtoytype" = "raw" ]; then
1005 if [ $vtoysupport -eq 1 ]; then
1006 if [ "$grub_platform" = "pc" ]; then
1007 if [ "$parttype" = "gpt" -a $efigrubpart -eq 0 ]; then
1008 echo "The OS in the vdisk was created in UEFI mode, but current is Legacy BIOS mode."
1009 echo "虚拟磁盘内的系统是在UEFI模式下创建的,而当前系统是Legacy BIOS模式,可能无法正常启动。"
1013 if [ "$parttype" = "mbr" ]; then
1014 echo "The OS in the vdisk was created in Legacy BIOS mode, but current is UEFI mode."
1015 echo "虚拟磁盘内的系统是在Legacy BIOS模式下创建的,而当前系统是UEFI模式,可能无法正常启动。"
1021 vt_raw_chain_data ${1}
1025 if [ -n "$vtoy_chain_mem_addr" ]; then
1026 if [ "$grub_platform" = "pc" ]; then
1027 vt_acpi_param ${vtoy_chain_mem_addr} 512
1028 linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} sector512 mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
1032 chainloader ${vtoy_path}/ventoy_x64.efi sector512 env_param=${ventoy_env_param} ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
1037 echo "chain empty failed!"
1041 echo "Unsupported vtoy type $vtoytype"
1046 function vtoy_common_menuentry {
1047 vt_chosen_img_path vt_chosen_path vt_chosen_size
1048 vtoyboot_common_func ${vtoy_iso_part}${vt_chosen_path}
1051 function vtoy_unsupport_menuentry {
1052 common_unsupport_menuentry
1056 #============================================================#
1057 # IMG file boot process #
1058 #============================================================#
1062 function ventoy_img_easyos {
1063 vt_load_cpio $vtoy_path/ventoy.cpio ${vt_chosen_path} ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
1064 vt_trailer_cpio ${vtoy_iso_part} ${vt_chosen_path} noinit
1066 loopback easysfs (vtimghd,1)/easy.sfs
1067 vt_get_lib_module_ver (easysfs) /lib/modules/ vt_module_ver
1069 if [ -n "$vt_module_ver" ]; then
1070 for mod in "kernel/drivers/md/dm-mod.ko" "kernel/drivers/dax/dax.ko"; do
1071 vt_img_extra_initrd_append (easysfs)/lib/modules/$vt_module_ver/$mod
1078 vt_set_boot_opt rdinit=/vtoy/vtoy
1081 syslinux_configfile (vtimghd,1)/syslinux.cfg
1088 function ventoy_img_volumio {
1089 vt_load_cpio $vtoy_path/ventoy.cpio ${vt_chosen_path} ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
1090 vt_trailer_cpio ${vtoy_iso_part} ${vt_chosen_path} noinit
1095 vt_set_boot_opt rdinit=/vtoy/vtoy imgpart=/dev/ventoy2 bootpart=/dev/ventoy1
1098 syslinux_configfile (vtimghd,1)/syslinux.cfg
1104 function ventoy_img_openelec {
1107 vt_load_cpio $vtoy_path/ventoy.cpio ${vt_chosen_path} ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
1108 vt_trailer_cpio ${vtoy_iso_part} ${vt_chosen_path} noinit
1110 loopback vtloopex $vtoy_efi_part/ventoy/vtloopex.cpio
1111 vt_img_extra_initrd_append (vtloopex)/$elec_ver/vtloopex.tar.xz
1116 vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=$elec_ver
1119 set root=(vtimghd,1)
1120 syslinux_configfile (vtimghd,1)/syslinux.cfg
1124 loopback -d vtloopex
1128 function ventoy_img_freedombox {
1129 vt_load_cpio $vtoy_path/ventoy.cpio ${vt_chosen_path} ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
1130 vt_trailer_cpio ${vtoy_iso_part} ${vt_chosen_path} noinit
1132 vt_get_lib_module_ver (vtimghd,1) /lib/modules/ vt_module_ver
1133 if [ -n "$vt_module_ver" ]; then
1134 vt_img_extra_initrd_append (vtimghd,1)/lib/modules/$vt_module_ver/kernel/drivers/md/dm-mod.ko
1140 vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=freedombox
1143 configfile (vtimghd,1)/boot/grub/grub.cfg
1149 function ventoy_img_paldo {
1150 vt_load_cpio $vtoy_path/ventoy.cpio ${vt_chosen_path} ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
1151 vt_trailer_cpio ${vtoy_iso_part} ${vt_chosen_path} noinit
1156 vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=paldo
1159 vt_fs_enum_1st_file (vtimghd,1) /loader/entries/ vt_paldo_entry_conf
1160 vt_file_basename $vt_paldo_entry_conf vtPaldoVer
1162 echo loading file...
1163 linux (vtimghd,1)/linux-${vtPaldoVer} root=/dev/ventoy1 rootfstype=vfat
1164 initrd (vtimghd,1)/initramfs-${vtPaldoVer}
1171 function ventoy_img_ubos {
1172 vt_load_cpio $vtoy_path/ventoy.cpio ${vt_chosen_path} ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
1173 vt_trailer_cpio ${vtoy_iso_part} ${vt_chosen_path} noinit
1175 vt_get_lib_module_ver (vtimghd,3) /lib/modules/ vt_module_ver
1176 if [ -n "$vt_module_ver" ]; then
1177 vt_img_extra_initrd_append (vtimghd,3)/lib/modules/$vt_module_ver/kernel/drivers/md/dm-mod.ko.xz
1183 vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=ubos
1186 echo loading file...
1187 linux (vtimghd,2)/vmlinuz-linux root=/dev/ventoy3 rw
1188 initrd (vtimghd,2)/initramfs-linux.img
1195 function ventoy_img_recalbox {
1196 vt_load_cpio $vtoy_path/ventoy.cpio ${vt_chosen_path} ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
1197 vt_trailer_cpio ${vtoy_iso_part} ${vt_chosen_path} noinit
1202 vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=recalbox
1205 set root=(vtimghd,1)
1206 configfile (vtimghd,1)/boot/grub/grub.cfg
1212 function ventoy_img_batocera {
1213 vt_load_cpio $vtoy_path/ventoy.cpio ${vt_chosen_path} ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
1214 vt_trailer_cpio ${vtoy_iso_part} ${vt_chosen_path} noinit
1219 vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=batocera
1222 set root=(vtimghd,1)
1223 syslinux_configfile (vtimghd,1)/boot/syslinux/syslinux.cfg
1229 function ventoy_img_memtest86 {
1230 chainloader (vtimghd,1)/efi/boot/BOOTX64.efi
1234 function img_unsupport_tip {
1235 echo -e "\n This IMG file is NOT supported now. \n"
1236 echo -e " 当前不支持启动此 IMG 文件 \n"
1237 echo -e "\npress ENTER to exit (请按 回车 键返回) ..."
1241 function img_common_menuentry {
1242 set ventoy_compatible=YES
1243 set ventoy_busybox_ver=32
1245 vt_chosen_img_path vt_chosen_path vt_chosen_size
1247 if [ -d (vtimghd)/ ]; then
1251 loopback vtimghd ${vtoy_iso_part}${vt_chosen_path}
1252 vt_img_sector ${vtoy_iso_part}${vt_chosen_path}
1254 vt_img_part_info (vtimghd)
1256 set vtback_root=$root
1260 vt_img_extra_initrd_reset
1262 vt_get_fs_label (vtimghd,1) vtImgHd1Label
1263 if [ -d (vtimghd,2)/lib ]; then
1264 vt_get_fs_label (vtimghd,2) vtImgHd2Label
1267 if [ -e (vtimghd,1)/etc/hostname ]; then
1268 vt_1st_line (vtimghd,1)/etc/hostname vtImgHostname
1271 if [ -e (vtimghd,1)/easy.sfs ]; then
1273 elif [ -e (vtimghd,1)/volumio.initrd ]; then
1275 elif vt_str_begin $vtImgHd1Label "LAKKA"; then
1276 ventoy_img_openelec lakka
1277 elif vt_str_begin $vtImgHd1Label "LIBREELEC"; then
1278 ventoy_img_openelec LibreELEC
1279 elif vt_str_begin $vtImgHd1Label "paldo-live"; then
1281 elif vt_str_begin $vtImgHostname "freedombox"; then
1282 ventoy_img_freedombox
1283 elif vt_str_begin $vtImgHd1Label "BATOCERA"; then
1285 elif [ "$vtImgHd2Label" = "RECALBOX" ]; then
1287 elif [ -f (vtimghd,2)/loader/entries/ubos.conf ]; then
1289 elif [ -f (vtimghd,1)/efi/boot/mt86.png ]; then
1290 if [ "$grub_platform" = "pc" ]; then
1293 ventoy_img_memtest86
1296 vt_linux_chain_data ${vtoy_iso_part}${vt_chosen_path}
1297 if [ "$grub_platform" = "pc" ]; then
1298 linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} sector512 mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
1301 chainloader ${vtoy_path}/ventoy_x64.efi sector512 env_param=${env_param} isoefi=${LoadIsoEfiDriver} FirstTry=${FirstTryBootFile} ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
1306 set root=$vtback_root
1309 set ventoy_compatible=NO
1312 function img_unsupport_menuentry {
1313 common_unsupport_menuentry
1316 #############################################################
1317 #############################################################
1318 #############################################################
1319 ####### Main Process ###########
1320 #############################################################
1321 #############################################################
1322 #############################################################
1324 set VENTOY_VERSION="1.0.21"
1326 # Default menu display mode, you can change it as you want.
1329 set VTOY_DEFAULT_MENU_MODE=0
1331 set VTOY_MEM_DISK_STR="[Memdisk]"
1332 set VTOY_ISO_RAW_STR="Compatible Mode"
1333 set VTOY_ISO_UEFI_DRV_STR="UEFI FS"
1335 set VTOY_F2_CMD="ventoy_power"
1336 set VTOY_F4_CMD="ventoy_localboot"
1337 set VTOY_F5_CMD="ventoy_diagnosis"
1338 set VTOY_F6_CMD="ventoy_ext_menu"
1340 if [ "$grub_platform" = "pc" ]; then
1341 set VTOY_TEXT_MENU_VER="Ventoy $VENTOY_VERSION BIOS www.ventoy.net"
1343 set VTOY_TEXT_MENU_VER="Ventoy $VENTOY_VERSION UEFI www.ventoy.net"
1346 vt_device $root vtoy_dev
1348 if [ "$vtoy_dev" = "tftp" ]; then
1349 set vtoy_path=($root)
1350 for vtid in 0 1 2 3; do
1351 if [ -f (hd$vtid,2)/ventoy/ventoy.cpio ]; then
1352 set vtoy_iso_part=(hd$vtid,1)
1353 set vtoy_efi_part=(hd$vtid,2)
1360 if [ -f $vtoy_iso_part/ventoy/ventoy.json ]; then
1361 set vt_plugin_path=$vtoy_iso_part
1363 set vt_plugin_path=$prefix
1364 vt_load_plugin $vt_plugin_path
1367 if [ "$prefix" = "(ventoydisk)/grub" ]; then
1368 set vtoy_path=(ventoydisk)/ventoy
1370 set vtoy_path=($root)/ventoy
1373 set vtoydev=$vtoy_dev
1374 set vtoy_iso_part=($vtoy_dev,1)
1375 set vtoy_efi_part=($vtoy_dev,2)
1377 set vt_plugin_path=$vtoy_iso_part
1380 #Load Partition Table
1381 vt_load_part_table $vtoydev
1384 if [ -f $vtoy_iso_part/ventoy/ventoy.json ]; then
1385 vt_load_plugin $vtoy_iso_part
1388 if [ -n "$VTOY_MENU_TIMEOUT" ]; then
1389 set timeout=$VTOY_MENU_TIMEOUT
1394 if [ -f $vtoy_iso_part/ventoy/ventoy_wimboot.img ]; then
1395 vt_load_wimboot $vtoy_iso_part/ventoy/ventoy_wimboot.img
1396 elif [ -f $vtoy_efi_part/ventoy/ventoy_wimboot.img ]; then
1397 vt_load_wimboot $vtoy_efi_part/ventoy/ventoy_wimboot.img
1400 if [ -f $vtoy_iso_part/ventoy/ventoy_vhdboot.img ]; then
1401 vt_load_vhdboot $vtoy_iso_part/ventoy/ventoy_vhdboot.img
1402 elif [ -f $vtoy_efi_part/ventoy/ventoy_vhdboot.img ]; then
1403 vt_load_vhdboot $vtoy_efi_part/ventoy/ventoy_vhdboot.img
1407 if [ $VTOY_DEFAULT_MENU_MODE -eq 0 ]; then
1408 set VTOY_F3_CMD="vt_dynamic_menu 1 1"
1409 set VTOY_HOTKEY_TIP="F1:Memdisk F2:Power F3:TreeView F4:Localboot F5:Tools F6:ExMenu"
1411 set VTOY_F3_CMD="vt_dynamic_menu 1 0"
1412 set VTOY_HOTKEY_TIP="F1:Memdisk F2:Power F3:ListView F4:Localboot F5:Tools F6:ExMenu"
1416 if [ -n "$vtoy_gfxmode" ]; then
1417 set gfxmode=$vtoy_gfxmode
1420 set gfxmode=1920x1080,1366x768,1024x768,800x600,auto
1425 if [ "$vtoy_display_mode" = "CLI" ]; then
1426 terminal_output console
1427 elif [ "$vtoy_display_mode" = "serial" ]; then
1428 if [ -n "$vtoy_serial_param" ]; then
1429 serial $vtoy_serial_param
1431 terminal_input serial
1432 terminal_output serial
1433 elif [ "$vtoy_display_mode" = "serial_console" ]; then
1434 if [ -n "$vtoy_serial_param" ]; then
1435 serial $vtoy_serial_param
1437 terminal_input serial console
1438 terminal_output serial console
1440 if [ -n "$vtoy_theme" ]; then
1441 set theme=$vtoy_theme
1443 set theme=$prefix/themes/ventoy/theme.txt
1445 terminal_output gfxterm
1448 #export necessary variable
1454 export vtoy_iso_part
1455 export vtoy_efi_part
1456 export VENTOY_VERSION
1457 export VTOY_CUR_VIDEO_MODE
1460 #colect all image files (iso files)
1461 set ventoy_img_count=0
1462 vt_list_img $vtoy_iso_part ventoy_img_count
1465 if [ $ventoy_img_count -gt 0 ]; then
1466 if [ $VTOY_DEFAULT_MENU_MODE -eq 0 ]; then
1472 if [ -n "$VTOY_NO_ISO_TIP" ]; then
1473 NO_ISO_MENU="No ISO files found, $VTOY_NO_ISO_TIP"
1474 elif [ -n "$VTOY_DEFAULT_SEARCH_ROOT" ]; then
1475 NO_ISO_MENU="No ISO files found, please check VTOY_DEFAULT_SEARCH_ROOT"
1477 NO_ISO_MENU="No ISO files found"
1479 menuentry "$NO_ISO_MENU (Press enter to reboot ...)" {
1480 echo -e "\n Rebooting ... "