Stock Android OS downloading [AOSP] and sync issue

风格不统一 提交于 2020-01-25 21:27:49

问题


I have started my AOSP download with lot of hiccups. I followed the google official site instructions.

$ mkdir ~/aosp/bin

$ PATH=~/aosp/bin:$PATH

$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/aosp/bin/repo

$ chmod a+x ~/aosp/bin/repo

$ mkdir zero

$ cd zero

$ git config --global user.name "Your Name"

$ git config --global user.email "you@example.com

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

$ repo sync -j2 -f

As of now my .repo folder is 40GB and sync is still on its been 2 days. Please can anybody help me, all I need is KitKat OS. Also could anyone enlighten me about project-object and project directories in repo directory.

Thanks in advance


回答1:


When you do:

 repo sync -j2 -f

You are synchronizing everything, which is huge. Give this a try:

 repo sync -j8 -c

This will only synch the initialized manifest, which is not as big. When you don't specify a manifest name with -m option, if falls to look for default.xml, which as I can see in https://android.googlesource.com/platform/manifest/+/refs/heads/android-4.4.2_r1 that's the manifest file for the branch you want.

Also -j specifies the threads used, nowadays you can give -j8 at least a try.

With -f you force the download, this does not affect on the size of what you download, nor the speed. You can drop it if desired.

Hope it helps!




回答2:


After a week's struggle completed the repo sync of KITKAT OS from google. even though you select only a particular OS, It will go upto 58 GB. Out of that 58 GB your KITKAT OS will be only of 9.5 GB. Rest is your .repo in your WORKING DIRECTORY. After sync is complete you will find your OS source in your WORKING DIRECTORY along side .repo.

STEPS:

$ mkdir ~/bin

$ PATH=~/bin:$PATH

$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo

$ chmod a+x ~/bin/repo

$ mkdir WORKING_DIRECTORY

$ cd WORKING_DIRECTORY

$ git config --global user.name "Your Name"

$ git config --global user.email "you@example.com"

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

check with google's "source code tags and build" page to select your OS version.

$ repo sync -j18 -c

flags that can be used with repo sync

sync-j - The value for this will be the number of threads to use when syncing the system. Parallelization helps get the job done quicker, but could also get the computer or the network stuck. Using 4 threads is what commonly used for syncing.

sync-c - syncing only the current branch/tag from git. This will checkout for each project only the current branch/tag that we specify for it, and not any other branches that exists on the repository. This will help save some space and bandwidth (and also time), but if you’ll need to switch between branches on a specific project later on - you’ll need to fetch it manually.

it took 8 days for me to get this done as my internet speed is slow (100kbps).

Thank you @Olaia for all the help. hope this helps for anyone out there.



来源:https://stackoverflow.com/questions/42642929/stock-android-os-downloading-aosp-and-sync-issue

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