Post Reply

(GUIDE)compiling kernel from source

OP karthick mostwanted

6th July 2014, 04:31 AM   |  #1  
karthick mostwanted's Avatar
OP Member
Flag chennai
Thanks Meter: 72
 
58 posts
Join Date:Joined: Mar 2014
Donate to Me
More
if you are new to kernel projects then this guide is for you]
im using s5312 source as an example

REQUIREMENTS
* ubuntu 10.1 or later ---> tutorial for installing http://www.youtube.com/watch?v=tDDRFiwHujg
* toolchain arm-eabi-4.6 ---> https://github.com/knzy/arm-eabi-4.6
* time and some unix knowledge
* installing java ---> https://www.digitalocean.com/communi...u-with-apt-get (or) installing offline http://www.wikihow.com/Install-Oracl...n-Ubuntu-Linux



[BPROCEDURE[/B]
1.MAKE SURE YOU INSTALLED ALL PACKAGES AND SETTED UBUNTU FOR COMPILING
if not ---->
git-core
gnupg
flex
bison
gperf
libsdl-dev
libesd0-dev
libwxgtk2.6-dev
build-essential
zip
curl
libncurses5-dev
zlib1g-dev
ia32-libs
lib32z1-dev
lib32ncurses5-dev
gcc-multilib
g -multilib
Adb

HOW TO INSTALL ----> for example
open terminal ctrl alt t -----> type commandsudo apt-get install git-core



2.downloading source
samsung ----> http://opensource.samsung.com
sony ----> http://developer.sonymobile.com/know...e/open-source/
LG ----> http://www.lg.com/global/support/opensource/index
HTC ----> http://htcsource.com/



3.TOOLCHAIN
arm-eabi-4.6 --> https://github.com/knzy/arm-eabi-4.6



4.SETTING UP DIRECTORY
* Open a terminal
* Type "mkdir sgy"
* Type "cd sgy"
* Type "mkdir kernel"
* Type "mkdir toolchains"

-------> remove (") while typing
EXTRACT SOURCE IN ----> home/sgy/kernel -->here<---
EXTRACT TOOLCHAIN IN ----> home/sgy/toolchains -->here<---



5.after doing above open Makefile in home/sgy/kernel
and edit like mine---> https://www.dropbox.com/s/wbsb0pr908...%3A41%3A45.png



6. Running defconfig for first time
for example ---> make bcm21654_rhea_ss_corsica_rev00_defconfig ---->dont use defconfig for second time<---- it needed for first time for enabling the stock features
you can find the stock defconfig in arch/arm//config if not then open ----> KERNEL_README.txt which came along with source



7.Adding features
REFER here ---> http://xda-university.com/as-a-devel...to-your-kernel
after adding enable in menuconfig by typing in terminal ---> make menuconfig
AFTER refering see go here
*adding governors ---> https://github.com/k2wl/evolution_i9...c1ae2a9ffa709f
*adding IO/scheduler--->
-sio https://github.com/NoelMacwan/SXDNic...cda19e3ba62cd1
-fiops https://github.com/NoelMacwan/SXDNic...3565edeccabce9
-vr https://github.com/NoelMacwan/SXDNic...a3e936df8affb5
-zen https://github.com/NoelMacwan/SXDNic...610875e757c2a5
-sio plus https://github.com/NoelMacwan/SXDNic...cfd39c804f3d10
*adding drivers ----->
for example powersuspend and autosleep
*adding ------> https://github.com/k2wl/evolution_i9...15019ffec6f955
*error fix -------> https://github.com/k2wl/evolution_i9...58737753d5eb34

------>REST YOU HAVE TO SEARCH<------



8.COMPILING
for compiling type "make" or if you have a dualcore or many type accorting to "make -j4" -j4 means compiling source with 4 cores for faster compile
after all now grabbing zimage from -----> arch/arm/boot/--->zimage<---



9.packing zimage to boot.img
* https://github.com/dsixda/Android-Kitchen/tagsdownload andoid kitchen
* extract it to home directory
* type "cd kitchen''
* type ./menu
* extract "boot.img" you can get it from stock ROM
* then replace with the "zimage" which u got from compiling



10.after making it boot.img [optional]
leave the source on github or any git if you post the kenel in xda forum beacuse the rules
-------> learning about git http://git-scm.com/book
(OR)
-------> PDF http://extincthacker.blogspot.in/2014/07/pro-git.html

important-----> after first build if you want to make another build run "make clean" -----> this command will refresh the source for next compilation

COMMAND USED
*make xxxx_defconfig --------> this command will run the defconfig which will enable stock features
*make menuconfig --------> this command will open a graphical interface which will show the features of source and to enable or disable
*make -j3 (or) -j2 (or) make --------> this command will used when you are finished
*make clean --------> this command will clean the compiled to non compile for another use

ENJOY

CREDITS
* k2wl
* noel macwan
Last edited by karthick mostwanted; 7th July 2014 at 02:40 PM.
The Following 10 Users Say Thank You to karthick mostwanted For This Useful Post: [ View ]
6th July 2014, 05:30 AM   |  #3  
Senior Member
Flag hamirpur h.p
Thanks Meter: 61
 
149 posts
Join Date:Joined: Dec 2013
More
nice guide. and helpful for me.
1st September 2014, 03:58 PM   |  #4  
TheStrix's Avatar
Senior Member
Flag ⓂⓊⓂⒷⒶⒾ
Thanks Meter: 176
 
422 posts
Join Date:Joined: May 2014
Donate to Me
More
Nice guide!! Thanks!!
The Following User Says Thank You to TheStrix For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Android Software and Hacking General [Developers Only] by ThreadRank