When the topic of this book was first presented to me, I dismissed it as something that was already covered by the plentiful documentation about the Linux kernel. Surely someone had already written down all of the basics needed in order to build, install, and customize the Linux kernel, as it seemed to be a very simple task to me. []
So this book was created with the goal of consolidating all of the existing information already scattered around the Internet about building the Linux kernel, as well as adding a lot of new and useful information that was not written down anywhere but had been learned by trial and error over my years of doing kernel development.
My secret goal of this book is to bring more people into the Linux kernel development fold. The act of building a customized kernel for your machine is one of the basic tasks needed to become a Linux kernel developer. The more people that try this out, and realize that there is not any real magic behind the whole Linux kernel process, the more people will be willing to jump in and help out in making the kernel the best that it can be.
Audience for the book
This book is intended to cover everything that is needed to know in order to properly build, customize, and install the Linux kernel. No programming experience is needed to understand and use this book.
Some familiarity with how to use Linux, and some basic command-line usage is expected of the reader.
This book is not intended to go into the programming aspects of the Linux kernel; there are many other good books listed in the Bibliography that already cover this topic.
[] Disclaimer: I'm a Linux kernel developer by trade, so things that seem basic and simple to me at times are completely incomprehensible by most people, as my family continues to remind me at times.
Organization of the material
There are three major parts to this book. The first part is composed of Chapters 1 through 6, which cover everything you need to know about retrieving, building, installing, and upgrading the Linux kernel, in more or less step-by-step fashion.
The second part consists of Chapters 7 and 8, which describe how to properly configure the kernel based on the hardware present in the system, and provides a number of different "recipes" for common configurations.
The final part consists of Chapters 9 through 11. These chapters provide a reference to the different kernel command line options, the kernel build options, and a select few of the different kernel configuration options.
Chapter 1, Introduction
, explains when and why you would want to build the kernel.
Chapter 2, Requirements For Building and Using the Kernel
, covers the different programs and tools that are needed in order to properly build the kernel. It also covers a number of different programs that are tied very closely to the kernel, how to determine the needed version of the programs, and where to find them.
Chapter 3, Retrieving the kernel source
discusses how the different Linux kernel versions relate to each other, where to retrieve the Linux kernel source code from, and how to download it properly.
Chapter 4, Configuring and Building
explains how to configure and properly build the Linux kernel.
Chapter 5, Installing and Booting from a Kernel
shows how to install the kernel that has been built properly, and then boot into that kernel version.
Chapter 6, Upgrading a Kernel
explains how to upgrade a kernel that was previously built to a newer version without having to start over from nothing.
Chapter 7, Customizing a Kernel
discusses how to customize the kernel for the hardware that is present on the system. It goes over a variety of different ways to determine what options should be selected and provides some simple scripts to help with the task.
Chapter 8, Kernel Configuration Recipes
explains how to configure the kernel for a variety of common situations.
Chapter 9, Kernel boot command-line parameter reference
details all of the different command-line options that can be passed to the kernel, and what the different options do.
Chapter 10, Kernel build command line reference
describes the different command line options that are available when building the kernel and how to use them.
Chapter 11, Kernel Configuration Option Reference
focuses on a few of the more popular and important Linux kernel configuration options.
Appendix A, Helpful Utilities
introduces a number of very good and handy tools that everyone who wishes to track the latest Linux kernel version should use.
Online Version and License
This book is freely available under the Creative Commons "Attribution-ShareAlike" license, Version 2.5. This license can be seen in its entirety in [THE LICENSE]. The full book is also available online at http://www.kroah.com/lkn.
Conventions Used in This Book
This book uses the following typographical conventions:
ItalicIndicates commands and command options, files, directories, usernames, and hostnames. Also indicates nomenclature that we've not previously used, emphasized words, and new terms.
Constant Width
Indicates strings used for kernel configuration, as well as a few special terms such as device names and distribution packages. Also used to show the command output, and the contents of text and program files.
Constant Width Bold
Used in examples to indicate commands or other text that should be typed literally by the user.
Constant Width Italic
Indicates text that you should replace with your own values; for example, your own name or password. When this appears as part of text that you should type in, it is shown as Constant Width Italic Bold
.
#
,
$
Used in some examples as the root shell prompt (#
) and as the user prompt (