Building Nexus/ (tilapia) kernel from source

89 views
Skip to first unread message

Domenico Pastore

unread,
Apr 4, 2014, 10:44:48 AM4/4/14
to android-...@googlegroups.com
I'm trying to build the kernel for the nexus 7 from source.
I currently downloaded to a path on my PC sources taken from https://android.googlesource.com/kernel/tegra/
On the internet, I can not find a tutorial specific to the Nexus 7, my problem is that I do not understand how to checkout the correct version of the kernel from git.
How do I make the correct version of the kernel?

Glenn Kasten

unread,
Apr 4, 2014, 10:55:25 AM4/4/14
to android-...@googlegroups.com
If you have not already done so, please read this article:
Then please post any specific follow-up questions.

Domenico Pastore

unread,
Apr 4, 2014, 11:13:51 AM4/4/14
to android-...@googlegroups.com
When I try to do "git log --max-count=1 kernel" i get the following error:"fatal: ambiguous argument 'kernel': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'"

Dave Turvene

unread,
Apr 4, 2014, 4:41:11 PM4/4/14
to android-...@googlegroups.com
On Friday, April 4, 2014 11:13:51 AM UTC-4, Domenico Pastore wrote:
When I try to do "git log --max-count=1 kernel" i get the following error:"fatal: ambiguous argument 'kernel': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'"

Yes, the google kernel engineers have gotten away from that convention in the last six months or so.  This use to be the case when they would checkin a kernel to the AOSP branch and  enter a comment like (I build for grouper):

    grouper: update kernel prebuilt
    
  1e8b3d8 ashmem: avoid deadlock between read and mmap calls

So you could do a "git checkout 1e8b3d8" and get the correct kernel.  I haven't seen anything like this in a while.  So how do you figure out the kernel for your AOSP branch?  

The easiest way is to cat /proc/version on a running device.   Look for "3.X.Xxxx-g< commit>", which should be a 7-digit hex number.  Do a 

The second easiest way is to use the "dd" command in the "Identifying Kernel Version" section.  I had to add an "-m 1" option to grep because there was more than one matches.

The third easiest way is to go to https://android.googlesource.com/device/asus/tilapia/log and search for the most recent kernel checkin.  Here's an example of what you're looking for:


The kernel *should* always be built with scm id (see setlocalversion in the kernel tree) so that will always be in the image.  Good luck!
Reply all
Reply to author
Forward
0 new messages