Cirno 发表于 2018-4-21 09:58:45

同步LineageOS源码,无需科学上网

本帖最后由 Cirno 于 2018-5-13 12:07 编辑

#如果你的机型有lineageos官方适配,并不推荐编译
#需要linux环境
#2018.5.13

一、安装Repo

1.新建目录:
mkdir ~/bin

2.下载repo
清华源:
curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo > ~/bin/repo

科大源:
curl https://storage-googleapis.proxy.ustclug.org/git-repo-downloads/repo > ~/bin/repo

3.设置权限:
chmod a+x ~/bin/repo

4.添加到path变量:
PATH=~/bin:$PATH


二、同步源码

1.cd到要同步的目录

2.初始化2.查看LineageOS远程分支
git --git-dir=.repo/manifests/.git/ branch -a
repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/lineageOS/LineageOS/android.git -b 要同步的分支(注意)分支为origin/之后的字符

3.修改到国内镜像站(可选)

3.1使用文本编辑器打开.repo/manifest.xml
vim .repo/manifest.xml

3.2修改以下内容

<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"

4.同步源码
repo sync -f -c -j8



admin 发表于 2018-4-21 14:21:40

挺好的文章,就是粘贴过来的时候,先在记事本里粘贴一遍,把格式去掉,然后自己重新设置一遍格式。
否则样式就乱了。:lol

Cirno 发表于 2018-4-21 18:04:15

admin 发表于 2018-4-21 14:21
挺好的文章,就是粘贴过来的时候,先在记事本里粘贴一遍,把格式去掉,然后自己重新设置一遍格式。
否则样 ...

大部分靠自己脑子编的耶

zzs20020430 发表于 2018-10-20 21:39:13

感谢分享!

Aleaf 发表于 2018-10-31 12:24:00

我感觉到好难

redhunter 发表于 2019-1-3 22:50:06

多谢楼主分享!!

生化之魂 发表于 2020-1-21 09:53:04

谢谢分享

pcy190 发表于 2020-3-26 14:37:47

感谢分享~~~~

jysxs 发表于 2020-12-28 09:06:42

感谢分享!谢谢:)

刘鞭教授 发表于 2022-7-3 21:49:05

谢谢分享
页: [1]
查看完整版本: 同步LineageOS源码,无需科学上网