Build kernel from 3rd-party sources on Debian 5

There are several way to build your kernel on Debian Linux and building it from kernel-sources is most recomended way, but it's possible that you need to build it from original tarball or some non-offical patchset. This artical describes the way to do this without turning your system into Slackware.

Install necessary packages:

$sudo apt-get install debhelper mc kernel-package libncurses5-dev tar bzip2

Download and untar kernel sources to /usr/src. You can try to download the sources from somewhere on or github:

#cd /usr/src
#wget http://url-to-linux-kernel-x.y.z..tar.bz2
#tar xvjf linux-kernel-x.y.z.tar.bz2
#cd linux-kernel-x.y.z
#make menuconfig

Now you should go throout the menu and choose optioins. To make the porcess simplier you can run make oldconfig before make menuconfig to take options of you current kernel and choose settings for unchaged options only. When you finished with configuring it's time to build the package:

#make-kpkg linux_image --initrd

If you're incredibly lucky or building kernel often you will see .deb package in /usr/src that will be called linux-image-x.y.z.deb that you can install with dpkg or in your favorite way.

This article was sourced by the follwing entry [RU]: