Skip to Content
Linux Kernel in a Nutshell
book

Linux Kernel in a Nutshell

by Greg Kroah-Hartman
December 2006
Intermediate to advanced
202 pages
8h 29m
English
O'Reilly Media, Inc.
Content preview from Linux Kernel in a Nutshell

Chapter 4. Configuring and Building

Now that you have downloaded the source for your selected kernel version and installed it into a local directory, it is time to build the code. The first step is to configure the kernel with the appropriate options; the kernel can then be compiled. Both tasks are done through the standard make utility.

Creating a configuration

The kernel configuration is kept in a file called .config in the top directory of the kernel source tree. If you have just expanded the kernel source code, there will be no .config file, so it needs to be created. It can be created from scratch, created by basing it on the "default configuration," taken from a running kernel version, or taken from a distribution kernel release. We will cover the first two methods here, and the last two methods in Chapter 7.

Configuring from scratch

The most basic method of configuring a kernel is to use the make config method:

$ cd linux-2.6.17.10
$ make config
 make config
scripts/kconfig/conf arch/i386/Kconfig
*
* Linux Kernel Configuration
*
*
* Code maturity level options
*
Prompt for development and/or incomplete code/drivers (EXPERIMENTAL) [Y/n/?] Y
*
* General setup
*
Local version - append to kernel release (LOCALVERSION) []  
Automatically append version information to the version string (LOCALVERSION_AUTO) [Y/n/?] Y
...

The kernel configuration program will step through every configuration option and ask you if you wish to enable this option or not. Typically, your choices for each ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux Kernel Development, Third Edition

Linux Kernel Development, Third Edition

Robert Love

Publisher Resources

ISBN: 0596100795Supplemental ContentErrata