Compiling a kernel on Debian

From LQWiki
Jump to navigation Jump to search

Debian has some utilities to make compiling a kernel easier. The kernel-package set of utilities allows to to create your own kernel package. For most users, this just means that your kernel shows up like all other debian packages. However, if you have multiple machines running the same kernel, it allows an easy way to install it on all of them. So let's get started.

First, make sure you have the kernel-package tools. You can install them with the command

  apt-get install kernel-package

The initial steps are the same

  make clean 
  make menuconfig (or xconfig etc...). 

Once your kernel is configured, type

  make-kpkg kernel_image 

and it will make your kernel.

Assuming the compile was successful, it will create a .deb in /usr/src which you can then install by typing

  dpkg -i kernel-package-filename

follow the instructions and reboot.

You can also create a custom kernel name (to avoid overwriting other kernels you have made) by typing something like:

  make-kpkg kernel_image --revision=custom.1

This is just a quick review of the commands you need, for more information check out this guide to compiling using the kernel package program.

See Also