电脑环境: Ubuntu17.04
高通开源源码网站:https://wiki.codeaurora.org/xwiki/bin/QAEP/release
- 安装git &repo
- sudo apt install git
- sudo apt install repo
- 修改repo
- sudo vim /usr/bin/repo
- #REPO_URL = 'https://gerrit.googlesource.com/git-repo'
- REPO_URL = 'https://gerrit-google.tuna.tsinghua.edu.cn/git-repo'
- 下载Android源码
- 创建源码目录
- mkdir android-msm8996
- 进入源码目录,初始化repo
- cd android-msm8996
- repo init -u git://codeaurora.org/platform/manifest.git -b release -m LA.UM.6.5.r1-02500-8x96.0.xml
- 同步代码
- repo sync -j4
- 编译Android源码
- 安装JDK
- sudo apt install openjdk-7-jdk
- 编译
- 进入源码目录
- cd android-msm8996
- 配置环境变量
- source build/envsetup.sh
- 选择产品
- lunch
- 27
- 执行命令启动编译
- make
- 或者 make -j4 showcommands dist
参数说明:
-j4, 开启4个线程;
showcommands, 显示编译过程中执行的命令[38];
dist, 将编译后产生的发布文件拷贝到out/dist目录中[38];
- 编译内核
- make bootimage
- 编译其他模块
- make sdk - build the tools that are part of an SDK (adb, fastboot, etc.)
- make snod - build the system image from the current software binaries
- make services
- make runtime
- make droid - make droid is the normal build.
- make all - make everything, whether it is included in the product definition or not
- make clean - remove all built files (prepare for a new build). Same as rm -rf out/<configuration>/
- make modules - shows a list of submodules that can be built (List of all LOCAL_MODULE definitions)
- make <local_module> - make a specific module (note that this is not the same as directory name. It is the LOCAL_MODULE definition in the Android.mk file)
- make clean-<local_module> - clean a specific module
- make bootimage TARGET_PREBUILT_KERNEL=/path/to/bzImage - create a new boot image with custom bzImage
-
- sudo apt install git
- sudo apt install repo
- 修改repo
- sudo vim /usr/bin/repo
- #REPO_URL = 'https://gerrit.googlesource.com/git-repo'
- REPO_URL = 'https://gerrit-google.tuna.tsinghua.edu.cn/git-repo'
- 下载Android源码
- 创建源码目录
- mkdir android-msm8996
- 进入源码目录,初始化repo
- cd android-msm8996
- repo init -u git://codeaurora.org/platform/manifest.git -b release -m LA.UM.6.5.r1-02500-8x96.0.xml
- 同步代码
- repo sync -j4
- 创建源码目录
- 编译Android源码
- 安装JDK
- sudo apt install openjdk-7-jdk
- 编译
- 进入源码目录
- cd android-msm8996
- 配置环境变量
- source build/envsetup.sh
- 选择产品
- lunch
- 27
- 执行命令启动编译
- make
- 或者 make -j4 showcommands dist
参数说明:
-j4, 开启4个线程;
showcommands, 显示编译过程中执行的命令[38];
dist, 将编译后产生的发布文件拷贝到out/dist目录中[38];
- 编译内核
- make bootimage
- 编译其他模块
- make sdk - build the tools that are part of an SDK (adb, fastboot, etc.)
- make snod - build the system image from the current software binaries
- make services
- make runtime
- make droid - make droid is the normal build.
- make all - make everything, whether it is included in the product definition or not
- make clean - remove all built files (prepare for a new build). Same as rm -rf out/<configuration>/
- make modules - shows a list of submodules that can be built (List of all LOCAL_MODULE definitions)
- make <local_module> - make a specific module (note that this is not the same as directory name. It is the LOCAL_MODULE definition in the Android.mk file)
- make clean-<local_module> - clean a specific module
- make bootimage TARGET_PREBUILT_KERNEL=/path/to/bzImage - create a new boot image with custom bzImage
-
- 进入源码目录
- 安装JDK