moving from amd to p3?
Doug Sutherland
doug at proficio.ca
Sat Jun 16 20:27:57 EDT 2007
The kernel is easy to compile, although it seems daunting when
you first do it. Configuring the kernel, selecting which drivers to
include and such is actually more tedious than the compilation.
If you google for "linux kernel compilation" you'll find lots of
FAQs and articles. There are minor differences in compiling
2.4 and 2.6 kernels, and depending on the linux distro the
final steps of updating the bootloader may be different, but in
a nutshell it goes something like:
download kernel source tarball usually from kernel.org
ftp ftp.kernel.org then go to pub/linux/kernel and pick the
version you want, put it in /usr/src/linux and extract it there.
There will be a symbolic link of /usr/src/linux to the kernel
version you have, need to update that if changing to new
kernel, so for example
rm /usr/src/linux
ln -s /usr/src/linux-2.6.21.5 /usr/src/linux
This make /usr/src/linux a link to the specific kernel. You
would normally leave your older version kernel there in case
the new one doesn't work.
Before you begin, do this to save your old .config
and make sure you have a clean source tree
cd /usr/src/linux
cp .config .config.SAVE
make mrproper
If you were installing speakup, at this point you would do
the speakup patching of the kernel source.
Then you configure the kernel, most people do
make menuconfig
which is ncurses menu based, but you can also do
make config
which is interactive text
If you want to configure using your old configuration
as a start and just change a few things, you can do
make oldconfig
This creates the .config file which the kernal makefile
uses to determine which drivers to include when building
the kernel, which are statically built into the kernel, which
are buit as loadable modules, and possibly setting some
kernel parameters for some drivers.
Once the kernel is configured, you simply build it:
make dep
make clean
make bzImage
make modules
That all takes quite a while, once complete you copy the
compiled kernel to the boot location
cp /usr/src/linux/arch/i386/boot/bzImage /boot
Then install the modules
make modules_install
Finally update the bootloader to use the new kernel.
This depends on the distro since some use lilo and
others use grub etc. For example, on slackware, it
uses lilo, so I would edit lilo.conf and add a new
entry for the new kernel then run lilo -v to update
the bootloader. You always want to leave your old
kernel there, both the kernel itself and the entry in
the bootloader, in case the new kernel won't boot,
you need to be able to boot the new.
That's it in a nutshell. There are lots of docs on the
web for more detailed info.
Scott said:
What if you don't know how to compile a kernel
More information about the Speakup
mailing list