The default Linux kernel of Debian Lenny is of course very stable - but a little outdated. If you’re the more adventurous type (or just need support for newer devices) you might like the idea of installing a more recent vanilla kernel? Debian makes this task quite easy and you’ll end up with real Debian kernel deb-packages! I’ll provide a small HOWTO here which you might follow and a small script which will automate everything. I gathered most of the information given here from the official Debian documentation (have a look at this and this).
OK, let’s start! First, make sure the following packages are installed:
If you choose
/usr/src as the source directory (which I strongly recommend), add yourself to group ‘src’ by
If you follow this, you don’t have to be root to build a new kernel - and that’s a good thing. Now import the Kernel Archive signing key to your gpg keyring (see this for details):
We need this to verify the integrity of the source tarball later on. So, download the kernel sources from https://www.kernel.org/ and the corresponding signature file from here to
/usr/src. Then check the source tarball integrity by
and you should see something like this:
gpg: Signature made Mon Oct 9 23:48:38 2000 PDT using DSA key ID 517D0F0E
gpg: Good signature from "Linux Kernel Archives Verification Key <firstname.lastname@example.org>"
If not, something went wrong during your download and you have to try again.
We may now unpack the source code (still within
For a start, copy an old
.config file to the kernel source tree. You may use the one from
/boot of your current kernel. I tend to choose one from sidux’ kernel, configured by slh. To do so, download a kernel package from one of sidux’ download mirrors and extract the content to a temporary directory, then copy
boot/config-<WHATEVER_VERSION> to your kernel source tree as
.config. For example, download “linux-image-2.6.29-1.slh.3-sidux-amd64_2.6.29-9_amd64.deb” and extract the content by:
Proceed with configuring and compiling the new kernel:
You may tweak your kernel now. (The sidux kernel tends to have almost every module compiled, so you might want to deselect some modules which you don’t here). I’d recommend to change at least the processor type to match your actual CPU, i.e., “Generic x8664” to “Athlon64” in my case. Now save your configuration and exit _xconfig. (EDIT: optionally run ‘
make-kpkg clean’, if you build multiple kernel packages with different configuration.) Let’s build the kernel package:
The “–append_to_version” switch may be used to append the revision and architecture/CPU type to the kernel name. For example “custom.1-amd64-k8”. Replacing
Whatever you choose, the former step may take a while, depending on your machine (it takes almost an hour on my computer - but I tend to compile a lot of modules, even those I might never need!) Once done, I’d recommend running almost the same command again but this time building a kernel header package:
You may repeat this with “kernel_doc” and “kernel_source”, too. You should end up with deb-packages in /usr/src, which can now be installed by
Your grub configuration will be automatically updated, just like with default Debian kernel updates - the Debian way! Once your new kernel is installed, remember to reinstall any proprietary drivers for your new kernel, like those by Nvidia or Ati.
Reboot to the new kernel and see if everything works… Good luck! ;-)
As I’m kind of lazy, I decided to script this whole procedure, so I don’t need to remember everything. You may download this script from here and do with it almost everything you like (I do not know, if a license is required for a small script like this, but if so, it’s GPL’d 2, of course.)
This script basically does everything described above automatically. It asks for the desired kernel version, downloads it if required, checks the gpg signature, asks for the revision, starts xconfig and creates the kernel packages. Please open this script first in your favorite editor and have a look at a few configurable variables and maybe adjust them. Please take a look at the README file! You may then run this script (NOT as root) and it should work.
Download the script from here:
custom_kernel_0.51.zip (Version 0.51) (md5sum:
Disclaimer: This script is provided “as is”, I give no warranty whatsoever.