From cce2cd88b66e35ef9fab3c0ddb57fd56cc4ae529 Mon Sep 17 00:00:00 2001 From: Lyndon Brown Date: Sat, 4 Apr 2020 01:31:42 +0100 Subject: [PATCH 1/2] grub2: split up grub.cfg as done in upstream live-build MR #135. the intention here is to prepare to fix application of the theme for submenus, as addressed next. we could accomplish that just by the theme.cfg portion of the split, but why not do the config.cfg bit also now. this is similar to how syslinux is broken up, and a part of the live-build MR #135 changes are to merge config/bootloader files on top of the default set, rather than use them instead, thus user/derivative configs only need to carry the bootloader files they actually want to replace. breaking up grub.cfg helps towards this, so eventually kali can drop carrying files that are identical to upstream ilve-build's. --- .../common/bootloaders/grub-pc/config.cfg | 16 ++++++++++ .../common/bootloaders/grub-pc/grub.cfg | 29 +------------------ .../common/bootloaders/grub-pc/theme.cfg | 13 +++++++++ 3 files changed, 30 insertions(+), 28 deletions(-) create mode 100644 kali-config/common/bootloaders/grub-pc/config.cfg create mode 100644 kali-config/common/bootloaders/grub-pc/theme.cfg diff --git a/kali-config/common/bootloaders/grub-pc/config.cfg b/kali-config/common/bootloaders/grub-pc/config.cfg new file mode 100644 index 0000000..f423aec --- /dev/null +++ b/kali-config/common/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/kali-config/common/bootloaders/grub-pc/grub.cfg b/kali-config/common/bootloaders/grub-pc/grub.cfg index d9bfb74..1216bf4 100644 --- a/kali-config/common/bootloaders/grub-pc/grub.cfg +++ b/kali-config/common/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/black - -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 diff --git a/kali-config/common/bootloaders/grub-pc/theme.cfg b/kali-config/common/bootloaders/grub-pc/theme.cfg new file mode 100644 index 0000000..12b0d82 --- /dev/null +++ b/kali-config/common/bootloaders/grub-pc/theme.cfg @@ -0,0 +1,13 @@ +set color_normal=light-gray/black +set color_highlight=white/black + +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 From 2a0d4fb7eaf33c13d03d316b5f99b786d2c6dea9 Mon Sep 17 00:00:00 2001 From: Lyndon Brown Date: Sat, 4 Apr 2020 01:37:16 +0100 Subject: [PATCH 2/2] grub2: fix application of theme to submenus the theme needs explicitly applying for submenus otherwise they are just displayed with a default layout with a black background. with the theme setting commands moved to a separate file, we can now simply `source` that into each submenu. this of course assumes that live-theme/theme.txt is suitable for submenus. --- kali-config/common/bootloaders/grub-pc/grub.cfg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kali-config/common/bootloaders/grub-pc/grub.cfg b/kali-config/common/bootloaders/grub-pc/grub.cfg index 1216bf4..6509aed 100644 --- a/kali-config/common/bootloaders/grub-pc/grub.cfg +++ b/kali-config/common/bootloaders/grub-pc/grub.cfg @@ -26,6 +26,8 @@ menuentry "Start installer with speech synthesis" { submenu 'Advanced options...' { +source /boot/grub/theme.cfg + # More installer entries (if any) LINUX_ADVANCED_INSTALL