]> glassweightruler.freedombox.rocks Git - Ventoy.git/blob - INSTALL/grub/grub.cfg
update
[Ventoy.git] / INSTALL / grub / grub.cfg
1 #************************************************************************************
2 # Copyright (c) 2020, longpanda <admin@ventoy.net>
3 #
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.
8 #
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.
13 #
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/>.
16 #
17 #************************************************************************************
18
19 function ventoy_pause {
20 if [ -n "${vtdebug_flag}" ]; then
21 echo "press Enter to continue ......"
22 read vtTmpPause
23 fi
24 }
25
26 function ventoy_debug_pause {
27 if [ -n "${vtdebug_flag}" ]; then
28 echo "press Enter to continue ......"
29 read vtTmpPause
30 fi
31 }
32
33 function ventoy_cli_console {
34 if [ "$grub_platform" = "pc" ]; then
35 terminal_output vga_text
36 else
37 if [ "$vtoy_display_mode" != "CLI" ]; then
38 terminal_output console
39 fi
40 fi
41 }
42
43 function ventoy_gui_console {
44 if [ "$grub_platform" = "pc" ]; then
45 if [ "$vtoy_display_mode" = "CLI" ]; then
46 terminal_output console
47 else
48 terminal_output gfxterm
49 fi
50 else
51 if [ "$vtoy_display_mode" != "CLI" ]; then
52 terminal_output gfxterm
53 fi
54 fi
55 }
56
57 function ventoy_power {
58 configfile $prefix/power.cfg
59 }
60
61 function ventoy_diagnosis {
62 configfile $prefix/debug.cfg
63 }
64
65 function ventoy_localboot {
66 configfile $prefix/localboot.cfg
67 }
68
69 function get_os_type {
70 set vtoy_os=Linux
71
72 for file in "efi/microsoft/boot/bcd" "sources/boot.wim" "boot/bcd" "bootmgr.efi" "boot/etfsboot.com" ; do
73 if vt_file_exist_nocase (loop)/$file; then
74 set vtoy_os=Windows
75 break
76 fi
77 done
78
79 if [ -n "${vtdebug_flag}" ]; then
80 echo ISO is $vtoy_os
81 fi
82 }
83
84 function vt_check_compatible_pe {
85 #Check for PE without external tools
86 if [ -f $1/HBCD_PE.ini ]; then
87 set ventoy_compatible=YES
88 fi
89 }
90
91 function locate_initrd {
92 vt_linux_locate_initrd
93
94 if [ -n "${vtdebug_flag}" ]; then
95 vt_linux_dump_initrd
96 ventoy_debug_pause
97 fi
98 }
99
100 function locate_wim {
101 vt_windows_locate_wim_patch (loop)
102
103 if [ -n "${vtdebug_flag}" ]; then
104 echo '###############################################'
105 vt_dump_wim_patch
106 echo '###############################################'
107 ventoy_debug_pause
108 fi
109 }
110
111 function distro_specify_wim_patch {
112 if [ -d (loop)/h3pe ]; then
113 vt_windows_collect_wim_patch wim /BOOT/H3_10PE.WIM
114 vt_windows_collect_wim_patch wim /BOOT/H3_7PE.WIM
115 vt_windows_collect_wim_patch wim /BOOT/H3_8PE.WIM
116 vt_windows_collect_wim_patch wim /BOOT/H3_81PE.WIM
117 fi
118 }
119
120 function distro_specify_wim_patch_phase2 {
121 if [ -f (loop)/boot/boot.wim ]; then
122 vt_windows_collect_wim_patch wim /boot/boot.wim
123 fi
124 }
125
126
127 function distro_specify_initrd_file {
128 if [ -e (loop)/boot/all.rdz ]; then
129 vt_linux_specify_initrd_file /boot/all.rdz
130 elif [ -e (loop)/boot/xen.gz ]; then
131 if [ -e (loop)/install.img ]; then
132 vt_linux_specify_initrd_file /install.img
133 fi
134 elif [ -d (loop)/casper ]; then
135 if [ -e (loop)/casper/initrd ]; then
136 vt_linux_specify_initrd_file /casper/initrd
137 fi
138 if [ -e (loop)/casper/initrd-oem ]; then
139 vt_linux_specify_initrd_file /casper/initrd-oem
140 fi
141 elif [ -e (loop)/boot/grub/initrd.xz ]; then
142 vt_linux_specify_initrd_file /boot/grub/initrd.xz
143 elif [ -e (loop)/initrd.gz ]; then
144 vt_linux_specify_initrd_file /initrd.gz
145 elif [ -e (loop)/slax/boot/initrfs.img ]; then
146 vt_linux_specify_initrd_file /slax/boot/initrfs.img
147 elif [ -e (loop)/pmagic/initrd.img ]; then
148 vt_linux_specify_initrd_file /pmagic/initrd.img
149 elif [ -e (loop)/boot/initrd.xz ]; then
150 vt_linux_specify_initrd_file /boot/initrd.xz
151 elif [ -f (loop)/boot/initrd ]; then
152 vt_linux_specify_initrd_file /boot/initrd
153 elif [ -f (loop)/boot/x86_64/loader/initrd ]; then
154 vt_linux_specify_initrd_file /boot/x86_64/loader/initrd
155 elif [ -f (loop)/boot/initramfs-x86_64.img ]; then
156 vt_linux_specify_initrd_file /boot/initramfs-x86_64.img
157
158
159 fi
160 }
161
162
163 function distro_specify_initrd_file_phase2 {
164 if [ -f (loop)/boot/initrd.img ]; then
165 vt_linux_specify_initrd_file /boot/initrd.img
166 elif [ -f (loop)/Setup/initrd.gz ]; then
167 vt_linux_specify_initrd_file /Setup/initrd.gz
168 elif [ -f (loop)/isolinux/initramfs ]; then
169 vt_linux_specify_initrd_file /isolinux/initramfs
170 elif [ -f (loop)/boot/iniramfs.igz ]; then
171 vt_linux_specify_initrd_file /boot/iniramfs.igz
172 elif [ -f (loop)/initrd-x86_64 ]; then
173 vt_linux_specify_initrd_file /initrd-x86_64
174 elif [ -f (loop)/live/initrd.img ]; then
175 vt_linux_specify_initrd_file /live/initrd.img
176 elif [ -f (loop)/initrd.img ]; then
177 vt_linux_specify_initrd_file /initrd.img
178 elif [ -f (loop)/sysresccd/boot/x86_64/sysresccd.img ]; then
179 vt_linux_specify_initrd_file /sysresccd/boot/x86_64/sysresccd.img
180
181 fi
182 }
183
184 function uefi_windows_menu_func {
185 vt_windows_reset
186
187 if [ "$ventoy_compatible" = "NO" ]; then
188
189 if [ "$ventoy_fs_probe" = "iso9660" ]; then
190 loopback -d loop
191 vt_iso9660_nojoliet 1
192 loopback loop $1$2
193 fi
194
195 for file in "efi/microsoft/boot/bcd"; do
196 vt_windows_collect_wim_patch bcd (loop)/$file
197 done
198
199 vt_windows_count_wim_patch vt_wim_cnt
200 if [ $vt_wim_cnt -eq 0 ]; then
201 distro_specify_wim_patch_phase2
202 fi
203
204 ventoy_debug_pause
205 locate_wim
206 fi
207
208 vt_windows_chain_data ${1}${chosen_path}
209 ventoy_debug_pause
210
211 if [ -n "$vtoy_chain_mem_addr" ]; then
212 ventoy_cli_console
213 chainloader ${vtoy_path}/ventoy_x64.efi env_param=${env_param} isoefi=${LoadIsoEfiDriver} ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
214 boot
215 else
216 echo "chain empty failed"
217 ventoy_pause
218 fi
219 }
220
221 function uefi_linux_menu_func {
222 if [ "$ventoy_compatible" = "NO" ]; then
223
224 if [ "$ventoy_fs_probe" = "udf" ]; then
225 loopback -d loop
226 set ventoy_fs_probe=iso9660
227 loopback loop $1$2
228 fi
229
230 vt_load_cpio ${vtoy_path}/ventoy.cpio $2 $1
231
232 vt_linux_clear_initrd
233
234 if [ -d (loop)/pmagic ]; then
235 vt_linux_specify_initrd_file /pmagic/initrd.img
236 else
237 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
238 if [ -e (loop)/$file ]; then
239 vt_linux_parse_initrd_grub file (loop)/$file
240 fi
241 done
242 fi
243
244 # special process for special distros
245 if [ -d (loop)/loader/entries ]; then
246 vt_linux_parse_initrd_grub dir (loop)/loader/entries/
247 elif [ -d (loop)/boot/grub ]; then
248 vt_linux_parse_initrd_grub dir (loop)/boot/grub/
249 fi
250
251 distro_specify_initrd_file
252
253 vt_linux_initrd_count vtcount
254 if [ $vtcount -eq 0 ]; then
255 distro_specify_initrd_file_phase2
256
257 if [ "$vt_efi_dir" = "NO" ]; then
258 if [ -f (loop)/efi.img ]; then
259 vt_add_replace_file 0 "initrd"
260 fi
261 fi
262 fi
263
264 locate_initrd
265
266 if [ -d (loop)/loader/entries ]; then
267 vt_linux_get_main_initrd_index vtindex
268
269 if [ -d (loop)/arch ]; then
270 if [ -f (loop)/arch/boot/x86_64/archiso.img ]; then
271 vt_add_replace_file $vtindex "EFI\\archiso\\archiso.img"
272 elif [ -f (loop)/boot/initramfs_x86_64.img ]; then
273 vt_add_replace_file $vtindex "boot\\initramfs_x86_64.img"
274 fi
275 elif [ -f (loop)/EFI/BOOT/initrd.gz ]; then
276 vt_add_replace_file $vtindex "EFI\\BOOT\\initrd.gz"
277 fi
278 elif [ -e (loop)/syslinux/alt0/full.cz ]; then
279 vt_add_replace_file 0 "EFI\\BOOT\\full.cz"
280 set FirstTryBootFile='@EFI@BOOT@grubx64.efi'
281 fi
282
283 fi
284
285 vt_linux_chain_data ${1}${chosen_path}
286
287 if [ -n "$vtoy_chain_mem_addr" ]; then
288 ventoy_cli_console
289 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}
290 boot
291 else
292 echo "chain empty failed"
293 ventoy_pause
294 fi
295 }
296
297
298 function uefi_iso_menu_func {
299
300 if [ -d (loop)/ ]; then
301 loopback -d loop
302 fi
303
304 if [ -n "$vtisouefi" ]; then
305 set LoadIsoEfiDriver=on
306 unset vtisouefi
307 elif vt_check_mode 2; then
308 set LoadIsoEfiDriver=on
309 else
310 unset LoadIsoEfiDriver
311 fi
312
313 vt_chosen_img_path chosen_path
314 vt_select_auto_install ${chosen_path}
315 vt_select_persistence ${chosen_path}
316
317 if vt_is_udf ${1}${chosen_path}; then
318 set ventoy_fs_probe=udf
319 else
320 set ventoy_fs_probe=iso9660
321 vt_iso9660_nojoliet 0
322 fi
323
324 loopback loop ${1}${chosen_path}
325 get_os_type (loop)
326
327 if [ -d (loop)/EFI ]; then
328 set vt_efi_dir=YES
329 elif [ -d (loop)/efi ]; then
330 set vt_efi_dir=YES
331 else
332 set vt_efi_dir=NO
333 fi
334
335 if [ -n "$vtcompat" ]; then
336 set ventoy_compatible=YES
337 unset vtcompat
338 elif vt_check_mode 1; then
339 set ventoy_compatible=YES
340 else
341 vt_check_compatible (loop)
342 fi
343
344 vt_img_sector ${1}${chosen_path}
345
346 if [ "$vtoy_os" = "Windows" ]; then
347 vt_check_compatible_pe (loop)
348 uefi_windows_menu_func $1 ${chosen_path}
349 else
350 uefi_linux_menu_func $1 ${chosen_path}
351 fi
352
353 ventoy_gui_console
354 }
355
356 function uefi_iso_memdisk {
357 vt_chosen_img_path chosen_path
358
359 echo 'Loading ISO file to memory ...'
360 vt_load_iso_to_mem ${1}${chosen_path} vtoy_iso_buf
361
362 ventoy_cli_console
363 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}
364 boot
365
366 ventoy_gui_console
367 }
368
369
370 function legacy_windows_menu_func {
371 vt_windows_reset
372
373 if [ "$ventoy_compatible" = "NO" ]; then
374
375 if [ "$ventoy_fs_probe" = "iso9660" ]; then
376 loopback -d loop
377 vt_iso9660_nojoliet 1
378 loopback loop $1$2
379 fi
380
381 for file in "boot/bcd" "/efi/microsoft/boot/bcd" "SSTR/BCD"; do
382 vt_windows_collect_wim_patch bcd (loop)/$file
383 done
384
385 distro_specify_wim_patch
386
387 vt_windows_count_wim_patch vt_wim_cnt
388 if [ $vt_wim_cnt -eq 0 ]; then
389 distro_specify_wim_patch_phase2
390 fi
391
392 ventoy_debug_pause
393 locate_wim
394 fi
395
396 vt_windows_chain_data ${1}${chosen_path}
397 ventoy_debug_pause
398
399 if [ -n "$vtoy_chain_mem_addr" ]; then
400 linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} ibft mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
401 boot
402 else
403 echo "chain empty failed"
404 ventoy_pause
405 fi
406 }
407
408 function legacy_linux_menu_func {
409 if [ "$ventoy_compatible" = "NO" ]; then
410
411 if [ "$ventoy_fs_probe" = "udf" ]; then
412 loopback -d loop
413 set ventoy_fs_probe=iso9660
414 loopback loop $1$2
415 fi
416
417 vt_load_cpio $vtoy_path/ventoy.cpio $2 $1
418
419 vt_linux_clear_initrd
420
421 if [ -d (loop)/pmagic ]; then
422 vt_linux_specify_initrd_file /pmagic/initrd.img
423 else
424 for dir in "isolinux" "boot/isolinux" "boot/x86_64/loader" "syslinux" "boot/syslinux"; do
425 if [ -d (loop)/$dir ]; then
426 vt_linux_parse_initrd_isolinux (loop)/$dir/
427 fi
428 done
429 fi
430
431 # special process for special distros
432 #archlinux
433 if [ -d (loop)/arch/boot/syslinux ]; then
434 vt_linux_parse_initrd_isolinux (loop)/arch/boot/syslinux/ /arch/
435 vt_linux_parse_initrd_isolinux (loop)/arch/boot/syslinux/ /arch/boot/syslinux/
436
437 #manjaro
438 elif [ -d (loop)/manjaro ]; then
439 if [ -e (loop)/boot/grub/kernels.cfg ]; then
440 vt_linux_parse_initrd_grub file (loop)/boot/grub/kernels.cfg
441 fi
442 elif [ -e (loop)/boot/grub/grub.cfg ]; then
443 vt_linux_parse_initrd_grub file (loop)/boot/grub/grub.cfg
444 fi
445
446 distro_specify_initrd_file
447
448 vt_linux_initrd_count vtcount
449 if [ $vtcount -eq 0 ]; then
450 distro_specify_initrd_file_phase2
451 fi
452
453 locate_initrd
454 fi
455
456 vt_linux_chain_data ${1}${chosen_path}
457 ventoy_debug_pause
458
459 if [ -n "$vtoy_chain_mem_addr" ]; then
460 linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
461 boot
462 else
463 echo "chain empty failed"
464 ventoy_pause
465 fi
466 }
467
468 function legacy_iso_menu_func {
469
470 if [ -d (loop)/ ]; then
471 loopback -d loop
472 fi
473
474 vt_chosen_img_path chosen_path
475 vt_select_auto_install ${chosen_path}
476 vt_select_persistence ${chosen_path}
477
478 if vt_is_udf ${1}${chosen_path}; then
479 set ventoy_fs_probe=udf
480 else
481 set ventoy_fs_probe=iso9660
482 vt_iso9660_nojoliet 0
483 fi
484
485 loopback loop ${1}${chosen_path}
486 get_os_type (loop)
487
488 if [ -n "$vtcompat" ]; then
489 set ventoy_compatible=YES
490 unset vtcompat
491 elif vt_check_mode 1; then
492 set ventoy_compatible=YES
493 else
494 vt_check_compatible (loop)
495 fi
496
497 vt_img_sector ${1}${chosen_path}
498
499 if [ "$vtoy_os" = "Windows" ]; then
500 vt_check_compatible_pe (loop)
501 legacy_windows_menu_func $1 ${chosen_path}
502 else
503 legacy_linux_menu_func $1 ${chosen_path}
504 fi
505 }
506
507 function legacy_iso_memdisk {
508 vt_chosen_img_path chosen_path
509
510 linux16 $vtoy_path/memdisk iso raw
511 echo "Loading ISO file to memory ..."
512 initrd16 ${1}${chosen_path}
513 boot
514 }
515
516 function iso_common_menuentry {
517 if [ "$grub_platform" = "pc" ]; then
518 if vt_check_mode 0; then
519 legacy_iso_memdisk $iso_path
520 else
521 legacy_iso_menu_func $iso_path
522 fi
523 else
524 if vt_check_mode 0; then
525 uefi_iso_memdisk $iso_path
526 else
527 uefi_iso_menu_func $iso_path
528 fi
529 fi
530 }
531
532 function common_unsupport_menuentry {
533 echo -e "\n The name of the iso file could NOT contain space or non-ascii characters. \n"
534 echo -e " 文件名中不能有中文或空格 \n"
535 echo -e "\n Will return to main menu after 10 seconds ...\n"
536 sleep 10
537 }
538
539 function iso_unsupport_menuentry {
540 common_unsupport_menuentry
541 }
542
543 function wim_common_menuentry {
544 vt_chosen_img_path chosen_path
545 vt_wim_chain_data ${iso_path}${chosen_path}
546
547 ventoy_debug_pause
548
549 if [ -n "$vtoy_chain_mem_addr" ]; then
550 if [ "$grub_platform" = "pc" ]; then
551 linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
552 else
553 ventoy_cli_console
554 chainloader ${vtoy_path}/ventoy_x64.efi env_param=${env_param} isoefi=${LoadIsoEfiDriver} ${vtdebug_flag} mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}
555 ventoy_gui_console
556 fi
557 boot
558 else
559 echo "chain empty failed"
560 ventoy_pause
561 fi
562 }
563
564 function wim_unsupport_menuentry {
565 common_unsupport_menuentry
566 }
567
568 function efi_common_menuentry {
569 vt_chosen_img_path chosen_path
570
571 ventoy_cli_console
572 chainloader ${iso_path}${chosen_path}
573 boot
574 ventoy_gui_console
575 }
576
577 function efi_unsupport_menuentry {
578 common_unsupport_menuentry
579 }
580
581 #############################################################
582 #############################################################
583 #############################################################
584 ####### Main Process ###########
585 #############################################################
586 #############################################################
587 #############################################################
588
589 set VENTOY_VERSION="1.0.14"
590
591 # Default menu display mode, you can change it as you want.
592 # 0: List mode
593 # 1: TreeView mode
594 set VTOY_DEFAULT_MENU_MODE=0
595
596 set VTOY_MEM_DISK_STR="[Memdisk]"
597 set VTOY_ISO_RAW_STR="Compatible Mode"
598 set VTOY_ISO_UEFI_DRV_STR="UEFI FS"
599
600 set VTOY_F2_CMD="ventoy_power"
601 set VTOY_F4_CMD="ventoy_localboot"
602 set VTOY_F5_CMD="ventoy_diagnosis"
603
604 if [ "$grub_platform" = "pc" ]; then
605 set VTOY_TEXT_MENU_VER="Ventoy $VENTOY_VERSION BIOS www.ventoy.net"
606 else
607 set VTOY_TEXT_MENU_VER="Ventoy $VENTOY_VERSION UEFI www.ventoy.net"
608 fi
609
610 vt_device $root vtoy_dev
611
612 if [ "$vtoy_dev" = "tftp" ]; then
613 set vtoy_path=($root)
614 for vtid in 0 1 2 3; do
615 if [ -d (hd$vtid,2)/ventoy ]; then
616 set iso_path=(hd$vtid,1)
617 set vtoy_efi_part=(hd$vtid,2)
618 break
619 fi
620 done
621 loadfont ascii
622
623 if [ -f $iso_path/ventoy/ventoy.json ]; then
624 set vt_plugin_path=$iso_path
625 else
626 set vt_plugin_path=$prefix
627 vt_load_plugin $vt_plugin_path
628 fi
629 else
630 if [ "$prefix" = "(ventoydisk)/grub" ]; then
631 set vtoy_path=(ventoydisk)/ventoy
632 else
633 set vtoy_path=($root)/ventoy
634 fi
635
636 set iso_path=($vtoy_dev,1)
637 set vtoy_efi_part=($vtoy_dev,2)
638 loadfont unicode
639 set vt_plugin_path=$iso_path
640 fi
641
642
643 #Load Plugin
644 if [ -f $iso_path/ventoy/ventoy.json ]; then
645 vt_load_plugin $iso_path
646 fi
647
648 if [ -n "$VTOY_MENU_TIMEOUT" ]; then
649 set timeout=$VTOY_MENU_TIMEOUT
650 else
651 unset timeout
652 fi
653
654 if [ -f $iso_path/ventoy/ventoy_wimboot.img ]; then
655 vt_load_wimboot $iso_path/ventoy/ventoy_wimboot.img
656 elif [ -f $vtoy_efi_part/ventoy/ventoy_wimboot.img ]; then
657 vt_load_wimboot $vtoy_efi_part/ventoy/ventoy_wimboot.img
658 fi
659
660
661 if [ $VTOY_DEFAULT_MENU_MODE -eq 0 ]; then
662 set VTOY_F3_CMD="vt_dynamic_menu 1 1"
663 set VTOY_HOTKEY_TIP="F1:Memdisk F2:Power F3:TreeView F4:Localboot F5:Debug"
664 else
665 set VTOY_F3_CMD="vt_dynamic_menu 1 0"
666 set VTOY_HOTKEY_TIP="F1:Memdisk F2:Power F3:ListView F4:Localboot F5:Debug"
667 fi
668
669
670 if [ -n "$vtoy_gfxmode" ]; then
671 set gfxmode=$vtoy_gfxmode
672 else
673 set gfxmode=1920x1080,1366x768,1024x768
674 fi
675
676 if [ "$vtoy_display_mode" = "CLI" ]; then
677 terminal_output console
678 else
679 if [ -n "$vtoy_theme" ]; then
680 set theme=$vtoy_theme
681 else
682 set theme=$prefix/themes/ventoy/theme.txt
683 fi
684 terminal_output gfxterm
685 fi
686
687 #colect all image files (iso files)
688 set ventoy_img_count=0
689 vt_list_img $iso_path ventoy_img_count
690
691 #Main menu
692 if [ $ventoy_img_count -gt 0 ]; then
693 if [ $VTOY_DEFAULT_MENU_MODE -eq 0 ]; then
694 vt_dynamic_menu 0 0
695 else
696 vt_dynamic_menu 0 1
697 fi
698 else
699 if [ -n "$VTOY_NO_ISO_TIP" ]; then
700 NO_ISO_MENU="No ISO files found, $VTOY_NO_ISO_TIP"
701 elif [ -n "$VTOY_DEFAULT_SEARCH_ROOT" ]; then
702 NO_ISO_MENU="No ISO files found, please check VTOY_DEFAULT_SEARCH_ROOT"
703 else
704 NO_ISO_MENU="No ISO files found"
705 fi
706 menuentry "$NO_ISO_MENU (Press enter to reboot ...)" {
707 echo -e "\n Rebooting ... "
708 reboot
709 }
710 fi