Create your own boot logo

http://www.arm9board.net/wiki/index.php?title=Create_your_own_boot_logo

Create your own boot logo

In this tutorial there will be explained how to show your own image on the LCD display while your Linux system is booting.

Contents

[hide]

Preparations

  • A complete system using buildroot
  • You need a board with the U-boot bootloader downloaded in NAND Flash.

Developping the boot logo

Linux users can use the Gimp for creating a logo. Gimp is an open source alternative for expensive Programs like Photoshop,… etc. On the Ftp website you can find a simple image I created in Gimp:

ftp://wikiusers@ftp.arm9board.net/Kernel_logo (password: Arm9board)

You find an .xcf and a .ppm file. Best is to download the .xcf file and open it using Gimp image editor.

As you can see it’s a pretty simple image, but it can be used for tutorial purposes. As you can see I’m using the 4.3″ LCD which has a 480*272 resolution. For other resolutions, you’ll have to adapt the image’s size of course.

Converting the image

When you’ve adapted the image as you please, you can save it using another extension .ppm and give the file the name:

logo_linux_custom.ppm

Going to a 224 color image

Now to fulfill the Linux kernels requirements, we need to adapt the ppm file a little bit more. The kernel boot screens only use 224 color images. So to convert our image, let’s open a new terminal and type:

$ sudo apt-get install netpbm

Reduce the colors to 224 with the following command:

$ ppmquant 224 logo_linux_custom.ppm > logo_linux_custom_224.ppm

Put the last file into ASCII mode:

$ pnmnoraw logo_linux_custom_224.ppm > logo_linux_custom_ascii_224.ppm

Put it inside the Kernel image

Move inside the buildroot directory:

$ cd ~/buildroot-2011.05
$ make clean

This will remove any build data, so we can restart with a fresh unpacked directory of the kernel. Edit the menuconfig of the kernel to unzip the archive:

$ make linux26-menuconfig

and exit the menuconfig. Now move into the unpacked directory of the kernel:

$ cd output/build/linux-custom/drivers/video/

And copy the logo_linux_custom_ascii_224.ppm to the logo directory:

$ cp logo_linux_custom_ascii_224.ppm logo/logo_custom_clut224.ppm

IMPORTANT: the _clut224 ending is very important for the kernel!

Editing the necessary files

Move into the logo directory:

$ cd logo

Edit the Makefile

$ gedit Makefile

And around line 19 add the followin line:

 obj-$(CONFIG_LOGO_ARMADEUS_CLUT224)     += logo_custom_clut224.o

Edit the logo.c file

$ gedit logo.c

And add the following line somewhere between all the _CLUT224 ifdef routines:

#ifdef CONFIG_LOGO_ARMADEUS_CLUT224
    /* Armadeus Linux logo */
    logo = &logo_custom_clut224;
#endif

Edit the Kconfig file

$ gedit Kconfig

And add the following lines to add your own boot logo to the menuconfig, of course you can change the text to whatever you want:

config LOGO_CUSTOM_CLUT224
 	bool "Your own boot logo here"
	default y

Editing the header file

This depends on which kernel version you are using:

For the 2.6.28 kernel version

You need to reopen the logo.c file again:

$ gedit logo.c

And add the following header around line 39:

extern const struct linux_logo logo_custom_clut224;

For the 2.6.36 kernel version

Move into the include directory of the linux kernel:

$ cd ~/buildroot-2011.05/output/build/linux-custom/include/linux
$ gedit linux_logo.h

And around line 50, add the following line:

extern const struct linux_logo logo_custom_clut224;

Select your boot logo and compile

Inside the main directory of buildroot, type:

$ make linux26-menuconfig

and select:

Device Drivers  --->
    Graphics support  --->
       [*] Bootup logo  --->
           [*] Your own boot logo here

Exit the menuconfig and build the new system

$ make

Download the zImage to the board an you’ll see the new boot logo appearing!

Removing the blinking cursor

You’ll see that in the top left corner, the cursor keeps blinking, we can remove it by makeing the following change to the kernel source code:

For the 2.6.36 kernel version

$ gedit ~/buildroot-2011.05/output/build/linux-custom/drivers/char/vt.c

Look for line 1640 and change:

vc->vc_deccm		= global_cursor_default;
to
vc->vc_deccm            = 0;

For the 2.6.28 kernel version

$ gedit ~/buildroot-2011.05/output/build/linux-custom/drivers/char/vt.c

Look for line 1623 and change:

vc->vc_deccm		= 1;
to
vc->vc_deccm		= 0;

Getting the cursor to blink again from a terminal

To activate the cursor again, you can boot your system and in a minicom terminal, type:

# echo -e '\033[?25h' > /dev/tty1
# echo 1 > /sys/class/graphics/fbcon/cursor_blink

Important notice

Remember that for now we have change the output build directory from buildroot, which means that when you use

$ make clean

All the changes you made will be lost, because buildroot starts again from the archive inside the dl folder

Best is to create a new archive from the output/build/linux-custom directory and put it inside the dl folder or to make all the changes we’ve just made directly inside the kernel .tgz archive inside the dl folder.

Have fun!