[Galaxy S I9000 Android Development] sztupy:
I added some convenience scripts to the config. Read the new tutorial here

The old one still works:

I put together a small virtualbox vm with a very minimal debian config with which I was able to compile a working kernel. This is for all the people who are running Windows, and want to try modifying kernels/initramfs's. As this is a minimal config there are some drawbacks (like it doesn't have a graphical interface), but you can always install additional packages, if you want to.

The VM includes: debian, build essentials, git, vb guest additions, mc, vim and codesourcery 2010q1 gnu-eabi. (it's larger than the simple eabi version, but can be used to compile non-kernel applications too)

First of all I hate both SunOracle VirtualBox and debian, but VB is free, and debian is lean, so they'll do the job.

To get the image running do the following:

First download and install VirtualBox

Next download the VM image: http://android.sztupy.hu/dl/KernelCompilerVM-1.1.7z and extract it. (it's a large download. If you can please put it up a mirror)

Mirrors: (thanks to the people mirroring it)

- http://www.multiupload.com/THJV19BJ9X

- http://bote.ro/sztupy/KernelCompilerVM-1.1.7z

After this run virtualbox, and import this VM.

Run the VM. The username/passwords are: root/root and kernel/kernel. Login with kernel. (you can always switch to root using sudo)

Next choose what kernel/initramfs you want to compile.

Here are some links to kernels:

The original sources can be found at supercurio's git:

git://github.com/project-voodoo/linux_gt-i9000.git

froyo-samsung branch

The kernel of the voodoo project can be found at the same place:

git://github.com/project-voodoo/linux_gt-i9000.git

froyo-voodoo branch

The ULTK kernel can be found at my account:

git://github.com/sztupy/universal_lagfix_kernel.git

Here are some links to initramfs files:

The original froyo initramfs can be found at supercurio's git page:

http://github.com/project-voodoo/samsung_ramdisks.git

afaik the voodoo initramfs is build using scripts from these images, so you have to apply them.

The ULTK initramfs can be found here:

git://github.com/sztupy/universal_lagfix_kernel_initramfs.git

For the rest of the tutorial I'll be showing how to compile ULTK:

First get the kernel sources using git:

git clone git://github.com/sztupy/universal_lagfix_kernel.git kernel

Unfortunately no copy-paste function is available, so you have to write this manually...

Next get the initramfs using git:

git clone git://github.com/sztupy/universal_lagfix_kernel_initramfs.git initramfs

If everything goes well you'll have two directoryes, called kernel and initramfs. Next we have to modify some values in the kernel configs.

Nano, mcedit and vim are installed, use the one that suits you best. (mcedit is the most user friendly)

Switch to the kernel directory and edit the Makefile there:

cd kernel
nano Makefile

Find the row that says

CROSS_COMPILE	?= some value

Replace it to

CROSS_COMPILE	?= /home/kernel/arm-2010q1/bin/arm-none-linux-gnueabi-

(if using nano make sure it won't add a line break into the row)

Next load the default config:

make aries_eur_defconfig

And edit it:

nano .config

We have to supply the directory of the initramfs. Search for the line:

CONFIG_INITRAMFS_SOURCE=some value

and replace it to

CONFIG_INITRAMFS_SOURCE=/home/kernel/initramfs/out

(this is for the ULTK. For voodoo the initramfs locations are "froyo-xxjp6" and "froyo-xxjpm" instead of "out")

if you've managed to do that too, let's compile the kernel:

make

If everything goes fine after a while you will have your shiny new kernel. Now let's get it to your computer, so it can be flashed:

First, you have to create a shared folder in VirtualBox. Simply create a directory somewhere on your computer, and add it as a shared folder in virtualbox. The name of the shared folder should be simple, for example "shr".

Next, you have to mount that directory inside the VM. To do this enter:

sudo mount -t vboxsf shr ~/share

After it has been mounted you can copy the fresh kernel to your host OS:

cp arch/arm/boot/zImage ~/share

If everything goes well you have a zImage ready at the folder you've just shared. TAR it, fire up odin, and flash.

---------------------------------

Now that you've succesfully compiled a working kernel try to modify it. You can use "make menuconfig" in the kernel directory to switch some kernel functions (like filesystem supports) on and off. You can edit .config by hand to add or remove some configuration values. And you can edit the files in the initramfs directory. After modifications you only have to enter "make" in the kernel directory to get your kernel inside the "arch/arm/boot/zImage" dir ready.

You can also copy files from your host OS, to the guest OS, by putting the file inside the shared folder and copying it:

cp ~/share/thefile ~/initramfs/copyithere

Hope this guide was useful.