Bug#1072072: grub2-common: Add GRUB_THEME field as default in /etc/default/grub

Matheus Polkorny mpolkorny at gmail.com
Tue May 28 06:38:05 BST 2024


Package: grub2-common
Version: 2.12-2
Severity: wishlist

Dear Maintainer,

By default in /usr/share/grub/default the GRUB_THEME is not defined, and the
project itself defines a theme called "starfield". It is not used, but it is
available for use.

However, if the user wants to use it, they will have to open /etc/default/grub/
and add the GRUB_THEME field pointing to the theme in
/usr/share/grub/themes/starfield/theme.txt. This, in my opinion, is not trivial
not only because they have to open the file and change the field but also
because in a grub-pc package update it would be checked that the
/etc/default/grub/ file has been changed and would ask if they want to keep
it or follow the same.

My suggestion: Set the GRUB_THEME field by default in /usr/share/grub/default
and point to a symbolic link default or that is

GRUB_THEME="/usr/share/grub/themes/default/theme.txt"

This way, if the user wants to use a different theme like starfield or breeze,
they wouldn't have to change any package files, just create the symbolic link
in /usr/share/grub/themes/. In fact, it would be possible to add to the
postinst of the packages that change the theme the creation of this symbolic
link, since it would not be conflicting.

In my tests, if the GRUB_THEME is defined but there is no theme, the default
debian theme was loaded. I don't know the impact of this on other
architectures, but I believe that in this way, in addition to allowing easier
customization for the user, it also allows the creation of numerous packages
that want to customize GRUB, since there would be no more conflicts and the
theme would be changed automatically.

Regards,
Matheus Polkorny
-------------- next part --------------
diff --git a/debian/default/grub b/debian/default/grub
index 289a217f5..d1930769e 100644
--- a/debian/default/grub
+++ b/debian/default/grub
@@ -16,6 +16,9 @@ GRUB_CMDLINE_LINUX=""
 # filesystems to look for things.
 GRUB_DISABLE_OS_PROBER=true
 
+# Create a symbolic link to the desired theme
+GRUB_THEME=/usr/share/grub/themes/default/theme.txt
+
 # Uncomment to enable BadRAM filtering, modify to suit your needs
 # This works with Linux (no patch required) and with any kernel that obtains
 # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)


More information about the Pkg-grub-devel mailing list