如何編譯 LineageOS for OnePlus 3T

環境搭建

1.安裝64位Ubuntu系統(實體安裝、虛擬機安裝均可)

注意:要求機器至少4G內存(虛擬機至少分配4G內存),硬盤至少100G空間(源碼20G+,編譯後整個目錄約60~70G)

2.更新系統至最新版本,在終端下輸入
sudo apt-get update
sudo apt-get upgrade
3.安裝編譯必需軟件包

sudo apt-get install bison build-essential curl flex git gnupg gperf libesd0-dev libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop openjdk-7-jdk openjdk-7-jre pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev imagemagick

 

4.建立repo命令
mkdir -p ~/bin
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
echo "export PATH=~/bin:$PATH" >> ~/.bashrc
5.新建一個儲存源碼的文件夾
mkdir ~/oneplus
cd ~/oneplus
6.初始化源碼目錄
repo init -u git://github.com/LineageOS/android.git -b cm-14.1
7.添加 OnePlus 3T 專用設定檔
git clone https://github.com/Koenkk/local_manifest_oneplus3_3T.git .repo/local_manifests
8.開始同步程式碼
repo sync
9.初始化編譯環境
. build/envsetup.sh
10. 開始編譯

breakfast oneplus3
brunch oneplus3