Files
scale-build/scripts/grub.cfg
Ameer Hamza 24a0bb88b7 grub: skip loading bli module when booting the ISO installer (#875)
Installing the BLI module in the installer’s minimal EFI environment
deadlocks, leading to an unresponsive black screen. We now only invoke
insmod bli on real installations by detecting ISO boots via
/.disk/info. This prevents the deadlock and blank screen on installer
boots while ensuring BLI still loads correctly on standard boots.
2025-06-13 22:38:49 +05:00

88 lines
2.3 KiB
INI

function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
set prefix=($root)/boot/grub
if loadfont $prefix/fonts/unicode.pf2 ; then
set gfxmode=auto
load_video
insmod gfxterm
insmod serial
set locale_dir=$prefix/locale
set lang=en_US
set gfxpayload=keep
fi
if [ "$grub_platform" = xen ]; then
set serial_console=""
set gfx_console="console=hvc0"
else
set serial_console="console=ttyS0,115200n8"
set gfx_console="console=tty0"
set default="serial"
serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
if terminal_output gfxterm; then
set default="video"
terminal_output --append serial
terminal_input --append serial
elif [ "$grub_platform" = pc ]; then
# PC console generally outputs to only the video console
terminal_input console serial
terminal_output console serial
elif [ "$grub_platform" = efi ]; then
# EFI console generally outputs to both the video console and serial port
terminal_input console
terminal_output console
fi
fi
# With serial input enabled, sleep helps consume buffered input
# grub.cfg generated by grub-install also includes the sleep for this purpose.
sleep -i 1
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
if [ "${recordfail}" = 1 ] ; then
set timeout=30
else
if [ x$feature_timeout_style = xy ] ; then
# set timeout_style=hidden
set timeout=15
# Fallback hidden-timeout code in case the timeout_style feature is
# unavailable.
elif sleep --interruptible 0 ; then
set timeout=15
fi
fi
insmod play
play 960 440 1 0 4 440 1
menuentry --hotkey=i --id=video 'Start $vendor Installation' {
load_video
set background_color=black
linux /vmlinuz gfxpayload=text quiet nomodeset boot=live toram=filesystem.squashfs $gfx_console
initrd /initrd.img
}
menuentry --hotkey=j --id=serial 'Start $vendor Installation (115200 baud)' {
load_video
set background_color=black
linux /vmlinuz gfxpayload=text quiet nomodeset boot=live toram=filesystem.squashfs $gfx_console $serial_console
initrd /initrd.img
}
# Skip loading the bli module when booting from the installer ISO
if [ ! -f /.disk/info ]; then
insmod bli
fi