mirror of
https://github.com/truenas/scale-build.git
synced 2026-02-15 07:29:12 +00:00
83 lines
2.2 KiB
INI
83 lines
2.2 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
|
|
}
|