Bug#748534: Making it easy for user to specify GRUB text/menu colors

Shriramana Sharma samjnaa at gmail.com
Sun May 18 06:47:28 UTC 2014


Package: grub-common
Version: 2.02~beta2-10

Hello. I am using Kubuntu Trusty. Since GRUB is not modified
downstream for Ubuntu, I'm filing this bug (actually an enhancement
request) against Debian. Perhaps some of these could be actually
included in topstream GRUB, but I leave it to the developers.

Currently it is unnecessarily difficult to specify the colors *and*
background image for GRUB 2. From
https://help.ubuntu.com/community/Grub2/Displays (I am not aware of
the equivalent Debian page) one learns that: To specify the background
image one has to edit /etc/default/grub and provide a GRUB_BACKGROUND=
entry, which seems a logical thing to do. But one is not able to
specify the colors therein as well. To get the required colors, one
can not "specify" custom colors in a settings file per se (i.e. meant
to be user-editable) but one is required to edit/alter files directly
part of packages[1], which seems awkward. And furthermore, there are
*two* files to edit, /etc/grub.d/05_debian_theme if a background image
is present and /lib/plymouth/themes/default.grub if not.

This is all totally sub-optimal IMO and I submit the attached patch as
a remedy. (While I'm using Trusty's GRUB 2.02~beta2-9, I am able to
successfully apply this patch on the recent 2.02*-10 tree too.)

This patch allows the colors to be specified in /etc/default/grub by
the variables GRUB_COLOR_{NORMAL,HIGHLIGHT} and
GRUB_MENU_COLOR_{NORMAL,HIGHLIGHT} just like the background image is
specified by GRUB_BACKGROUND. It also streamlines the selection of a
background image and its linkup with the colors being specified (i.e.
if there is a user-specified image, the user-specified colors are used
only if the image could be loaded at bootup). It also ties in
correctly with desktop-base[2] providing a default theme, with any
user-specified theme overriding that default. Further comments are
included inline in the patch.

A few related points:

1) I thought maybe I should patch debian/default/grub.md5sum too since
from the name one would assume it's an md5sum of the actual
debian/default/grub file but apparently it has lots of outdated
md5sum-s so I leave it to the developers to decide what to do with
that.

2) I've patched grub.texi documenting the new GRUB_*COLOR* variables.
I presume the info page (and any other documentation) will be
generated from that by the build process.

3) Two of the files to be patched (05_debian_theme and
grub-mkconfig.in) go into the grub-common package and two
(default/grub and grub.texi) go into the grub2-common package. I'm not
sure why these two are separate and I am sure not whether to specify
both packages or not. I am filing against grub-common only. Please
clone if needed.

Thanks.

Shriramana Sharma.

Footnotes:

[1 = I mean /etc/default/grub is not directly a part of a package but
is copied from /usr/share/grub/default/grub in package grub2-common by
its postinst.in lines 363 and 379 so the original from the package is
untouched by user configuration.]

[2 = The only requirement of the desktop-base for this integration is
that its grub_background.sh should also henceforth use the same
spellings for the image/colors as /etc/default/grub: GRUB_BACKGROUND,
GRUB_COLOR_* and GRUB_MENU_COLOR_*.]

-- 
Shriramana Sharma ஶ்ரீரமணஶர்மா श्रीरमणशर्मा
-------------- next part --------------
A non-text attachment was scrubbed...
Name: grub.patch
Type: text/x-patch
Size: 12976 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-grub-devel/attachments/20140518/d2a81e51/attachment.bin>


More information about the Pkg-grub-devel mailing list