Creating custom kernels with Debian's kernel-package system

Kevin McKinley


Revision History
Revision v0.9515 April 2003Revised by: kjm
Made new section for "Checking Minimal Requirements", added use of ver_linux script to check minimal requirements, changed to use "dpkg -i" to check program versions instead of checking Debian.changelog, moved "Create symlink" section, added new section "Adding third-party modules to an existing kernel", numerous minor stylistic changes.
Revision v0.921 March 2003Revised by: kjm
Numerous additions and revisions to bring up to date with Woody and kernel 2.4.18, revised list of packages to install, added general comments on configuration, expanded comments on xconfig, added section on menuconfig, added section on --append-to-version, revised section on --revision, deleted section on --flavours, added section on kernel-image file names, added use of fakeroot, added Advanced topics page.
Revision v0.323 May 2001Revised by: jwg
Updated section on symlinks, program version checks, how to compile as a regular user rather than root, filled in the checklist, added troubleshooting section(needs work).
Revision v0.222 April 2001Revised by: jwg
Quick fix on grammatical and spelling errors.
Revision v0.121 April 2001Revised by: jwg
Initial release.

This document is intended to help Debian newbies use the kernel-package system to create custom kernels. Copyright © 2003 Kevin McKinley, NewbieDoc project. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license can be found at the Free Software Foundation.

Thanks to Jesse Goerz for taking the biggest step and writing the first three versions of this document, and for graciously allowing me to carry it forward.

Table of Contents
1. Introduction
2. Preparations
2.1. Making a backup boot diskette
2.2. What to install
3. Setting up the source tree
3.1. Adding yourself to the src group
3.2. Expanding the source tarball
3.3. Setting up the symlink
3.4. Checking Current Minimal Requirements
4. Configuring the kernel
4.1. General Notes
4.2. make xconfig
4.3. make menuconfig
4.4. make config
5. Building the kernel image
5.1. make-kpkg
5.2. --append-to-version
5.3. --revision
5.4. Kernel package names
5.5. fakeroot
5.6. Making the kernel image
6. Installing the kernel-image package
7. What now?
7.1. Hold that kernel!
7.2. Removing the symlink
7.3. Backing up your kernel
7.4. Making a new boot diskette
7.5. Removing old kernels
7.6. Building your next kernel
8. Advanced topics
8.1. Using an existing configuration
8.2. Kernel-package and grub
8.3. Third-party modules
8.4. Adding third-party modules to an existing kernel
8.5. Debian kernel patches
9. Checklist