Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,731,116 Members 47,971 Now Online
XDA Developers Android and Mobile Development Forum

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

Tip us?
 
cdesai
Old
#1  
cdesai's Avatar
Recognized Developer - OP
Thanks Meter 3988
Posts: 2,276
Join Date: Jan 2011
Location: IN YOUR HEAD

 
DONATE TO ME
Default [Guide] Building from sources [Kernel only for now]

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.
CyanogenMod Maintainer | SGT7 | TeamBBQ

 
BBQLinux - An Arch based Linux distribution for Android developers
Website: http://www.bbqlinux.org | Downloads: [url]http://sourceforge.net/projects/bbqlinux/files//url]
IRC: #bbqlinux on freenode
The Following 11 Users Say Thank You to cdesai For This Useful Post: [ Click to Expand ]
 
alias_neo
Old
#2  
alias_neo's Avatar
Senior Member
Thanks Meter 190
Posts: 2,066
Join Date: Jun 2006
Location: Wilmslow
Nice work, it's been nice to see some instructions on building additional kernel modules too.

Sent from my GT-I9300 using Tapatalk 2
Storage Ether Widget - Storage Widget for Android phones and tablets.
 
shimp208
Old
#3  
shimp208's Avatar
Recognized Contributor
Thanks Meter 1485
Posts: 2,193
Join Date: Jan 2011
Location: Boston

 
DONATE TO ME
Great guide! I look forward to seeing your tutorial on compiling 4.2 from source .

Sent from my SCH-I535 using xda premium
 
jdbeitz
Old
#4  
jdbeitz's Avatar
Senior Member
Thanks Meter 503
Posts: 1,096
Join Date: Jul 2010
Location: Cincinnati

 
DONATE TO ME
Super awesome! I'm currently thoroughly learning the rom building process with my nexus... ill get to this!
See that "Thanks" button next to my name? Yeah, that one... Click it!
 
d4nntheman
Old
(Last edited by d4nntheman; 11th November 2012 at 02:47 PM.)
#5  
Junior Member
Thanks Meter 0
Posts: 14
Join Date: Dec 2008
Location: Tampa
looking forward towards the development
 
matt95
Old
(Last edited by matt95; 12th November 2012 at 10:42 PM.)
#6  
matt95's Avatar
Recognized Contributor
Thanks Meter 2322
Posts: 5,778
Join Date: Aug 2010
Location: Verona

 
DONATE TO ME
Great! This is very helpful and useful


Donate and support my studies at the MIT University! Unruu HTC RUUs | Setup Android Development Environment on Ubuntu | Decrypt HTC RUUs
 
matt95
Old
#7  
matt95's Avatar
Recognized Contributor
Thanks Meter 2322
Posts: 5,778
Join Date: Aug 2010
Location: Verona

 
DONATE TO ME
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


Donate and support my studies at the MIT University! Unruu HTC RUUs | Setup Android Development Environment on Ubuntu | Decrypt HTC RUUs
 
cdesai
Old
#8  
cdesai's Avatar
Recognized Developer - OP
Thanks Meter 3988
Posts: 2,276
Join Date: Jan 2011
Location: IN YOUR HEAD

 
DONATE TO ME
Quote:
Originally Posted by matt95 View Post
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
CyanogenMod Maintainer | SGT7 | TeamBBQ

 
BBQLinux - An Arch based Linux distribution for Android developers
Website: http://www.bbqlinux.org | Downloads: [url]http://sourceforge.net/projects/bbqlinux/files//url]
IRC: #bbqlinux on freenode
 
matt95
Old
#9  
matt95's Avatar
Recognized Contributor
Thanks Meter 2322
Posts: 5,778
Join Date: Aug 2010
Location: Verona

 
DONATE TO ME
Quote:
Originally Posted by cdesai View Post
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


Donate and support my studies at the MIT University! Unruu HTC RUUs | Setup Android Development Environment on Ubuntu | Decrypt HTC RUUs
 
renzyyy
Old
(Last edited by renzyyy; 14th November 2012 at 08:54 AM.)
#10  
renzyyy's Avatar
Junior Member
Thanks Meter 14
Posts: 22
Join Date: Aug 2010
Location: Milwaukee, WI
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.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes