1.编译系统
系统源码下载完毕,以及kernel编译完成后,我们来编译系统。
编译系统比较简单,官网上都有,这里只是简单写下命令:
$ source build/envsetup.sh
$ lunch full_crespo-userdebug
$ make -j16
编译完成后,生成boot.img, system.img, userdata.img,再用命令打包:
$ make otapackage
则会在 out/target/product/crespo/ 目录下生成full_crespo-ota-eng.liaowm.zip(名字和电脑hostname有关)。
2. 烧录系统
烧录系统有两种方法,可以用fastboot分别烧录 *.img, 也可以把ota包拷到/sdcard/下再进recovery升级
2.1 用fastboot烧录
先把boot.img, system.img, userdata.img放到同一个目录下,然后下一下脚本运行:
fastboot -w -p flashall
fastboot flash boot boot.img
fastboot flash system system.img
fastboot flash userdata userdata.img
这样的好处是不会把原来米UI刷的比较好用的recovery刷掉,但是比较麻烦。
2.2 用ota包烧入:
把full_crespo-ota-eng.liaowm.zip通过adb push到/sdcard/里,然后进入米UI的recovery模式进行从/sdcard/full_crespo-ota-eng.liaowm.zip更新。这个方法好的地方在于比较方便,不好的地方是,会把原来米UI的recovery刷掉,用ota包的uImage_recovery替代,而这个uImage_recovery做得没有米UI完善,在下一次更新包的时候就很麻烦,要重新用fastboot烧录uImage_recovery才行。