#1. 安装Git
# ubuntu系统直接使用sudo apt-get install git-core就能完成安装。
# 安装完成之后可以顺便配置一下个人信息:
git config --global user.email "youremail@xxx.com"
git config --global user.name "Your Name"
#2. 设置环境变量和repo安装目录
# 将下载repo的路径加入环境变量
mkdir ~/bin
vim ~/.bashrc
+export PATH=~/bin:$PATH
source ~/.bashrc
#3. repo工具的安装
###网上已知可以下载repo的网址
#1. git clone https://gerrit-googlesource.lug.ustc.edu.cn/git-repo (Try OK)
#2. git clone https://aosp.tuna.tsinghua.edu.cn/tools/repo (Try OK)
#4. 建立工作目录 && 初始化仓库
建立工作目录:
mkdir sourcecode && cd sourcecode
初始化仓库:
repo init -u git://codeaurora.org/quic/qsdk/releases/manifest/qstak -b release \
-m caf_AU_LINUX_QSDK_NHSS.QSDK.11.1_TARGET_ALL.12.0.4170.001.4476.xml \
--repo-url=https://gerrit-googlesource.lug.ustc.edu.cn/git-repo
#5. repo sync同步下载
repo sync -j8 --no-tags -qc #一般是这样用的。
#6. 加快repo下载速度 - 建立本地mirror-(待尝试)
### 初始化本地mirror
mkdir /home/mirror && cd /home/mirror //注意首次初始化mirror需在一个空目录下
repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest \
-b android-4.0.1_r1 \
--repo-url=https://aosp.tuna.tsinghua.edu.cn/tools/repo \
--mirror
这样就初始化好本地镜像了。然后执行repo sync命令。网络不好的情况请多执行 repo sync 几次。
repo sync -cdj 4 --no-tags
### 下载sourcecode时使用本地mirror
cd {DIR}/sourcecode
repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest \
-b android-4.0.1_r1 \
--repo-url=https://aosp.tuna.tsinghua.edu.cn/tools/repo \
--reference /home/mirror
repo sync -cdj 4 --no-tags
#7. 总结
初次使用repo下载sdk,各种注意点尚未完善,以待日后补全。
#8. 参考博客
感谢:
[1] Android下的配置管理之道之repo的使用 - 马哥私房菜
[2] repo下载QSDK代码全记录 - openwrt技术开发网