Debian Clusters for Education and Research: The Missing Manual

Setting Up the Kernel Build Environment

From Debian Clusters

(Redirected from Tuning the Linux Kernel)
Jump to: navigation, search

Building A Linux Kernel

The kernel that comes with the standard Debian distribution is intended to be universal in nature, being able to run on laptops through coffee pots (not really) to clusters. In general, there is a lot of support built into the stock distribution kernel that is not needed. Worse yet, some components of the stock kernel have the potential to undermine system performance.

As such, a kernel tuned for a high performance environment will likely want to be pruned of kernel features that serve no functionality to a compute node. Moreover a kernel tuned for high performance environment will likely include add-ons not normally found in the stock distribution kernel.

One of the fundamental reasons for choosing Debian for the base distribution of our cluster environment is the exceptional apt package management system. When confronted with the task of simultaneously updating and patching the kernel of hundreds of systems at a time, the power of apt and the Debian package management system really shines.

A word of warning is advised here. If you are running Debian (or Ubuntu) and following a kernel HowTo that suggests that you symlink your linux source tree to /usr/src/linux, RUN AWAY AS FAST AS YOU CAN!. This is just plain wrong on so many levels. I could elaborate more, but [I'll defer to Linus' response]. Suffice it to say, that this separation between source and headers is even more important in Debian, where the apt approach maintains everyone's kernel sanity.

An alternative to the single-system approach of "make oldconfig && make bzImage && make modules && make install && make modules_install && make me_crazy" approach to building a kernel is Compiling the Kernel "The Debian Way"

Setting up the kernel build environment

In order to create a Debian kernel "the Debian Way," you'll need to be able to build Debian kernel packages. You will need a slew of compilers and build tools in order to package up your kernel. Fortunately, the Debian apt repository has a meta package that pulls down all of the build tools that you'll need to build your kernel package:

  apt-get install kernel-package

One additional package that will make your life easier when it comes time to configure your kernel is the libncurses5-dev package. This package provides the text-based interface (ncurses) to configure the kernel.

  apt-get install libncurses5-dev

The final ingredient is the most important...the source code for the Linux kernel:

  apt-get install linux-source-2.6-25

Once the installation completes, you will find the Linux source in a bzip-compressed tar file under /usr/src/. As root, cd into /usr/src and unpack the tarball:

  root@trippio:~# cd /usr/src/
  root@trippio:/usr/src# tar xvfj linux-source-2.6.25.tar.bz2

The options to tar are to e"x"tract, be "v"erbose, the following "f"ile that has been bzip compressed ("j", because "b" was taken for block size long before bzip compression was available, and "z" was already taken for gzip).

The tarfile will extract into the directory linux-source-2.6.25.

Personal tools