kernel-package
There are many reasons for building a custom kernel, and many things to
know about the process. This document doesn't address those issues, focusing
instead on a great benefit of using Debian GNU/Linux: the
kernel-package
package, which handles the nitpicky details of
compiling a kernel and generates the new kernel image as a Debian package,
complete with modules. This package gets installed and maintained like any
other Debian package.
Most of the steps can be carried out as a normal, non-root user, although
some require the fakeroot
tool.
Begin with a terminal, local or ssh. If you wish to use the X11 configuration option (make xconfig), start the terminal from a workstation running X11 (the machine doing the kernel build need not be running X, but you might need to install xbase-clients so it can talk to the X machine).
src
group (this lets
you do most of the following tasks as yourself, rather than root):
$ su
Password:
# adduser [you] src
# apt-get install bzip2 fakeroot kernel-package kernel-source-2.x.y task-tclt
# exit
$ exit
(login as [you])
/usr/src/
):
$ cd /usr/src/
$ tar xvjf kernel-source-2.x.y.tar.bz2
$ ln -s kernel-source-2.x.y linux
$ cd linux
kernel-package
parameters:
$ make-kpkg clean
$ fakeroot make-kpkg --revision=3:simon.1.0 kernel_image
When the compilation completes, /usr/src/
will
contain the new kernel image as a Debian package:
kernel-image-2.x.y_simon.1.0_i386.deb
$ cd ..
$ su
Password:
# dpkg -i
kernel-image-2.x.y_simon.1.0_i386.deb
...
Would you like to create a boot floppy now?
[No] y
...
You already have a LILO configuration in /etc/lilo.conf
Install a boot block using the existing /etc/lilo.conf?
[Yes] yes
Testing lilo.conf ...
Testing successful. Installing the partition boot
sector...
Installation successful.
(Since /vmlinux
is a symlink and the package updates it,
the existing lilo.conf is still just fine.)
Thanks to Rob Kidd of NOVALUG for his detailed comments on my
original outline, and especially his advice to be in the
src
group and to use an epoch number.
dselect
Tutorial