[Galaxy S I9000 Android Development] Technecium:
Compile a Kernel in 13 Lucky Steps

If you are not familiar with Linux, you might have a hard time following this. Just as I am writing how to do get setup to compile a kernel and compile Android apps, others have written how to setup VirtualBox, Ubuntu, AndroidSDK, etc. Please see documentation provided by Oracle, Google, Ubuntu, etc. before you ask for help about VirtualBox, Ubuntu and the SDK. Thanks.

This is written for people who have used Linux but have not compiled much. Or for the brave at heart who are looking for a nice weekend project. This will tell/guide you through getting a system setup that will not destroy your existing OS.

My host OS is Ubuntu 10.10 64-bit. I wanted had to make an Ubuntu 10.04 32-bit 64-bit system for development because I didn't want to deal with 64-bit vs. 32-bit issues but since Gingerbread requires a 64-bit compiler, I had to. Might as well just use my host system, but since we're here let's keep going!

So you're about to begin. Let's just get one thing straight. No! This will not result in a kernel you can flash. “Then why do this?, you ask. Ask yourself that!

1. Install VirtualBox and the Oracle VM VirtualBox Extension Pack (Currently 4.0.0 r69151)

http://www.virtualbox.org/wiki/Downloads

2. Download an Ubuntu ISO (I suggest Ubuntu Desktop 10.04 64-bit)

http://www.ubuntu.com/desktop/get-ubuntu/download

3. Create a new VM in VirtualBox (You may/have to modify the settings)

4. Install VirtualBox Guest Additions

5. Install Ubuntu and Update Ubuntu

6. Enable multiverse and partner "Software Sources"

7. Install additional software: NOTE: I would also recommend installing preload, but it is not required.

sudo apt-get install qt3-dev-tools texinfo git-core gnupg flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev sun-java6-jdk eclipse ia32-libs

8. Get and Setup the AndroidSDK (Everything you need to know is there or just Google for help)

http://developer.android.com/sdk/index.html

NOTE: Ubuntu 10.04 does not have Java 5 in it's repositories. Follow this link to setup to Java 5

9. Get and Setup ADT Plugin for Eclipse (Everything you need to know is there or just Google for help)

http://developer.android.com/sdk/eclipse-adt.html#installing

10. Download and Install the Sourcery G++ Lite for ARM EABI Toolchain (Currently arm-2010.09)

http://www.codesourcery.com/sgpp/lite/arm/portal/subscription3053

11. Update your $PATH

You should be familiar with this because you had to do it to setup the AndroidSDK

Append the following to your PATH in .bashrc

~/CodeSourcery/arm-2010.09/bin

12 Download and Prepare the Samsung Source Code (Currently SHW-M110S_Opensource_Froyo_update2.zip)

http://opensource.samsung.com/

13. Compile a Kernel

Open a terminal window and move into the Kernel directory. Issue the following commands.

$ make shw-m110s_defconfig
$ make menuconfig

When the config editor opens do the following:

DOWN ARROW to Userspace binary formats and press ENTER

DOWN ARROW to Kernel support for a.out and ECOFF binaries and press SPACE

RIGHT ARROW to Exit and press ENTER

RIGHT ARROW to Exit and press ENTER

Press ENTER again and it will exit back to the command line

WARNING: Time is relative. This will take some time ... go make a sandwich or maybe even watch a movie.

$ make

When you see $ again check the last couple of lines of output. You want to see …

Congratulation! You just built a kernel for the m110s!