当前位置: 代码迷 >> Android >> 怎么基于android4.4.2的源码和android-4.3.1_r1的驱动编译I9250的ROM
  详细解决方案

怎么基于android4.4.2的源码和android-4.3.1_r1的驱动编译I9250的ROM

热度:40   发布时间:2016-04-28 05:49:40.0
如何基于android4.4.2的源码和android-4.3.1_r1的驱动编译I9250的ROM
如何基于android4.4.2的源码和android-4.3.1_r1的驱动编译I9250的ROM
作者:雨水  2014-05-04 联系方式:dennis.hu.cd at gmail.com

说明:经过多番折腾,终于把自己编译的Android4.4.2的源代码成功地跑在我的三星Galaxy Nexus I9250手机上了。期间离不开一位外国朋友的帮助,也就是参考资料[1]的作者Sato Kensuke. 这里将过程记录下来,希望对大家有所帮助!

第一步:下载android-4.4.2_r2的源码
参见我前面的文章<基于Ubuntu 14.04 LTS编译Android4.4.2源代码>,地址:http://blog.csdn.net/gobitan/article/details/24367439 

第二步:下载android-4.3.1_r1的device部分源码
由于我之前已经全部下载了android-4.3.1_r1的源码并编译成功运行到我的i9250手机上,具体参考我前面的文章<编译android-4.3.1_r源码并刷到自己的Galaxy Nexus I9250真机上>,地址:http://blog.csdn.net/gobitan/article/details/24792589。因此我是直接拷贝过去的。只下载指定目录源代码的方法是我估计的,未经测试:
按照正常下载源代码的步骤,在执行repo sync之前,修改.repo/manifest.xml文件,将里面不需要的目录全部注释掉,这样同步的时候应该就只需要同步自己需要的目录了,全部下载源代码耗时耗空间。

第三步:替换及修改device部分源代码
1. 备份android-4.4.2_r2的device目录;
2. 用android-4.3.1_r1的device目录完全替换android-4.4.2_r2的device目录;
3. 修改诸多文件以使4.3的设备代码适配4.4的源代码,过程较为复杂,这里暂不详述;

第四步:下载i9250的官方驱动
此步骤与我的<编译android-4.3.1_r源码并刷到自己的Galaxy Nexus I9250真机上>一文中的第三步完全一样,这里不详述. 参见地址:http://blog.csdn.net/gobitan/article/details/24792589

第五步:增加ducati-m3.bin驱动
注:如果缺少这一步,会导致相机无法使用。
(1) 下载img
进入https://developers.google.com/android/nexus/images#takju,然后选择4.3 (JWR66Y)的link下载。然后解压,找到里面的system.img文件,然后从该文件中提取出ducati-m3.bin。
(2) 将其push到/vendor/firmware,参见如下:
[email protected]:~$ adb rootrestarting adbd as root[email protected]:~$ adb remountremount succeeded[email protected]:~$ adb push ducati-m3.bin /vendor/firmware3772 KB/s (4515868 bytes in 1.168s)[email protected]:~$ 
第六步:将编译好的img刷到i9250手机上
(1) 修改~/.bashrc中的环境变量ANDROID_PRODUCT_OUT为:
export ANDROID_PRODUCT_OUT=/home/dennis/devenv/aosp/out/target/product/maguro
(2) 重新进入命令行,然后开始刷机
[email protected]:~$ adb devicesList of devices attached0146A0D00600900B        device[email protected]:~$ adb reboot bootloader[email protected]:~$ fastboot flashall -w< waiting for device >--------------------------------------------Bootloader Version...: PRIMEMD04Baseband Version.....: I9250XXLJ1Serial Number........: 0146A0D00600900B--------------------------------------------checking product...OKAY [  0.007s]sending 'boot' (4472 KB)...OKAY [  0.587s]writing 'boot'...OKAY [  0.681s]sending 'recovery' (5020 KB)...OKAY [  0.659s]writing 'recovery'...OKAY [  0.798s]erasing 'system'...OKAY [  0.015s]sending 'system' (264925 KB)...OKAY [ 34.379s]writing 'system'...OKAY [ 30.739s]erasing 'userdata'...OKAY [  0.418s]formatting 'userdata' partition...Creating filesystem with parameters:    Size: 14539534336    Block size: 4096    Blocks per group: 32768    Inodes per group: 8144    Inode size: 256    Journal blocks: 32768    Label:     Blocks: 3549691    Block groups: 109    Reserved block group size: 871Created filesystem with 11/887696 inodes and 97200/3549691 blockssending 'userdata' (137559 KB)...writing 'userdata'...OKAY [ 28.220s]erasing 'cache'...OKAY [  0.016s]formatting 'cache' partition...Creating filesystem with parameters:    Size: 452984832    Block size: 4096    Blocks per group: 32768    Inodes per group: 6912    Inode size: 256    Journal blocks: 1728    Label:     Blocks: 110592    Block groups: 4    Reserved block group size: 31Created filesystem with 11/27648 inodes and 3566/110592 blockssending 'cache' (8832 KB)...writing 'cache'...OKAY [  2.970s]rebooting...finished. total time: 99.523s[email protected]:~$
刷好之后,系统会自动重启,如果没什么其他问题,你可以看到你的劳动成果了! 

最后更新日期:2014-5-4 创建

转载请注明出处:作者:雨水,地址:http://blog.csdn.net/gobitan/article/details/25003141 

参考资料:
1. https://github.com/kensuke/How-to-Midracast-on-AOSP
  相关解决方案