在对Android 操作系统进行定制开发过程中,优势仅仅需要编译修改过的部分并烧写到设备上进行验证,下面是重新编译打包boot.img,并自动烧写到设备的脚本文件。
[code=Python]
echo on
out/host/linux-x86/bin/mkbootfs out/target/product/hammerhead/root | out/host/linux-x86/bin/minigzip > out/target/product/hammerhead/ramdisk.img
out/host/linux-x86/bin/mkbootimg --kernel out/target/product/hammerhead/kernel --ramdisk out/target/product/hammerhead/ramdisk.img --cmdline "console=ttyHSL0,115200,n8 androidboot.hardware=hammerhead user_debug=31 maxcpus=2 msm_watchdog_v2.enable=1" --base 0x00000000 --pagesize 2048 --ramdisk_offset 0x02900000 --tags_offset 0x02700000 --output out/target/product/hammerhead/boot.img
adb shell su 0 reboot bootloader
fastboot flash boot out/target/product/hammerhead/boot.img
fastboot reboot
[/code]
制作脚本:
1. 进入到你的Android 源代码根目录
2. gedit make_bootimage.sh
3. 拷贝上面内容到make_bootimage.sh文件
4. chmod 777 make_bootimage.sh
5. ./make_bootimage.sh 验证