]> glassweightruler.freedombox.rocks Git - Ventoy.git/blob - INSTALL/grub/localboot.cfg
Fix the order issue in TreeView mode. (#3218)
[Ventoy.git] / INSTALL / grub / localboot.cfg
1
2 if [ "$grub_platform" = "pc" ]; then
3 menuentry "$VTLANG_LB_SBOOT_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 "$VTLANG_LB_SBOOT_G4D" --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 "$VTLANG_LB_SBOOT_HDD1" --class=boot_disk --class=F4boot {
50 set root=(hd0,1)
51 chainloader +1
52 boot
53 }
54
55 menuentry "$VTLANG_LB_SBOOT_HDD2" --class=boot_disk --class=F4boot {
56 set root=(hd1,1)
57 chainloader +1
58 boot
59 }
60
61 menuentry "$VTLANG_LB_SBOOT_HDD3" --class=boot_disk --class=F4boot {
62 set root=(hd2,1)
63 chainloader +1
64 boot
65 }
66
67 else
68
69 menuentry "$VTLANG_LB_SBOOT_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 elif [ -f ($vtoydev,$partid)/efi/Microsoft/Boot/bootmgfw.efi ]; then
80 set root=($vtoydev,$partid)
81 terminal_output console
82 chainloader /efi/Microsoft/Boot/bootmgfw.efi
83 boot
84 elif [ -f ($vtoydev,$partid)/VTEFI/Microsoft/Boot/bootmgfw.efi ]; then
85 set root=($vtoydev,$partid)
86 terminal_output console
87 chainloader /VTEFI/Microsoft/Boot/bootmgfw.efi
88 boot
89 fi
90 else
91 break
92 fi
93 vt_incr partid 1
94 done
95
96 if search -n -s -f /EFI/Microsoft/Boot/bootmgfw.efi; then
97 terminal_output console
98 chainloader /EFI/Microsoft/Boot/bootmgfw.efi
99 boot
100 elif search -n -s -f /efi/Microsoft/Boot/bootmgfw.efi; then
101 terminal_output console
102 chainloader /efi/Microsoft/Boot/bootmgfw.efi
103 boot
104 else
105 echo "Windows NOT found ..."
106 fi
107 }
108
109 if [ "$grub_cpu" = "i386" ]; then
110 menuentry "$VTLANG_LB_SBOOT_IA32EFI" --class=boot_uefi --class=F4boot {
111 set VTOY_SEARCH_NO_VTOYEFI=1
112 if search -n -s -f /efi/boot/bootia32.efi; then
113 unset VTOY_SEARCH_NO_VTOYEFI
114 terminal_output console
115 chainloader /efi/boot/bootia32.efi
116 boot
117 elif search -n -s -f /vtefi/boot/bootia32.efi; then
118 unset VTOY_SEARCH_NO_VTOYEFI
119 terminal_output console
120 chainloader /vtefi/boot/bootia32.efi
121 boot
122 else
123 unset VTOY_SEARCH_NO_VTOYEFI
124 echo "BOOTIA32.EFI NOT found ..."
125 fi
126 }
127
128 menuentry "$VTLANG_LB_SBOOT_XORBOOT" --class=boot_xorboot --class=F4boot {
129 set VTOY_SEARCH_NO_VTOYEFI=1
130 if search -n -s -f /efi/xorboot/xorboot32.xor; then
131 unset VTOY_SEARCH_NO_VTOYEFI
132 terminal_output console
133 if [ -f /efi/xorboot/bootia32.efi ]; then
134 chainloader /efi/xorboot/bootia32.efi
135 elif [ -f /efi/xorboot/xorboot.efi ]; then
136 chainloader /efi/xorboot/xorboot.efi
137 fi
138 boot
139 elif search -n -s -f /vtefi/xorboot/xorboot32.xor; then
140 unset VTOY_SEARCH_NO_VTOYEFI
141 terminal_output console
142 if [ -f /vtefi/xorboot/bootia32.efi ]; then
143 chainloader /vtefi/xorboot/bootia32.efi
144 elif [ -f /vtefi/xorboot/xorboot.efi ]; then
145 chainloader /vtefi/xorboot/xorboot.efi
146 fi
147 boot
148 else
149 unset VTOY_SEARCH_NO_VTOYEFI
150 echo "xorboot NOT found ..."
151 fi
152 }
153 elif [ "$grub_cpu" = "arm64" ]; then
154 menuentry "$VTLANG_LB_SBOOT_AA64EFI" --class=boot_uefi --class=F4boot {
155 set VTOY_SEARCH_NO_VTOYEFI=1
156 if search -n -s -f /efi/boot/bootaa64.efi; then
157 unset VTOY_SEARCH_NO_VTOYEFI
158 terminal_output console
159 chainloader /efi/boot/bootaa64.efi
160 boot
161 elif search -n -s -f /vtefi/boot/bootaa64.efi; then
162 unset VTOY_SEARCH_NO_VTOYEFI
163 terminal_output console
164 chainloader /vtefi/boot/bootaa64.efi
165 boot
166 else
167 unset VTOY_SEARCH_NO_VTOYEFI
168 echo "BOOTAA64.EFI NOT found ..."
169 fi
170 }
171 else
172 menuentry "$VTLANG_LB_SBOOT_X64EFI" --class=boot_uefi --class=F4boot {
173 set VTOY_SEARCH_NO_VTOYEFI=1
174 if search -n -s -f /efi/boot/bootx64.efi; then
175 unset VTOY_SEARCH_NO_VTOYEFI
176 terminal_output console
177 chainloader /efi/boot/bootx64.efi
178 boot
179 elif search -n -s -f /vtefi/boot/bootx64.efi; then
180 unset VTOY_SEARCH_NO_VTOYEFI
181 terminal_output console
182 chainloader /vtefi/boot/bootx64.efi
183 boot
184 else
185 unset VTOY_SEARCH_NO_VTOYEFI
186 echo "BOOTX64.EFI NOT found ..."
187 fi
188 }
189
190 menuentry "$VTLANG_LB_SBOOT_XORBOOT" --class=boot_xorboot --class=F4boot {
191 set VTOY_SEARCH_NO_VTOYEFI=1
192 if search -n -s -f /efi/xorboot/xorboot.xor; then
193 unset VTOY_SEARCH_NO_VTOYEFI
194 terminal_output console
195 if [ -f /efi/xorboot/bootx64.efi ]; then
196 chainloader /efi/xorboot/bootx64.efi
197 elif [ -f /efi/xorboot/xorboot.efi ]; then
198 chainloader /efi/xorboot/xorboot.efi
199 fi
200 boot
201 elif search -n -s -f /vtefi/xorboot/xorboot.xor; then
202 unset VTOY_SEARCH_NO_VTOYEFI
203 terminal_output console
204 if [ -f /vtefi/xorboot/bootx64.efi ]; then
205 chainloader /vtefi/xorboot/bootx64.efi
206 elif [ -f /vtefi/xorboot/xorboot.efi ]; then
207 chainloader /vtefi/xorboot/xorboot.efi
208 fi
209 boot
210 else
211 unset VTOY_SEARCH_NO_VTOYEFI
212 echo "xorboot NOT found ..."
213 fi
214 }
215 fi
216
217
218 fi
219
220 menuentry "$VTLANG_RETURN_PREVIOUS" --class=vtoyret VTOY_RET {
221 echo "Return ..."
222 }