From 82f0acb091db1324af195935674e6e16e72d9271 Mon Sep 17 00:00:00 2001 From: Lyndon Brown Date: Fri, 27 Mar 2020 21:33:59 +0000 Subject: [PATCH] grub2|loopback: fix theme issues for submenus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit also enables greater flexibility for users to override more aspects of theme separate from menu entries, and similarly the initial config details separate from the menu entries. (with the recent change to merge user files with the defaults rather than replace them, users can pick which of these individual components they wish to customise. identical to change as sent in to Kali and accepted by Raphaƫl. Gbp-Dch: Short --- share/bootloaders/grub-pc/config.cfg | 16 ++++++++++++++ share/bootloaders/grub-pc/grub.cfg | 33 +++++----------------------- share/bootloaders/grub-pc/theme.cfg | 13 +++++++++++ 3 files changed, 34 insertions(+), 28 deletions(-) create mode 100644 share/bootloaders/grub-pc/config.cfg create mode 100644 share/bootloaders/grub-pc/theme.cfg diff --git a/share/bootloaders/grub-pc/config.cfg b/share/bootloaders/grub-pc/config.cfg new file mode 100644 index 000000000..f423aec99 --- /dev/null +++ b/share/bootloaders/grub-pc/config.cfg @@ -0,0 +1,16 @@ +set default=0 + +loadfont $prefix/dejavu-bold-16.pf2 +loadfont $prefix/dejavu-bold-14.pf2 +loadfont $prefix/unicode.pf2 +set gfxmode=auto +insmod all_video +insmod gfxterm +insmod png + +source /boot/grub/theme.cfg + +terminal_output gfxterm + +insmod play +play 960 440 1 0 4 440 1 diff --git a/share/bootloaders/grub-pc/grub.cfg b/share/bootloaders/grub-pc/grub.cfg index fa16737c1..521b3a7a5 100644 --- a/share/bootloaders/grub-pc/grub.cfg +++ b/share/bootloaders/grub-pc/grub.cfg @@ -1,31 +1,4 @@ -set default=0 - -loadfont $prefix/dejavu-bold-16.pf2 -loadfont $prefix/dejavu-bold-14.pf2 -loadfont $prefix/unicode.pf2 -set gfxmode=auto -insmod all_video -insmod gfxterm -insmod png - -set color_normal=light-gray/black -set color_highlight=white/dark-gray - -if [ -e /isolinux/splash.png ]; then - # binary_syslinux modifies the theme file to point to the correct - # background picture - set theme=/boot/grub/live-theme/theme.txt -elif [ -e /boot/grub/splash.png ]; then - set theme=/boot/grub/live-theme/theme.txt -else - set menu_color_normal=cyan/blue - set menu_color_highlight=white/blue -fi - -terminal_output gfxterm - -insmod play -play 960 440 1 0 4 440 1 +source /boot/grub/config.cfg # Live boot @LINUX_LIVE@ @@ -51,6 +24,8 @@ source /boot/grub/install_start.cfg submenu 'Advanced install options...' --hotkey=a { + source /boot/grub/theme.cfg + source /boot/grub/install.cfg } @@ -59,6 +34,8 @@ fi if @ENABLE_MEMTEST@; then submenu 'Advanced options...' { + source /boot/grub/theme.cfg + # Memtest (if any) source /boot/grub/memtest.cfg diff --git a/share/bootloaders/grub-pc/theme.cfg b/share/bootloaders/grub-pc/theme.cfg new file mode 100644 index 000000000..fb4d5ef74 --- /dev/null +++ b/share/bootloaders/grub-pc/theme.cfg @@ -0,0 +1,13 @@ +set color_normal=light-gray/black +set color_highlight=white/dark-gray + +if [ -e /isolinux/splash.png ]; then + # binary_syslinux modifies the theme file to point to the correct + # background picture + set theme=/boot/grub/live-theme/theme.txt +elif [ -e /boot/grub/splash.png ]; then + set theme=/boot/grub/live-theme/theme.txt +else + set menu_color_normal=cyan/blue + set menu_color_highlight=white/blue +fi