MSM8916 海信M9模块学习记录一:编译及烧录android5.1源码

编译平台说明:ubuntu16.4

一、M9编译


1. 整体编译(在根目录【ptobce】下编译)

编写在root环境下
①source build/envsetup.sh //配置编译的环境变量(一般编译过一次了,就不需要在输了,直接输②就好了)。
这里写图片描述
②M9PLUS_10Userdebug //我要用到的这个分支,所以输入此命令进行整体编译。
这里写图片描述
③一般第一次编译都会有如下报错,只要再编译一次就好了,这是M9这个android源码的坑。
这里写图片描述
④编译会比较慢,我的电脑编译需要2~3个小时,所以请耐心等下。
编译成功后会打印 success,如下图
这里写图片描述
⑤一些报错的解决办法参考:
1>android编译错误recipe commences before first target
参考:https://www.aliyun.com/jiaocheng/48238.html
提示 : vendor/qcom/proprietary/mm-still/ipl/Android.mk:16 recipe commences before first target。 停止
打开 vendor/qcom/proprietary/mm-still/ipl/Android.mk: 发现原来是15行缺少换行符
修改代码如下:

-D__alignx/(x/)=__attribute__/(/(__aligned__/(x/)/)/) 
改为
-D__alignx/(x/)=__attribute__/(/(__aligned__/(x/)/)/) /

2>提示 make[1]: * [sub-make] Error 2 如何处理
参考:http://forum.ubuntu.org.cn/viewtopic.php?t=474288
安装: u-boot-tools工具

 apt-get install u-boot-tools

3>提示:
make[2]: * [prepare3] Error 1
make[1]: * [sub-make] Error 2
参考:https://blog.csdn.net/ander_chen1024/article/details/45892617
再编译一次试试,不行的话在kernel目录执行 make mrproper后再编译

2. 部分编译(在根目录【ptobce】下编译 一般用不到)

①编译 bootimg: make bootimage -j8
②编译 systemimg: make systemimage -j8
③编译 uboot: make aboot -j8

3. 清除编译(详细说明参考下面链接)

https://blog.csdn.net/zifehng/article/details/73277241
①使用make clean ,将会会删除out/目录下所有内容,不过清除过之后再编译就会很慢。
②如果编译出现问题,先试试删除输出文件夹下system里面的内容,具体位置和指令如下:
rm –rf /out/target/product/M9PLUS_10/system/*

二、APP应用更新时替换文件目录


device/qcom/M9PLUS_10/qcom_bin/system/
只要做替换操作,把新的覆盖到旧的上就好了。

三、使用fastboot工具烧录程序(首先要安装号adb和fastboot)

1、ubuntu下(详细参考下面的链接)

https://blog.csdn.net/u011109881/article/details/79382874
①使用lsusb,查询设备是否连接上电脑,查询显示的设备号【Qualcomm, Inc.】如下图所示
②如果没有装过驱动,请使用【adb devices】安装USB驱动
③编译完成后去 out/target/product/M9PLUS_10
\HARDWARE-UBUNTU\project\msm8916src\szq\ptboce\out\target\product\M9PLUS_10
④找.img镜像文件,共十个文件,不过好像只要烧录四个就好。
把.img文件复制出来,做个备份
⑤使用fastboot三条指令烧录:
1>adb reboot bootloader //进入烧录模式
2>adb fastboot flash xxx xxx.img //烧录文件的指令,主要烧录如下所示三个文件即可,xxx代表要烧录的文件名(有两个xxx哦)
fastboot flash boot boot.img
fastboot flash system system.img
fastboot flash userdata userdata.img
3>fastboot reboot //退出烧录模式,并重启

2、Windows10下

在cmd下使用,使用方法指令上基本同上
使用fastboot三条指令烧录:
1>adb reboot bootloader //进入烧录模式
2>fastboot flash xxx xxx.img //烧录文件的指令,主要烧录如下所示三个文件即可,xxx代表要烧录的文件名(有两个xxx哦)
fastboot flash boot boot.img
fastboot flash system system.img
fastboot flash userdata userdata.img
3>fastboot reboot //退出烧录模式,并重启

3、一般APP更新后打包给他们,主要提供【/out/target/product/M9PLUS_10】目录下四个文件即可

①boot.img
②system.img
③userdata.img
④emmc_appsboot.mbn

猜你喜欢

转载自blog.csdn.net/u013422297/article/details/82496043