I have started the 3rd Edition of my 'The Definitive Guide to Theming GRUB' which now covers GRUB v1.99 and I have been pondering the question of whether or not I should move the directory which contains the GRUB2 themes.
Traditionally, GRUB2 themes were kept in a themes directory under the main GRUB directory. Some distros named this directory GRUB2 instead of GRUB.
Previously, all of the theme's files were kept in the root of it's directory under the themes directory. While browsing the source code, I realized that it's possible to have files placed in sub-directories under the theme's directory. For instance, let's have a theme named 'demo'. The files for this theme would be kept in:
Code:
/boot/GRUB/themes/demo
But now, it's possible to place files in different sub-directories under this directory. So that all image files for the progress bar can be placed in a sub-directory I'll call 'pbar':
Code:
/boot/GRUB/themes/demo/pbar
In the theme definition file I can tell the theme to find the images for the progressbar component in this sub-directory with the progressbar property 'theme_dir':
Code:
+progressbar {
theme_dir = "/boot/grub/themes/demo/pbar"
< Other properties left out>
}
Now the problem arises with distros that use the GRUB2 directory instead of the GRUB directory. This means that 'grub' in the above code, must be replaced with 'grub2' or the theme will fail to load.
Another scenario arises when you have a separate boot partition because there is no /boot directory available until the root filesystem is mounted and the boot filesystem mounted under /boot. The above code will fail across all distribution because of the non-existence of /boot and the value assigned to the theme_dir property must now be:
Code:
theme_dir = "/grub/themes/demo/pbar"
It can be argued that you can just place all file in the 'demo' directory, but for complex themes, you can have as much a 50 files some with very similar names.
To prevent this incompatibility and to ensure that themes will work across all distros whether they use the GRUB or GRUB2 directory, I was thinking it makes sense to move the themes out of GRUB's main directory and into the /usr/share/grub directory. This directory is created by the GRUB install and is the same across all distros.
However, in doing so I would like to keep things according to the FHS. Looking at the FHS, it states:
Quote:
/boot : Static files of the boot loader
Purpose
This directory contains everything required for the boot process except configuration files not needed at boot time and the map installer. Thus /boot stores data that is used before the kernel begins executing user-mode programs. This may include saved master boot sectors and sector map files.
|
And then there's:
Quote:
/usr/share : Architecture-independent data
Purpose
The /usr/share hierarchy is for all read-only architecture independent data files. [30]
This hierarchy is intended to be shareable among all architecture platforms of a given OS; thus, for example, a site with i386, Alpha, and PPC platforms might maintain a single /usr/share directory that is centrally-mounted. Note, however, that /usr/share is generally not intended to be shared by different OSes or by different releases of the same OS.
Any program or package which contains or requires data that doesn't need to be modified should store that data in /usr/share (or /usr/local/share, if installed locally). It is recommended that a subdirectory be used in /usr/share for this purpose.
|
If I understand the above correctly, then /usr/share/grub/themes will in fact be a more appropriate place for the theme directories than /boot/grub or /boot/grub2.
Your comments/suggestions/recommendations is greatly appreciated.