Category Archives: Operating Systems

How to add splash image to GRUB boot menu

GNU GRUB splashimage howto

Text of the page:

This file was last modified on: January, 30 2004 @ 04:01 pm EST
GRUB Splash Image Howto

Grubconf debian package
Here's a grubconf debian package I made. I had to slightly patch it. Testers are welcomed (needs to be run as root, `sudo grubconf`). Grubconf project homepage.

Splashimage contest
View currently submitted splashimages. So me and Jason Thomas want to start gathering up splashimages and put them into a package. To bring nice slashimages together we are having a contest for the nicest splashimage. What do you win? Just to be put on this page as the nicest splashimages around. Yeah... sorry I'm a broke. So start sending them in to me, by e-mail, with subject "splashimage contest". Then by the middle of september I will put them all up so people can vote. By October we should have a good package.

Quick tips for the impatient:
convert -resize 640x480 -colors 14 image.png image.xpm && gzip image.xpm
Quick tip for debian users: Use "unstable" packages in your /etc/apt/sources.list in order to get the latest GRUB with splashimage support

Example of menu.lst files:

* Windows / Linux setup
* True Linux power user

Quick tip to install GRUB (only Debian users do the apt-get line):

# using the unstable tree
apt-get install grub
grub-install /dev/hda
# Go edit/make a menu.lst file and put it in /boot/grub/menu.lst
grub
# then on the grub prompt run:

# The partition that has the boot partition root (hd0,0) install /grub/stage1 (hd0) /grub/stage2 p /grub/menu.lst quit

News about this howto
The GRUB splashimage Howto

*
0. About
o 0.0.History of this howto
o 0.1 History of splashimage feature
o 0.2 Distrubtions using it
o 0.3 Splashimage patch history
o 0.4 The future/death of this feature
*
1. Instructions
o 1.0 Requirements for GRUB splashimages
o 1.1 I have my image, now what?
o 1.2 Remapping hard drives in device.map problem
o 1.3 It doesn't work you suck!
o 1.4 Tips and tricks
o 1.5 File size... ?
o 1.6 Who are you? || Thanks!
*
2. Splashimages
o 2.0 View JPGs of currenlty available splash images
o 2.1 Download working publically available GRUB splash images
o 2.2 I made a cool splashimage I want to show the world
*
3. Detecting/adding splashimage support onto GRUB
o 3.0 Do I have a GRUB with splashimage support?
o 3.1 Adding splashimage support for your GRUB
*
4. Source compile
o 4.1 I don't have GRUB
o 4.2 I have GRUB but no splashimage feature
*
A. Section for Hackers and distributions developers
o A.0 I want to hack the splashimage feature
o A.1 I'd like to add splashimage feature onto GRUB fo my distribution
o A.2 I found a bug with the splashimage feature, what should I do?
*
B. This HOWTO's availability, license
o B.0 Download this howto, tar.gz, bz2
o B.1 License of this howto: GPL

0. About
0.0 History of this howto
This tutorial was written right after RH 8.0 was released. Red Hat 8.0 was the first distribution out there that included the "splashimage" feature. This feature, as many of you are aware of, allows you to have a nice image to display at boot time while you select the OS/kernel image you'd like to load. Fortunately for you readers I didn't read the info page which did have information regarding this feature on Red Hat 8.0. Here is part of the old Changelog for Grub for Red Hat 8.0 back then:

