FORUMS

[KERNEL]How to build a custom Android Kernel for your device

1,205 posts
Thanks Meter: 2,825
 
By AmalD, Senior Member on 12th April 2012, 12:34 AM
Post Reply Email Thread
12th April 2012, 10:11 AM |#11  
kurotsugi's Avatar
Senior Member
Flag yogyakarta
Thanks Meter: 1,816
 
More
well...thats your choice, irfan.

@sgy.creed: sorry, I don't mean to offend you. IMHO it will be nice if before someone post any guide they already have tested it by them. in this way, they'll able to give more accurate direction to anyone who need their guide. as we already know, kernel is crucial part in our device. any mistake in compiling it will lead to brick our device. we have to cautious on it. peace ^,^v
12th April 2012, 11:19 AM |#12  
Senior Member
Thanks Meter: 506
 
More
Quote:
Originally Posted by kurotsugi

well...thats your choice, irfan.

@sgy.creed: sorry, I don't mean to offend you. IMHO it will be nice if before someone post any guide they already have tested it by them. in this way, they'll able to give more accurate direction to anyone who need their guide. as we already know, kernel is crucial part in our device. any mistake in compiling it will lead to brick our device. we have to cautious on it. peace ^,^v

if you (or others) think it's better to put in other thread, or maybe op wanna edit his post, fell free to copy my post (or just link, it's up to you). i don't take any credit to that post, because it just recompilation from other thread.
12th April 2012, 06:15 PM |#13  
Rui Oliveira 21's Avatar
Senior Member
Flag Braga
Thanks Meter: 17
 
More
GT-B5510
Is there by chance anyway to find a stock Kernel for my device for my GT-B5510???

I recently flashed a custom Kernel for GT-S5360 and the result was a Brick.


is there someone willing to help me??
12th April 2012, 06:41 PM |#14  
Harsh06's Avatar
Senior Member
Shah Alam
Thanks Meter: 49
 
More
Quote:
Originally Posted by Rui Oliveira 21

Is there by chance anyway to find a stock Kernel for my device for my GT-B5510???

I recently flashed a custom Kernel for GT-S5360 and the result was a Brick.


is there someone willing to help me??

Have u tried through kies?if the answer u failed then only odin is the way.
u need pda files from the update.Search google,i found one FW but it is from Italy :
B5510CEKK1.
The Following User Says Thank You to Harsh06 For This Useful Post: [ View ] Gift Harsh06 Ad-Free
12th April 2012, 07:29 PM |#15  
whitexp's Avatar
Senior Member
Flag Rio De Janeiro
Thanks Meter: 3,236
 
Donate to Me
More
Quote:
Originally Posted by sgy.creed

Hi guys,
This guide teaches how to make a new kernel for your device, it works in most of the cases but doesnt mean it will work for everyone
You need a minimal linux experice to know WTF you are doing
If you have any questions, post Belloowww
Download the required files
You will need a linux machine with the basic development tools or a virtualbox machine running a linux distribution (ubuntu 64bits will do fine)
I use the codesourcery package
Download the IA32 GNU/Linux TAR
The tar package is the easier to install
You will also need your kernel source from your manufacturer, for samsung the sources are available here

Install the cross compiler
Enter the folder were you downloaded the package and extract it, you will get something like arm-2011.03
Move that folder to some location, i use opt
ex: mv arm-2011.03 /opt/
or
sudo mv arm-2011.03 /opt
Done!

Extract and prepare the kernel sources
I will use the samsung sources as example, but anything can be used
For the samsung sources, after you extract the zip, you will get something like DEVICE_Platform.tar and DEVICE_Kernel.tar.gz
Extract the kernel:
tar zxvf DEVICE_Kernel.tar.gz
Enter the kernel folder and list the folder contents
ls
The structure is something like this:


Most devices contain the config file inside the device
You can extract it like this:
adb shell
su
cp /proc/config.gz /sdcard/
exit
exit
adb pull /sdcard/config.gz
Good, now we have the sources, compiler and configuration

Compiling the kernel
To compile ther kernel, i usually clean the sources first, with this i know for sure nothing will go wrong (usually )
make ARCH=arm CROSS_COMPILE=/opt/arm-2011.03/bin/arm-none-eabi- distclean (Remember to replace acordingly the compiler folder)
Sources cleaned, time to load the config file
gunzip config.gz
cp config ./.config
Good, now lets check the menuconfig (menuconfig is a menu to choose the kernel options, created to make it easy to select)
make ARCH=arm CROSS_COMPILE=/opt/arm-2011.03/bin/arm-none-eabi- menuconfig
Change whatever you want and exit and save
good, now its time to build
make ARCH=arm CROSS_COMPILE=/opt/arm-2011.03/bin/arm-none-eabi- -j2
Now wait for it to finish!
Your compiled kernel will be located inside arch/arm/boot/zImage

Extracting a boot.img
Good, now we have the zImage, but WTF to do with it?
Well, android usually (some samsung devices use a different boot.img method, ex: I9000) has the boot.img, inside of it we contain:
- ramdisk (required files to load the /system partition and continue the boot sequence)
- zImage (our kernel)
- pagesize
- base
- cmdline (some kernel paremetes used on boot)

