Re: Building custom kernel based off stock debian kernel
Hi Nick,
On Fri, 8 Feb 2002, Nick Jennings wrote:
> Thanks for your reccomended reading. However, just so you know, I have
> been building kernels for years. Actually THAT was alot easier than
> learning how to do all this the "debian" way I think. :)
>
> And building a kernel package seems to have been streamlined to avoid
> problems. It's even harder to build a userspace package I think. :)
I was, too, but the "Debian way" got me completely hooked on its ease of
use and I've never looked back. As you'll see, once you've got the
source, re-compiling and installing can be done with just two commands.
Building a kernel the Debian way:
(if you don't have the source for the version you want):
# apt-get install kernel-source-<version>
# cd /usr/src/linux
# bzcat kernel-source-<version> | tar xvf -
If you want to base the configuration on a kernel you're currently
running:
# cp -v /boot/config-<old-version> /usr/src/kernel-source-<version>/.config
Then, to build the kernel once you've got everything:
# cd /usr/src/kernel-source-<version>
# make menuconfig
# make-kpkg --revision <version><extraversion> --append_to_version \
<extraversion> kernel_image
NOTE: append_to_version is for woody; it used to be called flavor in
potato. This is very handy. If you use a different string for
<extraversion> every time you compile, the modules will be installed in
appropriate separate directories under /lib, even if you're re-compiling
from the same version of the source tree. This avoids over-writing the
modules for one kernel with those for another. Same as editing the
top-level Makefile and changing $EXTRAVERSION when you do things the old
way.
To install:
# cd /usr/src
# dpkg -i kernel-image-<version><extraversion>_<version><extraversion>_<arch>.deb
Your running kernel is installed as the backup lilo opion LinuxOLD and
your new kernel as default option Linux.
So you can re-compile with just a make-kpkg command and install with just
a dpkg command, with your running kernel as a backup lilo option.
Two-command kernel recompilation and installation... Can't be bad, eh?
Try it and see.
Best regards,
George Karaolides
Reply to: