AOSP 存储库同步时间太长 [英] AOSP repo sync takes too long

查看:47
本文介绍了AOSP 存储库同步时间太长的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从同名的书中学习嵌入式 Android.并且作者建议使用 AOSP 姜饼分支.于是我跟着去下载源码:

I'm trying to learn Embedded Android from the book with the same name. And the author suggested working with AOSP gingerbread branch. So I followed to download the source:

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

$ repo sync

但是时间太长了.同样从输出来看,在我看来,它还从其他分支下载源代码(我看到 android-5 .....),这不是我想要的.我想知道这是否是需要这么长时间的原因.

But it's taking too long. Also from the output, it seems to me like it's also downloading source code from other branches (I see android-5.....) which is not what I want. I'm wondering if that's the reason why it takes so long.

有人遇到过同样的问题吗?请给我一个建议!谢谢!

Has anybody had the same problem? Please give me a suggestion! Thanks!

推荐答案

AOSP 一个数千兆字节的下载,因此您无能为力.但是,将 -c/--current-branch 选项传递给 repo sync 会导致 Repo 告诉 Git 只获取您真正需要的分支而不是每个存储库的所有分支.对于像 Gingerbread 这样的旧版本,理论上这应该是非常有益的.但是,Repo 使用它通过 HTTP 下载的 Git 包为存储库提供种子,并且包文件不受 -c 选项的影响.使用 --no-clone-bundle 禁用捆绑文件.因此,以下 Repo 命令应该产生最小的下载量:

AOSP is a multi-gigabyte download so there's not that much you can do. However, passing the -c/--current-branch option to repo sync causes Repo to tell Git to only fetch the branch you really need instead of all branches of each repository. With an old release like Gingerbread this should theoretically be quite beneficial. However, Repo seeds the repositories with Git bundles that it downloads via HTTP, and the bundle files aren't affected by the -c option. Using --no-clone-bundle disables the bundle files. Hence the following Repo command should yield the smallest download:

repo sync -c --no-clone-bundle

(请记住,Gingerbread 是几年前的版本.它在许多最新的硬件上都无法开箱即用.)

(Keep in mind that Gingerbread is a several year old release. It won't work out of the box on a lot of recent hardware.)

这篇关于AOSP 存储库同步时间太长的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