This article was reproduced from: http://blog.csdn.net/yandongqiangZHRJ/article/details/8585273
See a number of changes in the logo of the blog, but not very clear, here personally sent through their own hands modified after the verification method.
Android Boot In fact there will be a total of 3 images:
1, the first is the Linux system boot, the appearance of the Linux penguin Picture (reboot);
2, when the Android system boot from the Linux kernel, will perform the Anddroid platform initialization process, the screen will appear "A N D R I O D" text screen (but in my system this interface does not appear, or the naked eye does not see the appearance of this screen, This picture is still sent here to modify the method);
3, boot animation: This stage is everyone can see the system during the startup process, display the "a n d r o i d" after the words displayed pictures, similar to the progress bar, the picture content is "a n d r o i d" words.
The first (Little Penguin) screen modification:
After booting the Linux kernel boot, load the picture and the code involved is in the following directory:
/kernel/trunk/drivers/video/fbmem.c
/kernel/trunk/drivers/video/fbmem.h
/kernel/trunk/drivers/video/logo/logo.c
/kernel/trunk/drivers/video/logo/logo.h
/kernel/trunk/drivers/video/logo/kconfig
/kernel/trunk/include/linux/linux_logo.h
The steps for adding this boot logo to the kernel are as follows:
1. Let the kernel support the boot logo
Make menuconfig in the kernel directory
Device Drivers----> Graphics support---->
Select Bootup logo----> Standard 224-color Linux logo
2, the production of the image of the boot logo
The image that will be used as the boot logo is cut according to the size of your screen and saved in BMP format or PNG format; such as Linuxlogo.bmp or linuxlogo.png
Under Linux, enter the following command (for BMP):
#bmptoppm linuxlogo.bmp > linuxlogo.ppm//Generate PPM
#ppmquant 224 linuxlogo.ppm > linuxlogo224.ppm//Convert to 224 colors
#pnmnoraw linuxlogo224.ppm > linuxlogo224.ppm//Convert to ASCII format
Under Linux, enter the following command (for PNG):
# PNGTOPNM Linuxlogo.png > LINUXLOGO.PNM
# pnmquant 224 LINUXLOGO.PNM > LINUXLOGO224.PNM
# PNMTOPLAINPNM LINUXLOGO224.PNM > linuxlogo224.ppm
Note: The above command requires the installation of the NETPBM Toolkit sudo apt-get install NETPBM
3. Put the logo file into the kernel
Copy to the created logo file to the/drivers/video/logo folder.
Replace the logo_linux_clut224.ppm file, and also delete the LOGO_LINUX_CLUT224.O and logo_linux_clut224.c under the folder
4, re-compile the kernel is OK! This is not an unknown word.
The second ("A N D R I O d" text screen) screen modification:
Related code:
/system/core/init/init.c
/system/core/init/init.h
/system/core/init/init.rc
/system/core/init/logo.c
Steps to make the *.rle file:
1). Make a picture of the current screen pixel
Use PS to make a picture suitable for screen size, save as "Save as Web format", then on the popup window, "preset" Item select "PNG-24", Save As Android_logo.png (
Note: It seems that only support png-24, other formats generated RLE file display is not normal, interested people can be verified again.
2). Convert the picture to RAW format
Using the Convert command from the ImageMagick in Linux, the RAW format is converted with the following command:
Convert-depth 8 Android_logo.png Rgb:android_logo.raw
Note: Ubuntu 10.04 has the Imgagemagick tool installed by default, and if the current system is not installed, you can perform the following command installation:
sudo apt-get install ImageMagick
3). Convert raw format to RLE file
Need to use the Android compiled rgb2565 tool, in the Android/out/host/linux-x86/bin directory (Android is the current source directory), the conversion command is as follows:
Rgb2565-rle < Android_logo.raw > Initlogo.rle
So far, the boot needs to display the image has been done, that is Initlogo.rle, note that the file name must be this, if you want to change the file name, you need to modify
Macros in Android/system/core/init/init.h:
#define Init_image_file "/initlogo.rle"
4). Copy the prepared Initlogo.rle files to the root directory of the Android system, which is out/target/product/..../root
Finally compiled into a file system image xxx.img re-burn. Ok.
Third (boot animation) screen
In fact, this part of the animation is the use of two images displayed, the specific picture file path is: frameworks/base/core/res/assets/images, we look at the know, also know how to modify.
And this part of the relevant source files are mainly the following: Frameworks/base/cmds/bootanimation the following several files are, you can look at the contents of the BootAnimation.cpp file, there are the following code snippet:
BOOL Bootanimation::android ()
{
Inittexture (&mandroid[0], massets, "images/android-logo-mask.png");
Inittexture (&mandroid[1], massets, "images/android-logo-shine.png");
BOOL Bootanimation::android ()
{
Inittexture (&mandroid[0], massets, "images/android-logo-mask.png");
Inittexture (&mandroid[1], massets, "images/android-logo-shine.png"); This is where the foreground and background images are set to appear.
And then look at the following code:
[CPP] #define USER_BOOTANIMATION_FILE "/data/local/bootanimation.zip" &NBSP;
#define System_bootanimation_ FILE "/system/media/bootanimation.zip" &NBSP;&NBSP;
#define System_encrypted_bootanimation_file "/system/media/ Bootanimation-encrypted.zip "&NBSP;
#define User_bootanimation_file"/data/local/bootanimation.zip "
#define System_bootanimation_file "/system/media/bootanimation.zip"
#define SYSTEM_ENCRYPTED_BOOTANIMATION_FILE "/ System/media/bootanimation-encrypted.zip " look at the macro name I believe you will know, This is the name of the set animation file. Why does it show the picture again and animate it, this Android version is related. Showing two images: foreground and background images are used in the 1.5 version, then changed to set the animation file, that is: Bootanimation.zip, is the zip format, this file contains three content: two directories: Part0 and Part1, a file desc.txt.
Two directories are used to contain the pictures to be displayed, divided into the first and second phases. The rest of the file is about setting up information about how to display:
Examples are:
480
P 1 0 part0
P 0 0 part1
The specific meanings are as follows:
480--width of the image, 800--height of the image, 15--frames of second
P 1, display one time
P 0, display recycling till handset power on finished, I believe you understand! Oh.
You can make your own bootanimation.zip files placed in the appropriate directory, this can replace the default boot interface: Here the right directory is the above macro definition, we all know ^_^!
How to make Bootanimation.zip file? Create two directories and a file as above, then use the software or a command-line package to
Zip-r-0 bootanimation.zip part0 part1 desc.txt
Android System Boot Logo modification "turn"