mercredi 22 septembre 2010

Compiling the TG01 kernel!

Steps :

1) Use Linux, I am using Ubuntu. Go open a console and install this packages, you may not need all of them but is good to have it all. (Taken from source.android.com)

sudo apt-get install git-core gnupg flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev

2) Download the cross compiler
I use the codesourcery cross compiler you can use the google one too!

Here is the link of the compiler:


3) Extract the compiler to /opt/cross

sudo mkdir /opt/cross
cd /opt/cross

I imagine that you have download the file in your /home/username/Downloads

tar xjvf /home/usename/Downloads/arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2

Now you will have the folder arm-2009q1 in /opt/cross

4) It is great and to easy to define global variables in a unix system so we are going to create one to make our life easier. To a console type

gedit ~/.bashrc

and add the following line

export CROSS_TOOLS=/opt/cross/arm-2009q1/bin/arm-none-linux-gnueabi-

now to the console do

source ~/.bachrc

to be able to use the CROSS_TOOLS global variable

5) Create a directory Project in you home folder

mkdir Project
cd Project

Now the funny stuff:

6) Clone the git repository :

git clone git://github.com/endrix/kernel_common.git

Wait a little for the download !!!

7) Go to the kernel_common directory

cd kernel_common

8) Change the branch to the TG01

git checkout android-msm-2.6.32-tg01

9) Create the default config for htc leo but with some modified values for the TG01

make ARCH=arm htcleo_defconfig

10) Compile the kernel Image

make ARCH=arm CROSS_COMPILE=$CROSS_TOOLS Image

You wait a little and you will have the file Image in the arch/arm/boot directory

11) Download haret from the netrriper directory

haret for qsd8x

12) create a file default.txt with this in it

set mtype 2524
set ramaddr 0x11800000
set ramsize 0x18C00000
set kernel Image
boot

13) Create a ToshDroid directory in your SD card

14) Put the "Image" file the default.txt and the haret executable in the ToshDroid directory

15) Run haret and click on Run

16) You will see that the kernel is booting

17) And it craches ;) for the moment

So that is all folks for cross compiling the Linux kernel

1 commentaire:

  1. I hope some damn smart guy will figure out how to fix the kernel to work. :) tg01 is a cheap phone, but rubbish because it runs on this ancient wm 6.5..

    RépondreSupprimer