Android9.0源码编译[OnePlus6][LineageOS16.0]

一、系统环境:

ubuntu16.04LTE + 16G RAM

二、编译环境

sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip

三、代码下载

3.1.下载 repo 工具:

mkdir ~/bin
PATH=~/bin:$PATH
curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo > ~/bin/repo
chmod a+x ~/bin/repo

3.2.下载代码:

3.2.1 初始化repo

mkdir -p ~/android/lineage
cd ~/android/lineage
repo init -u https://github.com/LineageOS/android.git-b lineage-16.0

3.2.2  由于里面的默认是从google的服务器下载,国内墙的原因,更改为tuna源,修改如下:

vim .repo/manifests/default.xml

打开之后把下面内容

<remote name="github"
        fetch=".."
        review="review.lineageos.org" />

<remote name="private"
        fetch="ssh://git@github.com" />

<remote name="aosp"
        fetch="https://android.googlesource.com"
        review="android-review.googlesource.com"
        revision="refs/tags/android-9.0.0_r35" />

<default revision="refs/heads/lineage-16.0"
        remote="github"
        sync-c="true"
        sync-j="4" />

修改为

<remote  name="github"
           fetch="https://github.com/" />

 <remote  name="lineage"
           fetch="https://mirrors.tuna.tsinghua.edu.cn/git/lineageOS/"
           review="review.lineageos.org" />

  <remote  name="private"
           fetch="ssh://git@github.com" />

  <remote  name="aosp"
           fetch="https://aosp.tuna.tsinghua.edu.cn"
           review="android-review.googlesource.com"
           revision="refs/tags/android-9.0.0_r35" />

  <default revision="refs/heads/lineage-16.0"
           remote="lineage"
           sync-c="true"
           sync-j="4" />

3.3.同步代码

repo sync

3.4.下载设备相关的代码(驱动等硬件设备相关的)

source build/envsetup.sh
breakfast enchilada

3.5.从设备导出vendor下该手机特有的内容

把Root过的手机,通过usb连接电脑,adb连接正常,执行下面的脚本

cd ~/android/lineage/device/oneplus/enchilada
./extract-files.sh

四.编译

croot
brunch enchilada

croot是回到代码根目录。

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值