小米Max2 LineageOS编译过程 ubuntu

第一步:配置环境,我的环境是ubuntu 17.10

sudo apt update
sudo apt upgrade
sudo apt install bc bison build-essential curl flex g++-multilib gcc-multilib git gnupg gperf imagemagick \
lib32ncurses5-dev lib32readline-dev lib32z1-dev libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev \
libssl-dev libwxgtk3.0-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools \
xsltproc zip zlib1g-dev openjdk-8-jdk

第二步:初始化代码,由于国内网络原因,我走的是清华大学的源

repo init -u git://github.com/LineageOS/android.git -b cm-14.1 \
--repo-url=https://gerrit-google.tuna.tsinghua.edu.cn/git-repo

第三部:修改配置,准备同步代码

 vi .repo/manifest.xml

vi .repo/local_manifests/roomservice.xml


  
  
  
  
  

第四步:   同步代码(第一次会很漫长,根据网速情况,需要好几小时)

repo sync

第五步:编译

source build/envsetup.sh
breakfast oxygen
cd device/xiaomi/oxygen
export PATH=/home/jieen/jobs/bin/Android/android-sdk-linux/platform-tools:$PATH
./extract-files.sh
cd ../../..

export USE_CCACHE=1
prebuilts/misc/linux-x86/ccache/ccache -M 50G
##export CCACHE_COMPRESS=1
export ANDROID_JACK_VM_ARGS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx8G"
croot
brunch oxygen
漫长的编译之后,生成的文件会在out/target/product/oxygen目录下


你可能感兴趣的:(我的开发板)