Monday, November 9, 2009

Ubuntu 9.10 - making Grub2 look good

I've been using Ubuntu 9.10 for about a week now and I think it is fair to say all of my problems have been to do with Grub. Grub (the GRand Unified Bootloader - I don't know what is so Grand or Unified about it though) is upgraded in Ubuntu 9.10 from v1 to v2 - which appears to have caused widespread chaos, not least on my own netbook.

The rather basic Grub2 default menu

The first step was upgrading Grub to v2 at all. Since I had done an upgrade from Ubuntu 9.04 I still had the (working perfectly but, you know, old) Grub1 menu. There are lots of guides out there on upgrading so I won't reinvent the wheel. This one worked fine for me:

After upgrading I had the rather ugly menu above. It had extra menu options I didn't want (memtest x86 is a fine application but I know where the CD is thanks - I don't run it everyday) and was .

So, first thing to do was find nice background image! Everyone starts rebuilding their bootloader by sorting graphics, right? I went through the backgrounds in Ubuntu (in /usr/share/backgrounds), picked a simple one and made it 800x600 in The Gimp (I miss Photoshop...). It was 800x600 as that is the highest resolution Grub2 can switch to on an eee PC with its little screen (and no, it won't scale).

Editing Grub2 involves changing the config files then regenerating the menu, rather than the old way of directly editing menu.lst (which no longer exists). The menu options are built from /etc/grub.d/. Since I wanted to remove the memtest options, I remove the execute permission on the memtest file in this directory:
sudo chmod -x /etc/grub.d/20_memtest86+ 
I had saved the resized picture in my pictures folder but wanted to copy it to my backgrounds folder, where my other background images were.

sudo cp /home/edjakeman/Pictures/Climbing800600.jpg /usr/share/backgrounds/

Then I edited the Debian (Ubuntu) option from the /etc/grub.d/ folder to use the new background:

sudo gedit /etc/grub.d/05_debian_theme 

I found the section "Check for usable backgrounds" and edited it to include the directory I wanted to store the backgrounds in, the name of the file and the file type:

# check for usable backgrounds
if [ "$GRUB_TERMINAL_OUTPUT" = "gfxterm" ] ; then for i in
/usr/share/images/grub,/usr/share/backgrounds}/Climbing800600. {jpg,png,tga} ; do

I then edited the grub defaults file...
sudo gedit /etc/default/grub
In this I wanted to disable the recovery options (hey, they just look bad - why would I need them?! Its not like I mess about with system files for no reason) and change the resolution to 800x600. The important lines were:
Finally, this command used the config files to rebuild the grub menu - until its run the old configuration is still in place. This rebuilds the file /boot/grub/grub.cfg
sudo update-grub
My newly tarted up menu (that isn't me climbing)

No comments:

Post a Comment