Skip to content

天楚锐齿

人工智能 云计算 大数据 物联网 IT 通信 嵌入式

天楚锐齿

  • 下载
  • 物联网
  • 云计算
  • 大数据
  • 人工智能
  • Linux&Android
  • 网络
  • 通信
  • 嵌入式
  • 杂七杂八

使用GitBash同步android AOSP源码以及使用国内镜像来做本地AOSP镜像

2020-09-19

通过国内Android AOSP镜像来做本地镜像:

参考(国内清华和中科大两个镜像站点的地址):
https://mirrors.tuna.tsinghua.edu.cn/help/AOSP/
https://lug.ustc.edu.cn/wiki/mirrors/help/aosp/

先安装git。

配置缓存大小为1GB-1:
# git config –global https.postBuffer 1073741823
# git config –global http.postBuffer 1073741823
# git config –global git.postBuffer 1073741823
配置git用户信息:
# git config –global user.name “Max Shu”
# git config –global user.email “maxshu_cn@163.com”

安装repo:

# curl https://storage.googleapis.com/git-repo-downloads/repo > ~/repo
# sudo mv ~/repo /bin/repo
# sudo chmod a+x /bin/repo

镜像并同步:

# mkdir /AOSP_mirror
# cd /AOSP_mirror
# repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest –mirror –repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo
或者:# repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/aosp/mirror/manifest –mirror
# repo sync
执行多次,一直到同步完成(以后需要定期同步)。
查看一下从哪里镜像过来的:
# vi .repo/manifests.git/config
[remote “origin”]
        url = git://mirrors.ustc.edu.cn/aosp/platform/manifest
        fetch = +refs/heads/*:refs/remotes/origin/*

做本地git://镜像:

# yum install git-daemon
# git daemon –verbose –export-all –base-path=/AOSP_mirror
测试下:
(到别的目录或机器执行克隆)$ git clone git://172.18.1.23/device/google/bonito-kernel
启动到后台(默认端口为9418):
# git daemon –verbose –export-all –base-path=/AOSP_mirror  –detach

到其他机器上测试:

$ repo init -u git://172.18.1.23/platform/manifest –repo-url=https://mirrors.tuna.tsinghua.edu.cn/git/git-repo
$ repo sync

替换已有代码里面的https://镜像为git方式:

$ vi .repo/manifests.git/config
[remote “origin”]
#       url = http://aosp.tuna.tsinghua.edu.cn/platform/manifest
        url = git://172.18.1.23/platform/manifest
        fetch = +refs/heads/*:refs/remotes/origin/*
或者:
$ git config –global url.git://172.18.1.23/.insteadof    https://android.googlesource.com
$ git config –global url.git://172.18.1.23/.insteadof    http://android.googlesource.com
少量的则可以修改android AOSP的url为国内镜像的来下载也可以:
$ git config –global url.https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/.insteadof    https://android.googlesource.com

使用GitBash同步Adnroid的AOSP源码:

必须使用系统管理员方式打开GitBash。

设置代理,以便能访问adnroid aosp网站:

$ export http_proxy=”127.0.0.1:1080″
$ export https_proxy=”127.0.0.1:1080″

安装repo:

$ mkdir aosp
$ cd aosp
$ wget https://storage.googleapis.com/git-repo-downloads/repo
$ chmod a+x ./repo

配置缓存大小:

$ git config –global https.postBuffer 2147483648
$ git config –global http.postBuffer 2147483648

初始化是否能行:

$ ./repo init -u https://android.googlesource.com/platform/manifest
如果pgp校验出错(gpg: keyblock resource ‘/e/Work/AOSP_mirror/.repo/repo/C:\Users\maxsh/.repoconfig\gnupg/pubring.kbx’: No such file or directory):
$ cd .repo/
$ git clone https://gerrit.googlesource.com/git-repo
$ rm -rf repo/
$ mv git-repo repo
$ cd ..

重新初始化:

$ ./repo init -u https://android.googlesource.com/platform/manifest

同步:

$ ./repo sync
可能执行多次,一直到同步完成。
2,512次阅读

Post navigation

前一篇:

Android9下用ethernet 的Tether模式来做路由器功能

后一篇:

Android下的socket怎么区分不同Network的

1条评论

  1. maxshu说道:
    2020-09-19 12:01

    这个好

    登录以回复

回复 maxshu 取消回复

要发表评论,您必须先登录。

个人介绍

需要么,有事情这里找联系方式:关于天楚锐齿

=== 美女同欣赏,好酒共品尝 ===

微信扫描二维码赞赏该文章:

扫描二维码分享该文章:

分类

  • Linux&Android (81)
  • Uncategorized (1)
  • 下载 (28)
  • 云计算 (38)
  • 人工智能 (9)
  • 大数据 (35)
  • 嵌入式 (34)
  • 杂七杂八 (35)
  • 物联网 (65)
  • 网络 (25)
  • 通信 (22)

归档

近期文章

  • 飞书机器人发送卡片interactive消息
  • Springboot JPA实现对数据库表统一的增删改查
  • WEB的内容安全策略CSP(Content-Security-Policy)
  • CSS利用@media和viewport实现响应式布局自动适配手机电脑等
  • VUE前端增加国际化支持

近期评论

  • linux爱好者 发表在《Linux策略路由及iptables mangle、ip rule、ip route关系及一种Network is unreachable错误》
  • maxshu 发表在《使用Android的HIDL+AIDL方式编写从HAL层到APP层的程序》
  • Ambition 发表在《使用Android的HIDL+AIDL方式编写从HAL层到APP层的程序》
  • Ambition 发表在《使用Android的HIDL+AIDL方式编写从HAL层到APP层的程序》
  • maxshu 发表在《Android9下用ethernet 的Tether模式来做路由器功能》

阅读量

  • 使用Android的HIDL+AIDL方式编写从HAL层到APP层的程序 - 23,616次阅读
  • 卸载深信服Ingress、SecurityDesktop客户端 - 18,308次阅读
  • 车机技术之车规级Linux-Automotive Grade Linux(AGL) - 10,429次阅读
  • linux下的unbound DNS服务器设置详解 - 9,133次阅读
  • 在Android9下用ndk编译vSomeIP和CommonAPI以及使用例子 - 9,007次阅读
  • linux的tee命令导致ssh客户端下的shell卡住不动 - 8,509次阅读
  • 车机技术之360°全景影像(环视)系统 - 8,024次阅读
  • Linux策略路由及iptables mangle、ip rule、ip route关系及一种Network is unreachable错误 - 8,016次阅读
  • 车机技术之Android Automotive - 7,884次阅读
  • Windows下安装QEMU并在qemu上安装ubuntu和debian - 7,754次阅读

其他操作

  • 注册
  • 登录
  • 条目 feed
  • 评论 feed
  • WordPress.org

联系方式

地址
深圳市科技园

时间
周一至周五:  9:00~12:00,14:00~18:00
周六和周日:10:00~12:00

标签

android AT命令 CAN centos docker Hadoop hdfs ip java kickstart linux mapreduce mini6410 modem nova OAuth openstack os python socket ssh uboot 内核 协议 安装 嵌入式 性能 报表 授权 操作系统 数据 数据库 月报 模型 汽车 深信服 源代码 统计 编译 脚本 虚拟机 调制解调器 车机 金融 鉴权
© 2025 天楚锐齿