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
481 if [ $vtcount -eq 0 ]; then
482 distro_specify_initrd_file_phase2
484 if [ "$vt_efi_dir" = "NO" ]; then
485 if [ -f (loop)/efi.img ]; then
486 vt_add_replace_file 0 "initrd"
493 if [ -d (loop)/loader/entries ]; then
494 vt_linux_get_main_initrd_index vtindex
496 if [ -d (loop)/arch ]; then
497 if [ -f (loop)/arch/boot/x86_64/archiso.img ]; then
498 vt_add_replace_file $vtindex "EFI\\archiso\\archiso.img"
499 elif [ -f (loop)/boot/initramfs_x86_64.img ]; then
500 vt_add_replace_file $vtindex "boot\\initramfs_x86_64.img"
502 elif [ -d (loop)/parabola ]; then
503 if [ -f (loop)/parabola/boot/x86_64/parabola.img ]; then
504 vt_add_replace_file $vtindex "EFI\\parabola\\parabola.img"
505 elif [ -f (loop)/boot/initramfs_x86_64.img ]; then
506 vt_add_replace_file $vtindex "boot\\initramfs_x86_64.img"
508 elif [ -f (loop)/EFI/BOOT/initrd.gz ]; then
509 vt_add_replace_file $vtindex "EFI\\BOOT\\initrd.gz"
510 elif [ -f (loop)/loader/entries/thinstation.conf ]; then
511 vt_add_replace_file $vtindex "boot\\initrd"
512 elif [ -f (loop)/loader/entries/pisi-efi-x86_64.conf ]; then
513 vt_add_replace_file $vtindex "EFI\\pisi\\initrd.img"
515 elif [ -d (loop)/EFI/boot/entries ]; then
516 if [ -f (loop)/parabola/boot/x86_64/parabolaiso.img ]; then
517 vt_add_replace_file 0 "EFI\\parabolaiso\\parabolaiso.img"
518 elif [ -f (loop)/hyperbola/boot/x86_64/hyperiso.img ]; then
519 vt_add_replace_file 0 "EFI\\hyperiso\\hyperiso.img"
521 elif [ -d (loop)/EFI/BOOT/entries ]; then
522 if [ -f (loop)/parabola/boot/x86_64/parabolaiso.img ]; then
523 vt_add_replace_file 0 "EFI\\parabolaiso\\parabolaiso.img"
525 elif [ -e (loop)/syslinux/alt0/full.cz ]; then
526 vt_add_replace_file 0 "EFI\\BOOT\\full.cz"
527 set FirstTryBootFile='@EFI@BOOT@grubx64.efi'
534 vt_linux_chain_data ${1}${chosen_path}
536 if [ -n "$vtoy_chain_mem_addr" ]; then
538 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}
541 echo "chain empty failed"
546 function uefi_unix_menu_func {
547 ventoy_unix_comm_proc $1 ${chosen_path}
549 if [ -n "$vtoy_chain_mem_addr" ]; then
551 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}
554 echo "chain empty failed"
559 function uefi_iso_menu_func {
561 if [ -d (loop)/ ]; then
565 if [ -n "$vtisouefi" ]; then
566 set LoadIsoEfiDriver=on
568 elif vt_check_mode 2; then
569 set LoadIsoEfiDriver=on
571 unset LoadIsoEfiDriver
575 vt_select_auto_install ${chosen_path}
576 vt_select_persistence ${chosen_path}
578 if vt_is_udf ${1}${chosen_path}; then
579 set ventoy_fs_probe=udf
581 set ventoy_fs_probe=iso9660
582 vt_iso9660_nojoliet 0
585 loopback loop ${1}${chosen_path}
588 if [ -d (loop)/EFI ]; then
590 elif [ -d (loop)/efi ]; then
596 if [ -n "$vtcompat" ]; then
597 set ventoy_compatible=YES
599 elif vt_check_mode 1; then
600 set ventoy_compatible=YES
602 vt_check_compatible (loop)
605 vt_img_sector ${1}${chosen_path}
607 if [ "$vtoy_os" = "Windows" ]; then
608 vt_check_compatible_pe (loop)
609 uefi_windows_menu_func $1 ${chosen_path}
610 elif [ "$vtoy_os" = "Unix" ]; then
611 uefi_unix_menu_func $1 ${chosen_path}
613 uefi_linux_menu_func $1 ${chosen_path}
619 function uefi_iso_memdisk {
620 echo 'Loading ISO file to memory ...'
621 vt_load_img_memdisk ${1}${2} vtoy_iso_buf
624 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}
631 function legacy_windows_menu_func {
634 if [ "$ventoy_compatible" = "NO" ]; then
636 if [ "$ventoy_fs_probe" = "iso9660" ]; then
638 vt_iso9660_nojoliet 1
642 for file in "boot/bcd" "/efi/microsoft/boot/bcd" "SSTR/BCD"; do
643 vt_windows_collect_wim_patch bcd (loop)/$file
646 distro_specify_wim_patch
648 vt_windows_count_wim_patch vt_wim_cnt
649 if [ $vt_wim_cnt -eq 0 ]; then
650 distro_specify_wim_patch_phase2
657 vt_windows_chain_data ${1}${chosen_path}
660 if [ -n "$vtoy_chain_mem_addr" ]; then
661 linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} ibft mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
664 echo "chain empty failed"
669 function legacy_linux_menu_func {
670 if [ "$ventoy_compatible" = "NO" ]; then
672 if [ "$ventoy_fs_probe" = "udf" ]; then
674 set ventoy_fs_probe=iso9660
678 vt_load_cpio $vtoy_path/ventoy.cpio $2 $1 "busybox=$ventoy_busybox_ver"
680 vt_linux_clear_initrd
682 if [ -d (loop)/pmagic ]; then
683 vt_linux_specify_initrd_file /pmagic/initrd.img
685 for dir in "isolinux" "boot/isolinux" "boot/x86_64/loader" "syslinux" "boot/syslinux"; do
686 if [ -d (loop)/$dir ]; then
687 vt_linux_parse_initrd_isolinux (loop)/$dir/
692 # special process for special distros
694 if [ -d (loop)/arch/boot/syslinux ]; then
695 vt_linux_parse_initrd_isolinux (loop)/arch/boot/syslinux/ /arch/
696 vt_linux_parse_initrd_isolinux (loop)/arch/boot/syslinux/ /arch/boot/syslinux/
699 elif [ -d (loop)/manjaro ]; then
700 if [ -e (loop)/boot/grub/kernels.cfg ]; then
701 vt_linux_parse_initrd_grub file (loop)/boot/grub/kernels.cfg
703 elif [ -e (loop)/boot/grub/grub.cfg ]; then
704 vt_linux_parse_initrd_grub file (loop)/boot/grub/grub.cfg
707 distro_specify_initrd_file
709 vt_linux_initrd_count vtcount
710 if [ $vtcount -eq 0 ]; then
711 if [ -d (loop)/rancheros ]; then
712 vt_linux_parse_initrd_isolinux (loop)/boot/ /boot/isolinux/
715 distro_specify_initrd_file_phase2
721 vt_linux_chain_data ${1}${chosen_path}
724 if [ -n "$vtoy_chain_mem_addr" ]; then
725 linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
728 echo "chain empty failed"
734 function legacy_unix_menu_func {
735 ventoy_unix_comm_proc $1 ${chosen_path}
737 if [ -n "$vtoy_chain_mem_addr" ]; then
738 linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
741 echo "chain empty failed"
747 function legacy_iso_menu_func {
749 if [ -d (loop)/ ]; then
754 vt_select_auto_install ${chosen_path}
755 vt_select_persistence ${chosen_path}
757 if vt_is_udf ${1}${chosen_path}; then
758 set ventoy_fs_probe=udf
760 set ventoy_fs_probe=iso9660
761 vt_iso9660_nojoliet 0
764 loopback loop ${1}${chosen_path}
768 if [ -n "$vtcompat" ]; then
769 set ventoy_compatible=YES
771 elif vt_check_mode 1; then
772 set ventoy_compatible=YES
774 vt_check_compatible (loop)
777 vt_img_sector ${1}${chosen_path}
779 if [ "$vtoy_os" = "Windows" ]; then
780 vt_check_compatible_pe (loop)
781 legacy_windows_menu_func $1 ${chosen_path}
782 elif [ "$vtoy_os" = "Unix" ]; then
783 legacy_unix_menu_func $1 ${chosen_path}
785 legacy_linux_menu_func $1 ${chosen_path}
789 function legacy_iso_memdisk {
791 linux16 $vtoy_path/memdisk iso raw
792 echo "Loading ISO file to memory ..."
798 function iso_endless_os_proc {
799 if [ -d (loop)/ ]; then
803 loopback loop ${1}${2}
804 vt_img_sector ${1}${2}
806 vt_load_cpio $vtoy_path/ventoy.cpio $2 $1 "busybox=$ventoy_busybox_ver"
807 vt_trailer_cpio $1 $2 noinit
811 vt_set_boot_opt '@kparams' rdinit=/vtoy/vtoy
814 set ventoy_bls_bootdev=/boot
815 set ventoy_loading_tip="Loading files ......"
818 configfile (loop)/endless/grub/grub.cfg
821 unset ventoy_bls_bootdev
822 unset ventoy_loading_tip
828 function ventoy_iso_busybox_ver {
829 set ventoy_busybox_ver=32
831 #special process for deepin-live iso
832 if [ "$vt_chosen_size" = "403701760" ]; then
833 if vt_str_str $vt_chosen_path "/deepin-live"; then
834 set ventoy_busybox_ver=64
836 elif vt_str_begin $vt_volume_id "PHOTON_"; then
837 set ventoy_busybox_ver=64
838 elif vt_str_begin $vt_volume_id "smgl-test-quinq-x86_64"; then
839 set ventoy_busybox_ver=64
844 function iso_common_menuentry {
848 vt_chosen_img_path vt_chosen_path vt_chosen_size
849 vt_parse_iso_volume ${vtoy_iso_part}${vt_chosen_path} vt_system_id vt_volume_id
851 ventoy_iso_busybox_ver
853 #special process for Endless OS
854 if vt_str_begin $vt_volume_id "Endless-OS"; then
855 iso_endless_os_proc $vtoy_iso_part $vt_chosen_path
856 elif vt_str_begin $vt_volume_id "TENS-Public"; then
860 if [ "$grub_platform" = "pc" ]; then
861 if vt_check_mode 0; then
862 legacy_iso_memdisk $vtoy_iso_part $vt_chosen_path
864 legacy_iso_menu_func $vtoy_iso_part $vt_chosen_path
867 if vt_check_mode 0; then
868 uefi_iso_memdisk $vtoy_iso_part $vt_chosen_path
870 uefi_iso_menu_func $vtoy_iso_part $vt_chosen_path
875 function miso_common_menuentry {
876 vt_chosen_img_path vt_chosen_path vt_chosen_size
878 echo "memdisk mode boot for $vt_chosen_path"
882 if [ "$grub_platform" = "pc" ]; then
883 legacy_iso_memdisk $vtoy_iso_part $vt_chosen_path
885 uefi_iso_memdisk $vtoy_iso_part $vt_chosen_path
890 function common_unsupport_menuentry {
891 echo -e "\n The name of the iso file could NOT contain space or non-ascii characters. \n"
892 echo -e " 文件名中不能有中文或空格 \n"
893 echo -e "\npress ENTER to exit (请按 回车 键返回) ..."
897 function miso_unsupport_menuentry {
898 common_unsupport_menuentry
901 function iso_unsupport_menuentry {
902 common_unsupport_menuentry
905 function wim_common_menuentry {
906 vt_chosen_img_path vt_chosen_path vt_chosen_size
907 vt_wim_chain_data ${vtoy_iso_part}${vt_chosen_path}
911 if [ -n "$vtoy_chain_mem_addr" ]; then
912 if [ "$grub_platform" = "pc" ]; then
913 linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
916 chainloader ${vtoy_path}/ventoy_x64.efi env_param=${env_param} isoefi=${LoadIsoEfiDriver} ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
921 echo "chain empty failed"
926 function wim_unsupport_menuentry {
927 common_unsupport_menuentry
930 function efi_common_menuentry {
931 vt_chosen_img_path vt_chosen_path vt_chosen_size
933 vt_concat_efi_iso ${vtoy_iso_part}${vt_chosen_path} vtoy_iso_buf
939 unset vtoy_dotefi_retry
940 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}
943 if [ -n "$vtoy_dotefi_retry" ]; then
944 unset vtoy_dotefi_retry
945 chainloader ${vtoy_iso_part}${vt_chosen_path}
952 function efi_unsupport_menuentry {
953 common_unsupport_menuentry
956 function vhd_common_menuentry {
958 if [ "$VTOY_VHD_NO_WARNING" != "1" ]; then
959 if [ "$vtoy_iso_fs" != "ntfs" ]; then
960 echo -e "!!! WARNING !!!\n"
961 echo -e "\nPartition1 ($vtoy_iso_fs) is NOT ntfs, the VHD(x) file may not boot normally \n"
962 echo -e "\nVHD(x) 文件所在分区不是 ntfs 格式, 可能无法正常启动 \n\n"
963 echo -n "press ENTER to continue boot (请按 回车 键继续) ..."
968 vt_chosen_img_path vt_chosen_path vt_chosen_size
969 vt_patch_vhdboot $vt_chosen_path
973 if [ -n "$vtoy_vhd_buf_addr" ]; then
974 if [ "$grub_platform" = "pc" ]; then
975 linux16 $vtoy_path/memdisk iso raw
976 initrd16 mem:${vtoy_vhd_buf_addr}:size:${vtoy_vhd_buf_size}
980 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}
985 echo "Please put the right ventoy_vhdboot.img file to the 1st partition"
990 function vhd_unsupport_menuentry {
991 common_unsupport_menuentry
994 function vtoyboot_common_func {
998 vt_get_vtoy_type ${1} vtoytype parttype AltBootPart
1000 if vt_str_begin $vtoytype vhd; then
1002 elif [ "$vtoytype" = "raw" ]; then
1004 elif [ "$vtoytype" = "vdi" ]; then
1008 if [ $vtoysupport -eq 1 ]; then
1009 if [ "$grub_platform" = "pc" ]; then
1010 if [ "$parttype" = "gpt" -a $AltBootPart -eq 0 ]; then
1011 echo "The OS in the vdisk was created in UEFI mode, but current is Legacy BIOS mode."
1012 echo "虚拟磁盘内的系统是在UEFI模式下创建的,而当前系统是Legacy BIOS模式,可能无法正常启动。"
1016 if [ "$parttype" = "mbr" -a $AltBootPart -eq 0 ]; then
1017 echo "The OS in the vdisk was created in Legacy BIOS mode, but current is UEFI mode."
1018 echo "虚拟磁盘内的系统是在Legacy BIOS模式下创建的,而当前系统是UEFI模式,可能无法正常启动。"
1024 vt_raw_chain_data ${1}
1028 if [ -n "$vtoy_chain_mem_addr" ]; then
1029 if [ "$grub_platform" = "pc" ]; then
1030 vt_acpi_param ${vtoy_chain_mem_addr} 512
1031 linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} sector512 mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
1035 chainloader ${vtoy_path}/ventoy_x64.efi sector512 env_param=${ventoy_env_param} ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
1040 echo "chain empty failed!"
1044 echo "Unsupported vtoy type $vtoytype"
1049 function vtoy_common_menuentry {
1050 vt_chosen_img_path vt_chosen_path vt_chosen_size
1051 vtoyboot_common_func ${vtoy_iso_part}${vt_chosen_path}
1054 function vtoy_unsupport_menuentry {
1055 common_unsupport_menuentry
1059 #============================================================#
1060 # IMG file boot process #
1061 #============================================================#
1065 function ventoy_img_easyos {
1066 vt_load_cpio $vtoy_path/ventoy.cpio ${vt_chosen_path} ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
1067 vt_trailer_cpio ${vtoy_iso_part} ${vt_chosen_path} noinit
1069 loopback easysfs (vtimghd,1)/easy.sfs
1070 vt_get_lib_module_ver (easysfs) /lib/modules/ vt_module_ver
1072 if [ -n "$vt_module_ver" ]; then
1073 for mod in "kernel/drivers/md/dm-mod.ko" "kernel/drivers/dax/dax.ko"; do
1074 vt_img_extra_initrd_append (easysfs)/lib/modules/$vt_module_ver/$mod
1081 vt_set_boot_opt rdinit=/vtoy/vtoy
1084 syslinux_configfile (vtimghd,1)/syslinux.cfg
1091 function ventoy_img_volumio {
1092 vt_load_cpio $vtoy_path/ventoy.cpio ${vt_chosen_path} ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
1093 vt_trailer_cpio ${vtoy_iso_part} ${vt_chosen_path} noinit
1098 vt_set_boot_opt rdinit=/vtoy/vtoy imgpart=/dev/ventoy2 bootpart=/dev/ventoy1
1101 syslinux_configfile (vtimghd,1)/syslinux.cfg
1107 function ventoy_img_openelec {
1110 vt_load_cpio $vtoy_path/ventoy.cpio ${vt_chosen_path} ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
1111 vt_trailer_cpio ${vtoy_iso_part} ${vt_chosen_path} noinit
1113 loopback vtloopex $vtoy_efi_part/ventoy/vtloopex.cpio
1114 vt_img_extra_initrd_append (vtloopex)/$elec_ver/vtloopex.tar.xz
1119 vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=$elec_ver
1122 set root=(vtimghd,1)
1123 syslinux_configfile (vtimghd,1)/syslinux.cfg
1127 loopback -d vtloopex
1131 function ventoy_img_freedombox {
1132 vt_load_cpio $vtoy_path/ventoy.cpio ${vt_chosen_path} ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
1133 vt_trailer_cpio ${vtoy_iso_part} ${vt_chosen_path} noinit
1135 vt_get_lib_module_ver (vtimghd,1) /lib/modules/ vt_module_ver
1136 if [ -n "$vt_module_ver" ]; then
1137 vt_img_extra_initrd_append (vtimghd,1)/lib/modules/$vt_module_ver/kernel/drivers/md/dm-mod.ko
1143 vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=freedombox
1146 configfile (vtimghd,1)/boot/grub/grub.cfg
1152 function ventoy_img_paldo {
1153 vt_load_cpio $vtoy_path/ventoy.cpio ${vt_chosen_path} ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
1154 vt_trailer_cpio ${vtoy_iso_part} ${vt_chosen_path} noinit
1159 vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=paldo
1162 vt_fs_enum_1st_file (vtimghd,1) /loader/entries/ vt_paldo_entry_conf
1163 vt_file_basename $vt_paldo_entry_conf vtPaldoVer
1165 echo loading file...
1166 linux (vtimghd,1)/linux-${vtPaldoVer} root=/dev/ventoy1 rootfstype=vfat
1167 initrd (vtimghd,1)/initramfs-${vtPaldoVer}
1174 function ventoy_img_ubos {
1175 vt_load_cpio $vtoy_path/ventoy.cpio ${vt_chosen_path} ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
1176 vt_trailer_cpio ${vtoy_iso_part} ${vt_chosen_path} noinit
1178 vt_get_lib_module_ver (vtimghd,3) /lib/modules/ vt_module_ver
1179 if [ -n "$vt_module_ver" ]; then
1180 vt_img_extra_initrd_append (vtimghd,3)/lib/modules/$vt_module_ver/kernel/drivers/md/dm-mod.ko.xz
1186 vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=ubos
1189 echo loading file...
1190 linux (vtimghd,2)/vmlinuz-linux root=/dev/ventoy3 rw
1191 initrd (vtimghd,2)/initramfs-linux.img
1198 function ventoy_img_recalbox {
1199 vt_load_cpio $vtoy_path/ventoy.cpio ${vt_chosen_path} ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
1200 vt_trailer_cpio ${vtoy_iso_part} ${vt_chosen_path} noinit
1205 vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=recalbox
1208 set root=(vtimghd,1)
1209 configfile (vtimghd,1)/boot/grub/grub.cfg
1215 function ventoy_img_batocera {
1216 vt_load_cpio $vtoy_path/ventoy.cpio ${vt_chosen_path} ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
1217 vt_trailer_cpio ${vtoy_iso_part} ${vt_chosen_path} noinit
1222 vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=batocera
1225 set root=(vtimghd,1)
1226 syslinux_configfile (vtimghd,1)/boot/syslinux/syslinux.cfg
1232 function ventoy_img_memtest86 {
1233 chainloader (vtimghd,1)/efi/boot/BOOTX64.efi
1237 function img_unsupport_tip {
1238 echo -e "\n This IMG file is NOT supported now. \n"
1239 echo -e " 当前不支持启动此 IMG 文件 \n"
1240 echo -e "\npress ENTER to exit (请按 回车 键返回) ..."
1244 function img_common_menuentry {
1245 set ventoy_compatible=YES
1246 set ventoy_busybox_ver=32
1248 vt_chosen_img_path vt_chosen_path vt_chosen_size
1250 if [ -d (vtimghd)/ ]; then
1254 loopback vtimghd ${vtoy_iso_part}${vt_chosen_path}
1255 vt_img_sector ${vtoy_iso_part}${vt_chosen_path}
1257 vt_img_part_info (vtimghd)
1259 set vtback_root=$root
1263 vt_img_extra_initrd_reset
1265 vt_get_fs_label (vtimghd,1) vtImgHd1Label
1266 if [ -d (vtimghd,2)/lib ]; then
1267 vt_get_fs_label (vtimghd,2) vtImgHd2Label
1270 if [ -e (vtimghd,1)/etc/hostname ]; then
1271 vt_1st_line (vtimghd,1)/etc/hostname vtImgHostname
1274 if [ -e (vtimghd,1)/easy.sfs ]; then
1276 elif [ -e (vtimghd,1)/volumio.initrd ]; then
1278 elif vt_str_begin $vtImgHd1Label "LAKKA"; then
1279 ventoy_img_openelec lakka
1280 elif vt_str_begin $vtImgHd1Label "LIBREELEC"; then
1281 ventoy_img_openelec LibreELEC
1282 elif vt_str_begin $vtImgHd1Label "paldo-live"; then
1284 elif vt_str_begin $vtImgHostname "freedombox"; then
1285 ventoy_img_freedombox
1286 elif vt_str_begin $vtImgHd1Label "BATOCERA"; then
1288 elif [ "$vtImgHd2Label" = "RECALBOX" ]; then
1290 elif [ -f (vtimghd,2)/loader/entries/ubos.conf ]; then
1292 elif [ -f (vtimghd,1)/efi/boot/mt86.png ]; then
1293 if [ "$grub_platform" = "pc" ]; then
1296 ventoy_img_memtest86
1299 vt_linux_chain_data ${vtoy_iso_part}${vt_chosen_path}
1300 if [ "$grub_platform" = "pc" ]; then
1301 linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} sector512 mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
1304 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}
1309 set root=$vtback_root
1312 set ventoy_compatible=NO
1315 function img_unsupport_menuentry {
1316 common_unsupport_menuentry
1319 #############################################################
1320 #############################################################
1321 #############################################################
1322 ####### Main Process ###########
1323 #############################################################
1324 #############################################################
1325 #############################################################
1327 set VENTOY_VERSION="1.0.22"
1329 # Default menu display mode, you can change it as you want.
1332 set VTOY_DEFAULT_MENU_MODE=0
1334 set VTOY_MEM_DISK_STR="[Memdisk]"
1335 set VTOY_ISO_RAW_STR="Compatible Mode"
1336 set VTOY_ISO_UEFI_DRV_STR="UEFI FS"
1338 set VTOY_F2_CMD="ventoy_power"
1339 set VTOY_F4_CMD="ventoy_localboot"
1340 set VTOY_F5_CMD="ventoy_diagnosis"
1341 set VTOY_F6_CMD="ventoy_ext_menu"
1343 if [ "$grub_platform" = "pc" ]; then
1344 set VTOY_TEXT_MENU_VER="Ventoy $VENTOY_VERSION BIOS www.ventoy.net"
1346 set VTOY_TEXT_MENU_VER="Ventoy $VENTOY_VERSION UEFI www.ventoy.net"
1349 vt_device $root vtoy_dev
1351 if [ "$vtoy_dev" = "tftp" ]; then
1352 set vtoy_path=($root)
1353 for vtid in 0 1 2 3; do
1354 if [ -f (hd$vtid,2)/ventoy/ventoy.cpio ]; then
1355 set vtoy_iso_part=(hd$vtid,1)
1356 set vtoy_efi_part=(hd$vtid,2)
1363 if [ -f $vtoy_iso_part/ventoy/ventoy.json ]; then
1364 set vt_plugin_path=$vtoy_iso_part
1366 set vt_plugin_path=$prefix
1367 vt_load_plugin $vt_plugin_path
1370 if [ "$prefix" = "(ventoydisk)/grub" ]; then
1371 set vtoy_path=(ventoydisk)/ventoy
1373 set vtoy_path=($root)/ventoy
1376 set vtoydev=$vtoy_dev
1377 set vtoy_iso_part=($vtoy_dev,1)
1378 set vtoy_efi_part=($vtoy_dev,2)
1380 set vt_plugin_path=$vtoy_iso_part
1383 #Load Partition Table
1384 vt_load_part_table $vtoydev
1387 if [ -f $vtoy_iso_part/ventoy/ventoy.json ]; then
1388 vt_load_plugin $vtoy_iso_part
1391 if [ -n "$VTOY_MENU_TIMEOUT" ]; then
1392 set timeout=$VTOY_MENU_TIMEOUT
1397 if [ -f $vtoy_iso_part/ventoy/ventoy_wimboot.img ]; then
1398 vt_load_wimboot $vtoy_iso_part/ventoy/ventoy_wimboot.img
1399 elif [ -f $vtoy_efi_part/ventoy/ventoy_wimboot.img ]; then
1400 vt_load_wimboot $vtoy_efi_part/ventoy/ventoy_wimboot.img
1403 if [ -f $vtoy_iso_part/ventoy/ventoy_vhdboot.img ]; then
1404 vt_load_vhdboot $vtoy_iso_part/ventoy/ventoy_vhdboot.img
1405 elif [ -f $vtoy_efi_part/ventoy/ventoy_vhdboot.img ]; then
1406 vt_load_vhdboot $vtoy_efi_part/ventoy/ventoy_vhdboot.img
1410 if [ $VTOY_DEFAULT_MENU_MODE -eq 0 ]; then
1411 set VTOY_F3_CMD="vt_dynamic_menu 1 1"
1412 set VTOY_HOTKEY_TIP="F1:Memdisk F2:Power F3:TreeView F4:Localboot F5:Tools F6:ExMenu"
1414 set VTOY_F3_CMD="vt_dynamic_menu 1 0"
1415 set VTOY_HOTKEY_TIP="F1:Memdisk F2:Power F3:ListView F4:Localboot F5:Tools F6:ExMenu"
1419 if [ -n "$vtoy_gfxmode" ]; then
1420 set gfxmode=$vtoy_gfxmode
1423 set gfxmode=1920x1080,1366x768,1024x768,800x600,auto
1428 if [ "$vtoy_display_mode" = "CLI" ]; then
1429 terminal_output console
1430 elif [ "$vtoy_display_mode" = "serial" ]; then
1431 if [ -n "$vtoy_serial_param" ]; then
1432 serial $vtoy_serial_param
1434 terminal_input serial
1435 terminal_output serial
1436 elif [ "$vtoy_display_mode" = "serial_console" ]; then
1437 if [ -n "$vtoy_serial_param" ]; then
1438 serial $vtoy_serial_param
1440 terminal_input serial console
1441 terminal_output serial console
1443 if [ -n "$vtoy_theme" ]; then
1444 set theme=$vtoy_theme
1446 set theme=$prefix/themes/ventoy/theme.txt
1448 terminal_output gfxterm
1451 #export necessary variable
1457 export vtoy_iso_part
1458 export vtoy_efi_part
1459 export VENTOY_VERSION
1460 export VTOY_CUR_VIDEO_MODE
1463 #colect all image files (iso files)
1464 set ventoy_img_count=0
1465 vt_list_img $vtoy_iso_part ventoy_img_count
1468 if [ $ventoy_img_count -gt 0 ]; then
1469 if [ $VTOY_DEFAULT_MENU_MODE -eq 0 ]; then
1475 if [ -n "$VTOY_NO_ISO_TIP" ]; then
1476 NO_ISO_MENU="No ISO files found, $VTOY_NO_ISO_TIP"
1477 elif [ -n "$VTOY_DEFAULT_SEARCH_ROOT" ]; then
1478 NO_ISO_MENU="No ISO files found, please check VTOY_DEFAULT_SEARCH_ROOT"
1480 NO_ISO_MENU="No ISO files found"
1482 menuentry "$NO_ISO_MENU (Press enter to reboot ...)" {
1483 echo -e "\n Rebooting ... "