If you need a customized root filesystem or need to compile packages that have many dependencies, see the How To explaining the OpenEmbedded Build System. If you need to rapidly iterate in developing a small piece of C/C++ code, check out the guide to native compilation on a Gumstix COM. The following guide explains how to set up a basic cross-compilation environment. These instructions are given for a Debian-based host system, however they are similar for other Linux OS distributions.

Cross-Compiling the Linux Kernel

First, we explain how to cross-compile just the Linux kernel and run it on your Gumstix device without using a full buildsystem system.

Getting the Cross-Compiler

First, we need to get the cross-compiler. From Debian, Ubuntu, or Mint, use the following command:

Rename this file to <platform>_defconfig (i.e., for DuoVero, rename it duovero_defconfig) and move it to the arch/arm/configs subdirectory in your kernel working directory. Overwrite anything already there.

You can now run the configuration. Replace <platform>_defconfig with the name of the file you renamed in the last step:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- <platform>_defconfig

Then configure the kernel to your needs:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- menuconfig

Compile it:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage -j4

Replace the -j4 option with however many threads you want GNU make to utilize. Usually using twice as many threads as CPU cores available is good practice. When finished, the uImage kernel file can be found in the arch/arm/boot directory.

Kernel modules can be similarly compiled:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- modules -j4

The following command would then install these modules to a preformatted microSD card where the root file system is mounted at /media/rootfs. Run depmod on the gumstix to make sure these new modules can be found.

Testing the Kernel on Physical Hardware

Grab any binary files that you don't build yourself from the downloads page section for Yocto Project.

You may want to write a script that copies over the kernel automatically each time you build. If your kernel doesn't load, try using an earlier version. If you can't login or the image freezes, try using a different rootfs.

Useful Links

BEC·(note that the cross-compiler path has changed in recent versions of OE from something like·/oe/build/angstrom-2008.1/tmp/cross/armv7a/bin to something like oe/tmp/sysroots/i686-linux/usr/armv7a/bin)