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:
make menuconfig (allows you to adjust the kernel configuration to
suit you; there are many documents on the web describing the configuration of
the kernel, one of them you can find at
http://www.tlug.org.za/old/guides/lkcg/lkcg_config.html)
make (starts the compilation of the kernel; if you have more than
one processor core in your machine, you may want to use the -j option
of make, for example ''make -j5'')
make modules_install (installs the kernel modules in the
/lib/modules/ directory, creating the subdirectory named after the
version of the newly compiled kernel)
cp arch/i386/boot/bzImage /boot/vmlinuz-<kernel_version> (copy the
kernel to the /boot directory; <kernel_version> should be
the label reflecting the version of the kernel being installed)
cp System.map /boot/System.map-<kernel_version> (copy the map of
kernel symbols to the /boot directory)
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