RSS



How to give yourself a grub splash screen of your choice

Mon, Aug 21, 2006

ArsGeek, Linux, Ubuntu

Talk about it in our Forums

Grub!

As you may have guessed, I’m something of a self professed geek. I like my machine to boot with grub (given that I dual boot) and I like to have a nice image when I’m taking my 15 seconds to decide which OS I want to boot into. Or in case a supermodel just happens to be looking over my shoulder while I’m starting my laptop up.

It’s actually quite easy to take a picture you know and love and convert it into a splash image for Grub to grab. I’m using Ubuntu, but this will work for any linux distro that uses Grub.
First, locate your image. Mine is a screen capture from the movie Seven Samurai. I’ve named it 7samurai1.jpg, which is what I’ll use for this example.

First, we’ll need to download a tool to help us convert images.  Convert is part of the imagemagick suite, so let’s get the whole shebang.

sudo apt-get install imagemagick

Let’s make a folder to keep this image in.

cd /boot/grub

sudo mkdir images

Now, let’s make a quick backup of our menu.list file in case we muck it up.

sudo cp menu.lst menu.lst.bak

That’s the file that tells Grub what to do on boot.

Let’s move into our images director and do some work.

cd images

My image file is located on my desktop, so I’ll copy it into the /boot/grub/images directory I just made.

cp ~/Desktop/7samurai1.jpg .

Now to convert this jpg image to the appropriate format.

sudo convert -resize 640×480 -colors 14 7samurai1.jpg splashimage.xpm

sudo gzip splashimage.xpm

Now it’s converted and compressed. We’ll make a quick edit to our menu.lst file to tell it to look for a spash image.

sudo gedit ../menu.lst

In the file, just below the initial comments (lines that start with #) add the following line:

splashimage (hd0,1)/boot/grub/images/splashimage.xpm.gz

You’ll have to check to see which drive/partition it’s on. If you look at your menu.lst file, you should see several linux kernels. They’ll look something like this:

title Ubuntu, kernel 2.6.15-26-686
root (hd0,2)
kernel /boot/vmlinuz-2.6.15-26-686 root=/dev/sda3 ro quiet splash
initrd /boot/initrd.img-2.6.15-26-686
savedefault
boot

Where you see root (hd0,2) is where you’ll tell grub to look for your splash image above.

Now, save your menu.lst file, exit Gedit, and then reboot!

geek out.

Click the icon, share the link:
  • Digg
  • del.icio.us
  • MisterWong
  • Furl
  • Reddit
  • Technorati
  • BlinkList
  • feedmelinks
  • PopCurrent
  • Blogosphere News
  • Facebook
  • Fark
  • Mixx
  • Slashdot

This post was written by:

arsgeek - who has written 1980 posts on ArsGeek.


Contact the author

15 Comments For This Post

  1. Jeff Liu Says:

    Nice write up. Just a suggestion: you may wish to list ‘convert’ as part of the Imagemagick toolset. Not everyone will necessarily have Imagemagick installed…

  2. arsgeek Says:

    Ahhh! Good point Jeff. I’ll update the posting now.

    geek out.

  3. Sam Says:

    Hmm when I try it I get the following error
    convert: invalid argument for option `640×480′: -resize.

  4. arsgeek Says:

    Sam,

    That’s odd. Works great on my system. Actually, now that I’ve cut and pasted from ArsGeek into the CLI, it doesn’t work. However, on typing it it works fine.

    Voodoo. Try typing it manually? Let me know if that works.

    geek out.

  5. jap Says:

    Do you also have a step-by step to show how to put your favorite pictures on the desktop? Thank you, jap

  6. arsgeek Says:

    Putting up pics as a desktop background can be done a bunch of different ways, depending on what tools you’re using. I do have a way to do it however - I cycle through about 2500 different images ranging from 3D art to pics of my daughter.

    Keep an eye on this site, I’ll get a howto up tomorrow or the day after at the latest.

    geek out.

  7. arsgeek Says:

    Wallpaper changer post is up.
    http://www.arsgeek.com/?p=473

    geek out.

  8. jamesP Says:

    I tried your Grub splashscreen (chose the wrong picture, because it’s too dark ;), but it also came out VERY fuzzy. I have a 15″ LCD monitor, any advice on how to correct the image so it is clear?
    I had little trouble following your directions, they were clear and concise, my only problem was that I can’t get gedit to install (I run Gnome too), but it’s not Ubuntu, it’s Debian Sarge. I downloaded and installed nano, and that worked OK in place of gedit. Thanks much.

  9. arsgeek Says:

    Hi James,

    I use Gedit because it’s simple and fairly intuitive. Having said that however, use whatever editor you’re comfortable with. I also us VI a bunch.

    As for fuzziness, I’m not sure. I’ve not noticed it in my images that I use. I do use images that are either 640×480 or close to that however. What was the resolution on your original picture?

    geek out.

  10. jamesP Says:

    “What was the resolution on your original picture?” I don’t know, I just downloaded it from KDE themes. I will try to make sure that I try to get 640×480 from now on though. I’ll tell you this, arsgeek, your site is definitely bookmarked. I’ll use more of your tutorials as I can find the time. Thanks

  11. arsgeek Says:

    Hey, glad I can help. When I first started using Ubuntu and other linux distros, sites like this one were where I turned for answers (and the forums as well). Glad I could give a little back.

    geek out

  12. Rich Says:

    I did all the things you said I managed to convert a jpg to a xpm.gz. But my grub pics aren’t showing in grub. I have my Linux on (hd0,4) 4th partition would this have something to do with it?

  13. Aniruddha Says:

    Hi,

    Sam says:
    convert: invalid argument for option `640×480′: -resize.

    This is because you may have copy pasted the above command. The arguement 640×480 is invalid while 640×480 is valid.

    Bounced?
    second arguement contains small X from keyboard and first argument contains something which looks likes x but is not.

    Bye

  14. Malochi Says:

    Hmm…..I tried this….everything seemed to go well…but when I reboot it says “Failed to read (hd0,1)/boot/grub/images/splashimage.xpm.gz” ……………*shrugs* it’s obviously `trying` to load it……any guesses?

  15. fancypants Says:

    I got this until I realized that /boot was on (hd0,0) and changed the line to reflect that.
    BTW…
    You did rename your pic “splashimage” right?…. ’cause that’s the file it’s looking for.

Leave a Reply