Modify Linux kernel boot logo and center full screen display

Source: Internet
Author: User

1. Prepare Images

Using the Graph Software GIMP that comes with ubuntu is the fastest way to convert images. You can also use commands to convert images. In actual testing, an error is prompted, so you can use GIMP to process the image. The specific process is as follows:

(1) open the GIMP software and load image resources (file-> open). The format of your original image should not be limited. Mine is in bmp format.

(2) Click Image-> mode-> Indexed and set Maximum number of colors: 224 under Generate optimum palette in the pop-up option box. The default value is 255. Click the Convert button.

(3) Click file-> Save As to change the image file suffix to. ppm. After you click Save, a small tab is displayed to select the data format. Select Ascii and Save it.

(4) Rename the newly generated image file logo_linux_clut224.ppm and copy it to/driver/video/logo/in the kernel source code to replace the file with the same name. Delete the logo_linux_clut224.c and logo_linux_clut224.o files. After the files are re-compiled, they are automatically generated.

Now the image is ready...

2. Modify Kernel configuration options

(1) Device Drivers --->

Graphics support --->

[*] Boot logo --->

[*] Standard 224-color Linux logo

Support for kernel logo

(2) Device Drivers --->

Graphics support --->

Console display driver support --->

<*> Framebuffer Console support

If this option is not selected, it cannot be displayed on the screen.

After the source code is re-compiled, the replaced logo is started, but it is not displayed in the center full screen.

3. Center full screen display

(1) modify the fb_show_logo_line function in source code/driver/video/fbmem. c.

// Image. dx = 0;

// Image. dy = y;

Image. width = logo-> width;

Image. heigh = logo-> height;

Add

+ Image. dx = (info-> var. xres/2)-(image. width/2 );

+ Image. dy = (info-> var. yres/2)-(image. height/2 );

(2) modify the fbcon_prepare_logo () function in source code/driver/video/console/fbcon. c.

Add the following line of code after logo_height = fb_prepare_logo (info, ops-> rotate );

+ Logo_height + = (info-> var. yres/2)-(logo_height/2 );

After the preceding method, you can see that the modified kernel logo is displayed in the center and full screen mode.

After the above method, the kernel logo can be displayed normally, but it will be refreshed quickly by the first logo (White "a n d r o I D" text) on android boot, this will lead to a sudden sensation. In practice, we need to block it.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.