首先是repo的配置过程
1、根目录下创建.bin文件夹
mkdir ~/.bin
2、配置为临时环境变量(也可配置为永久的)
PATH=~/.BIN:$PATH
3、下载repo
git clone https://gerrit-googlesource.lug.ustc.edu.cn/git-repo
4、将git-repo中的repo文件复制到步骤1中创建的.bin目录中
5、修改权限
chmod a+x ~/.bin/repo
6、创建同步源码的工作目录
mkdir android_source
7、在工作目录中创建.repo目录
cd android_source
mkdir .repo
8、将下载的git-repo拷贝到.repo下,并改名为repo
9、配置完成
修改REPO_URL,在已加入系统环境变量的.bin文件夹中有一个repo文件,打开,将REPO_URL=后的内容进行修改,如下:
REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'
修改完成之后,初始化仓库:
repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest
我现在要下的是Android7.0版本:
repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-7.0.0_r1
最后同步源码树
repo sync
最烦人的问题就是REPO_URL一直无法连接,换成清华镜像之后得以解决