this is for you guys who want to learn to be a dev, a wannabe dev or just want to make a kernel for fun (it isnt really that fun though it feels great when you succesfully compile your own for the 1st time) ..... now im not going to go advance mode on this, just a basic guide to help you out
1st lets start off with the requirements
1. sorry windows users but you must be on linux preferably UBUNTU as its whats I use, ubuntu 12.04 64bit to be precise(32bit works fine as well), its tried and tested to be compiling perfectly fine on it, I am not so sure about other linux distros though but i think it should work too. You guys on windows can run ubuntu or whatever linux you like on a virtual machine like virtualbox if you want to not replace your current system or do not want to dualboot
2. second is you need the source code of Galaxy y which you can download here Galaxy y source at open souce samsung
just type gt-s5360 in the search box and download the source... i use update 2 but update 3 is already out but i havent tested it yet
3. you will need these stuff over here for some other tasks as well kernel tools and the gcc cross compiler download sourcery g++ 2009q-68
4. about 1gb of free diskspace on your drive(this is just an estimate. its only for kernel source its a 100+ mb when extracted and the compiling process will increase it 10 fold so 1gb free disk space is a must if you are on a virtual machine)
5. and lastly a brain with the latest busybox installed LOL (just kidding)
now the setup
so lets begin by setting up your system download all the necessary files from the links i have given
1st is the g++ 2009q-68, extract it to any folder you like but i prefer it in home folder just to make things easier
1st is the g++ 2009q-68, extract it to any folder you like but i prefer it in home folder just to make things easier
now lets see what you get from opensource update 2.zip
there are two tar.gz files in the zip folder the platform source and the kernel source
just extract the kernel source which is GT-S5360_kernel.tar.gz to a folder of your choice in your home folder and again extract the conntents of the tar.gz file . The extracted tar.gz should contain two folders which are common and modules
now open common folder and open Makefile with gedit
now look at line 194
as you can see mine is
and lastly the kernel compiling tools.zip contains 2 things in them split_bootimg.pl and mkbootimg for our galaxy y
extract them all and extract mkbootimg.tar.gz as well and remember where you extracted these files
COMPILING THE KERNEL
so now everything appears to be all set up and we are ready to compile ourselves the kernel zImage. first up is open a terminal and go to the directory where you extracted the kernel source code specifically to the common folder. mine is in home/thirdzcee/Android/kernel/common so i type in terminal
as you can see I need not add home/*my username*/ to the command as it is because the terminal starts up in your home directory already. so the format for your input in your terminal should be
your final output after entering the command should contain this
and this is what you should see
you can use the arrow keys to navigate, enter key to make choose a selection and the spacebar to change something if you want to include that certain configuration feature in the kernel which will dislplay an asterisk [*] or as a loadable module which will display as [M] in the selection
after making all your changes (do not change anything if you dont know what the changes your doing to the config will do to the kernel) exit and choose yes to save the configuration
now to begin the compilation process, enter this command in terminal
this is gonna take a while depending on how fast your processor is and your disk write speed as well so i suggest you go have coffee or do something else for a while...... and its done next thing to do is to grab the zImage so type this command in terminal
take note of the output as you will need it later
now we cd to the directory where you extracted mkbootimg so if its extracted in your home folder just type in terminal
now we move the zImage to the mkbootimg folder by entering this command
now we have zImage ready and all we need is a ramdisk so heres a download link of stock kernel ramdisk and paste it in the mkbootimg folder where the zImage is also found or you can use the split_bootimg.pl that came along with the mkbootimg download to get the ramdisk of any kernel you like by putting the kernel boot.img and the split_bootimg.pl in the same directery, preferably home and in terminal navigate to that directory and type in this command
now navigate to mkbootimg folder in terminal and enter these commands
to flash your kernel to your phone just add the boot.img to this .zip_archive move it to your phone's sdcard boot to cwm and flash away
there are two tar.gz files in the zip folder the platform source and the kernel source
just extract the kernel source which is GT-S5360_kernel.tar.gz to a folder of your choice in your home folder and again extract the conntents of the tar.gz file . The extracted tar.gz should contain two folders which are common and modules
now open common folder and open Makefile with gedit
now look at line 194
as you can see mine is
CROSS_COMPILE ?=/home/thirdzcee/arm-2009q3/bin/arm-none-eabi-because i extracted the gcc compiler in my home folder, you should replace the lines to the directory where you extracted the gcc compiler and it should contain "/bin/arm-none-eabi-" as this points to the subfolder where the required toolchains to compile are so this should be your format
CROSS_COMPILE ?=/home/* your username* /* directory where you extracted gcc*/bin/arm-none-eabi-it is important to do this because you wont be able to compile without making this change in the makefile
and lastly the kernel compiling tools.zip contains 2 things in them split_bootimg.pl and mkbootimg for our galaxy y
extract them all and extract mkbootimg.tar.gz as well and remember where you extracted these files
COMPILING THE KERNEL
so now everything appears to be all set up and we are ready to compile ourselves the kernel zImage. first up is open a terminal and go to the directory where you extracted the kernel source code specifically to the common folder. mine is in home/thirdzcee/Android/kernel/common so i type in terminal
cd Android/kernel/common
as you can see I need not add home/*my username*/ to the command as it is because the terminal starts up in your home directory already. so the format for your input in your terminal should be
cd *directory to where you extracted kernel source*/commonnow its time to choose the config file for the kernel type in terminal
make bcm21553_totoro_05_defconfig
your final output after entering the command should contain this
# configuration written to .config
to edit the configuration file run
make menuconfig
and this is what you should see
you can use the arrow keys to navigate, enter key to make choose a selection and the spacebar to change something if you want to include that certain configuration feature in the kernel which will dislplay an asterisk [*] or as a loadable module which will display as [M] in the selection
after making all your changes (do not change anything if you dont know what the changes your doing to the config will do to the kernel) exit and choose yes to save the configuration
now to begin the compilation process, enter this command in terminal
"make" for default or "make -jx" where x = to the number of cores your cpu has +1
mine is dual core so i type: make -j3
this is gonna take a while depending on how fast your processor is and your disk write speed as well so i suggest you go have coffee or do something else for a while...... and its done next thing to do is to grab the zImage so type this command in terminal
cp arch/arm/boot/zImage ~
cd ~those commands will copy the zImage to your home directory and will also bring you to the home directory as well, now its time we get an md5 check sum for the zImage( this is really important, kernel wont work too if you get the numbers wrong during this step) so now type in terminal
md5sum zImageand the output would be something like this:
65323874ebbdf80ba0a2ab3b775ff422 zImage
take note of the output as you will need it later
now we cd to the directory where you extracted mkbootimg so if its extracted in your home folder just type in terminal
cd ~/mkbootimg
now we move the zImage to the mkbootimg folder by entering this command
mv ~/zImage ./
now we have zImage ready and all we need is a ramdisk so heres a download link of stock kernel ramdisk and paste it in the mkbootimg folder where the zImage is also found or you can use the split_bootimg.pl that came along with the mkbootimg download to get the ramdisk of any kernel you like by putting the kernel boot.img and the split_bootimg.pl in the same directery, preferably home and in terminal navigate to that directory and type in this command
./split_bootimg.pl boot.imgthen copy the boot.img-ramdisk.gz to mkbootimg folder
now navigate to mkbootimg folder in terminal and enter these commands
chmod +x mkbooting
./mkbootimg --kernel zImage --ramdisk boot.img-ramdisk.gz --base 0x81600000 --kernelMD5 <md5sum result> -o boot.imgand voila you now have succesfully compile your own kernel!!!
to flash your kernel to your phone just add the boot.img to this .zip_archive move it to your phone's sdcard boot to cwm and flash away