next up previous contents
Next: Useful make options Up: Compilation and installation Previous: Compilation and installation   Contents

Kernel compilation

First, your system should be prepared for the configuration and compilation of the kernel. You will need gcc, make, binutils, util-linux and the package containing the ncurses header files (libncurses5-dev in Debian or ncurses-devel in Fedora Core and OpenSUSE). If you want to use a graphical tool for configuring the kernel, you will also need the Qt library or GTK+ and the corresponding development packages. The file Documentation/Changes in the kernel sources directory contains the list of all programs that you may need.

Now, we assume that you have already downloaded the kernel source code and patched it to obtain the required version. To compile it, change the current directory to the one that contains the kernel sources and run the following sequence of commands:

Instead of ''make menuconfig'' you can use ''make config'' that will cause the kernel build system to ask you a lot of questions regarding its configuration, which is inefficient and tedious, but can be done without ncurses.

If you have already configured the kernel, you can use the configuration file .config from the previous compilation. For this purpose copy it to the directory containing the current kernel sources and run ''make oldconfig'' (it works like ''make config'', but does not ask so many questions). Alternatively, you can use the configuration of the distribution kernel (usually it contains many things you will never need and that is one of the reasons why you may want to learn how to configure the kernel):

$ zcat /proc/config.gz > .config
$ make oldconfig


next up previous contents
Next: Useful make options Up: Compilation and installation Previous: Compilation and installation   Contents
MichaƂ Piotrowski 2007-06-21