[Android Software/Hacking General [Developers Only]] Karthick Chandran:
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/community/tutorials/how-to-install-java-on-ubuntu-with-apt-get (or) installing offline http://www.wikihow.com/Install-Oracle-Java-on-Ubuntu-Linux

OPEN TERMINAL HERE OPTION

sudo apt-get install nautilus-open-terminal

nautilus -q

TO INSTALL JAVA

sudo add-apt-repository ppa:webupd8team/java

sudo apt-get update

sudo apt-get install oracle-java6-installer

sudo apt-get install oracle-java6-set-default

PROCEDURE

1.MAKE SURE YOU INSTALLED ALL PACKAGES AND SETTED UBUNTU FOR COMPILING

if not ---->

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

sudo apt-get install git

TO INSTALL REPO AND OTHER TOOLS

sudo apt-get install phablet-tools

LINKING A FILE

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/knowledge-base/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 s5312

* Type

cd s5312

* Type

mkdir kernel

* Type

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/wbsb0pr908s3up5/Screenshot%20from%202014-07-06%2008%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-developer/adding-features-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_i9082/commit/0a2476bf7110afce36b3709b46c1ae2a9ffa709f

*adding IO/scheduler--->

-sio https://github.com/NoelMacwan/SXDNickiDS/commit/9e3310bb8cc4330d159ff40e43cda19e3ba62cd1

-fiops https://github.com/NoelMacwan/SXDNickiDS/commit/5f83e803873fb570f9c058f2d33565edeccabce9

-vr https://github.com/NoelMacwan/SXDNickiDS/commit/5f15277f722ce91f09a0b1be59a3e936df8affb5

-zen https://github.com/NoelMacwan/SXDNickiDS/commit/c47ccf11c3021d63396b404219610875e757c2a5

-sio plus https://github.com/NoelMacwan/SXDNickiDS/commit/46584177e0c0760283a42828b3cfd39c804f3d10

*adding drivers ----->

for example powersuspend and autosleep

*adding ------> https://github.com/k2wl/evolution_i9082/commit/529da6e51b306558acabca8f5d15019ffec6f955

*error fix -------> https://github.com/k2wl/evolution_i9082/commit/8aeb30a34a385dbaddbbf9b63658737753d5eb34

if you need more go here --->

https://github.com/karthick111/Hyper_CM11

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

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 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