如果因为代理方式下载aosp代码出现异常,可以用如下方法解决,备忘
1)新建一个ropo
curl http://mirrors.tuna.tsinghua.edu.cn/git/git-repo > ~/bin/repo_aosp
chmod a+x ~/bin/repo_aosp
2)https->http
export REPO_URL='http://mirrors.tuna.tsinghua.edu.cn/git/git-repo'
repo_aosp init -u http://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest -b android-11.0.0_r35
3)
export http_proxy=http://xxx.com:8080
export https_proxy=https://xxx.com:8080
repo init -u http://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest -b android-12.0.0_r10 --no-repo-verify --repo-branch=stable --repo-url=http://mirrors.tuna.tsinghua.edu.cn/git/git-repo
上述3条命令在()亲测成功,注意去掉repo init中的所有https,改成http
4)github代码下载方法
git clone http://github.com/coolsnowwolf/lede --config "http.proxy=http://xxx:xxx@proxy.xxxx.com:8080"
设置代理方式:git config --global http.proxy xxx:xxxxxx@http://proxy.xxx.com:8080
取消代理方式:git config --global --unset http.proxy
全局代理
export http_proxy="xxxxx"
vim ~/.bashrc
http_proxy=http://yourproxyaddress:proxyport
wget代理方式(curl怎么加代理还没搞明白)
vi ~/.wgetrc
http_proxy = http://proxy.xxx.com:8080
https_proxy = https://proxy.xxx.com:8080
proxy_user = username
proxy_password = password
use_proxy = on
wait = 15
下载github代码编译方法:
1. git clone改为http
2. feeds.conf.default中feed源改为http
3. vi ~/.wgetrc,增加wget代理,这个是支持https的
4. 愉快的编译
repo init 常见错误解决方案
错误1
SyntaxError: invalid syntax
解决方案:
curl http://mirrors.tuna.tsinghua.edu.cn/git/git-repo > ~/bin/repo
chmod +x ~/bin/repo
PATH="${HOME}/bin:${PATH}"
错误2
error.GitError: manifests rev-list ('^ca277d1d6b8d2f1f64dd8423401df0382f554d12', 'HEAD', '--'): fatal: bad revision 'HEAD'
解决方案:rm -rf .repo/manifest*