Ubuntu 14.04 编译Oneplus One Bacon CM13.0

Ubuntu 14.04 编译Oneplus One Bacon CM13.0

1. 编译环境配置

1.1.Install all libs:
sudo apt-get install openjdk-7-jdk git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc lib32readline-gplv2-dev

1.2.Install ia32-libs:
sudo dpkg –add-architecture i386
sudo apt-get update
cd /etc/apt/sources.list.d
echo “deb http://old-releases.ubuntu.com/ubuntu raring main restricted universe multiverse” > ia32-libs-raring.list
sudo apt-get update
sudo apt-get install ia32-libs
sudo rm ia32-libs-raring.list
sudo apt-get update

1.3.Setting environment variables, edit the file: /etc/profile.d/androidEnv.sh

JDK_PATH="/usr/lib/jvm"
export JAVA_HOME="$JDK_PATH/java-7-openjdk-amd64"
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin

export ANDROID_HOME="/home/ds/tools/sdk"
export PATH=$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools

export STUDIO_HOME="/home/ds/tools/android-studio/"
export PATH=$PATH:$STUDIO_HOME/bin

1.4.sudo apt-get install schedtool
1.5.sudo apt-get install maven

2. 下载源码和机型代码

Init and sync

repo init -u git://github.com/CyanogenMod/android.git -b cm-13.0
repo sync
. build/envsetup.sh
breakfast bacon (Download product source code)

At last, add these lines to the file .repo/local_manifests/roomservice.xml, and repo sync again.

<project name="CyanogenMod/android_device_qcom_common" path="device/qcom/common" remote="github" />

The contents of .repo/local_manifests/roomservice.xml as follows:


<manifest>
  <project name="CyanogenMod/android_device_oneplus_bacon" path="device/oneplus/bacon" remote="github" />
  <project name="CyanogenMod/android_device_oppo_common" path="device/oppo/common" remote="github" />
  <project name="CyanogenMod/android_kernel_oneplus_msm8974" path="kernel/oneplus/msm8974" remote="github" />
  <project name="CyanogenMod/android_device_qcom_common" path="device/qcom/common" remote="github" />
manifest>

3. 编译和生成OTA升级包

choosecombo (选择编译选项和编译,也可以直接运行brunch bacon以默认选项开始编译)
make -j24 2>&1 | tee build.log
make otapackage | tee otapackage.log

4. 安装OTA升级包

adb reboot recovery
wipe system/cache/data
install ota zip

FAQ:

  • Edit this file .repo/local_manifests/roomservice.xml, and add these lines:
  <project name="CyanogenMod/android_device_qcom_common" path="device/qcom/common" remote="github" />

, after this then run repo sync.

  • sudo apt-get install schedtool
  • sudo apt-get install maven

Ubuntu 14.04 编译Oneplus One Bacon CM13.0_第1张图片

你可能感兴趣的:(Android)