Download Android kernel source code

2020-07-22 18:32发布

问题:

I have been trying to download goldfish kernel source code but no luck.

Upon hitting the following command I end up with the source code of sized 1GB:

git clone https://android.googlesource.com/kernel/common

However we I pressed on following command,

git checkout -t origin/android-goldfish-2.6.29 -b goldfish

it prompt me:

Fatal error: git repository not found.

Even though,

git branch -r

is also giving me same error.

回答1:

git clone git://android.git.kernel.org/kernel/common.git

and then

cd common  ==============>>> this is the step u missed.

git branch -a 

git checkout -t  remotes/origin/android-2.6.38 -b mygoldfish2_6_38 

git branch -r 

git checkout -t  origin/android-2.6.35 -b mygoldfish_2_6_35

and then the following command gives:

git branch
  android-2.6.36
  mygoldfish2_6_38
* mygoldfish_2_6_35


回答2:

Well if you just need the source, but not local git repo, then just take a snapshot that you need, i.e. this one.
Similary you can download any git tree snapshot, just notice tags links over the https://android.googlesource.com