如何30分钟下载完368G的Android系统源码?

如何30分钟下载完368G的Android系统源码?

Android系统开发的一个痛点问题就是Android系统源码庞大,小则100G,大则,三四百G。如标题所言,本文介绍通过局域网高速网速下载源码的方法。

制作源码mirror

从源码git服务器A,下载到服务器B(serverB),制作一个镜像(A->B):

shell 复制代码
serverB# cd /serverB/AOSP
serverB# repo init -u [源码manifests的地址] -b  [manifests分支]  -m [manifests xml配置名] --mirror  --no-repo-verify
serverB# repo sync -j8  --force-sync

下载好后,这个目录和普通的源码结构不一样,以文件git项目为基本元素。

shell 复制代码
 repo.git 
 abc.git 
 adb1.git 
 abc2.git 
 ...

从mirror局域网下载源码

  1. 使用sshfs挂载B服务器的mirror地址到C服务器

    如果不存在sshfs,可使用apt-get install sshfs 下载

    shell 复制代码
    serverC# mkdir sshfs_mount_points
    serverC# sshfs account@serverB:/serverB/AOSP ./sshfs_mount_points/ ; [输入密码]
  2. C服务器使用mirror下载到本地

    shell 复制代码
    serverC# repo init -u [源码manifests的地址] -b  [manifests分支]  -m [manifests xml配置名] --reference=$(pwd)/sshfs_mount_points/  --dissociate --no-repo-verify
    
    serverC# repo sync -j8  --force-sync
    
    # 开始下载。。。 网速100-200M/s
    
    # 下载完
    serverC# umount sshfs_mount_points
相关推荐
我不会插花弄玉9 小时前
7.函数【由浅入深-MySQL】
android·数据库·mysql
vilya10 小时前
手机端 Agent 怎么动起来:Kotlin 与 Python 之间的桥
android·agent
高晶10 小时前
Android 新手实战:从零搭建 WebRTC 在线直播系统
android·程序员
alexhilton10 小时前
为什么你的 LazyColumn 仍然卡顿
android·kotlin·android jetpack
>Andre<11 小时前
系统架构全景
android
hai_android15 小时前
Android 嵌套滑动冲突:内部拦截 vs 外部拦截实战
android·android studio·android jetpack
木子欢儿17 小时前
Zabbix 7.4 Alpine 版 Docker Compose 部署
android·运维·docker·容器·zabbix
素师良码18 小时前
第9篇:Android驱动踩坑实录:DSI RX FIFO前置脏0、数据错位复盘
android
夜雪一千18 小时前
如何在MySQL中实现字段级加密
android·数据库·mysql
夜雪一千18 小时前
MySQL 如何存储经纬度坐标:选型、建表、空间查询实战
android·mysql·adb