To access the contents, click the chapter and section titles.
Complete Idiot's Guide to Linux
(Publisher: Macmillan Computer Publishing)
Author(s): Manuel Ricart
ISBN: 078971826x
Publication Date: 12/22/98
Chapter 24 Customizing Your Linux Kernel
In This Chapter
- Customizing your kernel with LISA
- Customizing your kernel by recompiling
- Building a new kernel
- Configuring, compiling, and installing new kernels and modules
Customizing Your Linux Kernel with LISA
The easiest way to customize your kernel is to add and remove driver modules using LISA. The standard installation of Caldera OpenLinux contains a large number of drivers for various types of hardware. These drivers can be inserted and removed from your system automatically by LISA without the need for further work on your part. Although some userssuch as those requiring advanced power managementwill need to recompile their kernel to make use of their hardware, others will be served just as well by the kernel-management facilities offered by LISA.
For more information on using LISA to configure your system, see Chapter 21, LISA: Linux Installation and System Administration Utility.
Note: This chapter is not for the faint of heart. It gets into the nitty gritty about working with kernels
something Linux beginners need to take great caution with. It might even be something you should wait to tackle until after youve had more hands-on experience with Linux.
Customizing Your Linux Kernel by Recompiling
Kernel configuration sounds like a scary topic, but it really isnt. The one caveat is that if you are not careful, you can make your system unbootable. But then again, understanding Linux and avoiding problems are the reasons why you bought this book.
As you already know, the Linux kernel installed on your system by default seems to provide support for most of the hardware installed by most machines. This is very cool because it enabled you to do a great number of things before you even knew that kernel building was something you wanted to do. If you are happy with what youve got, read no further, you dont need to customize your kernel. Even Caldera will tell you this.
Customizing your kernel can improve the performance of your system, but given todays speedy boxes it is not likely that youll be able to tell a great difference between a custom kernel and a generic one. There are several reasons why youd want to build your own kernel:
- You have a laptop and need power management support.
- You want to enable file system quotas.
- You need Symmetric Multi-Processing support.
- Amateur Radio Network drivers.
- You want a kernel that is customized for your processor.
- You have some other special hardware or needs.
Kernel building is especially important if you have special hardware, such as a laptop. Building a new kernel for a laptop enables you to include support for the power management features provided by Linux.
If you want to see how fast Linux can go, customizing the kernel gives you a glimpse of this. A custom kernel requires less memory, speeds up the bootup process, and increases performance. The kernel will be built to take advantage of your processor (instead of an i386 processor); that alone will help zip a few things along.
In order for you to be able to build your kernel, you need to have a compiler installed. Warning: this process takes a while, and the actual compilation itself can take an hour, depending on the hardware you have and how much you need to support.
Getting Started
There are several steps that you need to accomplish in order to build and install a new kernel:
- 1. Selecting drivers and feature support
- 2. Compiling the kernel and any necessary modules
- 3. Copying the kernel to its proper place
- 4. Installing the new modules
- 5. Configuring and reinstalling LILO to see the new kernel
- 6. Configuring the new modules and rebooting
In addition to the gcc compiler, you need the following packages.
(Note that the version of your package might be better than the one
I list.) The linux-source-doc package is not necessary to build the
kernel but is good to have around. If you do a standard install, this
package is already on your disk; otherwise it is included on your
CD.linux-kernel -include-2.0.35-1.i386.rpm
linux-source-common-2.0.35-1.i386.rpm
linux-source-i386-2.0.35-1.i386.rpm
linux-source-doc-2.0.35-1.i386.rpm
If you do a standard install, your kernel sources will be located in the /usr/src/linux directory. This directory is just a link to the current kernel sources Linux-2.0.35 or whatever you have.
As usual, it is a good idea to read the documentation included with the kernel. A nice README file contains information on how to build the kernel. Some steps might be missing or not as well elaborated, but between this book and that document you will have enough support to build your own kernel.
Kernel Building Approaches
As you configure your kernel, youll be offered the option to include support of a feature in two different ways:
- Building the support into the kernel itself
- Building the support as an external module
Use built-in support instead of module support when the supported device is required in order to boot your computer. If you have a specific networking or SCSI card, and you make use of that card as the computer is starting, compile support into the kernel. This makes the kernel bigger, so limit it to things you know will be loaded no matter what.
Features that you might use on and off (such as PPP support) might be better as a module. When not in use for extended periods of time the module can be removed from memory using LISA, thus releasing your valuable resources.
Caldera uses the module approach for its generic kernel. If your hardware requires the service, the module is loaded. If not, it just occupies a little of your disk.
|