User manual

Linux Guide taskit GmbH
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 your product are made up of a standard
kernel with ARM patches and some AT91-specific patches or drivers.
The process for creating your own kernel is broken down into three steps – configuring,
compiling and installing.
6.1. Configuring the kernel
The source codes for the Linux kernel are on the starterkit-CD in the tarred GZIP archive
linux.tgz. The kernel sources are configured in delivery form. You just need to append the
drivers you want to use or deselect the drivers that you don't need.
Before you can configure the kernel the tarred archive has to be extracted to your
development folder:
cd /develop
tar -xzvf starterkit-CD/linux.tgz
Before you can change the kernel configuration and compile your new kernel, you will
have to setup the kernel for your product:
ARCH=arm make PRODUCT_defconfig
Note: PRODUCT specifies the name of your product (the precise command for your
product can be found in the appendix “Product specific kernel settings”).
Now the kernel is configured for your product which factory settings. Various tools can be
used to change the kernel configuration; the most well-known is menuconfig.
Menuconfig is a Text User Interface (TUI), it offers a text-based interface, which allows for
easy configuration and can also be used in terminal emulation mode. In order to use it you
have to install the curses development package:
apt-get install ncurses-dev .
After that you can start the kernelconfiguration by typing:
ARCH=arm make menuconfig.
Page 18 of 65 Version 1.26 (2008-04-30)