尝试在清华源下载openthos源码

本文介绍如何使用repo工具从清华大学镜像站点同步AOSP(Android Open Source Project)源码,并解决过程中可能出现的gpg密钥问题及连接超时等问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

安装git gnupg gnupg2

相关链接

https://mirrors.tuna.tsinghua.edu.cn/help/openthos-src/

https://mirrors.tuna.tsinghua.edu.cn/help/git-repo/

https://mirrors.tuna.tsinghua.edu.cn/help/AOSP/


1下载repo

curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo -o repo
chmod +x repo


2修改repo

编辑repo 把

REPO_URL = 'https://gerrit.googlesource.com/git-repo' 修改为

https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/


3 repo init 初始化仓库 

repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/openthos-src/manifest -b marshmallow-x86

出现

gpg: keyblock resource '/home/iamhuskar/.repoconfig/gnupg/pubring.kbx': No such file or directory
gpg: no writable keyring found: Not found
gpg: error reading '[stdin]': General error
gpg: import from '[stdin]' failed: General error
gpg: Total number processed: 0

fatal: registering repo maintainer keys failed

记得安装gnupg 和gnupg2

git出现问题配置

git config --global user.email "you@example.com

git config --global user.name "Your Name"


4 执行 repo sync --no-tags --no-clone-bundle

Fetching project platform/external/flac
Fetching project platform/external/jsilver
Fetching project platform/external/apache-harmony
Fetching project platform/external/srtp
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:--  0:01:00 --:--:--     0

会开始下载一些资源。待会儿又会出现无法从google取得源的情况

fatal: unable to access 'https://android.googlesource.com/platform/external/srtp/': Connection timed out after 300048 milliseconds
fatal: unable to access 'https://android.googlesource.com/platform/external/apache-harmony/': Connection timed out after 300017 milliseconds
fatal: unable to access 'https://android.googlesource.com/platform/external/jsilver/': Connection timed out after 300017 milliseconds
fatal: unable to access 'https://android.googlesource.com/platform/external/flac/': Connection timed out after 300022 milliseconds

error: Cannot fetch platform/external/apache-harmony


此时要修改xml数据里面的


把所有的

https://android.googlesource.com/

修改为https://aosp.tuna.tsinghua.edu.cn/

再次执行repo sync --no-tags --no-clone-bundle

遇到的404 以及bundle错误都可以忽略

如果出现 exit due to fetch error 可以试试在repo加入 -f命令



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值