如何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
相关推荐
b20772115 分钟前
Flutter for OpenHarmony 身体健康状况记录App实战 - 个人中心实现
android·java·python·flutter·harmonyos
天才少年曾牛1 小时前
【无标题】
android·frameworks
2601_949575862 小时前
Flutter for OpenHarmony二手物品置换App实战 - 自定义组件实现
android·javascript·flutter
、BeYourself2 小时前
动作栏 (ActionBar) 与工具栏 (Toolbar) 的基本使用
android·android-studio
zfoo-framework2 小时前
kotlin
android·开发语言·kotlin
峥嵘life2 小时前
Android16 EDLA【CTS】CtsNetTestCases存在fail项
android·java·linux·学习·elasticsearch
weixin_403810132 小时前
EasyClick iOS自动化代理IPA挂了 如何再次启动?
android·ios·自动化
银河系栋梁3 小时前
Android AIDL理解
android·运维·服务器
掘根3 小时前
【jsonRpc项目】Dispatcher模块
android·网络
独行soc3 小时前
2026年渗透测试面试题总结-10(题目+回答)
android·网络·python·安全·web安全·渗透测试·安全狮