修改boot.img 1、备份 boot.img(前提是必须有 root权限的手机) adb shell su cat /proc/mtd 备份 boot.img命令举例如下(切记手机不同,命令不一定相同,请核对自己手机上一步的显示): cat /dev/mtd/mtd1 >/sdcard/boot.img 2、挂载主机的一个文件夹到 VMware虚拟机(我比较习惯 VMware)。 sudo mount -t vmhgfs .host:/ /mnt/hgfs/ 例如:挂载主机 d:\123文件夹到虚拟机/mnt/hgfs/目录下,虚拟机访问修改/mnt/hgfs/mmm/文件夹下的文件相当于主机访问修改d:\123文件夹下的文件(mmm是 d:\123共享到虚拟机的文件名)。这样做的好处就是 linux下解开要修改的文件,然后可以很方便的在 windows下修改了。若要详细设置挂载可以查看我的另一篇博文。 3、将所需工具放入/bin/目录下并添加执行权限: mv /mnt/hgfs/mmm/split_bootimg.pl /bin/ mv /mnt/hgfs/mmm/mkbootimg /bin/ mv /mnt/hgfs/mmm/mkbootfs /bin/ chmod +x /bin/split_bootimg.pl chmod +x /bin/mkbootimg chmod +x /bin/mkbootfs 4、解开 boot.img mkdir /mnt/hgfs/mmm/boot cp /mnt/hgfs/mmm/boot.img /mnt/hgfs/mmm/boot/ cd /mnt/hgfs/mmm/boot split_bootimg.pl boot.img 此时 BOOT目录下会多出几个文件,boot.img-ramdisk.gz和 boot.img-kernel。 mkdir ramdisk cd ramdisk gzip -dc ../boot.img-ramdisk.gz | cpio -i 我们对即将要修改的 init.rc也备份一下吧: cp ./init.rc ../init.rc.backup 5、修改 init.rc使含有 a2sd功能: a、搜索 class_start default,在这一行之前,加入两行代码: start a2sd on property:cm.filesystem.ready=1 b、在最末尾加入: service a2sd /system/bin/logwrapper /system/bin/sh /system/bin/a2sd disabled oneshot c、修改 system为读写 mount yaffs2 mtd@system /system rw remount d、修改 su的相关代码: chown root system /system/bin/su chmod 4550 /system/bin/su 改为: chown root root/system/bin/su chmod 6755 /system/bin/su 6、加入第二屏 要确定到底是那种格式的图片,方法是打开initrd\init文件,搜索logo,就会看到。 a、加入logo.bmp到boot.img\ramdisk.gz\initrd\(官方一般采用这种方法,切记此处的bmp不是一般的bmp) photoshop制作480*800的图片,然后水平翻转一下,再保存为BMP,BMP...