]> glassweightruler.freedombox.rocks Git - Ventoy.git/blob - INSTALL/grub/localboot.cfg
Update help information
[Ventoy.git] / INSTALL / grub / localboot.cfg
1
2 if [ "$grub_platform" = "pc" ]; then
3 menuentry 'Search and boot Windows' --class=boot_windows --class=F4boot {
4
5 set partid=3
6 while [ $partid -le 128 ]; do
7 if vt_check_part_exist $partid; then
8 for bt in bootmgr BOOTMGR Bootmgr BootMGR; do
9 if [ -f ($vtoydev,$partid)/$bt ]; then
10 set root=($vtoydev,$partid)
11 ntldr /$bt
12 boot
13 fi
14 done
15 else
16 break
17 fi
18 vt_incr partid 1
19 done
20
21 if search -n -s -f /Boot/BCD; then
22 for bt in bootmgr BOOTMGR Bootmgr BootMGR; do
23 if [ -f /$bt ]; then
24 if regexp '^hd0' $root; then
25 ntldr /$bt
26 else
27 drivemap -s hd0 $root
28 ntldr /$bt
29 fi
30 break
31 fi
32 done
33 elif search -n -s -f /NTDETECT.COM; then
34 drivemap -s hd0 $root
35 ntldr /ntldr
36 else
37 echo "Windows NOT found ..."
38 fi
39 }
40
41 menuentry 'Search and boot Grub4dos' --class=boot_g4d --class=F4boot {
42 if search -n -s -f /grldr; then
43 ntldr /grldr
44 else
45 echo "Grub4dos NOT found ..."
46 fi
47 }
48
49 menuentry 'Boot the 1st local disk' --class=boot_disk --class=F4boot {
50 set root=(hd0,1)
51 chainloader +1
52 boot
53 }
54
55 menuentry 'Boot the 2nd local disk' --class=boot_disk --class=F4boot {
56 set root=(hd1,1)
57 chainloader +1
58 boot
59 }
60
61 menuentry 'Boot the 3rd local disk' --class=boot_disk --class=F4boot {
62 set root=(hd2,1)
63 chainloader +1
64 boot
65 }
66
67 else
68
69 menuentry 'Search and boot Windows' --class=boot_windows --class=F4boot {
70
71 set partid=3
72 while [ $partid -le 128 ]; do
73 if vt_check_part_exist $partid; then
74 if [ -f ($vtoydev,$partid)/EFI/Microsoft/Boot/bootmgfw.efi ]; then
75 set root=($vtoydev,$partid)
76 terminal_output console
77 chainloader /EFI/Microsoft/Boot/bootmgfw.efi
78 boot
79 fi
80 else
81 break
82 fi
83 vt_incr partid 1
84 done
85
86 if search -n -s -f /EFI/Microsoft/Boot/bootmgfw.efi; then
87 terminal_output console
88 chainloader /EFI/Microsoft/Boot/bootmgfw.efi
89 boot
90 else
91 echo "Windows NOT found ..."
92 fi
93 }
94
95 if [ "$grub_cpu" = "i386" ]; then
96 menuentry 'Search and boot BOOTIA32.EFI' --class=boot_uefi --class=F4boot {
97 set VTOY_SEARCH_NO_VTOYEFI=1
98 if search -n -s -f /efi/boot/bootia32.efi; then
99 unset VTOY_SEARCH_NO_VTOYEFI
100 terminal_output console
101 chainloader /efi/boot/bootia32.efi
102 boot
103 else
104 unset VTOY_SEARCH_NO_VTOYEFI
105 echo "BOOTIA32.EFI NOT found ..."
106 fi
107 }
108
109 menuentry 'Search and boot xorboot' --class=boot_xorboot --class=F4boot {
110 set VTOY_SEARCH_NO_VTOYEFI=1
111 if search -n -s -f /efi/xorboot/xorboot32.xor; then
112 unset VTOY_SEARCH_NO_VTOYEFI
113 terminal_output console
114 if [ -f /efi/xorboot/bootia32.efi ]; then
115 chainloader /efi/xorboot/bootia32.efi
116 elif [ -f /efi/xorboot/xorboot.efi ]; then
117 chainloader /efi/xorboot/xorboot.efi
118 fi
119 boot
120 else
121 unset VTOY_SEARCH_NO_VTOYEFI
122 echo "xorboot NOT found ..."
123 fi
124 }
125 elif [ "$grub_cpu" = "arm64" ]; then
126 menuentry 'Search and boot BOOTAA64.EFI' --class=boot_uefi --class=F4boot {
127 set VTOY_SEARCH_NO_VTOYEFI=1
128 if search -n -s -f /efi/boot/bootaa64.efi; then
129 unset VTOY_SEARCH_NO_VTOYEFI
130 terminal_output console
131 chainloader /efi/boot/bootaa64.efi
132 boot
133 else
134 unset VTOY_SEARCH_NO_VTOYEFI
135 echo "BOOTAA64.EFI NOT found ..."
136 fi
137 }
138 else
139 menuentry 'Search and boot BOOTX64.EFI' --class=boot_uefi --class=F4boot {
140 set VTOY_SEARCH_NO_VTOYEFI=1
141 if search -n -s -f /efi/boot/bootx64.efi; then
142 unset VTOY_SEARCH_NO_VTOYEFI
143 terminal_output console
144 chainloader /efi/boot/bootx64.efi
145 boot
146 else
147 unset VTOY_SEARCH_NO_VTOYEFI
148 echo "BOOTX64.EFI NOT found ..."
149 fi
150 }
151
152 menuentry 'Search and boot xorboot' --class=boot_xorboot --class=F4boot {
153 set VTOY_SEARCH_NO_VTOYEFI=1
154 if search -n -s -f /efi/xorboot/xorboot.xor; then
155 unset VTOY_SEARCH_NO_VTOYEFI
156 terminal_output console
157 if [ -f /efi/xorboot/bootx64.efi ]; then
158 chainloader /efi/xorboot/bootx64.efi
159 elif [ -f /efi/xorboot/xorboot.efi ]; then
160 chainloader /efi/xorboot/xorboot.efi
161 fi
162 boot
163 else
164 unset VTOY_SEARCH_NO_VTOYEFI
165 echo "xorboot NOT found ..."
166 fi
167 }
168 fi
169
170
171 fi
172
173 menuentry 'Return to previous menu [Esc]' --class=vtoyret VTOY_RET {
174 echo 'Return ...'
175 }