lineageOS上编译lineageOS
首先列出参考资料:
清华镜像源:https://mirrors.tuna.tsinghua.edu.cn/help/lineageOS/
编译官方教程:https://wiki.lineageos.org/devices/sagit/build
摘取Vender相关代码链接https://blog.csdn.net/yusakul/article/details/103270156
1,首先要安装相关库文件:
bc bison build-essential ccache curl flex g++-multilib gcc-multilib git gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-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
记得安装openJDK1.8哦。
2,repo的安装
repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/lineageOS/LineageOS/android.git -b cm-14.1 --repo-url=https://gerrit-googlesource.lug.ustc.edu.cn/git-repo
git config --global user.email "286095742@qq.com"
git config --global user.name "rubin"
更改相关源到清华源
使用文本编辑器打开.repo/manifest.xml
vim .repo/manifest.xml
修改以下内容
将<remote name="github" fetch=".."改成
<remote name="github" fetch="https://mirrors.tuna.tsinghua.edu.cn/git/lineageOS/"
将<remote name="aosp" fetch="https://android.googlesource.com"改成
<remote name="aosp" fetch="https://aosp.tuna.tsinghua.edu.cn"
这里跟清华源镜像里写的不一样,我们先这样改,再同步,之后会报一些项目找不到。这时个,你就把aosp再改为谷歌源就可以了。改动如下:
将<remote name="aosp" fetch="https://aosp.tuna.tsinghua.edu.cn"改成
<remote name="aosp" fetch="https://android.googlesource.com"
同步:
repo sync -f -c -j4
漫长的等待。之后报错了。
只要把aosp源重新改回谷歌源,再同步就可以了。
源码上用breakfast sagit,在我们这边是无法用的,我们需要手动拉取device相关文件
1,在项目源码目录下的device目录下,新建一个目录xiaomi
然后在xiaomi目录下同步2个仓库代码
git clone https://github.com/LineageOS/android_device_xiaomi_sagit.git sagit -b cm-14.1
git clone https://github.com/LineageOS/android_device_xiaomi_msm8998-common.git msm8998-common -b cm-14.1
然后需要下载一个835机型的内核源码
源码目录下的kernel目录下新建目录xiaomi,然后再xiaomi目录下执行代码
git clone https://mirrors.tuna.tsinghua.edu.cn/git/lineageOS/LineageOS/android_kernel_xiaomi_msm8998.git msm8998 -b cm-14.1
项目还需要依赖一个android_packages_resources_devicesettings 也需要同步
在源码目录下的packages目录下新建目录resources,然后在resources目录下执行
git clone https://github.com/LineageOS/android_packages_resources_devicesettings.git -b cm-14.1 devicesettings
网友评论