一、安装repo
1. mkdir ~/bin //创建目录
2. PATH=~/bin:$PATH //给repo添加临时环境变量,如果重新开终端要重新添加
3. 下载repo:http://download.csdn.net/detail/enjosun/8068347
4. cp repo_ ~/bin //拷贝到创建的目录下
5. curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
(如果不行的话用中科大的源 curl http://mirrors.ustc.edu.cn/apt.dockerproject.org/repo > ~/bin/repo)
6. chmod u+x ~/bin/repo //给权限
二、同步android源码
1.
mkdir -p $HOME/devel/optee
2. cd $HOME/devel/optee
3.
repo init -u https://github.com/OP-TEE/manifest.git -m default.xml -b master
4. repo sync
(如果不行的话换一种初始化方式repo init -u https://github.com/OP-TEE/manifest.git -m default.xml --repo-url=git://codeaurora.org/tools/repo.git)
提示repository not found,仔细观察发现url后面是" .git.git ",所以gedit .repo/manifest.xml,把所有.git删掉
由于国内的网络有问题,所以同步的时候经常会崩溃,显示
fatal: The remote end hung up unexpectedly fatal: 过早的文件结束符(EOF)这时候你就要不断重复repo sync
建议在optee目录下写个sh脚本
- #!/bin/bash
- echo ¨================start repo sync===============¨
- repo sync -f -j10
- while [ $? == 1 ]; do
- echo ¨================sync failed, re-sync again=============¨
- sleep 3
- repo sync -f -j10 done