Quantcast
Channel: xda-developers - Android Software and Hacking General [Developers Only]
Viewing all articles
Browse latest Browse all 3614

(GUIDE)compiling kernel from source

$
0
0
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://dl-web.dropbox.com/get/ss/Screenshot%20from%202014-07-06%2008%3A41%3A45.png?_e_pi_=7%2CPAGE_ID10%2C34863  75527



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

Viewing all articles
Browse latest Browse all 3614

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>