CM12 Nightlies Hit the Note 4!

If you are eager to get nightly ROM fun on your Note 4, the latest Nightly build of CM12 has just arrived! … more

Pushbullet Available for iPad, Mac and Safari

One of the most useful tools for Android – Pushbullet – found its way to Mac OS X. … more

CyanogenMod 12 Dark Gray Theme

XDA Forum Memberprashantdrewshared one of his awesome themes. Change the look of your CyanogenMod 12 to gray … more

Runhex Runner

Got good reflexes? Check your skills with this classic jump and survive game by XDA Forum Memberdreamhex. Get your fingers … more

Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

(GUIDE)compiling kernel from source

OP karthick mostwanted

6th July 2014, 05:31 AM   |  #1  
karthick mostwanted's Avatar
OP Member
Flag chennai
Thanks Meter: 106
 
84 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
* Get ubuntu from here. x64 bit is better in developments http://www.ubuntu.com/download/desktop
* 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 but you can choose your own supported version (or) variant of toolchains
* 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

OPEN TERMINAL HERE OPTION
Code:
sudo apt-get install nautilus-open-terminal
Code:
nautilus -q
TO INSTALL JAVA
Code:
sudo add-apt-repository ppa:webupd8team/java
Code:
sudo apt-get update
Code:
sudo apt-get install oracle-java6-installer
Code:
sudo apt-get install oracle-java6-set-default





PROCEDURE
1.MAKE SURE YOU INSTALLED ALL PACKAGES AND SETTED UBUNTU FOR COMPILING
if not ---->
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential \zip curl zlib1g-dev libc6-dev lib32ncurses5-dev libncurses5-dev x11proto-core-dev \libx11-dev libreadline6-dev lib32readline-gplv2-dev lib32z-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos python python-markdown \libxml2-utils xsltproc pngcrush gcc-multilib lib32z1 schedtool
HOW TO INSTALL ----> for example
open terminal ctrl + alt + t -----> type commandcopy paste whole texts from sudo.....schedtool

TO INSTALL GIT
Code:
sudo apt-get install git
TO INSTALL REPO AND OTHER TOOLS
Code:
sudo apt-get install phablet-tools
LINKING A FILE
Code:
ln -s /usr/lib/i386-linux-gnu/libX11.so.6 /usr/lib/i386-linux-gnu/libX11.so





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
Code:
 mkdir s5312
* Type
Code:
cd s5312
* Type
Code:
mkdir kernel
* Type
Code:
mkdir toolchains
-------> remove (") while typing
EXTRACT SOURCE IN ----> home/s5312/kernel -->here<---
EXTRACT TOOLCHAIN IN ----> home/s5312/toolchains -->here<---








5. AFTER DOING THE ABOVE OPEN Makefile IN home/s5312/kernel
AND EDIT LIKE MINE--->
https://www.dropbox.com/s/wbsb0pr908...%3A41%3A45.png








6. RUNNING DEFCONFIG FOR FIRST TIME
for example --->
Code:
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

if you need more go here --->
https://github.com/karthick111/Hyper_CM11

------>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
Code:
cd kitchen
* type
Code:
./menu
* extract "boot.img" you can get it from stock ROM
* then replace with the "zimage" which u got from compiling







10.AFTER MAKING YOUR KERNEL SUCCESSFULLY [optional]
push the source on github or any compliants if you post the kenel in xda forum, You need to have the kernel source
-------> 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
* make mrproper ---------> this command will clean every configs

ENJOY

CREDITS
* k2wl
* noel macwan
Last edited by karthick mostwanted; 31st December 2014 at 05:06 PM.
The Following 15 Users Say Thank You to karthick mostwanted For This Useful Post: [ View ]
6th July 2014, 06:30 AM   |  #3  
Senior Member
Flag Hamirpur H.P
Thanks Meter: 79
 
169 posts
Join Date:Joined: Dec 2013
More
nice guide. and helpful for me.
25th January 2015, 08:11 AM   |  #5  
EndLess's Avatar
Member
Flag Panchkula
Thanks Meter: 49
 
44 posts
Join Date:Joined: Jan 2013
More
Nice guide bro.... Keep going
25th January 2015, 09:56 AM   |  #6  
berryman13's Avatar
Senior Member
Flag San Francisco
Thanks Meter: 623
 
1,283 posts
Join Date:Joined: Mar 2011
Donate to Me
More
Is this updated to lollipop?
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes