Compiling The AndroidLinux Kernel For The Epic Touch 4G.
Compiling The AndroidLinux Kernel For The Epic Touch 4G.
First, we are going to get familiar with the android kernel by compiling a stock build and
flashing it with Odin to your et4g.
Samsung open-source kernel and platform files. Available at: Samsung Open Source
Type in: Sph-d710 in the search bar in the link and download latest source.
initramfs files (More on this later) (includes cwm, busy box, and of course root! Thanks to
chris41g for his help.) Files available at: Initramfs Files
Step 1: Were going to unzip the source you got from Samsung and take a short look
around.
unzip the source and unzip the file that says, “SPH-D710_GB_Kernel.tar.gz” and, open it up.
You are now looking at the kernel source for the Epic touch 4g! Okay I well not go over to much
whats is here but, I well add a more in depth look in the kernel soon.
Scroll to the bottom of the source and you should see a document that says, "makefile". We are
just going to add a name for your stock compile of the kernel, to make it a little more special.
Open it and go to where it says Extra version and add your last name ,just make it all lower case
letters or it wont compile correctly. When you flash it to your phone, the about phone panel in
setting well say: Kernel version: 2.6 [last name you chose] now.
Step 2: Lets get started!
Open terminal in Linux and change your directory to the kernel. You do this by putting,
“cd” and then typing where your kernel source is then hit enter. My terminal looked like this:
Quote:
cd /home/shane/Desktop/SPH-D710_GB_Kernel
Step 3: Tell terminal where your tool chains you downloaded are located.
The kernel is compiled using a tool chain, and the terminal needs to know where the tool chain is
to compile. (The tool chain is the folder called “arm-2009q3” )Start by typing this in the
terminal:
Quote:
export CROSS_COMPILE=
Then after that put where your tool chain is located. Also when you are entering where it is at,
you need to put a “/bin/arm-none-eabi-” at the end of the directory. This shows the terminal that
the compiling tools are under the folder bin and starts with arm-none-eabi- and the android
compilation adds the last word for the compiler program it needs. (you can see this if you go into
the bin folder under the “arm-2009q3 folder.) For adding the tool chain I entered this:
Quote:
export CROSS_COMPILE=/home/shane/Desktop/arm-2009q3/bin/arm-none-eabi-
Then hit enter.
Step 4: Clean the kernel, enter configuration files and make the modules.
make c1_rev05_na_spr_defconfig
This is the configuration files for the epic touch 4g and well compile the kernel based off what is
in these files.
make modules
*Initramfs files are the root filesystem of the kernel and does processes the kernel can't do itself
while its booting.
You can do this by terminal or by hand. We are just moving the modules to the initramfs to be
used when compiling the kernel.
You can type this into terminal (Where it says “Path to initramfs” you need to replace with your
own path to the initramfs folder + /lib/modules) :
Quote:
*Remember to replace the “path to initramfs file” with the path to the initramfs file.
Okay this well take anywhere from 5-15 mins. to compile depending on your system.
Step 8: Were done compiling, lets make something flashable for Odin!
cd arch/arm/boot/
Then type:
Quote:
If you open up the kernel source file and go to arch/arm/boot you well see the zimage you
compiled and, the Mykernel.tar file for Odin. Double check and right click on the zimage and
make sure it is around 5-6 MB before flashing.
Go to a windows computer and download Odin.(if you have rooted your phone using zedomax's
method you should have it installed already)
Okay now open it up and place the Mykernel.tar file in the PDA section of Odin. Now download
the drivers for your phone if you haven't.(I assume you already have.) Then put your phone in
download mode (hold volume down button and power button on start up and push volume up
button when the warning pops up) Now plug your phone into the computer and make sure “auto-
reboot” is the only box checked in Odin. Hit start and your phone well be flashed with a kernel
you compiled yourself! If you did this right your phone should start up. If it is stuck in a boot
loop, immediately put back in download mode and flash to stock. Link available here to stock
files:
http://forum.xda-developers.com/show....php?t=1409634
and, try to figure out what you did wrong while compiling and try again!
Good job you have finished!
I would like to include more android kernel mods and stuff in the future but, wanted
to get this out there to get people familiar with the android compiling process. I want
this guide to be something people reference as they start to develop, by using the
methods here along with kernel and U.I mods on the platform being implemented in
the future. My ultimate goal is to at least know I helped at least one person get into
android development so, if I helped you please leave a reply or say thanks. If anyone
has ideas to add to the post, please pm me.
Have fun developing!