Thursday, 15 January 2015

Tutorial 1:- How To Build A Android Linux Kernel For your Custom ROM?

Samsung Galaxy Y stock kernel do not have /proc/config.gz and gcc version in arm-2011.03 not compatible with other precompiled module.

Requirement :
1. linux box 32 bit with working gcc. you can use real linux machine or virtual machine
2. Sourcery G++ Lite 2009q3-68 toolchain for ARM EABI fromhttp://www.codesourcery.com/ (Linux version without installer arm-2009q3-68-arm-none-eabi-i686-pc-linux-gnu.tar.bz2)
3. mkbootimg with md5support. got it from http://forum.xda-developers.com/show...&postcount=241 . credit to harish2704
4. split_bootimg.pl (google it)
5. kernel source from http://opensource.samsung.com . i use GT-S5360_GB_Opensource_Update2.zip
6. stock boot.img (or from your custom kernel).

Steps :
1. make folder "sgy" in your home. the result is folder "/home/<yourname>/sgy". <yourname> is your linux user name, and from now replace <yourname> with your user name. put all file you already download there
2. extract "GT-S5360_Kernel.tar.gz" from "GT-S5360_GB_Opensource_Update2.zip". put also in "sgy" folder
3. open terminal emulator and go to your working path with command


Code:
cd ~/sgy
4. extract your compiler with

Code:
tar -xvf arm-2009q3-68-arm-none-eabi-i686-pc-linux-gnu.tar.bz2
5. create folder "kernel" and extract kernel source there

Code:
mkdir kernel
cd kernel
tar -xvf ../GT-S5360_Kernel.tar.gz
you got 2 folder, "common" and "modules"

6. open folder "common", there is file "Makefile". open with text editor and find line with content "/opt/toolchains/arm-eabi-4.4.3/bin/arm-eabi-". replace with "/home/<yourname>/sgy/arm-2009q3/bin/arm-none-eabi-", don't forget replace <yourname>.

7. in terminal goto folder "common" and load default config for sgy

Code:
cd ~/sgy/kernel/common
make bcm21553_totoro_05_defconfig
8. if you want change you config run

Code:
make menuconfig
9. if you ready to build then run

Code:
make
or if you have dual core cpu and want to make it faster

Code:
make -j3
10. when complete and no error appear, copy your kernel to "sgy" folder

Code:
cp arch/arm/boot/zImage ~/sgy
11. extract ramdisk from your boot.img 

Code:
cd ~/sgy/
perl split_bootimg.pl boot.img
you got "boot.img-kernel" and "boot.img-ramdisk.gz". move "boot.img" and "boot.img-kernel" to other place.

12. repack your new kernel and ramdisk. but first get md5sum of your new kernel

Code:
md5sum zImage
you got something like

Code:
1fd319aa60abc2abae2e5932bcb9fc77  zImage
you need that "1fd319aa60abc2abae2e5932bcb9fc77" write it or copy to text editor. you need run it every time compile new kernel

13. repack

Code:
chmod +x mkbootimg
./mkbootimg --kernel zImage --ramdisk boot.img-ramdisk.gz --base 0x81600000 --kernelMD5 <your md5sum result> -o boot.img
14. make odin flash-able

Code:
tar -cf boot-sgy.tar boot.img

0 comments:

Post a Comment

DON'T BE SELFISH !!! SHARE IT !!!