Commit 9abc5dc5 authored by Anton Midyukov's avatar Anton Midyukov

grub: Add ability to override terminal from external grub.cfg on ESP

This will allow for ISO, writed on flash, disable gfxterm and enable serial console, if necessary. For EFI only. Example: GRUB_TERMINAL='console serial' GRUB_SERIAL_COMMAND='serial --unit=0 --speed=115200'
parent 964a3239
......@@ -33,3 +33,14 @@
@$(call set,GRUB_DEFAULT,live)
Именем дефолтного пункта является --id.
Запуск iso образа с неправильно работающей в grub графике (только EFI):
На ESP-разделе образа можно отредактировать конфиг EFI/BOOT/grub.cfg,
добавив в его начало:
GRUB_TERMINAL='console'
Если нужно включить последовательную консоль, пропишите в нём:
GRUB_TERMINAL='console serial'
GRUB_SERIAL_COMMAND='serial --unit=0 --speed=115200'
export GRUB_TERMINAL
export GRUB_SERIAL_COMMAND
if [ -n "$GRUB_TERMINAL" ]; then
$GRUB_SERIAL_COMMAND
terminal_output "$GRUB_TERMINAL"
terminal_input "$GRUB_TERMINAL"
fi
insmod echo
insmod gzio
insmod minicmd
......
......@@ -12,26 +12,28 @@ function load_video {
fi
}
font=${prefix}/fonts/unicode.pf2
if loadfont "$font" ; then
set gfxmode=auto
load_video
insmod gfxterm
terminal_output gfxterm
if [ -d ${prefix}/locale ]; then
set locale_dir=${prefix}/locale
insmod gettext
if [ -z "$GRUB_TERMINAL" ]; then
font=${prefix}/fonts/unicode.pf2
if loadfont "$font"; then
set gfxmode=auto
load_video
insmod gfxterm
terminal_output gfxterm
if [ -d ${prefix}/locale ]; then
set locale_dir=${prefix}/locale
insmod gettext
fi
insmod gfxmenu
insmod jpeg
insmod png
if [ -f ${prefix}/themes/@grubtheme@/theme.txt ]; then
set theme=${prefix}/themes/@grubtheme@/theme.txt;
export theme
fi
set timeout_style=menu
set menu_color_normal=white/black
set menu_color_highlight=black/white
set color_normal=white/black
set color_highlight=black/white
fi
insmod gfxmenu
insmod jpeg
insmod png
if [ -f ${prefix}/themes/@grubtheme@/theme.txt ]; then
set theme=${prefix}/themes/@grubtheme@/theme.txt;
export theme
fi
set timeout_style=menu
set menu_color_normal=white/black
set menu_color_highlight=black/white
set color_normal=white/black
set color_highlight=black/white
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment