This article was reproduced from: http://blog.csdn.net/qq258711519/article/details/7766303
One-machine platform Boot logo modification method
1: Modify the logo in kernel:
If you want to replace the boot logo in the kernel, you just need to replace the kernel directory Drivers/video/logo under the logo_android_1024_clut224.ppm file (note to keep the same name, This ppm is not available in the IMT SDK and the standard 224-color Linux logo is selected by default. Then the newly compiled core, the resulting zimage burned to NAND flash can be. The methods for making logo_android_1024_clut224.ppm are as follows:
1>, find a picture with a 1024x600 and a suffix of PNG. Then put it under the Linux system.
2>, making ppm files, using commands: This is a PNG image named Linuxlogo.png.
# PNGTOPNM Linuxlogo.png > LINUXLOGO.PNM
# pnmquant 224 LINUXLOGO.PNM > LINUXLOGO224.PNM
# PNMTOPLAINPNM LINUXLOGO224.PNM > linuxlogo224.ppm
After the production is finished, change the name of linuxlogo224.ppm to logo_android_1024_clut224.ppm and replace the corresponding file in the kernel.
If you do not have a PNG image library installed, you will need to install the following library files before making the PPM file.
netpbm LIBNETPBM10 Libnetpbm10-dev
Loading method:
$sudo apt-get Install NETPBM LIBNETPBM10 Libnetpbm10-dev
After the load is complete, you can create it.
The core logo is located in the kernel configuration as follows:
Device Drivers--->
Graphics Support--->
[*] BOOTUP Logo--->
which [*] standard 224-color Android logo (1024X600) for our production of the boot logo,
[] Standard 224-color Linux logo is Linux comes with the boot logo small penguin.
2: Modify the Android system's boot logo
The Android system's boot logo is to play a compressed file named Bootanimation.zip, in the system where the location is data/local/bootanimation.zip. Can be replaced directly in the Android system. It is generally convenient to replace the Bootanimation.zip file under data/local/after the Android system is running.
Bootanimation.zip file is a zip compressed file, compression method requires storage compression, contains a file and two directories:
1. Animation Property Description File: Desc.txt
2. First stage animated picture catalog: part0
3. Second stage animated picture catalog: part1
Desc.txt File Contents:
1024 600 30
P 1 0 part0
P 0 part1
Desc.txt File Analysis:
1024 600 30
Width High Frame number
P 1 0 part0
Marker cycle time period switch interval corresponding directory name
P 0 part1
Marker cycle time period switch interval corresponding directory name
==================
Marker:
Must be: P
Number of Cycles:
0: Indicates an infinite loop at this stage
Phase Switching interval:
The unit is the duration of a frame, such as the number of frames is 30, then the duration of the frame is 1 seconds/30 = 33.3 milliseconds.
Phase switching interval time during the boot animation process into hibernation, the CPU time to initialize the system to use.
That is, the long interval starts quickly, but it affects the animation effect.
The PART0 and Part1 directories contain a series of two animated images, in PNG format. The load refresh of the series picture files is sorted by the name of the file name.
The Bootanimation.zip file is made as follows:
1), the first production of Desc.txt, Part0 and part1 three files, as follows:
2), the Desc.txt, part0 and part1 three files made into a self-portrait format of the compressed file, as follows:
Where the icons are marked 1, 2 and 3 and place must. After clicking OK, a Bootanimation.zip file will be generated to instantly play the logo file of the Android system. Directly replace the system data/local/under the Bootanimation.zip can be.
For the all-in-one platform, the simplest way to modify is to replace the Bootloop_frame_0001.png file under Part2.
Android splash Screen principle
The Android system boot screen is divided into the following three stages:
1. Linux system boot, the Linux Penguin screen (reboot) (Android 1.5 and later has been canceled loading pictures);
2. Android platform launch initialization, "A N D R I O d" text screen;
3. The Android platform graphics system starts, and an animated picture (start) appears with the flashing Android typeface.
1, boot image (Linux penguin) (Android 1.5 and later version has been canceled loading pictures);
Linux kernel boot, load the picture.
LOGO.C defines nologo in the Fb_find_logo (int depth) function to determine whether the corresponding picture needs to be loaded according to the Nologo value. (Source: Kernel\drivers\video\logo)
Code is as follows:
static int nologo;
Module_param (nologo, bool, 0);
Module_parm_desc (Nologo, "disables startup logo");
/* logo ' s is marked __initdata. Use __init_refok to tell
* Modpost, it is intended the This function uses data
* marked __initdata.
*/
Const struct Linux_logo * __init_refok fb_find_logo (int depth)
{
const struct Linux_logo *logo = NULL;
if (nologo)
return null;
......
}
Related code:  
/kernel/drivers/video/fbmem.c
/kernel/drivers/video/logo/logo.c
/kernel/ DRIVERS/VIDEO/LOGO/KCONFIG&NBSP
/kernel/include/linux/linux_logo.h
2, boot text ("A N D R I O D")
After the Android system starts, init.c in main () calls the Load_565rle_image () function to read the/initlogo.rle (a 565 rle compressed bitmap), and if the read succeeds, the/dev/graphics/ fb0 Display logo image; If the read fails, set/dev/tty0 to text mode and open/dev/tty0 to output the word "A N d R I O D".
Define load Picture file name
#define Init_image_file "/initlogo.rle"
int Load_565rle_image (char *file_name);
#endif
Init.c in Main () loads the/initlogo.rle file.
static int console_init_action (int nargs, char **args)
{
int FD;
Char Tmp[prop_value_max];
if (Console[0]) {
snprintf (TMP, sizeof (TMP), "/dev/%s", console);
Console_name = StrDup (TMP);
}
FD = open (Console_name, O_RDWR);
if (FD >= 0)
Have_console = 1;
Close (FD);
if (Load_565rle_image (Init_image_file)) {
FD = open ("/dev/tty0", o_wronly);
if (FD >= 0) {
const char *msg;
msg = "\ n"
"\ n"
"\ n"
"\ n"
"\ n"
"\ n"
"\ n"//console is cols x lines
"\ n"
"\ n"
"\ n"
"\ n"
"\ n"
"\ n"
"\ n"
"A N D R O I D";
"R o C k C h i p r-b o X";
Write (FD, MSG, strlen (msg));
Close (FD);
}
}
return 0;
}
Related code:
/system/core/init/init.c
/system/core/init/init.h
/system/core/init/init.rc
/system/core/init/logo.c
/kernel/drivers/staging/msm/logo.c
Steps to make the *.rle file:
A. Use GIMP or advanced Batch converter software to convert images to RAW format;
B. Use the Android rgb2565 tool to convert raw format files to RLE format (e.g. Rgb2565-rle < Initlogo.raw > Initlogo.rle).
Description
There is no indication of R o C k C h i p r-b o x in the RK box because of a problem with the Linux kernel configuration.
Open the Kernel framebuffer console.
(1) Make MENUCONIFG Select device drivers->graphics support->console display driver Support->framebuffer Console Support
You can then open several configuration options that are relevant.
3. Boot animation (animated picture of flashing Android words)
Android 1.6 and later:
INIT.C parsing init.rc (which defines services: "Service Bootanim/system/bin/bootanimation"), Bootanim Service by Surfaceflinger.readytorun () (Property_set ("Ctl.start", "Bootanim"), perform a boot animation, bootfinished () (Property_set ("Ctl.stop", "Bootanim"), and perform a stop-start animation.
The BootAnimation.h and BootAnimation.cpp files have been placed in the/frameworks/base/cmds/bootanimation directory, adding a portal file bootanimation_main.cpp. As you can see in the Android.mk file, the boot animation is extracted from the original Surfaceflinger (, generating the executable file: Bootanimation. The ANDROID.MK code is as follows:
=============android.mk======================
Local_path:= $ (call My-dir)
Include $ (clear_vars)
local_src_files:= \
Bootanimation_main.cpp \
BootAnimation.cpp
Local_cflags + =-dgl_glext_prototypes-degl_eglext_prototypes
Local_shared_libraries: = \
Libcutils \
Libutils \
Libbinder \
Libui \
Libskia \
LIBEGL \
LIBGLESV1_CM \
Libgui
Local_c_includes: = \
$ (call include-path-for, CORECG graphics)
local_module:= bootanimation
Include $ (build_executable)
//==========================================
(1) After the ADB shell, you can directly run "bootanimation" to re-watch the boot animation, it will remain in the animation state, and will not stop.
(2) After the ADB shell, command "SetProp Ctl.start Bootanim" to perform the boot animation; command "Getprop ctl.start Bootanim" to stop the boot animation. The two sentences correspond to the two sentences of SurfaceFlinger.cpp: Property_set ("Ctl.start", "Bootanim"), and Property_set ("Ctl.stop", "Bootanim");
Related documents:
/frameworks/base/cmds/bootanimation/bootanimation.h
/frameworks/base/cmds/bootanimation/bootanimation.cpp
/frameworks/base/cmds/bootanimation/bootanimation_main.cpp
/system/core/init/init.c
/system/core/rootdir/init.r
Description
Android Boot animation source is located under Frameworks/base/cmds/bootanimation, this program will be/data/local/bootanimation.zip or/system/media/ The PNG or JPG images in the Bootanimation.zip are played in animated form.
First, let's analyze the source code first:
Frameworks/base/cmds/bootanimation/bootanimation.cpp
First look at the defined constants:
#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"
Bootanimation::readytorun ()
Enter an IF Judgment statement
if (encryptedanimation &&
(Access (System_encrypted_bootanimation_file, R_OK) ==0) &&
(Mzip.open (System_encrypted_bootanimation_file) ==no_error)) ||
(Access (User_bootanimation_file, R_OK) ==0) &&
(Mzip.open (User_bootanimation_file) ==no_error)) ||
(Access (System_bootanimation_file, R_OK) ==0) &&
(Mzip.open (System_bootanimation_file) ==no_error))) {
Mandroidanimation =false;
}
Bootanimation::threadloop ()
if (mandroidanimation) {
R =android (); Perform an android font flashing picture
} else{
R =movie (); Perform the animated picture provided in Bootanimation.zip
}
==> bootanimation::android () will load "images/android-logo-mask.png" and "Images/android-logo-shine.png"
==> Bootanimation::movie () loads the contents of the Bootanimation.zip
RK provides the source code in the default is not those of the. zip animation, so always jump to the Android font flashing screen
So if you want to use the. zip animation so long as the good animation copy to the corresponding directory can be compiled, if you want to modify the two images of Android flashing, the simplest way is to directly replace the picture, the two pictures in the./frameworks/base/core/res/ Assets/images directory, a skeleton Android map, a luminous effect, animation effect is the following that the light of the constantly moving around.
/frameworks/base/core/res/assets/images/android-logo-mask.png
Android default foreground picture, text part cutout, size 256x64
/frameworks/base/core/res/assets/images/android-logo-shine.png
Android default background image, with motion effect, size 512x64
Android Boot Logo modification method "Turn"