lfs-uefi: fix efivar-37 FTBFS
[linux_from_scratch_hints.git] / bootsplash.txt
blob3acd59af1790357c01e9f88742e44d3a4a784c4b
1 AUTHOR:      Joachim Beckers <jbeckers@linuxfromscratch.org>
2 DATE:        2005-07-31
3 LICENSE:     GNU Free Documentation License version 1.2
5 SYNOPSIS:    How to beautify the kernel 2.4/2.6 boot process using bootsplash.
7 PRIMARY URI: http://jbeckers.webhop.org/en/hints.html
9 DESCRIPTION:
10 This hint describes how to create your own graphical boot using bootsplash.
11 Bootsplash is a packages that allows you to display background pictures with or
12 without animations on your consoles, during kernel boot and during init. It's
13 fully themeable and it uses the framebuffer. Hence it works with kernel 2.4 as
14 well as 2.6 and you can use hardware graphics acceleration.
16 PREREQUISITES:
17 This hint was tested on LFS-5.1.1/kernel-2.6.8.1 and LFS-6.0/kernel-2.6.11.7.
18 These combinations are tested, but others will probably work too. Just get the
19 patch that matches your kernel version.
20 The bootsplash package requires that libmng is installed. See the BLFS book for
21 libmng build instructions.
23 HINT:
25     How things are to be done:
26     ==========================
27 Setting up bootsplash is to be done in six stages:
28 1. Patching the kernel with the bootsplash patch, configuring and recompiling.
29 2. Installing the bootsplash package.
30 3. Installing a theme.
31 4. Creating a initial ramdisk.
32 5. Configuring bootsplash and configuring your bootloader.
33 6. Adapting bootscripts.
35 Before we can start however, we'll need to download some packages.
38     Required Packages:
39     ==================
40 The bootsplash kernel patch:
41      http://www.bootsplash.de/files/ (for kernel 2.6 patches)
42 or:
43      http://www.bootsplash.de/files/old (for kernel 2.4 patches)
45 The bootsplash package:
46      http://www.bootsplash.de/files/splashutils/bootsplash-3.2.tar.bz2
48 A patch for bootsplash's makefile:
49      http://www.linuxfromscratch.org/hints/downloads/attachments/bootsplash/bootsplash-3.2_makefile.patch
51 A theme:
52      http://www.bootsplash.de/files/themes/
54 If you don't have your kernel's sources, get them from:
55      ftp://ftp.kernel.org/pub/linux/kernel/
58     Patching, configuring and recompiling the kernel:
59     =================================================
60 If you just downloaded the kernel sources, unpack them in the right place by
61 running the following commands:
62      cd /usr/src/
63      tar -xvjf /path/to/kernel-tarball
65 Now cd to the directory containing your kernel sources, and apply the patch:
66      cd /usr/src/linux-2.*
67      patch -p1 -i /path/to/bootsplash-kernel-patch
69 Now configure your kernel using your favorite configuration tool:
70      make *config
72 Make sure you compile these things _into_ your kernel, not as a module:
73  -for kernel 2.4:
74       Code maturity level options 
75         --> Prompt for development and/or incomplete code/drivers
76       Block devices
77         --> RAM disk support
78         --> Initial RAM disk (initrd) support
79       Console drivers
80         --> Video mode selection support
81         --> Frame-buffer support
82               --> Support for frame buffer devices
83               --> VESA VGA graphics console
84               --> Use splash screen instead of boot logo
86  - for kernel 2.6:
87      Device drivers 
88        --> Block devices
89              --> RAM disk support
90              --> Initial Ram disk (initrd) support
91        --> Graphics support
92              --> Support for framebuffer devices
93                    --> VESA VGA graphics support
94                    --> Console display driver support
95                          --> Video mode selection support
96                          --> Framebuffer console support
97                    --> Bootsplash configuration
98                          --> Bootup splash screen
100 Note: If there is a framebuffer driver for your graphics card in the kernel,
101 you may want to select the matching entry. This will allow you to use hardware
102 acceleration.
104 Finish off by compiling and installing the new kernel:
105  - for kernel 2.4:
106      make dep
107      make bzImage
108      make modules
109      make modules_install
110      cp ./arch/i386/boot/bzImage /boot/lfskernel-2.4.*
111      cp .config /boot/config-2.4.*
112      cp System.map /boot/System.map-2.4.*
114  - for kernel 2.6:
115      make all
116      make modules_install
117      cp ./arch/i386/boot/bzImage /boot/lfskernel-2.6.*
118      cp .config /boot/config-2.6.*
119      cp System.map /boot/System.map-2.6.*
122     Installing the bootsplash package:
123     ==================================
124 Install the bootsplash package by running the following commands:
125      tar -xvjf bootsplash-3.1.tar.bz2
126      cd ./bootsplash-3.2/
127      patch -Np1 -i /path/to/bootsplash-3.2_makefile.patch
128      cd ./Utilities/
129      make
130      cp splash fbresolution fbmngplay /sbin
131      cd ../Scripts/
132      cp bootanim /sbin
133      chmod +x /sbin/bootanim
135 Note: We only need three programs and one script from the bootsplash package.
136 The others are Suse-specific bootscripts. Take a look at the documentation in
137 bootsplash-3.2/Documentation to learn more.
140     Installing a theme:
141     ===================
142 Install a bootsplash theme by running the following commands:
143      mkdir -p /etc/bootsplash/themes
144      cd /etc/bootsplash/themes
145      tar -xvjf /path/to/your/theme
147 Now create a symlink that points to the default theme that will be used:
148      ln -s /path/to/your/theme current
151     Creating an initial ramdisk:
152     ============================
153 To show a splashimage on kernel startup, bootsplash uses an initial ramdisk.
154 Create an initial ramdisk by running the following command:
155      /sbin/splash -s -f \
156        /etc/bootsplash/themes/current/config/bootsplash-1024x768.cfg > \
157        /boot/bootsplash-initrd
159 Note: If you want to boot into a resolution other than 1024x768, simply replace
160 1024x768 by your favorite resolution. Remember to do the same during the
161 following sections. Also make sure that your theme supports the resolution that
162 you choose.
165     Configuring bootsplash and the bootloader:
166     ==========================================
167 Bootsplash can display a picture on the background of your terminals, but this
168 is only automatically done for tty1. To add a background to tty2, tty3, tty4,
169 tty5 and tty6, run the following command, where * is the tty number minus 1:
170      splash -n -s -u * \
171        /etc/bootsplash/themes/current/config/bootsplash-1024x768.cfg
173 Note: To have all your tty's get a nice background on startup, you can put this
174 command into a bootscript.
176 Now configure your bootloader. This hint provides the instructions for lilo and
177 grub. If you're using another bootloader, check out its documentation. The
178 instructions will probably be very similar.
179 - for lilo:
180      Edit /etc/lilo.conf
181      Make sure to change the kernel entry to match your new kernel. Under the
182      entry for your kernel, add:
183        vga=791
184        initrd=/boot/bootsplash-initrd
185        append="splash=silent"
186      Now apply your changes by running the following command:
187        lilo
189 - for grub:
190      Edit /boot/grub/menu.lst
191      Make sure to change the kernel entry to match your new kernel. Add the
192      following to the kernel entry:
193        vga=791 splash=silent
194      Below the kernel entry, add:
195        initrd /boot/bootsplash-initrd
197 Note: If you want to boot into a resolution other than 1024x768, change
198 "vga=791" to the number that matches your setup. The table below shows the
199 theoretically possible values. Note that some of these resolutions aren't
200 implemented yet.
201 +---------+---------+---------+----------+-----------+
202 |         | 640x480 | 600x800 | 1024x768 | 1280x1024 |
203 +---------+---------+---------+----------+-----------+
204 |  8 bit  |   769   |   771   |    773   |    775    |
205 |  15 bit |   784   |   787   |    790   |    793    |
206 |  16 bit |   785   |   788   |    791   |    794    |
207 |  24 bit |   786   |   789   |    792   |    795    |
208 +---------+---------+---------+----------+-----------+
211     Adapting the bootscripts:
212     =========================
213 Bootsplash can not only display pictures, it also supports animations. You can
214 adapt your bootscripts to make a progressbar move during startup, or to display
215 an animation when an event occurs. For a tidy way to use this, add the
216 following code to your /etc/rc.d/init.d/functions script:
218      progressbar()
219      {
221           if [ $# != 1 ]
222           then
223                echo "Usage: progressbar {progress}"
224                exit 1
225           fi
226                 
227           echo "show $(( 65534 * $1 / 100 ))" > /proc/splash
229      }
231      animate()
232      {
234           if [ $# = 0 ]
235           then
236                echo "Usage: animate {hook}"
237                exit 1
238           fi
240           splash "$*"
242      }
244 To use the progressbar, edit your bootscripts in /etc/rc.d/init.d.
245 Whenever you see "evaluate_retval", add "progressbar XXX" (where XXX is a
246 number between 0 and 100 that matches the boot progress). Take a look at
247 /etc/rc.d/rcsysinit and /etc/rc.d/rc*.d to get to know the order in which the
248 bootscripts are executed.
250 To use animation, you need to know on which events your theme can play an
251 animation. Take a look at /etc/bootsplash/themes/current/config/animations.cfg
252 to determine this. The animations.cfg file will probably look like this:
254      fsck start:bootanim start bounce.mng
255      master:bootanim stop
256      shutdown: bootanim start bounce.mng
258 Now add the following to the bootscript that runs fsck:
259      animate fsck start
261 Place the following just before the bootscripts finish, as this will
262 stop all animations:
263      animate master
265 The following should be placed somewhere in the shutdown scripts:
266      animate shutdown
269 Congratulations: that's it. You can now reboot and enjoy your new splashimage.
272 ACKNOWLEDGMENTS:
273 Thanks to Bryan Gale, the previous author of this hint.
274 Thanks to Anton Strobl for providing bootsplash-3.2_makefile.patch.
277 CHANGELOG:
278 [2004-09-19]
279 * Maintainership taken over.
280 * Converted to new hint format.
281 * Updated to include instructions for kernel 2.6 and grub.
282 * Published the hint on my website.
284 [2005-04-07]
285 * Added a note about which versions of the packages to use.
287 [2005-04-24]
288 * Removed the note added on 2005-04-07.
289 * Updated to bootsplash-3.2.
290 * Added a patch that makes bootsplash compile more cleanly.
291 * Some other fixes.
293 [2005-07-31]
294 * Updated primary URI