6. Compiling a new Linux kernel

If you work with Embedded Linux regularly, you will often face the need to create your own kernel. In most cases, this involves integrating new drivers, e.g. for USB devices, or additional file systems. Because memory space is limited on an embedded board, it does not make sense to set up a large number of drivers to start with (as is common for desktop PCs) unless you know for sure that you actually need them.

The kernel binaries and sources delivered with the product are made up of a standard kernel with patches or drivers from taskit. The process for creating your own kernel is broken down into three steps: configuring, compiling and installing.

1. Unpacking the kernel sources

Before you can configure and compile the kernel, you need the kernel source code. It can be found on the Starterkit-CD in gzip- oder bzip2-compressed tar archive (tarball), e.g. linux-2.6.29-stamp9g20.tar.bz2. It may also be possible, that there are updated versions available for download, see http://armbedded.eu/downloads. Then the archive has to be extracted to your development directory, e.g.:

tar -xvjf path/linux-2.6.29-stamp9g20.tar.bz2

Replace path with the path, where the Linux tarball can be found.

If you decompress a gzipped archive, replace -xvjf with -xvzf. Bzip2 tarballs commonly have an extension of .tar.bz2 or .tbz2. Gzip tarballs use .tar.gz or .tgz.