Building a Kernel

This example uses Fedora Core 4. Other distros will be similar, but not identical.

Why Build Your Own Kernel?

  • Optimizing for a particular processor
  • Adding specific drivers: “disk-only” drivers for some IDE disks, and issues with IDE CD-ROMs
  • Removing unnecessary drivers (most are external modules, but some are internally compiled)
  • Networking: Gigabit ethernet vs 100 Mbps, iSCSI, Fibre Channel
  • Queuing: real-time devices
  • Upgrading: moving a current system to a newer kernel


Create an emergency boot disk for your system before you go any further.

Insert a blank floppy disk in your first disk drive (/dev/fd0). First, you need to know the version of your kernel. Issue the command:

uname -r #for a short listing
uname -a #for a long listing

Write down the kernel version. Typically it will be something like 2.4.21-20. Now insert a floppy in the drive and command:

mkbootdisk –device /def/fd0 2.4.21-20 #replace 2.4.21-20 with your kernel version

Also note that one critical update may need to be performed on 2.4 kernel systems to upgrade to 2.6 kernels: you might have to update module-init-tools.


Kernel Versions

Kernels have three numbers. The 2.6.12 kernel, for instance, has a:

  • Major number of 2
  • Minor number or 6
  • Revision number of 12

The kernel itself is frequently named “vmlinuz”.


Determine Your Current Kernel Version

In most distros:

uname –a

gives you a long listing of your kernel information

uname –r

gives you the kernel version only

In Red Hat use :

cat /etc/redhat-release
cat /proc/version


Review the Kernel ReadMe

2.6 Kernel Readme/How-To


Resource: Digital Hermit’s Kernel How-To