[Developer] Guide to compile kernel for Sony Xperia L.

Search This thread

Navneet Suresh

Senior Member
Jun 25, 2013
658
556
/Universe/Earth/India/
How to compile kernel from source for Sony Xperia L

Things needed :

A PC

Ubuntu on VM or Main Os

Android Phone/Tab :p, In this case XL unlocked

Brain (Be sure you get it).


I suggest to get Hells-Kitchen Ubuntu distro it has all the basic things installed for compiling kernels/modding/and ROMS.

Distro Link : http://xdaforums.com/showthread.php?t=2152398

> Then proceed further by getting the opensource archives from Sony developer website.

> I suggest you to download within Ubuntu distro for ease.

> Extract it.

> Now we need to setup and fix some sh*ts before we can rven think of compiling.

> To start of setup the toolchains, In my case I used Linaro you can use the ones posted here

http://xdaforums.com/showthread.php?t=2098133

> Then setup the toolchains in your Makefile.

> Now the real work begins we need to fix the source before compilation.

>> Commits regarding the fixes :

https://github.com/varunchitre15/an...mmit/9db33fe4f788a05498c4de446a6ba711984d9343 - CCI Klog Fix

https://github.com/varunchitre15/an...mmit/9db33fe4f788a05498c4de446a6ba711984d9343 - Some more

https://github.com/varunchitre15/an...mmit/40fe59a2f80fe0e2544b50676afa4d65a2c2de8c - Increase Frame warn limit

https://github.com/varunchitre15/an...mmit/3fd4c1677d6e6a8d37be9e37636a88982c29f135 - Fix Frame Buffer


> After applying all the fixes : Now you can start with compiling the kernel.

> Go to your extracted ARCHIVE folder.

> Then start by initiating these commands.

> ARCH=arm make sa77_defconfig -Makes Config files

> ARCH=arm make menuconfig -Opens menus to edit configurations(In laymans language)

> ARCH=arm make -jX -Starts compiling, J x stands for no. of jobs for my PC i use -j3 and for first time use -j1 it lessens the scroll time if any major bug occurs.

> After you get the zimage , Now we can make boot.img.

> Get the ramdisk from stock or any other kernel (Be sure you give credits to the kernel author if you use it).

> Get Anikets Packing tool : https://github.com/aniketroxx/Aniket_Packer

> Pack your kernel get all the modules search for .ko files.

> Flash you kernel with Fastboot mode.

> Flash your modules or replace them manually and set permissions accordingly.

> You are done with your kernel if all goes well Xperia Should boot up :p


I may not have covered all topic and would update guide soon with more topics covered.

"If your kernel doesnt boot dont PM/spam me Instead post your problems here in this thread."

Credits :

@varun.chitre15 for Commits.
@h311sdr0id for his awesome Distro.
@Christopher83 for His GCC Toolchains Thread
Sorry if I forgot to credit anybody, who's work is used in my thread, PM me I will add it.
 
Last edited:

david makarove

Senior Member
Apr 1, 2014
640
1,350
Moscow
Thank you for this guide
i should be c++ programmer for start with this right?

Sent from my taoshan using XDA Premium 4 mobile app
 

Levered

Inactive Recognized Contributor
Feb 11, 2012
2,401
2,240
Malaysia
levered.webs.com
I have tried to be as simple as possible ... Be more clear with your question what part of the tutorial you didn't understand i mean setup, compiling, ??

Sent from my Nexus 7 using XDA Free mobile app

Yup, i know you make it's simple..,btw please wrap command..maybe will confuse others member to read this...

btw i've problem to setup...
 

FajarMF28

Senior Member
May 26, 2013
96
33
26
Gresik
fajarmf.blogspot.com
I will post list of needed packages here.

Sent from Nexus 7
Is it the right packages?

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.

and about linaro, iam using arm-linux-gnueabi-linaro_4.9.1-2014.05-build_2014_05_17.tar.xz, right?
sorry for so much asking :D
 

Navneet Suresh

Senior Member
Jun 25, 2013
658
556
/Universe/Earth/India/
Is it the right packages?

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.

and about linaro, iam using arm-linux-gnueabi-linaro_4.9.1-2014.05-build_2014_05_17.tar.xz, right?
sorry for so much asking :D

Yes BTW are you running it on VM ?

Sent from Nexus 7
 

Top Liked Posts