To create your own boot.img, you need one from a nandroid backup that was made from CWM or AmonRA custom recoveries (there are other methods, but for those use the madteam forum )
The boot.img is located inside your /sdcard/clockworkmod/backup/somedate/boot.img
You will also need the unpackbootimg and mkbootimg binaries, i this link there is the 64 bit version (wont work on 32 bit linux)
create an empty folder, copy the downloaded file inside, enter it and do:
tar zxvf bootimgtools.tar.gz
chmod 755 *
now copy the boot.img you got from the backup
and extract the boot.img with:
./unpackbootimg -i boot.img
this will create the files as explained above

Creating the boot.img
Before making the boot.img, we need some information from the files extracted
cat boot.img-base ( save the output #1)
cat boot.img-pagesize (save the output , place the value inside the Hex Value of this site, and copy the decimal value and save it #2)
cat boot.img-cmdline (save the output #3)

Good, now copy the compiled kernel (zImage) inside the current folder and do:
mkbootimg –kernel zImage –ramdisk boot.img-ramdisk.gz –cmdline “(replace with output#3)” –base (replace withoutput #1) –pagesize (replace with output#2) -o /tmp/boot.img
Good, the boot.img is created!
Now test on your device!

If you dont know how to flash the boot.img, enter the madteam forum and request help (its too difficult to explain the flashing of boot.img if you dont know how to do it )

Take care!

<External link removed>

please credits motafoca madteam
12th April 2012, 10:29 PM |#16  
Rui Oliveira 21's Avatar
Senior Member
Flag Braga
Thanks Meter: 17
 
More
GT-B5510
Quote:
Originally Posted by Harsh06

Have u tried through kies?if the answer u failed then only odin is the way.
u need pda files from the update.Search google,i found one FW but it is from Italy :
B5510CEKK1.

Kies said that I had the most recent firmware, tough I found some new versions.

right now trough kies I tried to do an emergency firmware restore, i guess thats the name, but it asked for a code, a 4 number code i guess and i dont know what's the code.

Via odin I tried to install stock firmware from sammobile but it failled as well, if you want I'll post the dialog from odin.

I can boot in recovery mode, Odin(download) mode and CWM mode.

could you point me in the right direction???


thanks for your time
13th April 2012, 12:47 AM |#17  
Harsh06's Avatar
Senior Member
Shah Alam
Thanks Meter: 49
 
More
Quote:
Originally Posted by Rui Oliveira 21

Kies said that I had the most recent firmware, tough I found some new versions.

right now trough kies I tried to do an emergency firmware restore, i guess thats the name, but it asked for a code, a 4 number code i guess and i dont know what's the code.

Via odin I tried to install stock firmware from sammobile but it failled as well, if you want I'll post the dialog from odin.

I can boot in recovery mode, Odin(download) mode and CWM mode.

could you point me in the right direction???


thanks for your time

I believe Doky already reply your post n willing to help u in others thread.Give doky some info about your current FW.U need 3 complete files n flash through Odin.Key in *#1234# with your dialer(u will see current info version) and PM doky about the info.He surely gonna help u.
Sorry OP off topic.
13th April 2012, 01:41 AM |#18  
Rui Oliveira 21's Avatar
Senior Member
Flag Braga
Thanks Meter: 17
 
More
GT-B5510
He did help, thanks

question now is...while trying to revive the phone I installed Creed's Rom for Gt-s5360, I got quiet, and obviously it doesnt work that well in my GT-B5510, so I need a custom Rom for my device or a Stock Rom, but I cant find neither :S

any lights??
16th May 2012, 12:24 PM |#19  
savie's Avatar
Senior Member
Thanks Meter: 637
 
More
Kernel
How to change Kernel Version when build kernel ??
usually display 2.6.35.7 [email protected] #1
i wanna change [email protected] #1 so how the setting on linux or maybe what file??
Thanks b4
16th May 2012, 02:46 PM |#20  
Senior Member
Thanks Meter: 83
 
More
Quote:
Originally Posted by Rui Oliveira 21

He did help, thanks

question now is...while trying to revive the phone I installed Creed's Rom for Gt-s5360, I got quiet, and obviously it doesnt work that well in my GT-B5510, so I need a custom Rom for my device or a Stock Rom, but I cant find neither :S

any lights??

I was just wondering if you went to the oldest possible firmware you could find and then proceeded to update from that. Sometimes the updates only contain necessary info and kind of rely on the previous installs.

Sent from my TF101 using Crashntalk 2
19th July 2012, 06:26 AM |#21  
DearTanker's Avatar
Member
Flag fuzhou
Thanks Meter: 19
 
More
Quote:
Originally Posted by savie

How to change Kernel Version when build kernel ??
usually display 2.6.35.7 [email protected] #1
i wanna change [email protected] #1 so how the setting on linux or maybe what file??
Thanks b4

I want know it too...
Post Reply Subscribe to Thread

Tags
sgy kernel

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes