Debian with a vanilla kernel

So one might want to ask why you’d want to sacrifice the fantastic stability and openness of Debian to install a vanilla (= original) kernel (Debian currently has 2.6.32). There are quite a few reasons for doing so. For example, the current kernel (2.6.38) has TRIM support, which is something I am looking for when using SSDs. Also, maybe you want to have a bleeding edge kernel just for the fun of it. So lets get started.

First order of business is to download a few packages, download the latest kernel from and then unpack the kernel in /usr/src/:

root@chimera:~# aptitude install fakeroot build-essential kernel-package debhelper dpkg-dev ncurses-dev
root@chimera:~# cd /usr/src
root@chimera:/usr/src# wget
root@chimera:/usr/src# tar xjf linux-

Then, since we want to build the kernel as a normal user and not as root, we add a user to the “src” group and set the owner group of the unpacked kernel folder to “src”. After that, there is no reason to be root anymore, so logout:

root@chimera:/usr/src# usermod -aG src simon
root@chimera:/usr/src# chown root:src -R linux-
root@chimera:/usr/src# chown root:src /usr/src/
root@chimera:/usr/src# chmod 775 src/
root@chimera:/usr/src# logout

Now we can actually configure the kernel. To do so, change to the previously unpacked kernel directory and configure the kernel using “make menuconfig”.

simon@chimera:~$ cd /usr/src/linux-
simon@chimera:/usr/src/linux-$ make menuconfig
Command line screenshot for "make menuconfig"
make menuconfig screenshot

Here you can make all your desired changes and apply all your tweaks. It is always a good idea to configure the correct processor family under “Processor type and features” -> “Processor family”. When you are done exploring and applying all your tweaks, exit the configuration utility and make sure to save your configuration. Then, make sure your configuration was saved successfully by looking for the “.config” file in the current folder:

simon@chimera:/usr/src/linux-$ ls -la
-rw-r--r--  1 simon simon 123150 May  8 13:57 .config

So let’s get cracking now. Since building the kernel can take a long time, we want to use all of our available CPU cores. Personally, I am using the Amazon EC2 service to build this kernel. By using an “c1.xlarge” instance, I have access to 8 logical cores. So set up the CONCURRENCY_LEVEL environment variable:

simon@chimera:/usr/src/linux-$ grep processor /proc/cpuinfo | wc -l
simon@chimera:/usr/src/linux-$ export CONCURRENCY_LEVEL=8

Build the kernel and kernel headers by issuing the following command. Note that you should change the “append_to_version” and “revision” parameters to fit it your needs.

simon@chimera:/usr/src/linux-$ fakeroot make-kpkg --initrd --append_to_version -krenger.1+xeon-aws --revision=1 kernel_image kernel_headers

Now go and have a coffee, because even on an 8-core machine, the build took about 20 minutes. When the build finishes, you should have two new DEB packages in your /usr/src/ folder. Install the kernel by issuing the following command:

root@chimera:/usr/src# dpkg -i linux-image-

If necessary, update your GRUB configuration (/boot/grub/menu.lst or /boot/grub/grub.cfg, depening on your Debian version) and add your newly installed kernel to the list of available kernels. Then, reboot your machine to test your new kernel out and verify that you are running your shiny new kernel by issuing:

simon@chimera:~$ uname -a
Linux #2 SMP Sun May 8 14:34:44 UTC 2011 x86_64 GNU/Linux

Hello world

My name is Simon Krenger, I am a Technical Account Manager (TAM) at Red Hat. I advise our customers in using Kubernetes, Containers, Linux and Open Source.


  1. GitHub
  2. LinkedIn
  3. GitLab