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
19th July 2012, 03:42 PM |#31  
kurotsugi's Avatar
Senior Member
Flag yogyakarta
Thanks Meter: 1,816
 
More
@savie: where can we get that? I edited .config manually to set my kernel
19th July 2012, 04:26 PM |#32  
savie's Avatar
Senior Member
Thanks Meter: 637
 
More
Quote:
Originally Posted by kurotsugi

@savie: where can we get that? I edited .config manually to set my kernel

Get from google lol
I've forget address link..
ncurses-5.9.tar.gz size only 2.69mb..
19th July 2012, 04:41 PM |#33  
Senior Member
Thanks Meter: 506
 
More
Quote:
Originally Posted by Master_Key

To both.

zImage compiled using a good source and correct method as stated by samsung is always good to go.

The only thing you need is a working ramdisk to combine that image with.

make xx_xx_xx_defconfig
make -j4

This is the easiest way to compile (only make commands are given above)

you still don't understand. i know how to compile kernel. i already have more than dozen kernel in my pc. in fact i write this step/tutorial more than a month after i did my first bootable kernel.

the real problem with samsung guide is it does not tell you how to install compiled kernel. back before february, few people already try to make custom kernel. none working. not before harish2704 find that we need mkbootimg which support md5 checksum. he post it here, in 6 feb, a month before meruk release his kernel for the first time.

the funny thing is all people waiting for custom kernel at that time, but nobody seem to care about his post.
The Following 2 Users Say Thank You to irfanbagus For This Useful Post: [ View ] Gift irfanbagus Ad-Free
19th July 2012, 04:43 PM |#34  
Senior Member
Thanks Meter: 235
 
More
Quote:
Originally Posted by irfanbagus

you still don't understand. i know how to compile kernel. i already have more than dozen kernel in my pc. in fact i write this step/tutorial more than a month after i did my first bootable kernel.

the real problem with samsung guide is it does not tell you how to install compiled kernel. back before february, few people already try to make custom kernel. none working. not before harish2704 find that we need mkbootimg which support md5 checksum. he post it here, in 6 feb, a month before meruk release his kernel for the first time.

the funny thing is all people waiting for custom kernel at that time, but nobody seem to care about his post.

Mk boot is the only way to pack a kernel that works.
I thought you know it.

Sent from my GT-S5360 using xda app-developers app
19th July 2012, 05:03 PM |#35  
Senior Member
Thanks Meter: 506
 
More
Quote:
Originally Posted by Master_Key

Mk boot is the only way to pack a kernel that works.
I thought you know it.

Sent from my GT-S5360 using xda app-developers app

i know, but do you know that boot.img in sgy need md5 checksum ? do you know standard mkbootimg do not have md5 support ? do you know what base addr for sgy boot.img ?
19th July 2012, 05:06 PM |#36  
Senior Member
Thanks Meter: 235
 
More
Quote:
Originally Posted by irfanbagus

i know, but do you know that boot.img in sgy need md5 checksum ? do you know standard mkbootimg do not have md5 support ? do you know what base addr for sgy boot.img ?

I used google.
The most powerful tool. :P

Sent from my GT-S5360 using xda app-developers app
19th July 2012, 05:15 PM |#37  
Inactive Recognized Developer
Flag New Delhi
Thanks Meter: 5,266
 
Donate to Me
More
when i use the command to "make" it shows that something eabi not found even though its there!! This prob didnt come when I tried this process in linux mint
19th July 2012, 05:23 PM |#38  
Senior Member
Thanks Meter: 506
 
More
Quote:
Originally Posted by Master_Key

I used google.
The most powerful tool. :P

Sent from my GT-S5360 using xda app-developers app

lol, how can you find it in google if nobody ever wrote it. can you find guide to build kernel for galaxy y which not related to harish2704 post and write before 6 february ?
The Following 2 Users Say Thank You to irfanbagus For This Useful Post: [ View ] Gift irfanbagus Ad-Free
19th July 2012, 05:24 PM |#39  
Senior Member
Thanks Meter: 235
 
More
Quote:
Originally Posted by hell_lock

when i use the command to "make" it shows that something eabi not found even though its there!! This prob didnt come when I tried this process in linux mint

I compiled it.
Check path to see if eabi is present.
Test cm kernel please hell lock.

Sent from my GT-S5360 using xda app-developers app
20th July 2012, 01:07 PM |#40  
Senior Member
Flag vadodara
Thanks Meter: 14
 
More
hey amal, use [code] etc [/code*] like this
it will help users.
BTW, very good HOW TO, will try it soon.

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:
Code:
mv arm-2011.03 /opt/
or
Code:
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:
Code:
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:
Code:
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 )
Code:
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
Code:
gunzip config.gz
cp config ./.config
Good, now lets check the
Code:
 menuconfig
(menuconfig is a menu to choose the kernel options, created to make it easy to select)
Code:
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
Code:
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:
Code:
tar zxvf bootimgtools.tar.gz
chmod 755 *
now copy the boot.img you got from the backup
and extract the boot.img with:
Code:
./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
Code:
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:
Code:
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!
20th July 2012, 01:26 PM |#41  
Senior Member
Thanks Meter: 235
 
More
Quote:
Originally Posted by irfanbagus

lol, how can you find it in google if nobody ever wrote it. can you find guide to build kernel for galaxy y which not related to harish2704 post and write before 6 february ?

I didn't find any good guide except that. So I thanked you.

And you seem to use google for sole personal use.

Alright so the base address used in Samsung Update 2 for euro zone is 0x81600000. This is not mentioned on google. I extracted the zip and found it. :P
Please do not plagiarise my stuff and codes.

Press thanks; I helped.

Sent from my GT-S5360 using xda app-developers app
The Following User Says Thank You to Master_Key For This Useful Post: [ View ] Gift Master_Key Ad-Free
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