* Mon Jan 21 2002 Jeremy Katz 0.91-1
- update to 0.91 final
- add documentation on splashimage param (#51609)

Thanks to Jeremy Katz, from Red Hat, for pointing this out. Originally I had said here that there was no documentation at all out there for the splashimage feature and I actually flamed Red Hat for it 😉 Good to hear I was wrong 🙂

It's been a while now since I started doing splash images, and I guess I really got the hang of it now. Anyway here's my latest splash image:

It really took me a lot of trial-and-error to figure out how to make one at first and then I confirmed the requirements by asking the developer of the feature by e-mail. I'd like go give credit to the designer of our LUG's (Penguin) logo. The original author of the penguin logo for our LUG is Jonathan Gaynor, he's one responsible for the original RUSLUG penguin artwork back in November 2001.

This particular image was designed by me for use at the EIT Lab, for our custom RedHat Install. The EIT Lab is now the new home of RUSLUG, our LUG. The Lab's computers dual-boot between win2k and Linux. The snowy background image you see is a picture I took of the College Avenue Campus in New Brunswick at Rutgers University.

Ready to see what a real nice splashimage might look like? Here it is:

This one's original artwork is brought to you by WLUG and the splashimage file author was Alexey Chernyak. Alexey's image uses Dithering and I then tried to make the image without dithering. The results without dithering can be viewed here.

Here is another nice one. This one was submitted by David Berner from Denmark. It is a picture of a Milk Man's bike in Guatemala:

0.1 History of splashimage feature
I've done my research and have confirmed through e-mail that the author of the splashimage hack is:

Name: Paulo Csar Pereira de Andrade
E-mail: pcpa[at]conectiva.com.br
Company: Conectiva

Paulo wrote the vga 16 patch (splashimage) for GRUB for Conectiva because he was asked to. Red Hat then just took it and used it for its distribution since it was cool. I remember I looked at the man page at that time and there was no documentation of the splashimage feature (the documentation was in the info page).

0.2 Distrubtions using it
Red Hat 8.0 and Red Hat 9.0 definitely include the patch and use GRUB by default. Gentoo uses it too and they actually have their own splashimage. Mandrake (9.1) does not use GRUB by default. Slackware (9.0) does not use GRUB by default. Debian (3.0) has this feature enabled but you have to install it from the "unstable" branch. You do this by changing your /etc/apt/sources.list and instead of using "stable" use "unstable". Then `apt-get update && apt-get install grub`. YOU MUST THEN CHANGE THE sources.list file and use again "stable" and do `apt-get update`, otherwise your system might break! You have been warned! Unstable is bleeding edge packages and by definitioncan break. If you know of other distributions using GRUB as the default boot loader, please let me know.

0.3 Splashimage patch history
As explained above, the splashimage feature is a patch that can be applied onto the GRUB source. It is not a bugfix, but a new feature added for GRUB. Because of this, only the upstream source mantainers for GRUB, (Yoshinori K. Okuji Gordon Matzigkeit) could decide whether to incorporate the patch (written by Paulo Csar Pereira de Andrade) into the source (since they're the ones receiving patches or adding new features; just like with the linux kernel where Linus receives patches and addons) so that they can also mantain it should other people patch on to it, etc.

What it comes down to is that the GRUB upstream source mantainers do not want to make non-bugfix or new-feauture enhances/changes to the GRUB 1.0 source base. "Why oh why", you may be asking right? Well I think I know the answer: there things the mantainers deem more important for a 1.0 release. Because of this, should distributions currently want to have GRUB with splashimage support, they have to grab the patch and incorporate it into the sources themselves. For example, thanks to Jeremy Katz now two large distributions have GRUB splashimage support. Katz currently is the Red Hat GRUB mantainer and took off working on the patch from where Paulo left off. He offered to accept bug fixes that the debian community found. How and why did this happen?Well I wasn't sure to take credit for this at first, but after going through my inbox thoroughly I am now sure that I did play a major role for this to occur. I was basically the messenger. My e-mail to Jason Thomas, which is Debian's GRUB package mantainer, and to Paolo, the author of the splashimage patch got forwarded to the the GRUB bug-brug mailing list and that seemed to get things rolling. Now, how Gentoo, or any other distribution supports it, I do not know. If you have insight as how it worked with other distributions, please drop me a line.

What follows is the story of how my e-mail got Debian unstable to get splashimage support. Initially, I had thought that the reason why the splashimage feature was not in any of the other distributions I was trying out while Red Hat 8.0 was out, was the big fun legal mess I figured patch contributers had to go through to submit patches to go as upstream for software designed for the GNU project. Why was I to think this? Well When I had first e-mailed Jason Thomas regarding my wish to see the splashimage feature on debian, I was told I had to contact the original patch developer and see to it that he would be willing to sign the papers to transfer copyright rights to the FSF if it were to be incorporated into GRUB upstream. Through my massive googling, I then found what seemed to be the main developer of the patch, Paulo Csar Pereira de Andrade. It was like finding a needle in a haysack, trust me! I then contacted Paolo regarding this and he replied willing to submit the paperwork. What was left in the picture was the Mantainer for the patch, that according to Jason, would be required, should it go to upstream. Jason then e-mailed the bug-GRUB mailing list asking Okuji if the patch could be incorporated into upstream. In that thread, Jeremy Katz then immediately replied and mentioned how should the patch go upstream, he would be willing to mantain it. In that e-mail, Katz also supplied the patch he had currently be working on for Red Hat. Following Katz notice that he would be willing to be the upstream mantainer, Paolo then sent out to the mailing list the patches used by Conectiva (for GRUB 0.92). What you may think might might have ended in a nice happy ending with the upstream mantainers accepting the patch into upstream is really not what happened. Okuji then replied with an authoritive, but yet simple "No". This was January 2, 2003. I then got notice from Jason the same day that he would be incorporating Jeremy's patches into debian's GRUB unstable package. I'd like to quote here for future reference that Okuji has said that he "would add graphics support into GRUB after 1.0". By this time, GRUB should become PUPA, it seems. On January 9, 2003, Jason informed me that he had uploaded a GRUB package to debian unstable with splashimage support. Yay! And that was the end of that long thread.

It has recently been brought to my attention by Yoshinori K. Okuji, that the GNU Project developers "strongly recommend that contributors assign or disclaim their copyrights, but that that is not a requirement" and that "if [the contributors/patchers] don't want to do that", GNU developers will still "accept them" (the patches, contributions, etc). So let the myth be dispelled that patches/contributions to the GNU project do not have to be solely copyrighted by the FSF. This is just a recomendation. The reason has to do with lawsuits so that should a company/entity violate GPL software belonging to the GNU project, the task of the FSF to carry out a lawsuit would be easier. Should a big lawsuit come up for certain GPL'd software that has tons of developers accross the globe who have not submitted their copyrights to the FSF, the FSF (or someone willing to take the challenge) would have to contact all contributors/patchers to the specific application in question for a successful lawsuit.

Just recently Leonid Lisovskiy sent this patch over claiming it did the following:

* font linear address calculation (affected on some notebooks)
* wrong viewport behaviour
* segment registers garbage in asm.S
* blinking graphical cursor
* routines optimization, etc.

I post it here in this section for what it's worth. I haven't tested the patch yet. According to Leonid he has submitted the patch to Jermey Katz but never got a reply. Maybe some of you might find some use for it.

0.4 The future/death of this feature
Well "what future, what are you talking about?" you may be asking... I'm actually talking about this feature's death. 🙂 Let me explain: according to Paulo this allowing-a-14-colored-image-hack is pretty lame (well he didn't say that, but you get the idea) compared to the apparantly_now_supported code in GRUB now that allows VESA modes (which increases the number of colors supported and larger resolutions). Here's the comment in his own words:

"[...] GRUB 0.92 has code for setting vesa modes, that would be pretty better to display images, think no limits in the number of colors and screen resolution. In that case the only reason to support vga16 would be for floopy boot disks as the 14 colors images are quite smaller than a true color one."

I've played with VESA modes on GRUB but it seems you can't really load any images.. it seems its more of a test-functionality currently supported on GRUB. My guess is that you can load images using these VESA modes but you gotta hack the code and another guess it that PUPA (future GRUB 2.0) will support these modes and image loading!

Today's date is May 5, 2003. I just finished updating this howto and I would now like to say here that I do not think that there currently are enough GRUB developers interested enough in getting VESA graphics support going. Jeremy Katz, from Red Hat seems to me the best developer candidate that would be able to put forth this effort. The reason, being that he is the current main splashimage patch mantainer. Let me invite all you GRUB hackers out there who really wish to see this feature become a reality to start hacking away! Please Okuji, don't step on me like an ant 🙂 Should I have more time I'd probably check the code out myself too, but right now I am busy graduating from school. I can start collecting names of people willing to contribute and all that other fun stuff... but I rather you guys just start hacking away and get on with it. If none of you do so, I will try to do it myself after this semester in May, after finals.

Also, just as the splashimage was a very undocumented feature back around December 2002, around the release of Red Hat 8.0, I believe that right now the VESA graphics support is in the same position. Despite VESA Graphics support not being of primary interest to the main goals for GRUB 1.0, I do realize there is an interest from aesthetic nazies out there to get this going. If you have any insight as to the VESA graphics support in GRUB, please let me know as much as you know and I will gather the information into a new section in my HOWTO.

I've received news about framebuffer splashimage support for GRUB! Scott reports to me that a person named Samuel Leo has some advanced GRUB code that:

* Read ntfs partitions
* frame buffer splashes
* Chinese character messages
* And more...

Accodring to Scott, the sources should be available from Blue Point (A Linux distro for Chinese speakers). Apparantly all this was code form year circa 2000. Also, apparantly these sources were posted on bug-grub too. I wonder if people are really aware of it. To anyone: please let me know if you get framebuffer splashimage support going.

1. Instructions
1.0 Requirements for GRUB splashimages:

1. xpm.gz file type
2. 640x480
3. 14 colors only

1.1 I have my image, now what?

1. Gzip your xpm file and put it into your /boot/GRUB directory (or to any directory of a /dev/hda1 partition). (do: `gzip myfile.xpm`)
2. Edit your GRUB config file (aka /etc/GRUB.conf) and add this line:
splashimage=(hd0,0)/GRUB/myfile.xpm.gz
NOTE: Change the partition and directory according to your system's setup.
3. reboot and cross your fingers

1.2 Remapping hard drives in device.map problem

While using Debian GRUB v0.93+cvs20030224-2 package, Alexey Chernyak has reported the need to re-issue the *grub-install* command every time he changed splashimage line in his menu.lst file for the change to take effect. This was a side effect of having remapped hard drives in device.map file. Example:

(fd0) /dev/fd0
(hd0) /dev/hde
(hd1) /dev/hdb
(hd2) /dev/hda

For whatever reason you may need to do this, it seems that for that old version of GRUB with the patch did in fact have a bug/intended behaviour that required you to do that. Alexey then reported that he contacted Jermey Katz and that little afterwards Debian had a new unstable release with this fixed.

1.3 It doesn't work you suck!
Too bad. Screw you =-) No really, if it didn't work or if this text needs clarification you can e-mail me and I can try to help you/ourselves out. I can't promise anything though, since school forces me to be a busy person.

1.4 Tips and tricks

1.3.0 Test all your images with only one reboot :)!

As you can imagine rebooting every time to test just one freakin' image can be painful and frustrating... With GRUB you don't have to! I'd recommend creating several xpm images you'd like to try out and after that, reboot to interact with GRUB to test each and everyone one of them one by one (don't forget to gzip each one and to put them in /boot/GRUB or so). So just reboot using the default splashimage given to you (don't edit the GRUB conf file).

After your reboot, when the menu for GRUB pops up, just hit "c" to go into the command-line prompt. At the prompt, load the partition with the GRUB images. Please try to make it your /dev/hda1 (which is (hd0,0) in GRUB-partition-nomenclature). I tried using some other partition several times and I only got GRUB to lock itself sometimes. You load partitions by doing:

root (hd0,0)

Then try to load the splash images, one by one:

splashimage /GRUB/myfile.xpm.gz

Do this command for each image you have... Cool huh? Once your satisfied with the splashimage just go ahead and boot up and edit to your GRUB conf file to use it. You may want to keep in mind that GIMP sometimes makes a file look a bit ugly when converting it to 14 colors... and it may take you a long time to re-edit it to make it look priiiiity. That's what happened to me. I used a friend's ruslug tux image and I ended up having to edit the file pixel by pixel... (not fun, it took me about 2-3 hours). What works nice is actually starting a file using 14 colors only and then creating your original artwork from there.
NOTE: it makes it even easier if you have two computers. You can have one on the GRUB prompt and use the other one to edit the xpm files and save them onto floppy disks. Then you just load the floppy instead of a hard drive partition 😉 (fd0) I think. Yes, there's a GIMP version for windows too 😉 It's a shame that running GRUB from the prompt, once Linux starts, it doesn't allow you to use the `splashimage` command. Otherwise you'd be able to test all these images without even restarting 😛 (I tried running it from both terminal and virtual terminal).

1.3.1 Only 14 colors... How do I do that?

To get GIMP to use only a 14 color palette, right click on your file and press ALT+I and put 14 where it says "Generate Optimal Palette:" on the top of the menu. If ALT+I doesn't get you there then right click on the image and go to:

Image-->Mode-->Indexed

Specify you want 14 colors and then if you want (*recommended*) select NO DITHERING. This will tell the gimp not to try to guess colors in between areas. It is also possible that you tell them gimp what colors you want in your 14-color pallete, I actually had to do this for one of my images and I replaced a dark color for a light one. 🙂 The GIMP ROCKS!

1.3.2 Does it have to be filename.xpm.gz?

Not really. GRUB just provides automatic unzip'ing functionality. How you think your bzImage kernel images get's loaded? Heh. So that's just a feature and it's good practice. According to `info GRUB` it does loads quicker. The reason for loading quicker is that -believe it or not- compressed files load quicker on today's computers than uncompressed files. Why? Well because the amount of time it takes for today's average computer to read from the hard drive an uncompressed (thus bigger) file is longer than the amount of time it takes for it to read a smaller hard area on the hard drive + pass it onto main memory + uncompress it with CPU power. Well anyway, you can still leave your xpm images uncompressed, they should work fine (they did when I tested them).

1.3.3 Can I change the foreground and background color of the menu?

Yes you can. Just put something like the following in your menu.lst file:

foreground = ffffff
background = 000000

1.5 File size... ?

There doesn't seem to be any file size limiation on the splash image file (well yes, maybe the size of your RAM)...

1.6 Who are you? || Thanks!

I'm Batman! Who cares really? But please let me know if this howto was useful. Thanks for all those e-mails I've received so far in support :] E-mail me

2. Splashimages
2.0 View images of currently available splashimages
2.1 Download working publically available GRUB splash images
2.2 I made a cool splashimage I want to show the world

If you would like to submit your splashimage into the GNU GRUB splashimage archive send me:

* file_name.jpg - a 640x480 jpg snapshot of your splashimage
* file_name.xpm.gz - a 640x480 splashimage file
* Tell me under what license it's covered under

3. Detecting/adding splashimage support onto GRUB
3.0 Do I have a GRUB with splashimage support?
Good question. Joseph Monti, main developer of the GRUBconf project asked me the same thing to see if he can detect this for his GRUBconf application. I did ask the bug-GRUB mailing list but got no replies. Unsatisfied without a reply back to Monti, I started playing around with stuff and finally wrote a script that seems to check if you have the splashimage feature in your GRUB stage files. You can get the script here and you should run it as root. If you have a better suggestion for how to detect if you have splashimage support, please let me and Monti know.
3.1 Adding splashimage support for your GRUB
I haven't myself added the splashimage patch onto the sources myself, but what I can provide for you is a link of all the patches that I have available, along with the current debian source tree:

* Historic Connectiva patches for GRUB (for 0.92)
* Red Hat 8.0 patch for GRUB
* Current Debian GRUB source tree. Everything there except the "historic" directory comes with the Debian GRUB source from unstable (GRUB 0.93)

I will try to get the most recent patch. Where would I find this? I'd look into the Debian source tree or the Red Hat GRUB source RPM.
4. Source Compile!
4.1 I don't have GRUB
You can grab the GRUB source from many places but for the sake of this HOWTO you have several options.

1. Latest debian sources
2. So what you get is just the mantainer's latest CVS GRUB source that he used to build the latest debian unstable package. I recommend you use these just because it comes with a diff for these specific sources. Also the upstream source mantainer for GRUB keeps close ties with Debian development 😉 Posted GNU GRUB sources
3. You can grab the latest posted sources from the GNU ftp mirror. Note that I don't yet have patches for these so unless someone submits one you are on your own with these sources for now in trying to patch it later for splashimage support. GNU GRUB CVS sources
You'll have to read on this link how to setup CVS and grab the latest sources form the CVS repository. You should only use these if you are very well experienced and are willing to modify the diffs to handle possible changes/etc.

4.2 I have GRUB but I don't have splashimage support
For now I will only provide an example of how to do this if you are using the debian sources. See question 4.1 if you don't have a clue what I am talking about. So you have the GRUB source.. now you need the patch. I'll summarize what you have to do in steps for you to follow. Open a terminal do the following:

mkdir grub-src
cd grub-src
wget http://ruslug.rutgers.edu/~mcgrof/grub-images/grub-debian-sources/grub_0.93+cvs20030224.orig.tar.gz
wget http://ruslug.rutgers.edu/~mcgrof/grub-images/grub-debian-sources/grub_0.93+cvs20030224-2.diff.gz
tar zxvf grub_0.93+cvs20030224.orig.tar.gz
gunzip grub_0.93+cvs20030224-2.diff.gz
patch -p0 < grub_0.93+cvs20030224-2.diff cd grub-0.93+cvs20030224 ./configure make make install The above remains to be tested thoroughly, let me know how it goes. After you do the above then you have install grub onto your MBR or partition. I do not document how to do this since it is beyond the scope of this HOWTO. Please either read the source's README or look on the GRUB home page how to do this. Thanks to Rick Knight for having tested the last latest patch on Slackware 9.0. A. Section for Hackers and distributions developers A.0 I want to hack the splashimage feature Go ahead, by all means 8^D, go hit the GRUB sources. You might want to check out the Historic patches and the current Debian source tree, the Red Hat source RPM for GRUB and gentoo's sources for GRUB. If you have patches, I can recommend you submit them to the author which is probably Jeremy Katz, from Red Hat. If you add nice new features you can also e-mail me and I guess I can post about them here. A.1 I'd like to add splashimage feature onto GRUB fo my distribution Cool, I'd say you get Jeremy Katz's latest work on the splashimage patch and just incorporate that into your source. That is my advice. A.2 I found a bug with the splashimage feature, what should I do? Since the GRUB splashimage feature is not yet officially supported by the upstream source mantainer and since Jeremy Katz seems to be the one ontop of the patch I would recommend to send comments about the specific splashimage patches to him. It may might be fine to post on the Bug-grub mailing list. B. This HOWTO's availability, license B.0 Download this howto, tar.gz, bz2 I've found it useful before to download tutorials or HOWTO's before. This can be useful, for example, on laptops. Also, you may want to incorporate this into your source, or site, or something.. I don't. For whatever reason, you can grab the tarballs here: * GRUB splashimage HOWTO tar.gz (7.3 MB) * GRUB splashimage HOWTO tar.bz2 (7.09 MB) If you are wondering why these tarballs are so large it is because it includes a lot of GRUB source and images. If you just want the HOWTO you can just righ click and "SAVE AS" since the howto is pretty much all in just one file. B.1 License of this howto: GPL This HOWTO/Tutorial is covered by the GPL license. You can view/read the license here. This file was last modified on: January, 30 2004 @ 04:01 pm EST Coplyeft 2003 by GPL - Luis R. Rodriguez