0

I've just cloned the Android kernel (via git clone) repository but for some reason, none of the source files are there. Instead there is just a massive .git folder, which I think has the kernel source code in it. How do I 'unpack' that git repository so I can get a workable source tree?

  • The exact command I've used was git clone git://android.git.kernel.org/kernel/common.git android-kernel.

  • git config core.bare returns false

  • git branch returns * master

  • git checkout master returns Already on 'master

The files seem to be there but they are packed. I really don't care about preserving integrity of the repository, I just want the source tree, without any of that stupid git crap.

Charles
  • 50,943
  • 13
  • 104
  • 142
Kristina
  • 15,859
  • 29
  • 111
  • 181
  • Can your provide the exact command you used to clone the repository? Also, in the repository, can you post the output of `git config core.bare`? – Noufal Ibrahim Dec 09 '11 at 13:37
  • Can you try checking out some branch and see if that creates some files? Or what does `git branch` return? – poke Dec 09 '11 at 13:58
  • possible duplicate of [Android 4.0 kernel source code?](http://stackoverflow.com/questions/8447794/android-4-0-kernel-source-code) – Mr_and_Mrs_D Oct 16 '13 at 20:38

2 Answers2

1

Old question, but - The answer above is, indeed, incorrect. You have to cd to the directory you've cloned, then run git branch -a, and checkout the relevant one:

bash-3.2# git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/android-2.6.39
  remotes/origin/android-3.0
  remotes/origin/android-3.3
  remotes/origin/android-3.4
  remotes/origin/android-3.4-compat
  remotes/origin/coupled-cpuidle
  remotes/origin/experimental/android-3.8
  remotes/origin/experimental/android-3.9-rc2
  remotes/origin/linux-bcm43xx-2.6.39
  remotes/origin/master

Then:

bash-3.2# git checkout android-3.4
Checking out files: 100% (38819/38819), done.
Branch android-3.4 set up to track remote branch android-3.4 from origin.
Switched to a new branch 'android-3.4'

Then, at last:

bash-3.2# ls
.git        Documentation   README      drivers     ipc     samples     usr
.gitignore  Kbuild      REPORTING-BUGS  firmware    kernel      scripts     virt
.mailmap    Kconfig     arch        fs      lib     security
COPYING     MAINTAINERS block       include     mm      sound
CREDITS     Makefile    crypto      init        net     tools
Technologeeks
  • 7,674
  • 25
  • 36
1

In android they use their own tooling which uses git under the hood:

I am not sure how to get a kernel built working if you directly clone git repo, for their own tooling here are the docs: http://source.android.com/source/downloading.html

Daniel Kurka
  • 7,973
  • 2
  • 24
  • 43