From 0950ba80123d58afb741aad3f79c6822adafabdd Mon Sep 17 00:00:00 2001 From: Anton Midyukov Date: Wed, 11 Mar 2020 23:37:32 +0700 Subject: [PATCH] grub: added gfxmode support --- features.in/grub/cfg.in/01gfxterm.cfg | 37 +++++++++++++++++++++++++++ features.in/grub/config.mk | 5 ---- features.in/grub/generate.mk | 6 +++++ 3 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 features.in/grub/cfg.in/01gfxterm.cfg diff --git a/features.in/grub/cfg.in/01gfxterm.cfg b/features.in/grub/cfg.in/01gfxterm.cfg new file mode 100644 index 00000000..55e626ed --- /dev/null +++ b/features.in/grub/cfg.in/01gfxterm.cfg @@ -0,0 +1,37 @@ +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 +} + +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 diff --git a/features.in/grub/config.mk b/features.in/grub/config.mk index 9a83e573..d108f62e 100644 --- a/features.in/grub/config.mk +++ b/features.in/grub/config.mk @@ -16,17 +16,12 @@ use/grub: ; @: endif -ifeq (,$(filter-out i586 x86_64,$(ARCH))) # UI is overwritten use/grub/ui/%: use/grub @$(call set,GRUB_UI,$*) @if [ "$*" == gfxboot ]; then \ - $(call add,STAGE1_PACKAGES,gfxboot); \ $(call add,STAGE1_BRANDING,bootloader); \ fi -else -use/grub/ui/%: use/grub; @: -endif use/grub/%.cfg: use/grub @$(call add,GRUB_CFG,$*) diff --git a/features.in/grub/generate.mk b/features.in/grub/generate.mk index 6d5a3667..28627ed5 100644 --- a/features.in/grub/generate.mk +++ b/features.in/grub/generate.mk @@ -19,6 +19,10 @@ ifndef GRUB_DIRECT GRUB_CFG := $(GRUB_CFG) $(SUBPROFILE_DIRS) defaults fwsetup_efi endif +ifdef GRUB_UI +GRUB_CFG := $(GRUB_CFG) gfxterm +endif + ifdef LOCALE GRUB_CFG := $(GRUB_CFG) lang endif @@ -94,6 +98,8 @@ bootargs: clean @if [ $$(echo $(KFLAVOURS) | wc -w) -gt 1 ]; then \ sed -i "s,@KFLAVOUR@,$(KFLAVOURS),g" $(DSTCFGS); \ fi + GRUBTHEME=$$(cut -d "-" -f2 <<< $(BRANDING)); \ + sed -i "s,@grubtheme@,$$GRUBTHEME,g" $(DSTCFGS); \ clean: copy @if [ "$(GRUB_UI)" = gfxboot ]; then \