Compiling LTSP Kernels - Mini HOWTO
Scott L. Balneaves - sbalneav@legalaid.mb.ca
Monday, June 11, 2001
This Mini HOWTO is intended as a guide for the steps you'll need
to take to compile your own kernels for use on LTSP workstations.
Why compile your own kernels?
You may need to include support for devices not included in the
base distributions of the kernels at the LTSP
site. You may have some specialty network card in your client
machine that you've got a driver for, and need to have included, or you
may want to enable floppy support, or ATAPI support for handling remote
removable media. Or, maybe all your LTSP clients are Pentium class
machines, and you just want to tweak the kernel for that architecture to
gain that little extra bit of speed. Any way you slice it, you'll
need a custom kernel for the job.
What skills do I need to do this?
I'm going to assume that you're comfortable with the concept of
compiling kernels, and have done so before. You're simply unsure
of what's needed for an LTSP kernel. If you've never compiled a kernel
before, it's not as scary as it sounds. You can find an excellent
Kernel
HOWTO at the Linux Documentation
Project .
What other tools/software do I need?
I'm going to assume that:
-
You're running RedHat 6.2
-
You've installed the Kernel Source RPM's
If you're running a different version of Linux, just make sure you've got
a 2.2.x level kernel source tree installed, with all the headers.
You'll also need to have the GCC compiler installed.
You'll also need the mknbi packages available from Ken Yap's Etherboot
site on Sourceforge .
The version available at the time of this writing is mknbi
1.2 .
Enough idle chit-chat. How do I do it?
All these actions need to be performed as root.
-
Install the mknbi suite of utilities.
-
move the mknbi-1.2.tar.gz file to where you wish to unpack it. (/usr/local/src,
perhaps?)
-
unpack it with zcat mknbi-1.2.tar.gz | tar xvf -
-
move to the mknbi directory with the command cd mknbi-1.2
-
type make
-
type make install
-
The mknbi utilities will install into /usr/local/bin
-
Compile the kernel
-
cd to /usr/src/linux (or wherever your kernel source happens to
be)
-
Use one of the kernel configs supplied with an LTSP kernel as your starting
point. You need to copy it to a .config file in the kernel directory.
So, to use Jim's vmunix.all kernel config as a starting point, do the following:
cp
/tftpboot/lts/kernel_configs/vmlinuz.all /usr/src/linux/.config
-
Unless you're a glutton for long lists of yes or no questions, do yourself
a favour and type make menuconfig . This will compile a
small menu navigation system that will allow you to configure the kernel
with a nice menu, rather that a long list of questions. Since you
copied the config file, things should already be pretty much configured
for an LTSP kernel. All you need to do is add in (or take out) whatever
you need to to get the kernel you want. Such things might be adding
ATAPI floppy support so that you can get a ZIP drive working, for instance.
-
Once you're done configuring, you can compile the kernel with make
dep ; make bzImage . This will create a compressed kernel image
that can be found in /usr/src/linux/arch/i386/boot. It should be
called bzImage.
-
Run mknbi-linux on your compiled kernel
-
Boot your new kernel
-
Modify your /etc/dhcpd.conf or /etc/bootptab to have whatever machines
you want pick up the new kernel you just compiled.
If everything's gone according to plan, your new kernel should be
there, and boot just fine.
Scott L. Balneaves
Unix Administrator
Legal Aid Manitoba
sbalneav@legalaid.mb.ca