Online Documentation Server
Net technology
Web technology
Data bases
Other docs



Вся предоставленная на этом сервере информация собрана нами из разных источников. Если Вам кажется, что публикация каких-то документов нарушает чьи-либо авторские права, сообщите нам об этом.

Basic Linux Training

Lesson 8: Rebuilding the Kernel and Using Modules

Table of Contents

Rebuilding the Kernel

The kernel you used to boot during the installation was designed to support only the minimal hardware needed to get Linux installed. You will find that this kernel does not have support for some of your hardware. Traditionally, you would have to rebuild the kernel to include that support - which requires three keys
  • you have the kernel source code
  • gcc is installed
  • you know which changes you need to make in your custom kernel
All that eats up a lot of real estate on your hard disk. If you have a minimal installation on a small partition you will not be able to do much about it.

Kernel rebuilding is an important skill, especially for system administrators, and not difficult to learn.

Sometimes you will have to upgrade the kernel to take advantage of a new version of other software - the compiler, libraries, or X applications, for example. Remember, that kernel development is being done daily, and although you do not need to be overly concerned with staying up to date with the very latest kernel, it costs you nothing but time and effort. As with any skill, the more often you practice, the quicker you will become proficient at it.

The numbering convention is

which you will see each time you login, and can easily confirm with the command
	uname -a
Even numbered minor levels are stable releases that contain only bug fixes but no new features; stick with this if you're most interested in getting things done and don't want to mess around with the operating system any more than is absolutely necessary. Odd numbered minor levels are development releases and contains new code that has not been thoroughly debugged; here's a built-in opportunity if you want to learn more than you really need to know; use this only if you are a programmer and are willing and able to put up with a lot of maintenance.

Most of you who have recently installed Linux by CD-ROM will have patchlevel 29 to 32. The procedure for downloading and installing the latest patches is not complicated - save your previous kernel tree directory before you untar the patches, and apply the patches individually in numerical order.

Using Modules

More recent development of the kernel has provided support for modules so that rather than recompiling the kernel you can edit /etc/rc.d/rc.modules to add the hardware support by simply removing the pound sign (#) in front of the line that applies to the device you want to include (and adding any additional information needed by the kernel module). Reboot and you should have the support.

These modules will be found in the directory named for the kernel currently installed, for example /lib/modules/2.0.30.

Remember, if you are using kernel modules, you will have to reinstall them when you upgrade your kernel. You do this by specifying M (to build selected drivers as modules) rather than Y (building them into the kernel). Compile your kernel as you would normally

        make dep ; make clean ; make zImage
then install the kernel modules
        make modules ; make modules_install
reboot to take advantage of the new kernel and you're ready to go.


Textbook: Running Linux

  • Chapter 7: Building a New Kernel, p.185-198

Terms and Concepts:

Define and add these to your glossary:

  • diff
  • patch
  • patchlevel
  • uname


And for those interested in hacking

If you haven't do so already, dredge up your User's Manual on your monitor and video card, and fill out the form for installing XFree86 at

Go to Basic Linux Index

Date last revised: 1 June 1998

Copyright © 1997, 1998 Henry White. All Rights Reserved.
Reproduction or redistribution without prior written consent is prohibited.
Address reprint requests and other inquiries to

With any suggestions or questions please feel free to contact us