Android 启动过程logo修改
这里我们是在ubuntu下进行操作我是用root用户登陆的,首先安装netpbm库
执行:apt-get install netpbm
对于Android系统最开始显示logo是在内核当中,所以首先我们要修改内核中的logo.
一.内核中相关修改
编译linux内核logo制作脚本mklogo.sh,内容如下:
[python]
#!/bin/sh
pngtopnm logo.png > linuxlogo.pnm
pnmquant 224 linuxlogo.pnm > linuxlogo224.pnm
pnmtoplainpnm linuxlogo224.pnm > logo_linux_gzsd_clut224.ppm
rm linuxlogo.pnm linuxlogo224.pnm
#!/bin/sh
pngtopnm logo.png > linuxlogo.pnm
pnmquant 224 linuxlogo.pnm > linuxlogo224.pnm
pnmtoplainpnm linuxlogo224.pnm > logo_linux_gzsd_clut224.ppm
rm linuxlogo.pnm linuxlogo224.pnm
将你选好的logo转换成png格式,命名为logo.png并与mklogo.sh放在同一路径下.
执行./mklogo.sh最后生成logo_linux_gzsd_clut224.ppm
这个命名可以自由更改,但是必须遵循logo_yourname_type这种命名方式,这里仅列举*_clut224.ppm的命名方式,其它格式的命名方式请查看drivers/video/logo/Makefile文件.
将logo_linux_gzsd_clut224.ppm文件放到内核源码下的drivers/video/logo/目录下
进入drivers/video/logo目录
1.修改Kconfig文件
增加:在endif #LOGO之前
[plain]
config LOGO_LINUX_GZSD
bool "gzsd logo"
default n
config LOGO_LINUX_GZSD
bool "gzsd logo"
default n2.修改Makefile文件
增加:
obj-$(CONFIG_LOGO_LINUX_GZSD) += logo_linux_gzsd_clut224.o
3.logo.c中函数fb_find_logo中的 if (depth >= 8)下面增加:
#ifdef CONFIG_LOGO_LINUX_GZSD
logo = &logo_linux_gzsd_clut224;
#endif
4.内核源码目录下的include/linux/linux_logo.h中增加
extern const struct linux_logo logo_linux_gzsd_clut224;
5.在终端执行make menuconfig,选上.
Device Drivers ---> Graphics support --->Bootup logo --->gzsd logo
保存退出后编译即可
6.禁止LCD控制台的光标
在内核源码目录下drivers/video/console/fbcon.c中
注释掉函数:fb_flashcursor和fbcon_cursor内的所有内容
7.让logo中屏幕中间显示:
drivers/video/fbmem.c
修改函数fb_do_show_logo如下
[cpp]
static void fb_do_show_logo(struct fb_info *info, struct fb_image *image,
int rotate, unsigned int num)
{
unsigned int x;
int xoff,yoff;
/**for central logo**/
xoff = (info->var.xres - num * (fb_logo.logo->width + 8))>>1; //得到中间x坐标
yoff = (info->var.yres - num * (fb_logo.logo->height + 8))>>1; //得到中间y坐标
if (rotate == FB_ROTATE_UR) {
for (x = 0; x < num && image->dx + image->width <= info->var.xres; x++) {
image->dx = xoff;
image->dy = yoff;
info->fbops->fb_imageblit(info, image);
image->dx += image->width + 8;
}
}
else if (rotate == FB_ROTATE_UD) {
for (x = 0; x < num && image->dx >= 0; x++) {
info->fbops->fb_imageblit(info, image);
image->dx -= image->width + 8;
}
}
else if (rotate == FB_ROTATE_CW) {
for (x = 0; x < num && image->dy + image->height <= info->var.yres; x++) {
info->fbops->fb_imageblit(info, image);
image->dy += image->height + 8;
}
}
else if (rotate == FB_ROTATE_CCW) {
for (x = 0; x < num && image->dy >= 0; x++) {
info->fbops->fb_imageblit(info, image);
image->dy -= image->height + 8;
}
}
}
static void fb_do_show_logo(struct fb_info *info, struct fb_image *image,
int rotate, unsigned int num)
{
unsigned int x;
int xoff,yoff;
/**for central logo**/
xoff = (info->var.xres - num * (fb_logo.logo->width + 8))>>1; //得到中间x坐标
yoff = (info->var.yres - num * (fb_logo.logo->height + 8))>>1; //得到中间y坐标
if (rotate == FB_ROTATE_UR) {
for (x = 0; x < num && image->dx + image->width <= info->var.xres; x++) {
image->dx = xoff;
image->dy = yoff;
info->fbops->fb_imageblit(info, image);
image->dx += image->width + 8;
}
}
else if (rotate == FB_ROTATE_UD) {
for (x = 0; x < num && image->dx >= 0; x++) {
info->fbops->fb_imageblit(info, image);
image->dx -= image->width + 8;
}
}
else if (rotate == FB_ROTATE_CW) {
for (x = 0; x < num && image->dy + image->height <= info->var.yres; x++) {
info->fbops->fb_imageblit(info, image);
image->dy += image->height + 8;
}
}
else if (rotate == FB_ROTATE_CCW) {
for (x = 0; x < num && image->dy >= 0; x++) {
info->fbops->fb_imageblit(info, image);
image->dy -= image->height + 8;
}
}
}重新编译即可
二.android启动后闪动画面修改:
路径:文件系统源码下的frameworks/base/core/res/assets/images/下有两张图片
android-logo-mask.png
android-logo-shine.png
修改这两张图片即可,注意请将原来的保存。
补充:移动开发 , Android ,