Compile Kernel for Debian

From NJH-Wiki

Jump to: navigation, search
Languages
english - deutsch
Author
Volker Grabsch


Contents

Introduction

This guide explains how to create a linux kernel the "Debian way". For the sake of practice assume you want to set up a VServer system. So you need to create a Linux-2.6 kernel with VServer patch.

Note that building a kernel yourself is usually unnecessary:

  • Debian/Etch and newer have binary packages for every usual kernel patch.
  • For Debian/Sarge there are corresponding Backports.

If you nevertheless want to compile a kernel on your own, this guide is for you.


Preconditions

  • Debian/Sarge (Stable)
  • Grub or LILO
  • installed Linux-2.6 kernel


Steps

Install the kernel sources and the VServer patch:

aptitude install kernel-source-2.6.8 kernel-patch-vserver

Unpack the kernel sources:

cd /usr/src
tar -xjf kernel-source-2.6.8.tar.bz2
cd kernel-source-2.6.8

Use the configuration of your standard kernel as template:

cp /boot/config-2.6.* .config

Compile kernel with patch:

make-kpkg --added-patches vserver --append_to_version -vserver kernel_image

Install new kernel:

cd ..
dpkg -i kernel-image-2.6.8-vserver_10.00.Custom_i386.deb

That's it! To activate the new kernel you need to reboot:

reboot


See also

Personal tools