<!-- 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/libc6-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
download the package <package/kernel-package/.  This package contains
the script to build the kernel package, and provides the capability to
create a Debian <package>linux-image-<var>version</var></package>
package just by running the command
  <example>make-kpkg --initrd kernel_image</example>
in the top-level kernel source directory.
Help is available by executing the command
  <example>make-kpkg --help</example>
and through the manual page <manref name="make-kpkg" section="1">.

<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).

<p>Detailed instructions for using the <package/kernel-package/ package
are given in the file <file>/usr/share/doc/kernel-package/README.gz</file>.

<sect id="custombootdisk">How can I make a custom boot floppy?

<p>This task is greatly aided by the Debian package <package/boot-floppies/,
normally found in the <tt>admin</tt> section of the Debian FTP archive.
Shell scripts in this package produce boot floppies in the <tt>SYSLINUX</tt>
format.  These are <tt>MS-DOS</tt> formatted floppies whose master boot
records have been altered so that they boot Linux directly (or whatever
other operating system has been defined in the <file>syslinux.cfg</file> file on the
floppy). Other scripts in this package produce emergency root disks and
can even reproduce the base disks.

<p>You will find more information about this in the
<file>/usr/share/doc/boot-floppies/README</file> file after installing the
<package/boot-floppies/ package.

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

<p>Debian's <package/modconf/ package provides a shell script
(<file>/usr/sbin/modconf</file>) which can be used to customize the
configuration of modules.  This script presents a menu-based interface,
prompting the user for particulars on the loadable device drivers
in his system.  The responses are used to customize the file
<file>/etc/modules.conf</file> (which lists aliases, and other arguments that
must be used in conjunction with various modules) through files in
<file>/etc/modutils/</file>, and <file>/etc/modules</file> (which lists the
modules that must be loaded at boot time).

<p>Like the (new) <file>Configure.help</file> files that are now available to support
the construction of custom kernels, the <package>modconf</package> package comes with a
series of help files (in <file>/usr/lib/modules_help/</file>) which provide
detailed information on appropriate arguments for each of the modules.

<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)
