<!-- retain these comments for translator revision tracking -->
<!-- Original version: $Revision: 1.17 $ -->
<chapt id="kernel">Debian and the kernel

<sect id="non-debian-kernel">Can I install and compile a kernel without
  some Debian-specific tweaking?

<p>Yes.

<p>There's only one common catch: the Debian C libraries are built with the
most recent <em>stable</em> releases of the <strong>kernel</strong> headers.
If you happen to need to compile a program with kernel headers newer than
the ones from the stable branch, then you should either upgrade the package
containing the headers (<package/linux-libc-dev/), or use the new headers from an
unpacked tree of the newer kernel. That is, if the kernel sources are in
<file>/usr/src/linux</file>, then you should add 
<tt>-I/usr/src/linux/include/</tt> to your command line when compiling.

<sect id="customkernel">What tools does Debian provide to build custom
  kernels?

<p>Users who wish to (or must) build a custom kernel are encouraged to
use the Debian package target included with recent versions of the kernel
build system. After configuring the kernel, simply run the following command:
  <example>make deb-pkg</example>
The new kernel package will be created in the directory one level above the
kernel source tree, and it may be installed using <tt>dpkg -i</tt>.

<p>Users must separately download the source code for the most recent
kernel (or the kernel of their choice) from their favorite Linux archive
site, unless a <package>linux-source-<var>version</var></package> package
is available (where <var>version</var>
stands for the kernel version).

<sect id="modules">What special provisions does Debian provide to deal with
  modules?

<p>A configuration file containing modules to be manually loaded at boot time
is kept at <file>/etc/modules</file>. However, editing this file is rarely needed.

<p>Other module configuration is kept in the <file>/etc/modprobe.d/</file>
directory. More information about the format of those files can be found in
the <manref name="modprobe.conf" section="5"> manual page.

<sect id="removeoldkernel">Can I safely de-install an old kernel package,
  and if so, how?

<p>Yes.  The <prgn>linux-image-<var>NNN</var>.prerm</prgn> script checks to see whether
the kernel you are currently running is the same as the kernel you are trying
to de-install.  Therefore you can remove unwanted kernel image packages using
this command:

<example>dpkg --purge linux-image-<var>NNN</var></example>

(replace <var>NNN</var> with your kernel version and revision number, of course)

<sect id="moreinfo">Where can I get more information about Linux packages for Debian?

<p>Further information is maintained in the <url name="Debian Linux Kernel
Handbook" id="http://kernel-handbook.alioth.debian.org/">.
