AOSP repo sync takes too long

我与影子孤独终老i 提交于 2019-11-27 09:53:26

问题


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

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!


回答1:


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

(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.)




回答2:


You should use this commands:

Example: for my personal AOSP Repo,

repo init --depth=1 -u https://github.com/zawzaww/aosp-android.git -b android-8.1.0

and then,

repo sync  -f --force-sync --no-clone-bundle --no-tags -j$(nproc --all)

You can learn more on my GitHub Repo




回答3:


repo sync -c --no-tags --no-clone-bundle -j2

Shortens my sync times greatly.




回答4:


repo init --depth 1

This is another option that might improve sync speed, as it should only download the latest version of the repos.

See also: https://superuser.com/questions/603547/how-can-i-limit-the-size-of-the-android-source-i-need-to-download-with-repo-syn

Here are my full test commands: How to compile the Android AOSP kernel and test it with the Android Emulator?



来源:https://stackoverflow.com/questions/28379870/aosp-repo-sync-takes-too-long

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!