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 if [ "$grub_platform" = "pc" ]; then
24 function ventoy_pause {
25 echo "press Enter to continue ......"
29 function ventoy_debug_pause {
30 if [ -n "${vtdebug_flag}" ]; then
31 echo "press Enter to continue ......"
37 function ventoy_max_resolution {
38 #Skip this for VirtualBox
39 smbios -t 1 -s 0x05 --set=system_product;
40 if vt_str_casebegin "$system_product" "VirtualBox"; then
45 vt_get_video_mode 0 vtCurMode
46 terminal_output console
47 set gfxmode=$vtCurMode
48 terminal_output gfxterm
51 function ventoy_cli_console {
52 if [ -z "$vtoy_display_mode" ]; then
53 terminal_output console
54 elif [ "$vtoy_display_mode" = "GUI" ]; then
55 terminal_output console
59 function ventoy_gui_console {
60 if [ -z "$vtoy_display_mode" ]; then
61 terminal_output gfxterm
62 elif [ "$vtoy_display_mode" = "GUI" ]; then
63 terminal_output gfxterm
67 function ventoy_acpi_param {
68 if [ "$VTOY_PARAM_NO_ACPI" != "1" ]; then
69 vt_acpi_param "$1" "$2"
73 function ventoy_vcfg_proc {
74 if vt_check_custom_boot "${1}" vt_vcfg; then
75 set vtoy_chosen_path="${1}"
76 vt_file_basefile "${vtoy_chosen_path}" vtoy_chosen_file
78 export vtoy_chosen_path
79 export vtoy_chosen_file
81 configfile "${vtoy_iso_part}${vt_vcfg}"
88 function ventoy_language {
89 configfile $prefix/menulang.cfg
92 function ventoy_diagnosis {
94 configfile $prefix/debug.cfg
97 function ventoy_localboot {
98 configfile $prefix/localboot.cfg
101 function ventoy_ext_menu {
102 if [ -e $vt_plugin_path/ventoy/ventoy_grub.cfg ]; then
103 set ventoy_new_context=1
104 configfile $vt_plugin_path/ventoy/ventoy_grub.cfg
105 unset ventoy_new_context
107 echo "ventoy_grub.cfg NOT exist."
108 echo -en "\n$VTLANG_ENTER_EXIT ..."
113 function ventoy_checksum {
114 if [ -f "${vtoy_iso_part}${VTOY_CHKSUM_FILE_PATH}" ]; then
115 configfile $prefix/checksum.cfg
119 function ventoy_show_help {
120 if [ -f $prefix/help.tar.gz ]; then
121 if [ -z "$vtoy_help_txt_mem_addr" ]; then
122 vt_load_file_to_mem "auto" $prefix/help.tar.gz vtoy_help_txt_mem
125 loopback vt_help_tarfs mem:${vtoy_help_txt_mem_addr}:size:${vtoy_help_txt_mem_size}
126 vt_cur_menu_lang vtCurLang
127 if [ -f "(vt_help_tarfs)/help/${vtCurLang}.txt" ]; then
128 cat "(vt_help_tarfs)/help/${vtCurLang}.txt"
130 cat "(vt_help_tarfs)/help/en_US.txt"
132 loopback -d vt_help_tarfs
136 function ventoy_load_menu_lang_file {
137 vt_load_file_to_mem "auto" $prefix/menu.tar.gz vtoy_menu_lang_mem
138 loopback vt_menu_tarfs mem:${vtoy_menu_lang_mem_addr}:size:${vtoy_menu_lang_mem_size}
141 function get_os_type {
145 if vt_str_begin "$vt_volume_id" "DLC Boot"; then
146 if [ -f (loop)/DLCBoot.exe ]; then
150 for file in "efi/microsoft/boot/bcd" "sources/boot.wim" "boot/bcd" "bootmgr.efi" "boot/etfsboot.com" ; do
151 if vt_file_exist_nocase (loop)/$file; then
158 if [ "$vtoy_os" = "Linux" ]; then
159 if vt_strstr "$vt_system_id" "FreeBSD"; then
161 set vt_unix_type=FreeBSD
162 elif [ -e (loop)/bin/freebsd-version ]; then
164 set vt_unix_type=FreeBSD
165 elif [ -e (loop)/boot/kernel/geom_ventoy.ko ]; then
167 set vt_unix_type=FreeBSD
168 elif vt_str_begin "$vt_system_id" "DragonFly"; then
170 set vt_unix_type=DragonFly
173 elif [ -e (loop)/boot/kernel/kernel ]; then
174 if file --is-x86-kfreebsd (loop)/boot/kernel/kernel; then
176 set vt_unix_type=FreeBSD
177 elif file --is-x86-knetbsd (loop)/boot/kernel/kernel; then
179 set vt_unix_type=NetBSD
184 if [ -n "${vtdebug_flag}" ]; then
185 echo ISO is "$vtoy_os"
189 function vt_check_compatible_pe {
190 #Check for PE without external tools
191 #set compatible if ISO file is less than 80MB
192 if [ $vt_chosen_size -GT 33554432 -a $vt_chosen_size -LE 83886080 ]; then
193 set ventoy_compatible=YES
199 function vt_check_compatible_linux {
200 if vt_str_begin "$vt_volume_id" "embootkit"; then
201 set ventoy_compatible=YES
202 elif [ -e "$1/casper/tinycore.gz" ]; then
203 set ventoy_compatible=YES
209 function locate_initrd {
210 vt_linux_locate_initrd
212 if [ -n "${vtdebug_flag}" ]; then
218 function locate_wim {
219 vt_windows_locate_wim_patch (loop) "$1"
221 if [ -n "${vtdebug_flag}" ]; then
222 echo '###############################################'
224 echo '###############################################'
229 function distro_specify_wim_patch {
230 if [ -d (loop)/h3pe ]; then
231 vt_windows_collect_wim_patch wim /BOOT/H3_10PE.WIM
232 vt_windows_collect_wim_patch wim /BOOT/H3_7PE.WIM
233 vt_windows_collect_wim_patch wim /BOOT/H3_8PE.WIM
234 vt_windows_collect_wim_patch wim /BOOT/H3_81PE.WIM
235 elif [ -d (loop)/2k10/winpe ]; then
236 vt_windows_collect_wim_patch wim /2k10/winpe/w1086pe.wim
237 vt_windows_collect_wim_patch wim /2k10/winpe/w8x86pe.wim
238 vt_windows_collect_wim_patch wim /2k10/winpe/w7x86pe.wim
242 function distro_specify_wim_patch_phase2 {
243 if [ -f (loop)/boot/boot.wim ]; then
244 vt_windows_collect_wim_patch wim /boot/boot.wim
245 elif [ -f (loop)/sources/boot.wim ]; then
246 vt_windows_collect_wim_patch wim /sources/boot.wim
249 if vt_str_begin "$vt_volume_id" "DLC Boot"; then
250 for vwfile in "/DLC1/WinPE/W11x64.wim" "/DLC1/WinPE/W10x64.wim" "/DLC1/WinPE/W10x86.wim"; do
251 if [ -f (loop)/$vwfile ]; then
252 vt_windows_collect_wim_patch wim $vwfile
260 function distro_specify_initrd_file {
261 if [ -e (loop)/boot/all.rdz ]; then
262 vt_linux_specify_initrd_file /boot/all.rdz
263 elif [ -e (loop)/boot/xen.gz ]; then
264 if [ -e (loop)/install.img ]; then
265 vt_linux_specify_initrd_file /install.img
267 elif [ -d (loop)/casper ]; then
268 if [ -e (loop)/casper/initrd ]; then
269 vt_linux_specify_initrd_file /casper/initrd
271 if [ -e (loop)/casper/initrd.gz ]; then
272 vt_linux_specify_initrd_file /casper/initrd.gz
274 if [ -e (loop)/casper/initrd-oem ]; then
275 vt_linux_specify_initrd_file /casper/initrd-oem
277 elif [ -e (loop)/boot/grub/initrd.xz ]; then
278 vt_linux_specify_initrd_file /boot/grub/initrd.xz
279 elif [ -e (loop)/initrd.gz ]; then
280 vt_linux_specify_initrd_file /initrd.gz
281 elif [ -e (loop)/slax/boot/initrfs.img ]; then
282 vt_linux_specify_initrd_file /slax/boot/initrfs.img
283 elif [ -e (loop)/minios/boot/initrfs.img ]; then
284 vt_linux_specify_initrd_file /minios/boot/initrfs.img
285 elif [ -e (loop)/pmagic/initrd.img ]; then
286 vt_linux_specify_initrd_file /pmagic/initrd.img
287 elif [ -e (loop)/boot/initrd.xz ]; then
288 vt_linux_specify_initrd_file /boot/initrd.xz
289 elif [ -e (loop)/boot/initrd.gz ]; then
290 vt_linux_specify_initrd_file /boot/initrd.gz
291 elif [ -f (loop)/boot/initrd ]; then
292 vt_linux_specify_initrd_file /boot/initrd
293 elif [ -f (loop)/boot/x86_64/loader/initrd ]; then
294 vt_linux_specify_initrd_file /boot/x86_64/loader/initrd
295 elif [ -f (loop)/boot/initramfs-x86_64.img ]; then
296 vt_linux_specify_initrd_file /boot/initramfs-x86_64.img
297 elif [ -f (loop)/boot/isolinux/initramfs_data64.cpio.gz ]; then
298 vt_linux_specify_initrd_file /boot/isolinux/initramfs_data64.cpio.gz
299 elif [ -f (loop)/boot/initrd.img ]; then
300 vt_linux_specify_initrd_file /boot/initrd.img
304 if [ -f (loop)/isolinux/initrd.gz ]; then
305 vt_linux_specify_initrd_file /isolinux/initrd.gz
308 if vt_str_begin "$vt_volume_id" "QUBES"; then
309 vt_linux_specify_initrd_file /images/pxeboot/initrd.img
312 if [ "$vt_chosen_size" = "1133375488" ]; then
313 if [ -d (loop)/boot/grub/x86_64-efi ]; then
314 vt_cpio_busybox64 "64h"
320 function distro_specify_initrd_file_phase2 {
321 if [ -f (loop)/boot/initrd.img ]; then
322 vt_linux_specify_initrd_file /boot/initrd.img
323 elif [ -f (loop)/Setup/initrd.gz ]; then
324 vt_linux_specify_initrd_file /Setup/initrd.gz
325 elif [ -f (loop)/isolinux/initramfs ]; then
326 vt_linux_specify_initrd_file /isolinux/initramfs
327 elif [ -f (loop)/boot/iniramfs.igz ]; then
328 vt_linux_specify_initrd_file /boot/iniramfs.igz
329 elif [ -f (loop)/initrd-x86_64 ]; then
330 vt_linux_specify_initrd_file /initrd-x86_64
331 elif [ -f (loop)/live/initrd.img ]; then
332 vt_linux_specify_initrd_file /live/initrd.img
333 elif [ -f (loop)/initrd.img ]; then
334 vt_linux_specify_initrd_file /initrd.img
335 elif [ -f (loop)/sysresccd/boot/x86_64/sysresccd.img ]; then
336 vt_linux_specify_initrd_file /sysresccd/boot/x86_64/sysresccd.img
337 elif [ -f (loop)/CDlinux/initrd ]; then
338 vt_linux_specify_initrd_file /CDlinux/initrd
339 elif [ -f (loop)/parabola/boot/x86_64/parabolaiso.img ]; then
340 vt_linux_specify_initrd_file /parabola/boot/x86_64/parabolaiso.img
341 if [ -f (loop)/parabola/boot/i686/parabolaiso.img ]; then
342 vt_linux_specify_initrd_file /parabola/boot/i686/parabolaiso.img
344 elif [ -f (loop)/parabola/boot/x86_64/initramfs-linux-libre.img ]; then
345 vt_linux_specify_initrd_file /parabola/boot/x86_64/initramfs-linux-libre.img
346 if [ -f (loop)/parabola/boot/i686/initramfs-linux-libre.img ]; then
347 vt_linux_specify_initrd_file /parabola/boot/i686/initramfs-linux-libre.img
349 elif [ -f (loop)/hyperbola/boot/x86_64/hyperiso.img ]; then
350 vt_linux_specify_initrd_file /hyperbola/boot/x86_64/hyperiso.img
351 if [ -f (loop)/hyperbola/boot/i686/hyperiso.img ]; then
352 vt_linux_specify_initrd_file /hyperbola/boot/i686/hyperiso.img
354 elif [ -f (loop)/EFI/BOOT/initrd.img ]; then
356 vt_linux_specify_initrd_file /EFI/BOOT/initrd.img
357 if [ "$grub_platform" != "pc" ]; then
358 vt_add_replace_file 0 "initrd.img"
360 elif [ -f (loop)/initrd ]; then
361 vt_linux_specify_initrd_file /initrd
362 elif [ -f (loop)/live/initrd1 ]; then
363 vt_linux_specify_initrd_file /live/initrd1
364 elif [ -f (loop)/isolinux/initrd.img ]; then
365 vt_linux_specify_initrd_file /isolinux/initrd.img
366 elif [ -f (loop)/isolinux/initrd.gz ]; then
367 vt_linux_specify_initrd_file /isolinux/initrd.gz
368 elif [ -f (loop)/syslinux/kernel/initramfs.gz ]; then
369 vt_linux_specify_initrd_file /syslinux/kernel/initramfs.gz
370 elif vt_strstr "$vt_volume_id" "Daphile"; then
371 vt_linux_parse_initrd_isolinux (loop)/isolinux/
372 elif [ -f (loop)/boot/rootfs.xz ]; then
373 vt_linux_specify_initrd_file /boot/rootfs.xz
374 if [ "$grub_platform" != "pc" ]; then
375 vt_add_replace_file 0 "minimal\\x86_64\\rootfs.xz"
377 elif [ -f (loop)/arch/boot/x86_64/archiso.img ]; then
378 vt_linux_specify_initrd_file /arch/boot/x86_64/archiso.img
379 if [ "$grub_platform" != "pc" ]; then
380 vt_add_replace_file 0 "EFI\\archiso\\archiso.img"
382 elif [ -f (loop)/blackarch/boot/x86_64/archiso.img ]; then
383 vt_linux_specify_initrd_file /blackarch/boot/x86_64/archiso.img
384 elif [ -f (loop)/blackarch/boot/x86_64/initramfs-linux.img ]; then
385 vt_linux_specify_initrd_file /blackarch/boot/x86_64/initramfs-linux.img
387 elif [ -f (loop)/install.amd/initrd.gz ]; then
388 vt_linux_specify_initrd_file /live/initrd2.img
389 vt_linux_specify_initrd_file /install.amd/initrd.gz
390 vt_linux_specify_initrd_file /install.amd/gtk/initrd.gz
391 elif [ -f (loop)/boot/grub/kernels.cfg ]; then
392 vt_linux_parse_initrd_grub file (loop)/boot/grub/kernels.cfg
393 elif [ -f (loop)/austrumi/initrd.gz ]; then
394 vt_linux_specify_initrd_file /austrumi/initrd.gz
395 if [ -f (loop)/EFI/BOOT/bootx64.efi ]; then
396 vt_cpio_busybox64 "64h"
398 elif [ -f (loop)/boot/initfs.x86_64-efi ]; then
399 vt_linux_specify_initrd_file /boot/initfs.x86_64-efi
400 if [ -f (loop)/boot/initfs.i386-pc ]; then
401 vt_linux_specify_initrd_file /boot/initfs.i386-pc
403 elif [ -f (loop)/antiX/initrd.gz ]; then
404 vt_linux_specify_initrd_file /antiX/initrd.gz
405 elif [ -f (loop)/360Disk/initrd.gz ]; then
406 vt_linux_specify_initrd_file /360Disk/initrd.gz
407 elif [ -f (loop)/porteus/initrd.xz ]; then
408 vt_linux_specify_initrd_file /porteus/initrd.xz
409 elif [ -f (loop)/pyabr/boot/initrfs.img ]; then
410 vt_linux_specify_initrd_file /pyabr/boot/initrfs.img
411 elif [ -f (loop)/initrd0.img ]; then
412 vt_linux_specify_initrd_file /initrd0.img
413 elif [ -f (loop)/sysresccd/boot/i686/sysresccd.img ]; then
414 vt_linux_specify_initrd_file /sysresccd/boot/i686/sysresccd.img
415 elif [ -f (loop)/boot/full.cz ]; then
416 vt_linux_specify_initrd_file /boot/full.cz
417 elif [ -f (loop)/images/pxeboot/initrd.img ]; then
418 vt_linux_specify_initrd_file /images/pxeboot/initrd.img
419 elif [ -f (loop)/live/initrd ]; then
420 vt_linux_specify_initrd_file /live/initrd
421 elif [ -f (loop)/initramfs-linux.img ]; then
422 vt_linux_specify_initrd_file /initramfs-linux.img
423 elif [ -f (loop)/boot/isolinux/initrd.gz ]; then
424 vt_linux_specify_initrd_file /boot/isolinux/initrd.gz
429 function ventoy_get_ghostbsd_ver {
430 # fallback to parse version from elf /boot/kernel/kernel
431 set vt_freebsd_ver=xx
434 function ventoy_get_furybsd_ver {
435 set vt_freebsd_ver=12.x
436 if regexp --set 1:vtFuryVer "(14|13)\.[0-9]" "$2"; then
437 set vt_freebsd_ver=${vtFuryVer}.x
441 function ventoy_get_freenas_ver {
442 set vt_freebsd_ver=11.x
444 if [ -e (loop)/FreeNAS-MANIFEST ]; then
445 vt_parse_freenas_ver (loop)/FreeNAS-MANIFEST vt_freenas_ver
446 if regexp --set 1:vtNasVer "^(14|13|12|11)\.[0-9]" "$vt_freenas_ver"; then
447 set vt_freebsd_ver=${vtNasVer}.x
452 function ventoy_get_truenas_ver {
453 set vt_freebsd_ver=12.x
455 if [ -e (loop)/TrueNAS-MANIFEST ]; then
456 vt_parse_freenas_ver (loop)/TrueNAS-MANIFEST vt_truenas_ver
457 if regexp --set 1:vtTNasVer "^(14|13|12|11)\.[0-9]" "$vt_truenas_ver"; then
458 set vt_freebsd_ver=${vtTNasVer}.x
463 function ventoy_get_midnightbsd_ver {
464 if vt_str_begin "$vt_volume_id" "1_"; then
465 set vt_freebsd_ver=11.x
466 elif vt_str_begin "$vt_volume_id" "2_"; then
467 set vt_freebsd_ver=2.x
468 elif vt_str_begin "$vt_volume_id" "3_"; then
469 set vt_freebsd_ver=3.x
473 function ventoy_freebsd_proc {
474 set vtFreeBsdDistro=FreeBSD
475 set vt_freebsd_ver=xx
477 if [ -e (loop)/boot/kernel/geom_ventoy.ko ]; then
478 vt_unix_ko_fillmap /boot/kernel/geom_ventoy.ko
482 if vt_strstr "$vt_volume_id" "GHOSTBSD"; then
483 ventoy_get_ghostbsd_ver "$1" "${chosen_path}"
484 elif vt_strstr "$vt_volume_id" "FREENAS"; then
485 ventoy_get_freenas_ver "$1" "${chosen_path}"
486 elif vt_strstr "$vt_volume_id" "TRUENAS"; then
487 ventoy_get_truenas_ver "$1" "${chosen_path}"
488 elif vt_strstr "$vt_volume_id" "FURYBSD"; then
489 ventoy_get_furybsd_ver "$1" "${chosen_path}"
490 elif regexp --set 1:vtBsdVerNum "^(14|13|12|11|10|9)_[0-9]" "$vt_volume_id"; then
491 set vt_freebsd_ver=${vtBsdVerNum}.x
492 elif [ -d (loop)/usr/midnightbsd-dist ]; then
493 ventoy_get_midnightbsd_ver "$1" "${chosen_path}"
494 set vtFreeBsdDistro=MidnightBSD
495 elif [ -e (loop)/bin/freebsd-version ]; then
496 vt_unix_parse_freebsd_ver (loop)/bin/freebsd-version vt_userland_ver
497 if regexp --set 1:vtBsdVerNum "\"(14|13|12|11|10|9)\.[0-9]-" "$vt_userland_ver"; then
498 set vt_freebsd_ver=${vtBsdVerNum}.x
500 elif [ -e (loop)/README.TXT ]; then
501 vt_1st_line (loop)/README.TXT vt_freebsd_line1
502 if regexp --set 1:vtBsdVerNum "FreeBSD (14|13|12|11|10|9)\.[0-9]-" "$vt_freebsd_line1"; then
503 set vt_freebsd_ver=${vtBsdVerNum}.x
505 elif vt_strstr "${chosen_path}" "MidnightBSD"; then
506 set vt_freebsd_ver=9.x
510 if [ -e (loop)/usr/freebsd-dist/cloninst.sh ]; then
511 set vtFreeBsdDistro=ClonOS
514 set vt_freebsd_bit=64
515 for file in "/boot/kernel/kernel" "/boot/kernel/kernel.gz"; do
516 if [ -e (loop)/$file ]; then
517 if file --is-i386-kfreebsd (loop)/$file; then
518 set vt_freebsd_bit=32
524 if [ "$vt_freebsd_ver" = "xx" ]; then
525 if [ -e (loop)/boot/kernel/kernel ]; then
526 vt_unix_parse_freebsd_ver_elf (loop)/boot/kernel/kernel $vt_freebsd_bit vt_freebsd_ver
527 elif [ -e (loop)/boot/kernel/kernel.gz ]; then
528 vt_unix_parse_freebsd_ver_elf (loop)/boot/kernel/kernel.gz $vt_freebsd_bit vt_freebsd_ver
531 if [ "$vt_freebsd_ver" = "xx" ]; then
532 set vt_freebsd_ver=14.x
536 if [ "$vt_freebsd_ver" = "14.x" ]; then
537 if [ -e (loop)/boot/lua/brand-pfSense.lua ]; then
538 set vtFreeBsdDistro=pfSense
543 if [ -n "${vtdebug_flag}" ]; then
544 echo "This is $vtFreeBsdDistro $vt_freebsd_ver ${vt_freebsd_bit}bit"
547 unset vt_unix_mod_path
548 for file in "/COPYRIGHT" "/FreeNAS-MANIFEST" "/TrueNAS-MANIFEST" "/version" "/etc/fstab"; do
549 if [ -e (loop)${file} ]; then
550 set vt_unix_mod_path=${file}
555 if [ -n "$vt_unix_mod_path" ]; then
556 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
557 vt_unix_replace_conf FreeBSD "${1}${chosen_path}"
558 elif [ -e (loop)/easyre.ufs.uzip ]; then
559 vt_unix_replace_ko "/boot/grub/i386-pc/linux.mod" (vtunix)/ventoy_unix/$vtFreeBsdDistro/geom_ventoy_ko/$vt_freebsd_ver/$vt_freebsd_bit/geom_ventoy.ko.xz
560 if [ "$grub_platform" = "pc" ]; then
561 vt_unix_replace_grub_conf "/boot/grub/i386-pc/linux.mod" "cd9"
563 vt_unix_replace_conf FreeBSD "${1}${chosen_path}" "cd9"
568 function ventoy_dragonfly_proc {
570 unset vt_unix_mod_path
571 for file in "/boot/kernel/initrd.img.gz"; do
572 if [ -e (loop)${file} ]; then
573 set vt_unix_mod_path=${file}
578 vt_unix_replace_ko $vt_unix_mod_path ${vtoy_path}/dragonfly.mfs.xz
579 vt_unix_fill_image_desc
581 vt_unix_replace_conf DragonFly "${1}${chosen_path}"
584 function ventoy_unix_comm_proc {
587 vt_unix_check_vlnk "${1}${chosen_path}"
589 if [ "$ventoy_compatible" = "NO" ]; then
590 loopback vtunix $vtoy_efi_part/ventoy/ventoy_unix.cpio
592 if [ "$vt_unix_type" = "FreeBSD" ]; then
593 ventoy_freebsd_proc "$1" "${chosen_path}"
594 elif [ "$vt_unix_type" = "DragonFly" ]; then
595 ventoy_dragonfly_proc "$1" "${chosen_path}"
596 elif [ "$vt_unix_type" = "NetBSD" ]; then
597 echo "NetBSD not supported"
601 if [ -n "${vtdebug_flag}" ]; then
602 echo "Unknown unix type"
607 vt_unix_chain_data "${1}${chosen_path}"
612 function uefi_windows_menu_func {
615 unset vt_cur_wimboot_mode
616 if vt_check_mode 4 "$vt_chosen_name"; then
617 set vt_cur_wimboot_mode=1
620 if [ "$ventoy_compatible" = "NO" -o "$vt_cur_wimboot_mode" = "1" ]; then
621 if [ "$ventoy_fs_probe" = "iso9660" ]; then
623 vt_iso9660_nojoliet 1
627 for file in "efi/microsoft/boot/bcd"; do
628 vt_windows_collect_wim_patch bcd (loop)/$file
631 vt_windows_count_wim_patch vt_wim_cnt
632 if [ $vt_wim_cnt -eq 0 ]; then
633 distro_specify_wim_patch_phase2
637 locate_wim "${chosen_path}"
640 vt_windows_chain_data "${1}${chosen_path}"
643 if [ "$vt_cur_wimboot_mode" = "1" ]; then
647 if [ -n "$vtoy_chain_mem_addr" ]; then
648 ventoy_acpi_param ${vtoy_chain_mem_addr} 2048
649 ventoy_max_resolution
650 chainloader ${vtoy_path}/ventoy_${VTOY_EFI_ARCH}.efi env_param=${env_param} isoefi=${LoadIsoEfiDriver} iso_${ventoy_fs_probe} ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
653 echo "chain empty failed"
658 function uefi_find_replace_initrd {
659 if vt_get_efi_vdisk_offset "${1}${2}" vt_efivdisk_offset; then
660 loopback -s $vt_efivdisk_offset vtefivdisk "${1}${2}"
663 vt_search_replace_initrd (vtefivdisk) vt_rp_initrd
665 if [ -n "$vt_rp_initrd" ]; then
666 vt_add_replace_file $3 "$vt_rp_initrd"
669 loopback -d vtefivdisk
674 function uefi_linux_menu_func {
676 if [ "$ventoy_compatible" = "NO" ]; then
678 if [ "$ventoy_fs_probe" = "udf" ]; then
680 set ventoy_fs_probe=iso9660
684 vt_load_cpio $vtoy_path "$2" "$1" "busybox=$ventoy_busybox_ver"
686 vt_linux_clear_initrd
688 if [ -d (loop)/pmagic ]; then
689 vt_linux_specify_initrd_file /pmagic/initrd.img
691 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
692 if [ -e (loop)/$file ]; then
693 vt_linux_parse_initrd_grub file (loop)/$file
698 # special process for special distros
699 if [ -d (loop)/loader/entries ]; then
700 vt_linux_parse_initrd_grub dir (loop)/loader/entries/
701 elif [ -d (loop)/boot/grub ]; then
702 vt_linux_parse_initrd_grub dir (loop)/boot/grub/
705 distro_specify_initrd_file
707 vt_linux_initrd_count vtcount
709 if [ $vtcount -eq 0 ]; then
710 if [ -e (loop)/EFI/boot/livegrub.cfg ]; then
711 vt_linux_parse_initrd_grub file (loop)/EFI/boot/livegrub.cfg
713 distro_specify_initrd_file_phase2
715 if [ "$vt_efi_dir" = "NO" ]; then
716 if [ -f (loop)/efi.img ]; then
717 vt_add_replace_file 0 "initrd"
724 if [ -d (loop)/loader/entries ]; then
725 vt_linux_get_main_initrd_index vtindex
727 if [ -d (loop)/arch ]; then
728 if [ -f (loop)/arch/boot/x86_64/archiso.img ]; then
729 vt_add_replace_file $vtindex "EFI\\archiso\\archiso.img"
730 elif [ -f (loop)/arch/boot/x86_64/initramfs-linux.img ]; then
731 vt_add_replace_file $vtindex "arch\\boot\\x86_64\\initramfs-linux.img"
732 elif [ -f (loop)/boot/initramfs_x86_64.img ]; then
733 vt_add_replace_file $vtindex "boot\\initramfs_x86_64.img"
735 elif [ -d (loop)/blackarch ]; then
736 if [ -f (loop)/blackarch/boot/x86_64/archiso.img ]; then
737 vt_add_replace_file $vtindex "EFI\\archiso\\archiso.img"
738 elif [ -f (loop)/blackarch/boot/x86_64/initramfs-linux.img ]; then
739 vt_add_replace_file $vtindex "blackarch\\boot\\x86_64\\initramfs-linux.img"
741 elif [ -d (loop)/anarchy ]; then
742 if [ -f (loop)/anarchy/boot/x86_64/initramfs-linux.img ]; then
743 vt_add_replace_file $vtindex "anarchy\\boot\\x86_64\\initramfs-linux.img"
745 elif [ -d (loop)/parabola ]; then
746 if [ -f (loop)/parabola/boot/x86_64/parabolaiso.img ]; then
747 vt_add_replace_file $vtindex "EFI\\parabolaiso\\parabolaiso.img"
748 elif [ -f (loop)/parabola/boot/x86_64/initramfs-linux-libre.img ]; then
749 vt_add_replace_file $vtindex "parabola\\boot\\x86_64\\initramfs-linux-libre.img"
751 elif [ -f (loop)/EFI/BOOT/initrd.gz ]; then
752 vt_add_replace_file $vtindex "EFI\\BOOT\\initrd.gz"
753 elif [ -f (loop)/loader/entries/thinstation.conf ]; then
754 vt_add_replace_file $vtindex "boot\\initrd"
755 elif [ -f (loop)/loader/entries/pisi-efi-x86_64.conf ]; then
756 vt_add_replace_file $vtindex "EFI\\pisi\\initrd.img"
759 vt_get_replace_file_cnt vt_replace_cnt
760 if [ $vt_replace_cnt -eq 0 ]; then
761 uefi_find_replace_initrd "$1" "$2" $vtindex
763 elif [ -d (loop)/EFI/boot/entries ]; then
764 if [ -f (loop)/parabola/boot/x86_64/parabolaiso.img ]; then
765 vt_add_replace_file 0 "EFI\\parabolaiso\\parabolaiso.img"
766 elif [ -f (loop)/hyperbola/boot/x86_64/hyperiso.img ]; then
767 vt_add_replace_file 0 "EFI\\hyperiso\\hyperiso.img"
769 elif [ -d (loop)/EFI/BOOT/entries ]; then
770 vt_linux_get_main_initrd_index vtindex
772 if [ -f (loop)/parabola/boot/x86_64/parabolaiso.img ]; then
773 vt_add_replace_file 0 "EFI\\parabolaiso\\parabolaiso.img"
774 elif [ -f (loop)/parabola/boot/x86_64/initramfs-linux-libre.img ]; then
775 vt_add_replace_file $vtindex "parabola\\boot\\x86_64\\initramfs-linux-libre.img"
777 elif [ -e (loop)/syslinux/alt0/full.cz ]; then
778 vt_add_replace_file 0 "EFI\\BOOT\\full.cz"
779 set FirstTryBootFile='@EFI@BOOT@grubx64.efi'
781 elif vt_str_begin "$vt_volume_id" "SolusLive"; then
782 vt_add_replace_file 0 "initrd"
788 vt_linux_chain_data "${1}${chosen_path}"
790 if [ -n "$LoadIsoEfiDriver" -a $vt_chosen_size -LT 104857600 ]; then
791 if [ -f (loop)/efi/clover/cloverx64.efi ]; then
792 unset LoadIsoEfiDriver
796 if [ -n "$vtoy_chain_mem_addr" ]; then
797 ventoy_acpi_param ${vtoy_chain_mem_addr} 2048
801 if vt_check_mode 3 "$vt_chosen_name"; then
803 elif vt_str_begin "$vt_volume_id" "HOLO_"; then
804 if [ -d (loop)/loader/entries ]; then
807 elif vt_str_begin "$vt_volume_id" "KRD"; then
808 if [ -f (loop)/boot/grub/grub.cfg.sig ]; then
813 if [ -n "$vtGrub2Mode" ]; then
816 if [ "$VTOY_EFI_ARCH" != "mips" ]; then
817 chainloader ${vtoy_path}/ventoy_${VTOY_EFI_ARCH}.efi fallback env_param=${env_param} isoefi=${LoadIsoEfiDriver} FirstTry=${FirstTryBootFile} ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
823 set vtback_root=$root
825 set vtback_theme=$theme
828 vt_trailer_cpio "$vtoy_iso_part" "$vt_chosen_path" noinit
829 vt_set_boot_opt rdinit=/vtoy/vtoy
832 set vtback_cfg_find=0
833 for cfg in "/boot/grub/grub.cfg" "/EFI/BOOT/grub.cfg" "/EFI/debian/grub.cfg" "EFI/boot/grub.cfg" "efi/boot/grub.cfg" "/grub/grub.cfg" "EFI/BOOT/BOOTX64.conf"; do
834 if [ -e "$cfg" ]; then
835 set vtback_cfg_find=1
840 if [ $vtback_cfg_find -eq 0 ]; then
841 if [ -f (loop)/loader/loader.conf -a -d (loop)/loader/entries ]; then
842 if vt_str_begin "$vt_volume_id" "HOLO_"; then
844 vt_systemd_menu (loop,2) vt_sys_menu_mem
846 vt_systemd_menu (loop) vt_sys_menu_mem
848 set vtback_cfg_find=1
849 configfile "mem:${vt_sys_menu_mem_addr}:size:${vt_sys_menu_mem_size}"
853 if [ $vtback_cfg_find -eq 0 ]; then
854 if [ -f (loop)/boot/isolinux/syslnx64.cfg ]; then
855 syslinux_configfile (loop)/boot/isolinux/syslnx64.cfg
856 set vtback_cfg_find=1
857 elif [ -f (loop)/boot/syslinux/porteus.cfg ]; then
858 syslinux_configfile (loop)/boot/syslinux/porteus.cfg
859 set vtback_cfg_find=1
863 if [ "$vtback_cfg_find" = "0" ]; then
865 echo "No bootfile found for UEFI!"
866 echo "Maybe the image does not support $VTOY_EFI_ARCH UEFI"
872 set root=$vtback_root
873 set theme=$vtback_theme
877 echo "chain empty failed"
882 function uefi_unix_menu_func {
883 ventoy_unix_comm_proc $1 "${chosen_path}"
885 if [ -n "$vtoy_chain_mem_addr" ]; then
886 ventoy_acpi_param ${vtoy_chain_mem_addr} 2048
888 chainloader ${vtoy_path}/ventoy_${VTOY_EFI_ARCH}.efi env_param=${env_param} isoefi=${LoadIsoEfiDriver} FirstTry=${FirstTryBootFile} ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
891 echo "chain empty failed"
896 function ventoy_reset_nojoliet {
897 if vt_str_begin "$vt_volume_id" "ARCARESCUE"; then
898 vt_iso9660_nojoliet 1
900 vt_iso9660_nojoliet 0
903 vt_append_extra_sector 0
906 function uefi_iso_menu_func {
907 if [ -n "$vtisouefi" ]; then
908 set LoadIsoEfiDriver=on
910 elif vt_check_mode 2 "$vt_chosen_name"; then
911 set LoadIsoEfiDriver=on
913 unset LoadIsoEfiDriver
917 vt_select_auto_install "${chosen_path}"
918 vt_select_persistence "${chosen_path}"
920 if ! vt_is_udf "${1}${chosen_path}"; then
921 # Lenovo EasyStartup need an addional sector for boundary check
922 if vt_str_begin "$vt_volume_id" "EasyStartup"; then
923 vt_skip_svd "${vtoy_iso_part}${vt_chosen_path}"
924 vt_append_extra_sector 1
928 if [ -d (loop)/EFI ]; then
930 elif [ -d (loop)/efi ]; then
936 if [ -n "$vtcompat" ]; then
937 set ventoy_compatible=YES
939 elif vt_check_mode 1 "$vt_chosen_name"; then
940 set ventoy_compatible=YES
942 vt_check_compatible (loop)
945 vt_img_sector "${1}${chosen_path}"
947 if [ "$ventoy_fs_probe" = "iso9660" ]; then
948 vt_select_conf_replace "${1}" "${chosen_path}"
951 if [ "$vtoy_os" = "Windows" ]; then
952 vt_check_compatible_pe (loop)
953 uefi_windows_menu_func "$1" "${chosen_path}"
954 elif [ "$vtoy_os" = "Unix" ]; then
955 uefi_unix_menu_func "$1" "${chosen_path}"
957 vt_check_compatible_linux (loop)
958 uefi_linux_menu_func "$1" "${chosen_path}"
964 function uefi_iso_memdisk {
965 echo 'Loading ISO file to memory ...'
966 vt_load_img_memdisk "${1}${2}" vtoy_iso_buf
969 chainloader ${vtoy_path}/ventoy_${VTOY_EFI_ARCH}.efi memdisk env_param=${env_param} isoefi=${LoadIsoEfiDriver} ${vtdebug_flag} mem:${vtoy_iso_buf_addr}:size:${vtoy_iso_buf_size}
975 function vtoy_windows_wimboot {
976 if [ -f (loop)/x86/sources/boot.wim -a -f (loop)/x64/sources/boot.wim ]; then
977 vt_sel_wimboot vtoy_wimboot_bit
978 if [ "$vtoy_wimboot_bit" = "32" ]; then
979 set vtoy_wimboot_prefix=(loop)/x86
981 set vtoy_wimboot_prefix=(loop)/x64
984 set vtoy_wimboot_prefix=(loop)
985 if vt_is_pe64 $vtoy_wimboot_prefix/setup.exe; then
986 set vtoy_wimboot_bit=64
988 set vtoy_wimboot_bit=32
992 if [ -n "${vtdebug_flag}" ]; then
993 echo vtoy_wimboot_prefix=$vtoy_wimboot_prefix vtoy_wimboot_bit=$vtoy_wimboot_bit vt_wimkernel=$vt_wimkernel
996 vt_windows_wimboot_data "$vtoy_wimboot_prefix/sources/boot.wim" vtoy_init_exe vtoy_wim_bit
998 if [ "$grub_platform" = "pc" ]; then
999 linux16 "$vtoy_path/$vt_wimkernel" quiet
1002 vt_set_wim_load_prompt 1 "Loading files......"
1003 initrd16 newc:winpeshl.exe:mem:${vtoy_wimboot_mem_addr}:size:${vtoy_wimboot_mem_size} \
1004 newc:vtoy_wimboot:$vtoy_wimboot_prefix/boot/bcd \
1005 newc:bcd:$vtoy_wimboot_prefix/boot/bcd \
1006 newc:boot.sdi:$vtoy_wimboot_prefix/boot/boot.sdi \
1007 newc:boot.wim:$vtoy_wimboot_prefix/sources/boot.wim
1008 vt_set_wim_load_prompt 0
1011 vt_set_wim_load_prompt 1 "Loading files......"
1012 vt_load_file_to_mem "nodecompress" $vtoy_wimboot_prefix/sources/boot.wim vtoy_wimfile_mem
1013 vt_set_wim_load_prompt 0
1015 if [ $? -eq 0 ]; then
1016 set vtoy_wimfile_path=mem:${vtoy_wimfile_mem_addr}:size:${vtoy_wimfile_mem_size}
1018 set vtoy_wimfile_path=$vtoy_wimboot_prefix/sources/boot.wim
1022 chainloader "$vtoy_path/$vt_wimkernel" quiet \
1023 "vf=winpeshl.exe:mem:${vtoy_wimboot_mem_addr}:size:${vtoy_wimboot_mem_size}" \
1024 "vf=vtoy_wimboot:$vtoy_wimboot_prefix/boot/bcd" \
1025 "vf=bcd:$vtoy_wimboot_prefix/boot/bcd" \
1026 "vf=boot.sdi:$vtoy_wimboot_prefix/boot/boot.sdi" \
1027 "vf=boot.wim:$vtoy_wimfile_path" \
1028 pfsize=$vtoy_chain_file_size \
1029 pfread=$vtoy_chain_file_read
1035 function vtoy_winpe_wimboot {
1036 unset vtoy_boot_sdi_legacy
1037 unset vtoy_boot_sdi_efi
1039 set vtoy_wimboot_prefix=(loop)
1040 set vtoy_wim_path="$1"
1042 if [ -n "${vtdebug_flag}" ]; then
1043 echo "winpe_wimboot $1 $2 $3"
1046 if [ "$2" != "0" ]; then
1047 set vtoy_boot_sdi_legacy="newc:boot.sdi:$vtoy_wimboot_prefix/$2"
1048 set vtoy_boot_sdi_efi="vf=boot.sdi:$vtoy_wimboot_prefix/$2"
1051 vt_windows_wimboot_data $vtoy_wimboot_prefix/$vtoy_wim_path vtoy_init_exe vtoy_wim_bit
1053 if [ "$grub_platform" = "pc" ]; then
1054 linux16 "$vtoy_path/$vt_wimkernel" quiet
1057 vt_set_wim_load_prompt 1 "Loading files......"
1058 initrd16 newc:$vtoy_init_exe:mem:${vtoy_wimboot_mem_addr}:size:${vtoy_wimboot_mem_size} \
1059 newc:vtoy_wimboot:$vtoy_path/$vt_wimkernel \
1060 newc:bootmgr.exe:mem:${vtoy_pe_bootmgr_mem_addr}:size:${vtoy_pe_bootmgr_mem_size} \
1061 newc:bcd:mem:${vtoy_pe_bcd_mem_addr}:size:${vtoy_pe_bcd_mem_size} \
1062 $vtoy_boot_sdi_legacy \
1063 newc:boot.wim:$vtoy_wimboot_prefix/$vtoy_wim_path
1064 vt_set_wim_load_prompt 0
1067 if [ "$VTOY_EFI_ARCH" = "x64" -a "$vtoy_wim_bit" = "32" ]; then
1068 echo -e "\nThis is 32bit Windows and does NOT support x86_64 UEFI firmware.\n"
1069 echo -e "这是32位的 Windows 系统,不支持当前的64位 UEFI 环境。\n"
1072 vt_set_wim_load_prompt 1 "Loading files......"
1073 vt_load_file_to_mem "nodecompress" $vtoy_wimboot_prefix/$vtoy_wim_path vtoy_wimfile_mem
1074 vt_set_wim_load_prompt 0
1076 if [ $? -eq 0 ]; then
1077 set vtoy_wimfile_path=mem:${vtoy_wimfile_mem_addr}:size:${vtoy_wimfile_mem_size}
1079 set vtoy_wimfile_path=$vtoy_wimboot_prefix/$vtoy_wim_path
1082 unset vtoy_boot_efi_path
1083 if [ -F (loop)/efi/boot/boot${VTOY_EFI_ARCH}.efi ]; then
1084 set vtoy_boot_efi_path="vf=bootx64.efi:(loop)/efi/boot/boot${VTOY_EFI_ARCH}.efi"
1088 chainloader "$vtoy_path/$vt_wimkernel" quiet \
1089 "vf=$vtoy_init_exe:mem:${vtoy_wimboot_mem_addr}:size:${vtoy_wimboot_mem_size}" \
1090 "vf=vtoy_wimboot:$vtoy_path/$vt_wimkernel" \
1091 "vf=bcd:mem:${vtoy_pe_bcd_mem_addr}:size:${vtoy_pe_bcd_mem_size}" \
1092 "$vtoy_boot_sdi_efi" \
1093 "$vtoy_boot_efi_path" \
1094 "vf=boot.wim:$vtoy_wimfile_path" \
1095 pfsize=$vtoy_chain_file_size \
1096 pfread=$vtoy_chain_file_read
1102 function vtoy_wimboot_func {
1103 if [ "$grub_platform" = "pc" ]; then
1104 set vt_wimkernel=wimboot.x86_64.xz
1106 if [ "$grub_cpu" = "i386" ]; then
1107 set vt_wimkernel=wimboot.i386.efi.xz
1109 set vt_wimkernel=wimboot.x86_64.xz
1113 if vt_is_standard_winiso (loop); then
1114 echo -e "\n==================== VENTOY WIMBOOT ==================\n"
1115 vtoy_windows_wimboot
1117 vt_sel_winpe_wim (loop)
1118 if [ -n "$vtoy_pe_wim_path" ]; then
1119 echo -e "\n==================== VENTOY WIMBOOT ==================\n"
1122 vt_load_file_to_mem "auto" $vtoy_path/common_bcd.xz vtoy_pe_bcd_mem
1125 for vsdi in "boot/boot.sdi" "2K10/FONTS/boot.sdi" "SSTR/boot.sdi" "ISPE/BOOT.SDI" \
1126 "boot/uqi.sdi" "ISYL/boot.sdi" "WEPE/WEPE.SDI" ; do
1127 if [ -F "(loop)/$vsdi" ]; then
1128 set vt_sdi_path=$vsdi
1133 if [ "$grub_platform" = "pc" ]; then
1134 vt_load_file_to_mem "auto" $vtoy_path/common_bootmgr.xz vtoy_pe_bootmgr_mem
1135 vtoy_winpe_wimboot "$vtoy_pe_wim_path" "$vt_sdi_path" 1
1137 vtoy_winpe_wimboot "$vtoy_pe_wim_path" "$vt_sdi_path" 0
1145 function legacy_windows_menu_func {
1148 unset vt_cur_wimboot_mode
1149 if vt_check_mode 4 "$vt_chosen_name"; then
1150 set vt_cur_wimboot_mode=1
1153 if [ "$ventoy_compatible" = "NO" -o "$vt_cur_wimboot_mode" = "1" ]; then
1154 if [ "$ventoy_fs_probe" = "iso9660" ]; then
1156 vt_iso9660_nojoliet 1
1157 loopback loop "$1$2"
1160 for file in "boot/bcd" "/efi/microsoft/boot/bcd" "SSTR/BCD" "boot/bce"; do
1161 vt_windows_collect_wim_patch bcd (loop)/$file
1164 distro_specify_wim_patch
1166 vt_windows_count_wim_patch vt_wim_cnt
1167 if [ $vt_wim_cnt -eq 0 ]; then
1168 distro_specify_wim_patch_phase2
1172 if [ -z "$vt_cur_wimboot_mode" ]; then
1173 locate_wim "${chosen_path}"
1177 vt_windows_chain_data "${1}${chosen_path}"
1180 if [ "$vt_cur_wimboot_mode" = "1" ]; then
1184 if [ -n "$vtoy_chain_mem_addr" ]; then
1185 ventoy_acpi_param ${vtoy_chain_mem_addr} 2048
1186 if [ "$ventoy_compatible" = "NO" ]; then
1187 linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
1189 linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} ibft mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
1193 echo "chain empty failed"
1198 function legacy_linux_menu_func {
1199 if [ "$ventoy_compatible" = "NO" ]; then
1201 if [ "$ventoy_fs_probe" = "udf" ]; then
1203 set ventoy_fs_probe=iso9660
1204 loopback loop "$1$2"
1208 if vt_syslinux_need_nojoliet "$1$2"; then
1209 vt_iso9660_nojoliet 1
1211 loopback loop "$1$2"
1214 vt_load_cpio $vtoy_path "$2" "$1" "busybox=$ventoy_busybox_ver"
1216 vt_linux_clear_initrd
1218 if [ -d (loop)/pmagic ]; then
1219 vt_linux_specify_initrd_file /pmagic/initrd.img
1221 for dir in "isolinux" "boot/isolinux" "boot/x86_64/loader" "syslinux" "boot/syslinux"; do
1222 if [ -d (loop)/$dir ]; then
1223 vt_linux_parse_initrd_isolinux (loop)/$dir/
1228 # special process for special distros
1230 if [ -d (loop)/arch/boot/syslinux ]; then
1231 vt_linux_parse_initrd_isolinux (loop)/arch/boot/syslinux/ /arch/
1232 vt_linux_parse_initrd_isolinux (loop)/arch/boot/syslinux/ /arch/boot/syslinux/
1233 elif [ -d (loop)/anarchy/boot/syslinux ]; then
1234 vt_linux_parse_initrd_isolinux (loop)/anarchy/boot/syslinux/ /anarchy/
1237 elif [ -d (loop)/manjaro ]; then
1238 if [ -e (loop)/boot/grub/kernels.cfg ]; then
1239 vt_linux_parse_initrd_grub file (loop)/boot/grub/kernels.cfg
1241 elif [ -e (loop)/boot/grub/grub.cfg ]; then
1242 vt_linux_parse_initrd_grub file (loop)/boot/grub/grub.cfg
1245 distro_specify_initrd_file
1247 vt_linux_initrd_count vtcount
1248 if [ $vtcount -eq 0 ]; then
1249 if [ -d (loop)/rancheros ]; then
1250 vt_linux_parse_initrd_isolinux (loop)/boot/ /boot/isolinux/
1253 distro_specify_initrd_file_phase2
1259 vt_linux_chain_data "${1}${chosen_path}"
1262 if [ -n "$vtoy_chain_mem_addr" ]; then
1264 if vt_check_mode 3 "$vt_chosen_name"; then
1266 elif vt_str_begin "$vt_volume_id" "HOLO_"; then
1267 if [ -d (loop)/loader/entries ]; then
1272 if [ -n "$vtGrub2Mode" ]; then
1273 ventoy_acpi_param ${vtoy_chain_mem_addr} 2048
1277 set vtback_root=$root
1279 set vtback_theme=$theme
1282 vt_trailer_cpio "$vtoy_iso_part" "$vt_chosen_path" noinit
1283 vt_set_boot_opt rdinit=/vtoy/vtoy
1286 set vtback_cfg_find=0
1287 for cfg in "/boot/grub/grub.cfg" "/EFI/BOOT/grub.cfg" "/EFI/debian/grub.cfg" "EFI/boot/grub.cfg" "efi/boot/grub.cfg" "/grub/grub.cfg" "EFI/BOOT/BOOTX64.conf"; do
1288 if [ -e "$cfg" ]; then
1289 set vtback_cfg_find=1
1294 if [ $vtback_cfg_find -eq 0 ]; then
1295 if [ -f (loop)/loader/loader.conf -a -d (loop)/loader/entries ]; then
1296 if vt_str_begin "$vt_volume_id" "HOLO_"; then
1298 vt_systemd_menu (loop,2) vt_sys_menu_mem
1300 vt_systemd_menu (loop) vt_sys_menu_mem
1302 set vtback_cfg_find=1
1303 configfile "mem:${vt_sys_menu_mem_addr}:size:${vt_sys_menu_mem_size}"
1307 if [ $vtback_cfg_find -eq 0 ]; then
1308 if [ -f (loop)/boot/isolinux/syslnx64.cfg ]; then
1309 syslinux_configfile (loop)/boot/isolinux/syslnx64.cfg
1310 set vtback_cfg_find=1
1311 elif [ -f (loop)/boot/syslinux/porteus.cfg ]; then
1312 syslinux_configfile (loop)/boot/syslinux/porteus.cfg
1313 set vtback_cfg_find=1
1318 set root=$vtback_root
1319 set theme=$vtback_theme
1323 ventoy_acpi_param ${vtoy_chain_mem_addr} 2048
1324 linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
1328 echo "chain empty failed"
1334 function legacy_unix_menu_func {
1335 ventoy_unix_comm_proc $1 "${chosen_path}"
1337 if [ -n "$vtoy_chain_mem_addr" ]; then
1338 #ventoy_acpi_param ${vtoy_chain_mem_addr} 2048
1339 linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
1342 echo "chain empty failed"
1348 function legacy_iso_menu_func {
1349 set chosen_path="$2"
1351 vt_select_auto_install "${chosen_path}"
1352 vt_select_persistence "${chosen_path}"
1354 if [ -n "$vtcompat" ]; then
1355 set ventoy_compatible=YES
1357 elif vt_check_mode 1 "$vt_chosen_name"; then
1358 set ventoy_compatible=YES
1360 vt_check_compatible (loop)
1363 vt_img_sector "${1}${chosen_path}"
1365 if [ "$ventoy_fs_probe" = "iso9660" ]; then
1366 vt_select_conf_replace "${1}" "${chosen_path}"
1369 if [ "$vtoy_os" = "Windows" ]; then
1370 vt_check_compatible_pe (loop)
1371 legacy_windows_menu_func "$1" "${chosen_path}"
1372 elif [ "$vtoy_os" = "Unix" ]; then
1373 legacy_unix_menu_func "$1" "${chosen_path}"
1375 vt_check_compatible_linux (loop)
1376 legacy_linux_menu_func "$1" "${chosen_path}"
1378 vt_secondary_recover_mode
1381 function legacy_iso_memdisk {
1383 linux16 $vtoy_path/memdisk iso raw
1384 echo "Loading ISO file to memory ..."
1390 function iso_endless_os_proc {
1391 if [ -d (loop)/ ]; then
1395 loopback loop "${1}${2}"
1396 vt_img_sector "${1}${2}"
1398 vt_load_cpio $vtoy_path "$2" "$1" "busybox=$ventoy_busybox_ver"
1399 vt_trailer_cpio "$1" "$2" noinit
1403 vt_set_boot_opt '@kparams' rdinit=/vtoy/vtoy
1406 set ventoy_bls_bootdev=/boot
1407 set ventoy_loading_tip="Loading files ......"
1410 configfile (loop)/endless/grub/grub.cfg
1413 unset ventoy_bls_bootdev
1414 unset ventoy_loading_tip
1420 function ventoy_iso_busybox_ver {
1422 if [ "$VTOY_EFI_ARCH" = "aa64" ]; then
1423 set ventoy_busybox_ver=a64
1424 elif [ "$VTOY_EFI_ARCH" = "mips" ]; then
1425 set ventoy_busybox_ver=m64
1427 set ventoy_busybox_ver=32
1429 #special process for deepin-live iso
1430 if [ "$vt_chosen_size" = "403701760" ]; then
1431 if vt_str_str "$vt_chosen_path" "/deepin-live"; then
1432 set ventoy_busybox_ver=64
1434 elif vt_str_begin "$vt_volume_id" "PHOTON_"; then
1435 set ventoy_busybox_ver=64
1436 elif vt_str_begin "$vt_volume_id" "smgl-test-quinq-x86_64"; then
1437 set ventoy_busybox_ver=64
1438 elif vt_str_begin "$vt_volume_id" "LDiagBootable"; then
1439 set ventoy_busybox_ver=64
1440 elif vt_str_begin "$vt_volume_id" "KAOS_"; then
1441 set ventoy_busybox_ver=64
1448 function iso_common_menuentry {
1452 vt_chosen_img_path vt_chosen_path vt_chosen_size vt_chosen_name
1454 vt_parse_iso_volume "${vtoy_iso_part}${vt_chosen_path}" vt_system_id vt_volume_id vt_volume_space
1455 if [ $vt_volume_space -NE $vt_chosen_size ]; then
1456 vt_mod $vt_chosen_size 2048 vt_chosen_size_mod
1457 if [ $vt_chosen_size_mod -ne 0 ]; then
1458 echo -e "\n $vt_volume_space $vt_chosen_size $vt_chosen_size_mod\n"
1459 echo -e "\n The size of the iso file \"$vt_chosen_size\" is invalid. File corrupted ?\n"
1460 echo -e " 此ISO文件的大小 \"$vt_chosen_size\" 有问题,请确认文件是否损坏。\n"
1461 echo -en "\n$VTLANG_ENTER_CONTINUE ..."
1466 if vt_check_password "${vt_chosen_path}"; then
1470 if ventoy_vcfg_proc "${vt_chosen_path}"; then
1476 #secondary boot menu
1477 if vt_is_udf "${vtoy_iso_part}${vt_chosen_path}"; then
1478 set ventoy_fs_probe=udf
1480 set ventoy_fs_probe=iso9660
1481 ventoy_reset_nojoliet
1484 if [ -d (loop)/ ]; then
1487 loopback loop "${vtoy_iso_part}${vt_chosen_path}"
1493 if vt_need_secondary_menu "$vt_chosen_name"; then
1494 vt_show_secondary_menu "$vt_chosen_path" "$vtoy_os" $vt_chosen_size
1495 if [ "$VTOY_SECOND_EXIT" = "1" ]; then
1501 if vt_str_begin "$vt_volume_id" "Avira"; then
1502 vt_skip_svd "${vtoy_iso_part}${vt_chosen_path}"
1505 ventoy_iso_busybox_ver
1507 #special process for Endless OS
1508 if vt_str_begin "$vt_volume_id" "Endless-OS"; then
1509 iso_endless_os_proc $vtoy_iso_part "$vt_chosen_path"
1510 elif vt_str_begin "$vt_volume_id" "TENS-Public"; then
1515 # auto memdisk mode for some special ISO files
1516 vt_iso_vd_id_parse "${vtoy_iso_part}${vt_chosen_path}"
1518 if vt_check_mode 0 "$vt_chosen_name"; then
1521 if [ "$grub_platform" = "pc" ]; then
1522 if vt_iso_vd_id_begin 1 0 "Memtest86+"; then
1524 elif vt_iso_vd_id_begin 0 1 "KolibriOS"; then
1530 if [ $vt_chosen_size -LE 67108864 ]; then
1531 if vt_str_begin "$vt_chosen_name" "iKuai"; then
1539 if [ "$grub_platform" = "pc" ]; then
1540 if [ -n "$vtMemDiskBoot" ]; then
1541 legacy_iso_memdisk $vtoy_iso_part "$vt_chosen_path"
1543 legacy_iso_menu_func $vtoy_iso_part "$vt_chosen_path"
1546 if [ -n "$vtMemDiskBoot" ]; then
1547 uefi_iso_memdisk $vtoy_iso_part "$vt_chosen_path"
1549 uefi_iso_menu_func $vtoy_iso_part "$vt_chosen_path"
1553 vt_secondary_recover_mode
1556 function miso_common_menuentry {
1557 vt_chosen_img_path vt_chosen_path vt_chosen_size vt_chosen_name
1559 if vt_check_password "${vt_chosen_path}"; then
1563 echo "memdisk mode boot for $vt_chosen_path"
1567 if [ "$grub_platform" = "pc" ]; then
1568 legacy_iso_memdisk $vtoy_iso_part "$vt_chosen_path"
1570 uefi_iso_memdisk $vtoy_iso_part "$vt_chosen_path"
1575 function common_unsupport_menuentry {
1576 echo -e "\n The name of the iso file could NOT contain space or non-ascii characters. \n"
1577 echo -e " 文件名中不能有中文或空格 \n"
1578 echo -en "\n$VTLANG_ENTER_EXIT ..."
1582 function miso_unsupport_menuentry {
1583 common_unsupport_menuentry
1586 function iso_unsupport_menuentry {
1587 common_unsupport_menuentry
1590 function wim_common_menuentry {
1591 vt_chosen_img_path vt_chosen_path vt_chosen_size vt_chosen_name
1593 if vt_check_password "${vt_chosen_path}"; then
1597 if ventoy_vcfg_proc "${vt_chosen_path}"; then
1601 if vt_wim_check_bootable "${vtoy_iso_part}${vt_chosen_path}"; then
1602 vt_wim_chain_data "${vtoy_iso_part}${vt_chosen_path}"
1604 echo -e "\n This is NOT a bootable WIM file. \n"
1605 echo -e " 这不是一个可启动的 WIM 文件。\n"
1610 if [ -n "$vtoy_chain_mem_addr" ]; then
1611 if [ "$grub_platform" = "pc" ]; then
1612 linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
1615 chainloader ${vtoy_path}/ventoy_${VTOY_EFI_ARCH}.efi env_param=${env_param} isoefi=${LoadIsoEfiDriver} ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
1620 echo "chain empty failed"
1625 function wim_unsupport_menuentry {
1626 common_unsupport_menuentry
1629 function efi_common_menuentry {
1630 vt_chosen_img_path vt_chosen_path vt_chosen_size vt_chosen_name
1632 if vt_check_password "${vt_chosen_path}"; then
1636 if ventoy_vcfg_proc "${vt_chosen_path}"; then
1641 if vt_is_vlnk_name "${vt_chosen_path}"; then
1642 vt_get_vlnk_dst "${vtoy_iso_part}${vt_chosen_path}" vt_vlnk_dst
1643 if [ -z "$vt_vlnk_dst" ]; then
1644 echo -e "\n### VLNK FILE NOT FOUND ###\n### VLNK 文件不存在 ###\n"
1649 vt_vlnk_dst="${vtoy_iso_part}${vt_chosen_path}"
1656 #first try with chainload
1658 set root=$vtoy_iso_part
1659 chainloader "${vt_vlnk_dst}"
1664 vt_concat_efi_iso "${vt_vlnk_dst}" vtoy_iso_buf
1665 chainloader ${vtoy_path}/ventoy_${VTOY_EFI_ARCH}.efi memdisk env_param=${env_param} dotefi isoefi=on ${vtdebug_flag} mem:${vtoy_iso_buf_addr}:size:${vtoy_iso_buf_size}
1671 function efi_unsupport_menuentry {
1672 common_unsupport_menuentry
1675 function vhdboot_common_func {
1676 vt_patch_vhdboot "$1"
1680 if [ -n "$vtoy_vhd_buf_addr" ]; then
1681 if [ "$grub_platform" = "pc" ]; then
1683 linux16 $vtoy_path/memdisk iso raw
1684 initrd16 mem:${vtoy_vhd_buf_addr}:size:${vtoy_vhd_buf_size}
1689 chainloader ${vtoy_path}/ventoy_${VTOY_EFI_ARCH}.efi memdisk env_param=${env_param} isoefi=${LoadIsoEfiDriver} ${vtdebug_flag} mem:${vtoy_vhd_buf_addr}:size:${vtoy_vhd_buf_size}
1694 echo "Please put the right ventoy_vhdboot.img file to the 1st partition"
1699 function vhd_common_menuentry {
1700 vt_chosen_img_path vt_chosen_path vt_chosen_size vt_chosen_name
1702 if vt_check_password "${vt_chosen_path}"; then
1706 if ventoy_vcfg_proc "${vt_chosen_path}"; then
1711 if vt_is_vlnk_name "${vt_chosen_path}"; then
1712 vt_get_vlnk_dst "${vtoy_iso_part}${vt_chosen_path}" vt_vlnk_dst
1713 if [ -z "$vt_vlnk_dst" ]; then
1714 echo -e "\n### VLNK FILE NOT FOUND ###\n### VLNK 文件不存在 ###\n"
1719 vt_vlnk_dst="${vt_chosen_path}"
1720 if [ "$VTOY_VHD_NO_WARNING" != "1" ]; then
1721 if [ "$vtoy_iso_fs" != "ntfs" ]; then
1722 echo -e "!!! WARNING !!!\n"
1723 echo -e "\nPartition1 ($vtoy_iso_fs) is NOT ntfs, the VHD(x) file may not boot normally \n"
1724 echo -e "\nVHD(x) 文件所在分区不是 ntfs 格式, 可能无法正常启动 \n\n"
1725 echo -en "\n$VTLANG_ENTER_CONTINUE ..."
1731 vhdboot_common_func "${vt_vlnk_dst}"
1734 function vhd_unsupport_menuentry {
1735 common_unsupport_menuentry
1738 function vtoyboot_common_func {
1742 vt_get_vtoy_type "${1}" vtoytype parttype AltBootPart
1744 if vt_str_begin $vtoytype vhd; then
1746 elif [ "$vtoytype" = "raw" ]; then
1748 elif [ "$vtoytype" = "vdi" ]; then
1752 if [ $vtoysupport -eq 1 ]; then
1753 if [ "$grub_platform" = "pc" ]; then
1754 if [ "$parttype" = "gpt" -a $AltBootPart -eq 0 ]; then
1755 echo "The OS in the vdisk was created in UEFI mode, but current is Legacy BIOS mode."
1756 echo "虚拟磁盘内的系统是在UEFI模式下创建的,而当前系统是Legacy BIOS模式,可能无法正常启动。"
1760 if [ "$parttype" = "mbr" -a $AltBootPart -eq 0 ]; then
1761 echo "The OS in the vdisk was created in Legacy BIOS mode, but current is UEFI mode."
1762 echo "虚拟磁盘内的系统是在Legacy BIOS模式下创建的,而当前系统是UEFI模式,可能无法正常启动。"
1767 vt_img_sector "${1}"
1768 vt_raw_chain_data "${1}"
1772 if [ -n "$vtoy_chain_mem_addr" ]; then
1773 if [ "$grub_platform" = "pc" ]; then
1774 vt_acpi_param ${vtoy_chain_mem_addr} 512
1775 linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} bios80 sector512 mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
1778 if vt_check_secureboot_var; then
1779 vt_acpi_param ${vtoy_chain_mem_addr} 512
1782 chainloader ${vtoy_path}/ventoy_${VTOY_EFI_ARCH}.efi sector512 env_param=${ventoy_env_param} ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
1787 echo "chain empty failed!"
1791 echo "Unsupported vtoy type $vtoytype"
1796 function vtoy_common_menuentry {
1797 vt_chosen_img_path vt_chosen_path vt_chosen_size vt_chosen_name
1799 if vt_check_password "${vt_chosen_path}"; then
1803 if ventoy_vcfg_proc "${vt_chosen_path}"; then
1808 if vt_is_vlnk_name "${vt_chosen_path}"; then
1809 vt_get_vlnk_dst "${vtoy_iso_part}${vt_chosen_path}" vt_vlnk_dst
1810 if [ -z "$vt_vlnk_dst" ]; then
1811 echo -e "\n### VLNK FILE NOT FOUND ###\n### VLNK 文件不存在 ###\n"
1816 vt_vlnk_dst="${vtoy_iso_part}${vt_chosen_path}"
1819 vtoyboot_common_func "${vt_vlnk_dst}"
1822 function vtoy_unsupport_menuentry {
1823 common_unsupport_menuentry
1827 #============================================================#
1828 # IMG file boot process #
1829 #============================================================#
1832 function only_uefi_tip {
1833 echo -e "\n This IMG file is only supported in UEFI mode. \n"
1834 echo -en "\n$VTLANG_ENTER_EXIT ..."
1838 function ventoy_img_easyos {
1839 vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
1840 vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit
1842 loopback easysfs (vtimghd,1)/easy.sfs
1843 vt_get_lib_module_ver (easysfs) /lib/modules/ vt_module_ver
1845 if [ -n "$vt_module_ver" ]; then
1846 for mod in "kernel/drivers/md/dm-mod.ko" "kernel/drivers/dax/dax.ko"; do
1847 if [ -e (easysfs)/lib/modules/$vt_module_ver/$mod ]; then
1848 vt_img_extra_initrd_append (easysfs)/lib/modules/$vt_module_ver/$mod
1856 vt_set_boot_opt rdinit=/vtoy/vtoy
1859 syslinux_configfile (vtimghd,1)/syslinux.cfg
1866 function ventoy_img_easyos2 {
1867 vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
1868 vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit
1870 if [ -e (vtimghd,2)/easyos/easy.sfs ]; then
1871 loopback easysfs (vtimghd,2)/easyos/easy.sfs
1872 elif [ -d (vtimghd,2)/easyos/releases ]; then
1873 vt_fs_enum_1st_dir (vtimghd,2) /easyos/releases/ vt_dir_name
1874 loopback easysfs (vtimghd,2)/easyos/releases/$vt_dir_name/easy.sfs
1877 vt_get_lib_module_ver (easysfs) /lib/modules/ vt_module_ver
1879 if [ -n "$vt_module_ver" ]; then
1880 for mod in "kernel/drivers/md/dm-mod.ko" "kernel/drivers/dax/dax.ko"; do
1881 if [ -e (easysfs)/lib/modules/$vt_module_ver/$mod ]; then
1882 vt_img_extra_initrd_append (easysfs)/lib/modules/$vt_module_ver/$mod
1890 vt_set_boot_opt rdinit=/vtoy/vtoy
1893 vt_limine_menu (vtimghd,1)/limine.cfg vt_sys_menu_mem
1894 configfile "mem:${vt_sys_menu_mem_addr}:size:${vt_sys_menu_mem_size}"
1901 function ventoy_img_volumio {
1902 vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
1903 vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit
1908 vt_set_boot_opt rdinit=/vtoy/vtoy imgpart=/dev/ventoy2 bootpart=/dev/ventoy1
1911 syslinux_configfile (vtimghd,1)/syslinux.cfg
1917 function ventoy_img_openelec {
1920 if [ "$elec_ver" = "LibreELEC" ]; then
1921 if vt_strstr "$vt_chosen_name" "x86_64"; then
1922 set ventoy_busybox_ver=64
1926 vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
1927 vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit
1929 loopback vtloopex $vtoy_efi_part/ventoy/vtloopex.cpio
1930 vt_img_extra_initrd_append (vtloopex)/$elec_ver/vtloopex.tar.xz
1932 if [ "$elec_ver" = "LibreELEC" ]; then
1933 if [ -f (vtimghd,1)/system ]; then
1934 loopback elecsfs (vtimghd,1)/system
1935 vt_get_lib_module_ver (elecsfs) /usr/lib/kernel-overlays/base/lib/modules/ vt_module_ver
1936 if [ -n "$vt_module_ver" ]; then
1937 for mod in "kernel/drivers/md/dm-mod.ko"; do
1938 if [ -e (elecsfs)/usr/lib/kernel-overlays/base/lib/modules/$vt_module_ver/$mod ]; then
1939 vt_img_extra_initrd_append (elecsfs)/usr/lib/kernel-overlays/base/lib/modules/$vt_module_ver/$mod
1949 vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=$elec_ver
1952 set root=(vtimghd,1)
1953 syslinux_configfile (vtimghd,1)/syslinux.cfg
1957 loopback -d vtloopex
1962 function ventoy_img_freedombox {
1963 vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
1964 vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit
1966 vt_get_lib_module_ver (vtimghd,1) /lib/modules/ vt_module_ver
1967 if [ -n "$vt_module_ver" ]; then
1968 vt_img_extra_initrd_append (vtimghd,1)/lib/modules/$vt_module_ver/kernel/drivers/md/dm-mod.ko
1974 vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=freedombox
1977 configfile (vtimghd,1)/boot/grub/grub.cfg
1983 function ventoy_img_paldo {
1984 vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
1985 vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit
1990 vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=paldo
1993 vt_fs_enum_1st_file (vtimghd,1) /loader/entries/ vt_paldo_entry_conf
1994 vt_file_basename $vt_paldo_entry_conf vtPaldoVer
1996 echo loading file...
1997 linux (vtimghd,1)/linux-${vtPaldoVer} root=/dev/ventoy1 rootfstype=vfat
1998 initrd (vtimghd,1)/initramfs-${vtPaldoVer}
2005 function ventoy_img_ubos {
2006 vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
2007 vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit
2009 vt_get_lib_module_ver (vtimghd,3) /lib/modules/ vt_module_ver
2010 if [ -n "$vt_module_ver" ]; then
2011 vt_img_extra_initrd_append (vtimghd,3)/lib/modules/$vt_module_ver/kernel/drivers/md/dm-mod.ko.xz
2017 vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=ubos
2020 echo loading file...
2021 linux (vtimghd,2)/vmlinuz-linux root=/dev/ventoy3 rw
2022 initrd (vtimghd,2)/initramfs-linux.img
2029 function ventoy_img_recalbox {
2030 if [ $vtoy_img_max_part_end -GT $vt_chosen_size ]; then
2031 echo -e "\nPlease extend the img file size before boot it. \n"
2036 vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
2037 vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit
2039 if [ -e (vtimghd,1)/boot/recalbox ]; then
2040 loopback recalbox (vtimghd,1)/boot/recalbox
2041 vt_get_lib_module_ver (recalbox) /lib/modules/ vt_module_ver
2042 if [ -n "$vt_module_ver" ]; then
2043 vt_img_extra_initrd_append (recalbox)/lib/modules/$vt_module_ver/kernel/drivers/md/dm-mod.ko
2050 vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=recalbox
2053 set root=(vtimghd,1)
2054 configfile (vtimghd,1)/boot/grub/grub.cfg
2060 function ventoy_img_esysrescue {
2061 vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
2062 vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit
2067 vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=esysrescue
2070 set root=(vtimghd,1)
2071 configfile (vtimghd,1)/boot/grub/grub.cfg
2077 function ventoy_img_batocera {
2078 vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
2079 vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit
2084 vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=batocera
2087 set root=(vtimghd,1)
2088 syslinux_configfile (vtimghd,1)/boot/syslinux/syslinux.cfg
2094 function ventoy_img_openwrt {
2095 if [ -e (vtimghd,2)/lib64 ]; then
2096 set ventoy_busybox_ver=64
2099 vt_fs_enum_1st_dir (vtimghd,2) /lib/modules/ vt_dir_name
2101 if [ -f (vtimghd,2)/lib/modules/$vt_dir_name/dm-mod.ko ]; then
2102 set openwrt_plugin_need=0
2103 vt_img_extra_initrd_append (vtimghd,2)/lib/modules/$vt_dir_name/dm-mod.ko
2104 if [ -f (vtimghd,2)/lib/modules/$vt_dir_name/dax.ko ]; then
2105 vt_img_extra_initrd_append (vtimghd,2)/lib/modules/$vt_dir_name/dax.ko
2108 set openwrt_plugin_need=1
2109 if [ ! -f ${vtoy_iso_part}/ventoy/ventoy_openwrt.xz ]; then
2111 echo -e "\n ventoy_openwrt.xz not found. Please refer https://www.ventoy.net/en/doc_openwrt.html.\n"
2112 echo -e " 未找到 ventoy_openwrt.xz 文件。请参考 https://www.ventoy.net/cn/doc_openwrt.html\n"
2113 echo -en "\n$VTLANG_ENTER_EXIT ..."
2120 if vt_img_check_range "${vtoy_iso_part}${vt_chosen_path}"; then
2124 echo -e "\n IMG file need processed. Please refer https://www.ventoy.net/en/doc_openwrt.html.\n"
2125 echo -e " 此 IMG 文件必须处理之后才能支持。请参考 https://www.ventoy.net/cn/doc_openwrt.html\n"
2126 echo -e "\n press ENTER to exit (请按 回车 键返回) ..."
2132 vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
2133 vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit
2135 if [ $openwrt_plugin_need -eq 1 ]; then
2136 if [ -f ${vtoy_iso_part}/ventoy/ventoy_openwrt.xz ]; then
2137 vt_img_extra_initrd_append ${vtoy_iso_part}/ventoy/ventoy_openwrt.xz
2142 vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=openwrt
2145 set root=(vtimghd,1)
2146 configfile (vtimghd,1)/boot/grub/grub.cfg
2152 function ventoy_img_tails {
2153 vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
2154 vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit
2159 vt_set_boot_opt rdinit=/vtoy/vtoy live-media=/dev/dm-1 ventoyos=tails
2162 set root=(vtimghd,1)
2163 configfile (vtimghd,1)/efi/debian/grub.cfg
2169 function ventoy_img_fydeos {
2170 if [ "$grub_platform" = "pc" ]; then
2175 vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=64"
2176 vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit
2181 vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=fydeos
2184 set grubdisk=vtimghd
2185 set grubpartA=(vtimghd,3)
2186 set grubpartB=(vtimghd,5)
2187 set linuxpartA=(sda,3)
2188 set linuxpartB=(sda,5)
2190 set root=(vtimghd,12)
2191 configfile (vtimghd,12)/efi/boot/grub.cfg
2203 function ventoy_img_cloudready {
2204 if [ "$grub_platform" = "pc" ]; then
2209 vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=64"
2210 vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit
2215 vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=cloudready
2218 set grubdisk=vtimghd
2219 set grubpartA=(vtimghd,3)
2220 set grubpartB=(vtimghd,5)
2221 set linuxpartA=(sda,3)
2222 set linuxpartB=(sda,5)
2224 set root=(vtimghd,12)
2225 configfile (vtimghd,12)/efi/boot/grub.cfg
2238 function ventoy_img_fwts {
2239 vt_load_cpio $vtoy_path "${vt_chosen_path}" ${vtoy_iso_part} "busybox=$ventoy_busybox_ver"
2240 vt_trailer_cpio ${vtoy_iso_part} "${vt_chosen_path}" noinit
2245 vt_set_boot_opt rdinit=/vtoy/vtoy ventoyos=fwts
2248 configfile $prefix/distro/fwts.cfg
2254 function ventoy_img_memtest86 {
2255 chainloader (vtimghd,1)/efi/boot/BOOTX64.efi
2259 function img_unsupport_tip {
2260 echo -e "\n This IMG file is NOT supported now. \n"
2261 echo -e " 当前不支持启动此 IMG 文件 \n"
2262 echo -en "\n$VTLANG_ENTER_EXIT ..."
2266 function legacy_img_memdisk {
2267 linux16 $vtoy_path/memdisk
2268 echo "Loading img file to memory ..."
2275 function img_common_menuentry {
2276 set ventoy_compatible=YES
2277 set ventoy_busybox_ver=32
2278 unset LoadIsoEfiDriver
2280 vt_chosen_img_path vt_chosen_path vt_chosen_size vt_chosen_name
2282 if vt_check_password "${vt_chosen_path}"; then
2286 if ventoy_vcfg_proc "${vt_chosen_path}"; then
2290 if [ "$grub_platform" = "pc" ]; then
2291 if vt_check_mode 0 "$vt_chosen_name"; then
2292 legacy_img_memdisk $vtoy_iso_part "$vt_chosen_path"
2297 loopback vtimghd "${vtoy_iso_part}${vt_chosen_path}"
2298 vt_img_sector "${vtoy_iso_part}${vt_chosen_path}"
2300 vt_img_part_info (vtimghd)
2302 set vtback_root=$root
2305 set vtback_theme=$theme
2308 vt_img_extra_initrd_reset
2311 vt_get_fs_label (vtimghd,1) vtImgHd1Label
2313 if [ "$vtImgHd1Label" = "STATE" ]; then
2314 vt_get_fs_label (vtimghd,3) vtImgHd3Label
2315 elif [ -d (vtimghd,2)/lib ]; then
2316 vt_get_fs_label (vtimghd,2) vtImgHd2Label
2319 if [ -z "$vtImgHd1Label" ]; then
2320 if [ -d (vtimghd,2)/efi ]; then
2321 vt_get_fs_label (vtimghd,3) vtImgHd3Label
2322 elif [ -d (vtimghd,12)/efi ]; then
2323 vt_get_fs_label (vtimghd,3) vtImgHd3Label
2327 if [ -e (vtimghd,1)/etc/hostname ]; then
2328 vt_1st_line (vtimghd,1)/etc/hostname vtImgHostname
2331 if vt_str_begin "$vtImgHd3Label" "ROOT-"; then
2332 if [ -f (vtimghd,3)/etc/os-release.d/ID ]; then
2333 vt_1st_line (vtimghd,3)/etc/os-release.d/ID vt_release_line1
2334 if vt_str_begin "$vt_release_line1" "FydeOS"; then
2337 ventoy_img_cloudready
2339 elif [ -f (vtimghd,3)/etc/cloudready-release ]; then
2340 ventoy_img_cloudready
2341 elif [ -f (vtimghd,3)/etc/chrome_dev.conf ]; then
2342 ventoy_img_cloudready
2344 elif vt_str_begin "$vtImgHd3Label" "fwts-result"; then
2346 elif vt_str_begin "$vtImgHd1Label" "LAKKA"; then
2347 ventoy_img_openelec lakka
2348 elif vt_str_begin "$vtImgHd1Label" "LIBREELEC"; then
2349 ventoy_img_openelec LibreELEC
2350 elif vt_str_begin "$vtImgHd1Label" "paldo-live"; then
2352 elif vt_str_begin "$vtImgHostname" "freedombox"; then
2353 ventoy_img_freedombox
2354 elif vt_str_begin "$vtImgHd1Label" "BATOCERA"; then
2356 elif vt_str_begin "$vtImgHd1Label" "Tails"; then
2358 elif [ "$vtImgHd2Label" = "RECALBOX" -o "$vtImgHd1Label" = "RECALBOX" ]; then
2360 elif [ "$vtImgHd1Label" = "ESYSRESCUE" ]; then
2361 ventoy_img_esysrescue
2362 elif [ -e (vtimghd,1)/easy.sfs ]; then
2364 elif [ -d (vtimghd,2)/easyos ]; then
2366 elif [ -e (vtimghd,1)/volumio.initrd ]; then
2368 elif [ -f (vtimghd,2)/loader/entries/ubos.conf ]; then
2370 elif [ -f (vtimghd,2)/etc/openwrt_version ]; then
2373 if [ -f (vtimghd,1)/efi/boot/mt86.png ]; then
2374 if [ "$grub_platform" = "pc" ]; then
2380 vt_linux_chain_data "${vtoy_iso_part}${vt_chosen_path}"
2381 ventoy_acpi_param ${vtoy_chain_mem_addr} 512
2382 if [ "$grub_platform" = "pc" ]; then
2383 linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} sector512 mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
2386 chainloader ${vtoy_path}/ventoy_${VTOY_EFI_ARCH}.efi sector512 env_param=${env_param} isoefi=${LoadIsoEfiDriver} FirstTry=${FirstTryBootFile} ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
2393 set root=$vtback_root
2395 set theme=$vtback_theme
2397 set ventoy_compatible=NO
2400 function img_unsupport_menuentry {
2401 common_unsupport_menuentry
2404 function mimg_common_menuentry {
2405 vt_chosen_img_path vt_chosen_path vt_chosen_size vt_chosen_name
2407 if vt_check_password "${vt_chosen_path}"; then
2411 echo "memdisk mode boot for $vt_chosen_path"
2415 if [ "$grub_platform" = "pc" ]; then
2416 legacy_img_memdisk $vtoy_iso_part "$vt_chosen_path"
2418 vt_load_img_memdisk "$vtoy_iso_part$vt_chosen_path" vtoy_img_buf
2420 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}
2426 #############################################################
2427 #############################################################
2428 #############################################################
2429 ####### Main Process ###########
2430 #############################################################
2431 #############################################################
2432 #############################################################
2434 set VENTOY_VERSION="1.1.07"
2436 #ACPI not compatible with Window7/8, so disable by default
2437 set VTOY_PARAM_NO_ACPI=1
2439 # Default menu display mode, you can change it as you want.
2442 set VTOY_DEFAULT_MENU_MODE=0
2444 set VTOY_MEM_DISK_STR="[Memdisk]"
2445 set VTOY_ISO_RAW_STR="Compatible Mode"
2446 set VTOY_GRUB2_MODE_STR="GRUB2 Mode"
2447 set VTOY_WIMBOOT_MODE_STR="WIMBOOT Mode"
2448 set VTOY_ISO_UEFI_DRV_STR="UEFI FS"
2450 set VTOY_F2_CMD="vt_browser_disk"
2451 set VTOY_F4_CMD="ventoy_localboot"
2452 set VTOY_F5_CMD="ventoy_diagnosis"
2453 set VTOY_F6_CMD="ventoy_ext_menu"
2454 set VTOY_HELP_CMD="ventoy_show_help"
2455 set VTOY_CHKSUM_CMD="ventoy_checksum"
2456 set VTOY_HELP_TXT_LANGUAGE="en_US"
2457 set VTOY_CHKSUM_FILE_PATH="X"
2458 set VTOY_LANG_CMD="ventoy_language"
2461 if [ "$grub_platform" = "pc" ]; then
2462 set VTOY_TEXT_MENU_VER="Ventoy $VENTOY_VERSION BIOS www.ventoy.net"
2464 if [ "$grub_cpu" = "i386" ]; then
2465 set VTOY_EFI_ARCH=ia32
2466 set VTOY_TEXT_MENU_VER="Ventoy $VENTOY_VERSION IA32 www.ventoy.net"
2467 elif [ "$grub_cpu" = "arm64" ]; then
2468 set VTOY_EFI_ARCH=aa64
2469 set VTOY_TEXT_MENU_VER="Ventoy $VENTOY_VERSION AA64 www.ventoy.net"
2470 elif [ "$grub_cpu" = "mips64el" ]; then
2471 set VTOY_EFI_ARCH=mips
2472 set VTOY_TEXT_MENU_VER="Ventoy $VENTOY_VERSION MIPS www.ventoy.net"
2474 set VTOY_EFI_ARCH=x64
2475 set VTOY_TEXT_MENU_VER="Ventoy $VENTOY_VERSION UEFI www.ventoy.net"
2479 vt_device $root vtoy_dev
2481 if [ "$vtoy_dev" = "tftp" ]; then
2482 set vtoy_path=($root)
2483 for vtid in 0 1 2 3; do
2484 if [ -f (hd$vtid,2)/ventoy/ventoy.cpio ]; then
2485 set vtoy_iso_part=(hd$vtid,1)
2486 set vtoy_efi_part=(hd$vtid,2)
2493 if [ -n "$vtoy_efi_part" ]; then
2494 vt_load_file_to_mem "auto" $vtoy_efi_part/grub/fonts/unicode.pf2 vtoy_font_mem
2495 loadfont mem:${vtoy_font_mem_addr}:size:${vtoy_font_mem_size}
2498 if [ -f $vtoy_iso_part/ventoy/ventoy.json ]; then
2499 set vt_plugin_path=$vtoy_iso_part
2501 set vt_plugin_path=$prefix
2502 vt_load_plugin $vt_plugin_path
2505 if [ "$prefix" = "(ventoydisk)/grub" ]; then
2506 set vtoy_path=(ventoydisk)/ventoy
2508 set vtoy_path=($root)/ventoy
2511 set vtoydev=$vtoy_dev
2512 set vtoy_iso_part=($vtoy_dev,1)
2513 set vtoy_efi_part=($vtoy_dev,2)
2515 vt_load_file_to_mem "auto" $prefix/fonts/unicode.pf2 vtoy_font_mem
2516 loadfont mem:${vtoy_font_mem_addr}:size:${vtoy_font_mem_size}
2518 set vt_plugin_path=$vtoy_iso_part
2521 #Load Partition Table
2522 vt_load_part_table $vtoydev
2524 #Load menu lang file
2525 ventoy_load_menu_lang_file
2528 if [ -f $vtoy_iso_part/ventoy/ventoy.json ]; then
2530 vt_load_plugin $vtoy_iso_part
2533 vt_check_json_path_case $vtoy_iso_part
2536 if [ -n "$VTOY_MENU_LANGUAGE" ]; then
2537 vt_init_menu_lang "$VTOY_MENU_LANGUAGE"
2539 vt_init_menu_lang en_US
2542 if [ -n "$VTOY_MENU_TIMEOUT" ]; then
2543 set timeout=$VTOY_MENU_TIMEOUT
2548 if [ -f $vtoy_iso_part/ventoy/ventoy_wimboot.img ]; then
2549 vt_load_wimboot $vtoy_iso_part/ventoy/ventoy_wimboot.img
2550 elif [ -f $vtoy_efi_part/ventoy/ventoy_wimboot.img ]; then
2551 vt_load_wimboot $vtoy_efi_part/ventoy/ventoy_wimboot.img
2554 if [ -f $vtoy_iso_part/ventoy/ventoy_vhdboot.img ]; then
2555 vt_load_vhdboot $vtoy_iso_part/ventoy/ventoy_vhdboot.img
2556 elif [ -f $vtoy_efi_part/ventoy/ventoy_vhdboot.img ]; then
2557 vt_load_vhdboot $vtoy_efi_part/ventoy/ventoy_vhdboot.img
2561 if [ $VTOY_DEFAULT_MENU_MODE -eq 0 ]; then
2562 set VTOY_F3_CMD="vt_dynamic_menu 1 1"
2564 set VTOY_F3_CMD="vt_dynamic_menu 1 0"
2567 terminal_output console
2569 if [ -n "$vtoy_gfxmode" ]; then
2570 set gfxmode=$vtoy_gfxmode
2573 set gfxmode=1024x768
2578 if [ "$vtoy_display_mode" = "CLI" ]; then
2579 terminal_output console
2580 elif [ "$vtoy_display_mode" = "serial" ]; then
2581 if [ -n "$vtoy_serial_param" ]; then
2582 serial $vtoy_serial_param
2584 terminal_input serial
2585 terminal_output serial
2586 elif [ "$vtoy_display_mode" = "serial_console" ]; then
2587 if [ -n "$vtoy_serial_param" ]; then
2588 serial $vtoy_serial_param
2590 terminal_input serial console
2591 terminal_output serial console
2593 if [ "$vtoy_gfxmode" = "max" ]; then
2594 set gfxmode=1024x768
2595 terminal_output gfxterm
2598 vt_get_video_mode 0 vtCurMode
2599 terminal_output console
2600 set gfxmode=$vtCurMode
2601 terminal_output gfxterm
2602 elif [ "$vtoy_res_fit" = "1" ]; then
2603 terminal_output gfxterm
2606 if [ -n "$vtoy_theme" ]; then
2609 set theme=$prefix/themes/ventoy/theme.txt
2611 terminal_output gfxterm
2614 if [ "$grub_platform" = "efi" ]; then
2615 set mouse_delta=4000
2616 # terminal_input --append mouse
2619 if [ -n "$VTOY_DEFAULT_KBD_LAYOUT" ]; then
2620 set_keyboard_layout "$VTOY_DEFAULT_KBD_LAYOUT"
2623 if [ -n "$VTOY_PLUGIN_PATH_CASE_MISMATCH" ]; then
2625 echo "$VTOY_PLUGIN_PATH_CASE_MISMATCH"
2626 echo -e "\n\nPath case does not match! ventoy directory and ventoy.json MUST be all lowercase!"
2627 echo -e "\n路径大小写不匹配!ventoy 目录和 ventoy.json 文件的名字必须是全部小写,请修正!"
2628 echo -e "\n\npress ENTER to continue (请按回车键继续) ..."
2632 if [ -n "$VTOY_PLUGIN_SYNTAX_ERROR" ]; then
2634 if [ -n "$VTOY_PLUGIN_ENCODE_ERROR" ]; then
2635 echo -e "\n Encoding type for ventoy.json is not supported, please convert to UTF-8.\n"
2636 echo -e " ventoy.json 文件编码格式不支持,请转换为 UTF-8 编码格式!\n"
2638 echo -e "\n Syntax error detected in ventoy.json, please check! \n"
2639 echo -e " ventoy.json 文件中有语法错误,所有配置都不会生效,请检查!\n"
2642 echo -e "\n press ENTER to continue (请按 回车 键继续) ..."
2647 for vtTFile in ventoy.json ventoy_grub.cfg; do
2648 if [ -f $vtoy_efi_part/ventoy/$vtTFile ]; then
2650 echo -e "\n You need to put $vtTFile in the 1st partition which hold the ISO files.\n"
2651 echo -e " $vtTFile 放错分区了,请放到镜像分区里的 ventoy 目录下(此目录需要手动创建)!\n"
2652 echo -e "\n press ENTER to continue (请按 回车 键继续) ..."
2657 #clear all input key before show main menu
2660 #export necessary variable
2668 export vtoy_iso_part
2669 export vtoy_efi_part
2670 export VENTOY_VERSION
2671 export VTOY_CUR_VIDEO_MODE
2672 export VTOY_EFI_ARCH
2673 export VTOY_MEM_DISK_STR
2674 export VTOY_ISO_RAW_STR
2675 export VTOY_GRUB2_MODE_STR
2676 export VTOY_WIMBOOT_MODE_STR
2677 export VTOY_ISO_UEFI_DRV_STR
2682 export VTOY_HELP_CMD
2683 export VTOY_CHKSUM_CMD
2684 export VTOY_HELP_TXT_LANGUAGE
2685 export VTOY_CHKSUM_FILE_PATH
2686 export VTOY_LANG_CMD
2689 #colect all image files (iso files)
2690 set ventoy_img_count=0
2691 vt_list_img $vtoy_iso_part ventoy_img_count
2694 if [ $ventoy_img_count -gt 0 ]; then
2695 if [ $VTOY_DEFAULT_MENU_MODE -eq 0 ]; then
2701 if [ -n "$VTOY_NO_ISO_TIP" ]; then
2702 NO_ISO_MENU="No ISO or supported IMG files found, $VTOY_NO_ISO_TIP"
2703 elif [ -n "$VTOY_DEFAULT_SEARCH_ROOT" ]; then
2704 NO_ISO_MENU="No ISO or supported IMG files found, please check VTOY_DEFAULT_SEARCH_ROOT"
2706 NO_ISO_MENU="No ISO or supported IMG files found"
2708 menuentry "$NO_ISO_MENU (Press enter to reboot ...)" {
2709 echo -e "\n Rebooting ... "
2715 #special VTOY_DEFAULT_IMAGE process
2716 if [ -n "$VTOY_DEFAULT_IMAGE" ]; then
2717 if regexp --set 1:vtHotkey --set 2:vtDefault "(F[2-9])>(.*)" "$VTOY_DEFAULT_IMAGE"; then
2719 set default="$vtDefault"
2720 if [ -z "$VTOY_MENU_TIMEOUT" ]; then
2723 set timeout=$VTOY_MENU_TIMEOUT
2731 if [ "$vtHotkey" = "F2" ]; then
2734 elif [ "$vtHotkey" = "F4" ]; then
2736 elif [ "$vtHotkey" = "F5" ]; then
2738 elif [ "$vtHotkey" = "F6" ]; then