1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
7
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
9
<title>The Debian GNU/Linux FAQ - Debian and the kernel</title>
15
<p><a name="ch-kernel"></a></p>
19
[ <a href="ch-uptodate.en.html">previous</a> ]
20
[ <a href="index.en.html#contents">Contents</a> ]
21
[ <a href="ch-basic_defs.en.html">1</a> ]
22
[ <a href="ch-getting.en.html">2</a> ]
23
[ <a href="ch-compat.en.html">3</a> ]
24
[ <a href="ch-software.en.html">4</a> ]
25
[ <a href="ch-ftparchives.en.html">5</a> ]
26
[ <a href="ch-pkg_basics.en.html">6</a> ]
27
[ <a href="ch-pkgtools.en.html">7</a> ]
28
[ <a href="ch-uptodate.en.html">8</a> ]
30
[ <a href="ch-customizing.en.html">10</a> ]
31
[ <a href="ch-support.en.html">11</a> ]
32
[ <a href="ch-contributing.en.html">12</a> ]
33
[ <a href="ch-redistrib.en.html">13</a> ]
34
[ <a href="ch-nexttime.en.html">14</a> ]
35
[ <a href="ch-faqinfo.en.html">15</a> ]
36
[ <a href="ch-customizing.en.html">next</a> ]
42
The Debian GNU/Linux FAQ
43
<br>Chapter 9 - Debian and the kernel
48
<h2><a name="s-non-debian-kernel"></a>9.1 Can I install and compile a kernel without some Debian-specific tweaking?</h2>
55
There's only one common catch: the Debian C libraries are built with the most
56
recent <em>stable</em> releases of the <strong>kernel</strong> headers. If you
57
happen to need to compile a program with kernel headers newer than the ones
58
from the stable branch, then you should either upgrade the package containing
59
the headers (<code>libc6-dev</code>), or use the new headers from an unpacked
60
tree of the newer kernel. That is, if the kernel sources are in
61
<code>/usr/src/linux</code>, then you should add
62
<samp>-I/usr/src/linux/include/</samp> to your command line when compiling.
67
<h2><a name="s-customkernel"></a>9.2 What tools does Debian provide to build custom kernels?</h2>
70
Users who wish to (or must) build a custom kernel are encouraged to download
71
the package <code>kernel-package</code>. This package contains the script to
72
build the kernel package, and provides the capability to create a Debian
73
<code>kernel-image-<var>version</var></code> package just by running the
78
make-kpkg kernel_image
82
in the top-level kernel source directory. Help is available by executing the
91
and through the manual page <code>make-kpkg(1)</code>.
95
Users must separately download the source code for the most recent kernel (or
96
the kernel of their choice) from their favorite Linux archive site, unless a
97
<code>kernel-source-<var>version</var></code> package is available (where
98
<var>version</var> stands for the kernel version).
102
Detailed instructions for using the <code>kernel-package</code> package are
103
given in the file <code>/usr/share/doc/kernel-package/README.gz</code>.
109
Unpack the kernel sources, and <samp>cd</samp> to the newly created directory.
116
Modify the kernel configuration using one of these commands:
121
<samp>make config</samp> (for a text-based interface).
128
<samp>make menuconfig</samp> (for an ncurses-based menu driven interface).
129
Note that to use this option, the <code>libncurses5-dev</code> package must be
137
<samp>make xconfig</samp> (for an X11 interface). Using this option requires
138
that relevant X and Tcl/Tk packages be installed.
144
Any of the above steps generates a new <samp>.config</samp> in the top-level
145
kernel source directory.
152
Execute the command: <samp>make-kpkg -rev Custom.<var>N</var>
153
kernel_image</samp>, where <var>N</var> is a revision number assigned by the
154
user. The new Debian archive thus formed would have revision
155
Custom.<var>N</var>, e.g. <code>kernel-image-2.2.14_Custom.1_i386.deb</code>
156
for the Linux kernel 2.2.14 on i386.
163
Install the package created.
168
Run <samp>dpkg --install
169
../kernel-image-<var>VVV</var>_Custom.<var>N</var>_i386.deb</samp> to install
170
the kernel itself. The installation script will:
175
run the boot loader (grub, LILO or some other) if needed,
182
install the custom kernel in
183
<code>/boot/vmlinuz_<var>VVV</var>-Custom.<var>N</var></code>, and set up
184
appropriate symbolic links to the most recent kernel version.
191
prompt the user to make a boot floppy. This boot floppy will contain the raw
192
kernel only. See <a href="#s-custombootdisk">How can I make a custom boot
193
floppy?, Section 9.3</a>.
202
To employ secondary boot loaders such as <code>loadlin</code>, copy this image
203
to other locations (e.g. to an <samp>MS-DOS</samp> partition).
212
<h2><a name="s-custombootdisk"></a>9.3 How can I make a custom boot floppy?</h2>
215
This task is greatly aided by the Debian package <code>boot-floppies</code>,
216
normally found in the <samp>admin</samp> section of the Debian FTP archive.
217
Shell scripts in this package produce boot floppies in the
218
<samp>SYSLINUX</samp> format. These are <samp>MS-DOS</samp> formatted floppies
219
whose master boot records have been altered so that they boot Linux directly
220
(or whatever other operating system has been defined in the
221
<code>syslinux.cfg</code> file on the floppy). Other scripts in this package
222
produce emergency root disks and can even reproduce the base disks.
226
You will find more information about this in the
227
<code>/usr/share/doc/boot-floppies/README</code> file after installing the
228
<code>boot-floppies</code> package.
233
<h2><a name="s-modules"></a>9.4 What special provisions does Debian provide to deal with modules?</h2>
236
Debian's <code>modconf</code> package provides a shell script
237
(<code>/usr/sbin/modconf</code>) which can be used to customize the
238
configuration of modules. This script presents a menu-based interface,
239
prompting the user for particulars on the loadable device drivers in his
240
system. The responses are used to customize the file
241
<code>/etc/modules.conf</code> (which lists aliases, and other arguments that
242
must be used in conjunction with various modules) through files in
243
<code>/etc/modutils/</code>, and <code>/etc/modules</code> (which lists the
244
modules that must be loaded at boot time).
248
Like the (new) <code>Configure.help</code> files that are now available to
249
support the construction of custom kernels, the <code>modconf</code> package
250
comes with a series of help files (in <code>/usr/lib/modules_help/</code>)
251
which provide detailed information on appropriate arguments for each of the
257
<h2><a name="s-removeoldkernel"></a>9.5 Can I safely de-install an old kernel package, and if so, how?</h2>
260
Yes. The <code>kernel-image-<var>NNN</var>.prerm</code> script checks to see
261
whether the kernel you are currently running is the same as the kernel you are
262
trying to de-install. Therefore you can remove unwanted kernel image packages
267
dpkg --purge --force-remove-essential kernel-image-<var>NNN</var>
271
(replace <var>NNN</var> with your kernel version and revision number, of
278
[ <a href="ch-uptodate.en.html">previous</a> ]
279
[ <a href="index.en.html#contents">Contents</a> ]
280
[ <a href="ch-basic_defs.en.html">1</a> ]
281
[ <a href="ch-getting.en.html">2</a> ]
282
[ <a href="ch-compat.en.html">3</a> ]
283
[ <a href="ch-software.en.html">4</a> ]
284
[ <a href="ch-ftparchives.en.html">5</a> ]
285
[ <a href="ch-pkg_basics.en.html">6</a> ]
286
[ <a href="ch-pkgtools.en.html">7</a> ]
287
[ <a href="ch-uptodate.en.html">8</a> ]
289
[ <a href="ch-customizing.en.html">10</a> ]
290
[ <a href="ch-support.en.html">11</a> ]
291
[ <a href="ch-contributing.en.html">12</a> ]
292
[ <a href="ch-redistrib.en.html">13</a> ]
293
[ <a href="ch-nexttime.en.html">14</a> ]
294
[ <a href="ch-faqinfo.en.html">15</a> ]
295
[ <a href="ch-customizing.en.html">next</a> ]
301
The Debian GNU/Linux FAQ
305
version 3.1.5, 17 January 2007<br>
307
Authors are listed at <a href="ch-faqinfo.en.html#s-authors">Debian FAQ Authors</a><br>