Post Reply

[Guide] Building from sources [Kernel only for now]

OP cdesai

9th November 2012, 10:11 AM   |  #1  
cdesai's Avatar
OP Recognized Developer
Flag IN YOUR HEAD
Thanks Meter: 4,009
 
2,281 posts
Join Date:Joined: Jan 2011
Donate to Me
More
Hello everyone.

This guide will help you in building a kernel from source for your Nexus 10

Later, when 4.2 hits AOSP, i'll add a guide for building that too

You will need a computer running Linux / OSX to build the kernel, natively, or via a VM.
This guide assumes you’re running any Linux distro.

Getting a toolchain:
You need a toolchain to build the kernel.
The preferred one is Google’s toolchain, the same they use to build AOSP.

In a terminal, type:
Code:
git clone https://android.googlesource.com/pla...droideabi-4.6/
export PATH=$PATH:$(pwd)/arm-linux-androideabi-4.6/bin
export CROSS_COMPILE=arm-linux-androideabi-
TIp: paste the export statements in your ~/.bashrc to have them exported each login.

Getting the kernel source:
The kernel source for Nexus devices is available from Google’s servers.

Source : https://android.googlesource.com/kernel/exynos
Github Mirror: https://github.com/chirayudesai/android_kernel_exynos

Open the terminal, and type the below commands to get the kernel source on your computer.

Code:
mkdir -p android/kernel
cd android/kernel
For Nexus 10, we get the exynos kernel sources.
Next, we change our directory to the newly fetched source.

Type
Code:
cd exynos
Figuring out what to build:
Now, we need to figure out which revision to build.
You need to be exactly sure about this, otherwise there are chances that the compiled kernel won’t work.

The commit to build upon can be found by a few ways.
To get the kernel sources matching the device tree, type the below in the device tree.
Code:
git log kernel
Then type the below in the kernel tree
Code:
git checkout <commit>
The commit of the version running on the current review units is 52f6ab1 (probably), which is same as branch android-exynos-manta-3.4-jb-mr1-fr .

Compiling:

Name of defconfig: manta_defconfig

cd to the directory of the kernel source, then type the below in a terminal.

Code:
export ARCH=arm
export SUBARCH=arm
Code:
make <name_of_defconfig>
make
The kernel image will be ready at arch/arm/boot/zImage

To flash it, you need to make it into a boot.img, more on that later. when we have more sources.
The Following 11 Users Say Thank You to cdesai For This Useful Post: [ View ]
9th November 2012, 01:37 PM   |  #2  
alias_neo's Avatar
Senior Member
Flag Wilmslow
Thanks Meter: 203
 
2,073 posts
Join Date:Joined: Jun 2006
More
Nice work, it's been nice to see some instructions on building additional kernel modules too.

Sent from my GT-I9300 using Tapatalk 2
9th November 2012, 03:06 PM   |  #3  
shimp208's Avatar
Recognized Contributor
Flag Boston
Thanks Meter: 1,591
 
2,258 posts
Join Date:Joined: Jan 2011
Donate to Me
More
Great guide! I look forward to seeing your tutorial on compiling 4.2 from source .

Sent from my SCH-I535 using xda premium
10th November 2012, 08:47 PM   |  #4  
jdbeitz's Avatar
Senior Member
Cincinnati
Thanks Meter: 503
 
1,096 posts
Join Date:Joined: Jul 2010
Donate to Me
More
Super awesome! I'm currently thoroughly learning the rom building process with my nexus... ill get to this!
11th November 2012, 02:37 PM   |  #5  
Junior Member
Flag Tampa
Thanks Meter: 0
 
14 posts
Join Date:Joined: Dec 2008
More
looking forward towards the development
Last edited by d4nntheman; 11th November 2012 at 02:47 PM.
12th November 2012, 07:59 PM   |  #6  
matt95's Avatar
Recognized Contributor
Flag Verona
Thanks Meter: 2,341
 
5,787 posts
Join Date:Joined: Aug 2010
Donate to Me
More
Great! This is very helpful and useful
Last edited by matt95; 12th November 2012 at 10:42 PM.
12th November 2012, 11:27 PM   |  #7  
matt95's Avatar
Recognized Contributor
Flag Verona
Thanks Meter: 2,341
 
5,787 posts
Join Date:Joined: Aug 2010
Donate to Me
More
hey man, i got stuck at this point
Code:
 git log kernel
it gives me this error

Code:
fatal: ambiguous argument 'kernel': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
didn't really get that point... thanks
13th November 2012, 03:00 AM   |  #8  
cdesai's Avatar
OP Recognized Developer
Flag IN YOUR HEAD
Thanks Meter: 4,009
 
2,281 posts
Join Date:Joined: Jan 2011
Donate to Me
More
Quote:
Originally Posted by matt95

hey man, i got stuck at this point

Code:
 git log kernel
it gives me this error

Code:
fatal: ambiguous argument 'kernel': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
didn't really get that point... thanks

It has to be typed in the device tree, which hasn't hit AOSP yet, but should soon.

Sent from my GT-P1000
13th November 2012, 05:02 AM   |  #9  
matt95's Avatar
Recognized Contributor
Flag Verona
Thanks Meter: 2,341
 
5,787 posts
Join Date:Joined: Aug 2010
Donate to Me
More
Quote:
Originally Posted by cdesai

It has to be typed in the device tree, which hasn't hit AOSP yet, but should soon.

Sent from my GT-P1000

oh, now i get this
14th November 2012, 08:49 AM   |  #10  
renzyyy's Avatar
Junior Member
Flag Milwaukee, WI
Thanks Meter: 14
 
22 posts
Join Date:Joined: Aug 2010
More
i was able to make a build tonight from aosp, waiting for my device to arrive & then ill be able to test. but as far as i could tell the output sizes were pretty on compared to the factory image files i extracted http://renzy.me/aoi

...just realized i didnt extract proprietary binaries.
Last edited by renzyyy; 14th November 2012 at 08:54 AM.

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes