1+ # BigLinux live GRUB configuration
2+ # UI language is intentionally neutral here; locale and keyboard selection are
3+ # handled by the graphical setup wizard after boot.
4+
15insmod font
2- insmod keylayouts
36insmod part_msdos
47insmod part_gpt
8+ insmod regexp
59
6- export loaded
7- export koptsok
8- export disable_gfxterm
9- export bootarch
10- export firmware
11- export firmware_found
12- export from
13- export fromiso
14- export bootlang
15- export keyboard
16- export timezone
17- export hwclock
18- export def_bootlang
19- export def_keyboard
20- export def_timezone
21- export menu_color_normal
22- export menu_color_highlight
23- export pager
24-
25-
10+ set pager =1
11+ set menu_color_normal =light-gray/black
12+ set menu_color_highlight =cyan/black
2613
2714function menu_reload {
2815 configfile /boot/grub/grub.cfg
2916}
3017
31-
32- function prompt {
33- echo -n " > "
34- }
35-
3618function is_efi {
3719 if [ " ${grub_platform}" = " efi" ]; then
3820 return 0
@@ -41,233 +23,148 @@ function is_efi {
4123}
4224
4325function efi_detect {
44- if is_efi ; then
45- submenu --class =find.efi --hotkey =f " Detect EFI bootloaders" {
46- efi_found =false
47-
48- for efi in (*,gpt*)/efi/*/*.efi (*,gpt*)/efi/*/*/*.efi (*,gpt*)/*.efi (*,gpt*)/*/*.efi ; do
49- regexp --set =1:efi_device ' ^\( (.*)\) /' " ${efi}"
26+ if is_efi; then
27+ insmod chain
28+ submenu " Detect EFI bootloaders" --class =efi --hotkey =f {
29+ set efi_found =false
30+
31+ for efi in \
32+ (*,gpt*)/efi/*/*.efi \
33+ (*,gpt*)/efi/*/*/*.efi \
34+ (*,gpt*)/*.efi \
35+ (*,gpt*)/*/*.efi \
36+ (*,msdos*)/efi/*/*.efi \
37+ (*,msdos*)/efi/*/*/*.efi \
38+ (*,msdos*)/*.efi \
39+ (*,msdos*)/*/*.efi; do
5040 if [ -e " ${efi}" ]; then
51- efi_found =true
52-
53- menuentry -- class =efi " ${efi}" " ${efi_device}" {
54- root =" ${2}"
41+ regexp -- set =1:efi_device ' ^ \( (.*) \) / ' " ${efi} "
42+ set efi_found =true
43+ menuentry " ${efi}" -- class =efi " ${efi_device}" {
44+ set root =" ${2}"
5545 chainloader " ${1}"
5646 }
5747 fi
5848 done
5949
60- if [ " ${efi_found}" != true ]; then
61- menuentry -- hotkey =q -- class =find.none " No EFI files detected. " {menu_reload}
62- else
63- menuentry -- hotkey =q -- class =cancel " Cancel " {menu_reload }
50+ if [ " ${efi_found}" != " true" ]; then
51+ menuentry " No EFI files detected" -- class =safe {
52+ menu_reload
53+ }
6454 fi
6555 }
6656 fi
6757}
6858
6959function memtest_detect {
70- if ! is_efi; then
71- if [ -f /boot/memtest ]; then
72- menuentry " Run Memory Testing Tool (memtest86+)" --class memtest86 --class gnu --class tool {linux16 /boot/memtest}
73- fi
74- elif is_efi; then
60+ if is_efi; then
7561 if [ -f /boot/memtest-efi ]; then
76- menuentry " Run Memory Testing Tool (memtest86+)" --class memtest86 --class gnu --class tool {linux16 /boot/memtest-efi}
62+ insmod chain
63+ menuentry " Run memory test" --class =memtest {
64+ chainloader /boot/memtest-efi
65+ }
7766 fi
78- fi
79- }
80-
81- function boot_defaults {
82- source /boot/grub/defaults.cfg
83- }
84-
85- function grub_reboot {
86- menuentry --class =reboot " Restart computer" {reboot}
87- }
88-
89- function check {
90- cliname =" $1"
91- varname =" $2"
92- if [ " ${optname}" != " ${cliname}" ]; then
93- return 1
94- fi
95- if [ -z " $varname" ]; then
96- varname =" ${cliname}"
97- fi
98- if [ -z " ${optval}" ]; then
99- eval ${varname}=" ${cliname}"
100- else
101- eval ${varname}=" ${cliname}=${optval}"
102- if [ " ${optname}" = " lang" ]; then
103- lang_setup ${optval}
104- elif [ " ${optname}" = " keytable" ]; then
105- def_keyboard =" ${optval}"
106- elif [ " ${optname}" = " tz" ]; then
107- def_timezone =" ${optval}"
108- fi
109- fi
110- return 0
111- }
112-
113- function checkinput {
114- newinput =" $1"
115- newoutput =" "
116- for newcli in ${newinput} ; do
117- optname =" "
118- optval =" "
119- optdone =" "
120- regexp -s optname ' ^(.+)=.*$' " ${newcli}"
121- if [ -z " ${optname}" ]; then
122- optname =" ${newcli}"
12367 else
124- regexp -s optval ' ^.+=(.*)$' " ${newcli}"
125- fi
126- for tocheck in " lang bootlang" " keytable keyboard" " tz timezone" " utc hwclock" ; do
127- if check $tocheck ; then
128- optdone =" Y"
129- break
130- fi
131- done
132- if [ -z " ${optdone}" ]; then
133- if [ -z " ${newoutput}" ]; then
134- newoutput =" ${newcli}"
135- else
136- newoutput =" ${newoutput} ${newcli}"
137- fi
138- fi
139- done
140- }
141-
142- function new2cli {
143- newinput =" $1"
144- if [ -n " $newinput" ]; then
145- checkinput " $newinput"
146- if [ -n " ${newoutput}" ]; then
147- newinput =" ${newoutput}"
148- if [ -n " $clinput" ]; then
149- clinput =" $clinput $newinput"
150- else
151- clinput =" $newinput"
152- fi
153- export clinput
68+ if [ -f /boot/memtest ]; then
69+ menuentry " Run memory test" --class =memtest {
70+ linux16 /boot/memtest
71+ }
15472 fi
15573 fi
15674}
15775
158- function getargs {
159- args =" "
160- for a in $@; do
161- if [ -n " ${a}" ]; then
162- args =" ${args} ${a}"
163- fi
164- done
165- }
166-
167- function bootcheck {
168- getargs
76+ function grub_reboot {
77+ menuentry " Restart computer" --class =restart {
78+ reboot
79+ }
16980}
17081
171- pager =1
172-
173- insmod regexp
174- insmod datehook
175- if ! is_efi; then
176- insmod part_gpt
82+ # Load local defaults first, but retain safe built-in fallbacks if a source
83+ # package is incomplete.
84+ if [ -f /boot/grub/variable.cfg ]; then
85+ source /boot/grub/variable.cfg
17786fi
178-
179- if is_efi; then
180- insmod efi_gop
181- insmod efi_uga
87+ if [ -z " ${grub_theme}" ]; then
88+ set grub_theme =" /boot/grub/themes/biglinux-live/theme.txt"
89+ fi
90+ if [ -z " ${gfxmode}" ]; then
91+ set gfxmode =" 1024x768,800x600,auto"
92+ fi
93+ if [ -z " ${timeout}" ]; then
94+ set timeout =10
95+ fi
96+ if [ -z " ${timeout_style}" ]; then
97+ set timeout_style =menu
98+ fi
99+ if [ -z " ${default}" ]; then
100+ set default =0
182101fi
183102
184- if [ -z " ${loaded} " ] ; then
185- iscd = " "
186- auto = " "
187- regexp -s iscd ' ^(cd) ' " ${root} "
188- if [ " ${iscd} " != " cd " -a -e (cd) ] ; then
189- probe -s cdp -u cd
190- probe -s hdp -u $root
191- if [ -n " $cdp " -a " $cdp " = " $hdp " ] ; then
192- iscd = " cd "
193- fi
194- fi
195- if [ " ${root} " != " hd96 " -a " ${iscd} " != " cd " ] ; then
196- auto = " ${auto} "
103+ # The theme deliberately uses a solid color rather than a full-screen image.
104+ # That avoids large PNG decoding/scaling in firmware with limited video memory.
105+ # A generic Unicode font may still enable gfxterm, but the custom theme is only
106+ # activated when its own Terminus font is available.
107+ set gfx_ready =false
108+ set theme_ready =false
109+ if loadfont /boot/grub/themes/biglinux-live/terminus-16.pf2 ; then
110+ set gfx_ready =true
111+ set theme_ready =true
112+ loadfont /boot/grub/themes/biglinux-live/terminus-14.pf2
113+ elif [ -f /boot/grub/unicode.pf2 ] ; then
114+ if loadfont /boot/grub/unicode.pf2 ; then
115+ set gfx_ready =true
197116 fi
198- source /boot/grub/variable.cfg
199- loaded =true
200-
201-
117+ fi
202118
203- if [ " ${disable_gfxterm}" != " true" ]; then
204- if loadfont /boot/grub/unicode.pf2 ; then
205- if [ -z " $gfxmode" ] ; then
206- gfxmode =1024x768,auto
207- gfxpayload =keep
119+ if [ " ${gfx_ready}" = " true" ]; then
120+ insmod all_video
121+ insmod gfxterm
122+ insmod gfxmenu
123+ insmod png
124+
125+ if terminal_output --append gfxterm; then
126+ terminal_output --remove console
127+ if [ " ${theme_ready}" = " true" ]; then
128+ if [ -f " ${grub_theme}" ]; then
129+ set theme =" ${grub_theme}"
130+ export theme
208131 fi
209- insmod efi_gop
210- insmod all_video
211- insmod efi_uga
212- insmod ieee1275_fb
213- insmod vbe
214- insmod vga
215- insmod video_bochs
216- insmod video_cirrus
217- insmod gfxterm
218- if terminal_output --append gfxterm; then
219- terminal_output --remove console
220- else
221- disable_gfxterm =true
222- fi
223- else
224- disable_gfxterm =true
225132 fi
226133 fi
227-
228- insmod gfxmenu
229- insmod jpeg
230- insmod png
231- theme =($root)/boot/grub/themes/manjaro-live/theme.txt
232- export theme
233-
234- menu_color_normal =cyan/blue
235- menu_color_highlight =white/blue
236-
237- if [ -n " ${iso_path}" ]; then
238- auto =" img_dev=/dev/disk/by-uuid/${rootuuid} img_loop=${iso_path}"
239- fi
240-
241- export auto
242134fi
243135
244- boot_defaults
245-
246- for kopt in " ${clinput}" " ${bootlang}" " ${keyboard}" " ${timezone}" " ${hwclock}" " ${auto}" ; do
247- if [ -n " ${kopt}" ]; then
248- kopts =" ${kopts} ${kopt}"
136+ # Loopback ISO support. Extra parameters are appended last so a caller can
137+ # override defaults when booting the ISO from another GRUB installation.
138+ set auto =" "
139+ if [ -n " ${iso_path}" ]; then
140+ if [ -z " ${rootuuid}" ]; then
141+ probe -s rootuuid -u ${root}
142+ fi
143+ if [ -n " ${rootuuid}" ]; then
144+ set auto =" img_dev=/dev/disk/by-uuid/${rootuuid} img_loop=${iso_path}"
249145 fi
250- done
251- if [ -n " ${bootlang}${keyboard}${timezone}" ]; then
252- koptsok =" true"
253146fi
254147
148+ set kopts =" "
149+ if [ -n " ${clinput}" ]; then
150+ set kopts =" ${kopts} ${clinput}"
151+ fi
152+ if [ -n " ${auto}" ]; then
153+ set kopts =" ${kopts} ${auto}"
154+ fi
155+ export kopts
156+ export auto
157+ export clinput
255158
256159source /boot/grub/kernels.cfg
257- if [ -n " $clinput" ]; then
258- menuentry --class =edit " $clinput" {
259- if [ -n " $1" ]; then
260- clinput =" $@"
261- else
262- unset clinput
263- fi
160+
161+ if [ -n " ${clinput}" ]; then
162+ menuentry " Clear extra boot parameters" --class =edit {
163+ unset clinput
264164 menu_reload
265165 }
266166fi
267167
268-
269168efi_detect
270169memtest_detect
271- grub_bios_installed
272- grub_efi_installed
273170grub_reboot
0 commit comments