Hi,

On Sun, Jul 02, 2017 at 11:36:46PM +0900, Osamu Aoki wrote:
> Package: grub2-common
> Version: 2.02~beta3-5
> Severity: wishlist
> Tags: patch

After testing, I realized these GRUB_COLOR_* variables needs to be
exported to pass values.

I also realized my proposed extension can be more complete by letting
these override to work even if only colors are specified.

Please consider to apply this attached patch after the previous one.

Regards,

Osamu
>From d91bf81aa7e2cdd62f40a282ea5c15b8895c646b Mon Sep 17 00:00:00 2001
From: Osamu Aoki <os...@debian.org>
Date: Mon, 3 Jul 2017 21:30:16 +0900
Subject: [PATCH] Export GRUB_COLOR_* variables

Enable to override of color only, too
---
 debian/grub.d/05_debian_theme | 16 +++++++++++++---
 util/grub-mkconfig.in         |  2 ++
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/debian/grub.d/05_debian_theme b/debian/grub.d/05_debian_theme
index 3be09b0a9..b0ca00384 100755
--- a/debian/grub.d/05_debian_theme
+++ b/debian/grub.d/05_debian_theme
@@ -168,11 +168,19 @@ fi
 
 # Next search for pictures the user put into /boot/grub/ and use the first one.
 for background in *.jpg *.JPG *.jpeg *.JPEG *.png *.PNG *.tga *.TGA; do
-	if set_background_image "${background}"; then
+	if set_background_image "${background}" "${GRUB_COLOR_NORMAL}" \
+		"${GRUB_COLOR_HIGHLIGHT}"; then
 		exit 0
 	fi
 done
 
+if [ -n "${GRUB_COLOR_NORMAL}" ]; then
+	COLOR_NORMAL="${GRUB_COLOR_NORMAL}"
+fi
+if [ -n "${GRUB_COLOR_HIGHLIGHT}" ]; then
+	COLOR_HIGHLIGHT="${GRUB_COLOR_HIGHLIGHT}"
+fi
+
 # Next try to use the background image and colors specified by desktop-base.
 if set_background_image "${WALLPAPER}" "${COLOR_NORMAL}" "${COLOR_HIGHLIGHT}"; then
 	exit 0
@@ -183,12 +191,14 @@ case $GRUB_DISTRIBUTOR in
 	Ubuntu|Kubuntu)
 		;;
 	Tanglu)
-		if set_background_image "/usr/share/images/grub/grub.png"; then
+		if set_background_image "/usr/share/images/grub/grub.png" \
+			"${COLOR_NORMAL}" "${COLOR_HIGHLIGHT}"; then
 			exit 0
 		fi
 		;;
 	*)
-		if set_background_image "/usr/share/images/desktop-base/desktop-grub.png"; then
+		if set_background_image "/usr/share/images/desktop-base/desktop-grub.png" \
+			"${COLOR_NORMAL}" "${COLOR_HIGHLIGHT}"; then
 			exit 0
 		fi
 		;;
diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
index ad716384b..2e9029a9e 100644
--- a/util/grub-mkconfig.in
+++ b/util/grub-mkconfig.in
@@ -235,6 +235,8 @@ export GRUB_DEFAULT \
   GRUB_VIDEO_BACKEND \
   GRUB_GFXMODE \
   GRUB_BACKGROUND \
+  GRUB_COLOR_NORMAL \
+  GRUB_COLOR_HIGHLIGHT \
   GRUB_THEME \
   GRUB_GFXPAYLOAD_LINUX \
   GRUB_DISABLE_OS_PROBER \
-- 
2.11.0

Reply via email to