Cross compiling with KernelKit


The first way I found is an out of the box cross compiling environment based on Knoppix called "KernelKit".

As it is easier to setup a toolchain on SuSE 9.3 with the handheld toolchain, this "howto" stays published here just as an
archive.

Requirements:
Setup:

First download the KernelKit iso at http://free-electrons.com/community/tools/kernelkit/en. I used the version 0.3.1.
Burn the image on a CD. Next get the kernel sources at http://www.kernel.org/. I took the version 2.6.14. as tar.gz file.

As I located the kernel sources on a Windows PC, I will describe my procedure here. There are probably other (better)
ways to proceed, but this is how it worked for me.

Once you got the kernel sources unpack them to c:\kernel\. You can use WinRAR for unpacking the tar.gz file. Unpack
the archive to c:\kernel\. Now the sources will be located at c:\kernel\linux-2.6.14\.

As you will start KernelKit on the second PC, you will need to connect to kernel sources over the network. Therefor
the folder c:\kernel needs to be accessable. So create a share on the folder c:\kernel with writeaccess to all users.

The reason for putting the kernel sources on a Windows PC is that the RAM disk of KernelKit offers not enough
space for the kernel sources. Once you created the share on the Windows PC, you can boot the second PC on
the KernelKit CD.

When KernelKit came up, bring it into the same network as the Windows PC is. Test the network connection with
"ping ip-address-of windows-pc". Next create a folder named /home/knoppix/kernel on KernelKit. Now connect to
the Windows share from a shell with

su -

mount -t smbfs \\\\ip-address-of windows-pc\\name-of-the-share /home/koppix/kernel


Stay within the root shell and cd to /home/knoppix/kernel/linux-2.4.16/.

Next you will need to create two symlinks:

ln -s /usr/local/uclibc/arm .
cd include
ln -s /usr/local/uclibc/common-files/stdarg.h .


Watch the dots.

Cross compiling:

Now everything is ready to compile.

Stay within the root shell and cd to /home/knoppix/kernel/linux-2.4.16/. Type:

make allnoconfig

This creates an "empty" .config file. Next you need to configure the kernel to your needs:

make menuconfig

At this point I can't help you at the moment, because I am still looking for the best settings (here). What is important is to
set the right processor type at "general setup". Once you found a configuration for your needs compile with:

make zImage

After the compilation you find your new ARM kernel at arch/arm/boot/zImage

As I wrote, there may be better, faster or whatever ways to cross compile an ARM kernel, but this way worked for me.

Lets have fun on Maui ...
Chris

Back to "Cross compiling an ARM kernel"


Last update: 11.22.2005