LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-05-2012, 08:29 PM   #1
towheedm
Member
 
Registered: Sep 2011
Location: Trinidad & Tobago
Distribution: Debian Stretch
Posts: 612

Rep: Reputation: 125Reputation: 125
Your suggestions on moving /grub/themes to /usr/share/grub/themes


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.
 
Old 02-09-2012, 04:07 AM   #2
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,669

Rep: Reputation: 498Reputation: 498Reputation: 498Reputation: 498Reputation: 498
Your thought of course carries the more expedient logic, but I'd guess you ought to talk to grub developers directly, or to the distribution developers. Sometimes it is not a matter of necessity only that one distro implements one thing differently from others. But with that work of yours I suppose they might appreciate and think with your idea.

Good luck.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Bisigi Themes Natty PPA Updated, Install 15 Great Themes in Just 3 Steps! LXer Syndicated Linux News 0 08-01-2011 11:42 PM
Where to find Grub+Bootsplash+GDM+GNOME splash+Wallpaper themes that match? General Linux - Desktop 1 06-09-2007 12:10 AM
Themes: KDE - GNOME desktop themes trouble. Chuong Linux - Software 3 08-26-2006 10:19 PM
Any tool to convert Fluxbox themes to WindowMaker themes ?? skouket Linux - Software 1 06-24-2005 07:42 AM
Bootsplash Themes(need a list of websites to download themes from) ganja_guru Linux - General 1 09-26-2004 11:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration