The grub boot menu Ubuntu uses has bothered me since I first saw the SUSE implementation of grub. So, after installing the latest 9.10 beta, I decided it was time to figure out how to get rid of that awful black grub menu. Two days later, here is what I have figured out.
Find an image
I used the cool heron image from a previous release of ubuntu. Find it here. My desktop resolution is 1280X1024 so that's what I trimmed down this image to match.
You'll have to save this image in PNG/TGA format. You'll see why later so just make sure this is the format you use.
Set the default grub resolution
Grub2 uses a collection of files to set the various settings it uses. You can specify your desired resolution in the /etc/default/grub file. Edit it with this command:
Code:
gksudo gedit /etc/default/grub
Look for the line #GRUB_GFXMODE=640X480. Remove the # and set your desired resolution. Here's what I did:
Code:
GRUB_GFXMODE=1280x1024
For whatever reason, one that I don't totally understand, this is not all you have to do to change the resolution grub uses. As I discovered in this blog, there is one more change you need to make.
Edit this file: /etc/grub.d/00_header with the command:
Code:
gksudo gedit /etc/grub.d/00_header
You are looking for the line that consists of:
Code:
set gfxmode=${GRUB_GFXMODE}
After that line, add:
Code:
set gfxpayload=keep
your block of code will look like:
Code:
if loadfont `make_system_path_relative_to_its_root ${GRUB_FONT_PATH}` ; then
set gfxmode=${GRUB_GFXMODE}
set gfxpayload=keep
insmod gfxterm
With this new line, your resolution will now be displayed by grub. If you ran the sudo update-grub command you could reboot and witness the glorious resolution. Since I want to add a background, I won't run this command yet.
Set a background image and change the highlighting colors
To set a background in grub you have to edit the debian theme file stored at /etc/grub.d/05_debian_theme. Edit this file with the command:
Code:
gksudo gedit /etc/grub.d/05_debian_theme
First, look for the line:
change it to:
Next you are looking for the "for" statement just below the use bg piece of code we just changed. This for statement will show you the directories that grub will look for your background image in. I added another directory, emphasized in bold, to this list so my entry looks like this:
Code:
for i in {/boot/grub,/usr/share/images/desktop-base,/usr/share/images/grub}/xxxxxxxxxx.{png,tga} ;
Make sure your image is in either png or tga format and then copy it into one of the directories listed above. I just used /usr/share/images/grub. I named my image ubuntu for ease of use, so I replaced the previous image name (the x's in the example above) with my image name.
Code:
for i in {/boot/grub,/usr/share/images/desktop-base,/usr/share/images/grub}/ubuntu.{png,tga} ;
Finally, depending on your preferences, you might want to adjust the colors grub uses for text and highlighting. With background images enabled, grub defaults to black text with magenta highlighting. To change this scroll down to the bottom of the file and look for the code:
Code:
if background_image `make_system_path_relative_to_its_root ${bg}` ; then
set color_normal=black/black
set color_highlight=magenta/black
else
You'll want to keep the color after the slash, for both instances, set to black. It seems this makes the foreground transparent allowing your to see your handsome new background. You can see a list of available colors in the grub manual. This is what I used for my brown-heavy image.
Code:
if background_image `make_system_path_relative_to_its_root ${bg}` ; then
set color_normal=white/black
set color_highlight=brown/black
else
One last thing
In order for all of this stuff to work, you'll have to recompile the grub configuration file. Do this by running:
All that's left is to restart and behold the wonder. Enjoy.
Bookmarks