update-grub ignores GRUB_COLOR_NORMAL and GRUB_COLOR_HIGHLIGHT

Bug #1027223 reported by Thomas Schweikle
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

This is because these two variables are not exported, as expected. Patching /usr/sbin/grub-mkconfig with

248c248,250
< GRUB_BADRAM
---
> GRUB_BADRAM \
> GRUB_COLOR_NORMAL \
> GRUB_COLOR_HIGHLIGHT

fixes this bug.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: grub-common 1.99-21ubuntu3.1
Uname: Linux 3.4.6 x86_64
ApportVersion: 2.0.1-0ubuntu11
Architecture: amd64
Date: Fri Jul 20 21:25:26 2012
InstallationMedia: Xubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
ProcEnviron:
 LANGUAGE=de_DE:en
 TERM=screen-bce
 PATH=(custom, no user)
 LANG=de_DE.UTF-8
 SHELL=/bin/bash
SourcePackage: grub2
UpgradeStatus: Upgraded to precise on 2012-07-16 (4 days ago)
modified.conffile..etc.grub.d.05.debian.theme: [modified]
mtime.conffile..etc.grub.d.05.debian.theme: 2012-07-20T20:59:12.486533

Revision history for this message
Thomas Schweikle (tps) wrote :
Revision history for this message
Thomas Schweikle (tps) wrote :

This bug is a regression. It is not there for Ubuntu 11.10.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Unfortunately, we cannot work on this bug because your description didn't include enough information. You may find it helpful to read "How to report bugs effectively" http://www.chiark.greenend.org.uk/~sgtatham/bugs.html. We'd be grateful if you would then provide a more complete description of the problem.

We have instructions on debugging some types of problems at http://wiki.ubuntu.com/DebuggingProcedures

At a minimum, we need:
1. the specific steps or actions you took that caused you to encounter the problem,
2. the behavior you expected, and
3. the behavior you actually encountered (in as much detail as possible).
Thanks!

Changed in grub2 (Ubuntu):
status: New → Incomplete
Revision history for this message
Thomas Schweikle (tps) wrote :

Hi! I've included a fix for this bug already! The variables in question are not exported by the scripts. You may set them, but they are ignored this way. Adding them to the export list is all what is needed to fix this!

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

@tps: I understand the fix you are proposing. But I don't understand what are you trying to fix? What is it that used to work and now doesn't? The screen is correctly of purple colour for me when I boot. Isn't it for you? Can you please attach your /etc/default/grub ?

Revision history for this message
Thomas Schweikle (tps) wrote :

The problem arrises with background pictures: if the picture is mostly purple and you use purple colour for the menue, you'll find the menu unreadable. There has to be a way to change colours for the menu at will or by some calcuation from the colours the background picture provides to keep displayed text readable.
This doesn't work if the variables defined are not changeable by users. Since the fix is simple, why don't fix it?

Revision history for this message
Thomas Schweikle (tps) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for grub2 (Ubuntu) because there has been no activity for 60 days.]

Changed in grub2 (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Ben Fritz (fritzophrenic) wrote :

Please reopen this bug and assign it. Here's a problem description. Original post had a fix (which I am going to try after posting).

Steps to reproduce
1. Install kde-grub2-config from Synaptic
2. Run the installed application
3. Go to the "Appearance" settings and specify a wallpaper, foreground colors, and background colors
4. Apply changes
5. Verify settings are stored in /etc/default/grub
6. Reboot computer, observe GRUB menu.

Expected behavior:
Wallpaper chosen in the GRUB2 Bootloader config application and stored in /etc/default/grub should be used as the background image for the GRUB menu. Font foreground color and background colors should likewise be used by the GRUB menu.

Actual behavior:
Wallpaper chose in the GRUB2 Bootloader config application is used for the background image as expected. Font colors are ignored. Instead, the default colors in /etc/grub.d/05_debian_theme are used. If the font colors are too similar to the background image color, menu is unreadable.

Observed on 12.04 (standard Ubuntu, but with KDE desktop installed, so some things like default GRUB screen colors have been changed).

Revision history for this message
Thomas Schweikle (tps) wrote :

Same for 12.10, 13.04

Revision history for this message
Ben Fritz (fritzophrenic) wrote :

I tested the fix in the original post. It did not work, until I also modified /etc/grub.d/05_debian_theme as follows:

#if [ -n "${GRUB_BACKGROUND+x}" ]; then
# set_background_image "${GRUB_BACKGROUND}" || set_default_theme
# exit 0
#fi
if [ -n "${GRUB_BACKGROUND+x}" ]; then
 set_background_image "${GRUB_BACKGROUND}" "${GRUB_COLOR_NORMAL}" "${GRUB_COLOR_HIGHLIGHT}" || set_default_theme
 exit 0
fi

I'm pretty certain this is NOT the best fix, but it works for me for the time being. Neither fix has any effect at all for me by itself, but with both fixes in place the colors defined in /etc/default/grub apply as expected.

Changed in grub2 (Ubuntu):
status: Expired → Confirmed
Revision history for this message
Ben Fritz (fritzophrenic) wrote :

I think I managed to find a satisfactory fix. Please can this get applied so I can stop doing this manually?

First, in /etc/grub.d/05_debian_theme, there are several lines that call "set_background_image" with various values for the wallpaper. But only one of those lines sets any colors, i.e.:

# 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
fi

I simply added the same "${COLOR_NORMAL}" "${COLOR_HIGHLIGHT}" to every other function call to set_background_image. Why shouldn't the colors be passed for every method of setting an image?

Secondly, I updated /usr/sbin/grub-mkconfig to actually set those variables, from the variables used by kde-grub2-config and other applications, by adding these two lines:

export COLOR_NORMAL=$GRUB_COLOR_NORMAL
export COLOR_HIGHLIGHT=$GRUB_COLOR_HIGHLIGHT

Now, after "sudo update-grub", my color settings are working fine.

Revision history for this message
Sebastián Salgado (cebas) wrote :

I also have this bug in Kubuntu 14.10.
I've made a workaround that doesn't involve modifying distribution files.
I created the file /etc/grub.d/99_color_fix which sets the colors. See attachment.

Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

This release of Ubuntu is no longer receiving maintenance updates. If this is still an issue on a maintained version of Ubuntu please let us know.

Changed in grub2 (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for grub2 (Ubuntu) because there has been no activity for 60 days.]

Changed in grub2 (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.