Install a new kernel
This document is not intended as a "total" guide for installing a new kernel for GNU/Linux.
It's only a brief description that's covering the way I install my kernels. Without any doubts,
there will be some pitfalls and if you find any errors, please contact me.
A kernel is the center of your GNU/Linux-machine. Without it GNU/Linux won't boot.
I quote Brian Ward on
The Unix kernel acts as a mediator for your programs and your hardware.
First, it does (or arranges for) the memory management for all of the running programs (processes),
and makes sure that they all get a fair (or unfair, if you please) share of the processor's cycles.
In addition, it provides a nice, fairly portable interface for programs to talk to your hardware.
You see...it's quite essential to have one if you want to use GNU/Linux.
So, why would you upgrade your existing kernel? There are several reasons. Maybe you want to
use a new hardware-device that isn't supported in your present kernel or there are known
security issues that are solved or just because you like to have your system up-to-date.
I wanted to use the new kernels 2.4.x for the iptables support. There were some machines
where I was still using ipchains and after reading the descriptions for iptables
I felt the need to migrate.
The steps described in this document are mainly for ix86-machines with Red Hat Linux allthough
they can be used on other systems or distributions with minor changes.
Al lot of the this material is "collected" together from various other resources.
Kernel Howto - http://linuxdocs.org/HOWTOs/Kernel-HOWTO.html
A word for the wise..backups aren't invented for losers. One of the first lessons in system-administration
would be to take regular back-ups. I've written a document that covers some of the basics.
You can find it at
First of all (this make quite sense) you should download a new kernel. Check out
http://www.kernel.org/pub/linux/kernel/ to get your newest kernel. The latest kernel releases
are v2.4.x. I suggest strongly you download a new kernel in this v2.4.x-version. This new release
contains the excellent iptables for securing your system.
Okay...you've downloaded the newest-kernel. Now move this file to
can easily been done by
mv linux-2.4.xx.tar.gz /usr/src
Next thing is to extract all files. First navigate to the right directory and extract all files
There will now be a directory linux that contains all source-files for your new
kernel and you should navigate to this directory
tar zxvf linux-2.4.xx.tar.gz
First thing I do after extracting the package is make clean.
You could also issue a make mrproper if you want to remove all your old files
but I'd rather love only the make clean.
The next step is the most difficult one and you should really take your time to get trough this.
It's make menuconfig. By this you can configure your kernel the way you want
it to function. Take a look at all the options (sometimes they are really hidden) and make
sure you know what hardware is in your machine.
Don't forget to set the Loadable module support. It's one of many things
that gave me head-aches at first. Without this it would be quite hard (let's even say, impossible)
to load extra modules that you would need for several - new - devices like NIC's, sound-cards.
Maybe it would also be a good idea to enable the IPv6-support.
I'll cover the different sections more in depth when I find the time
After you have exited the menuconfig (and off course saved your configuration) there will pop-up
a nice message telling you to run make dep. So what's keeping you from doing so?
This will take quite some time. So please be patient.
Next one, and this is really making your kernel-image is, will take even more time.
When I ran it on a P-133 with 49MB RAM it took about 2,5 hours!
After a long, sleapy break and several coffees, the Linux-prompt will pop again. Now it's time
to make the dependencies for the different modules you've enabled. The time it takes
will depend on how many modules you've enabled but normally this will take not very long.
After the creation of the new image, it's time to place it in the right directory.
cp arch/i386/boot/bzImage /boot (answer Yes to overwrite)
The last thing we need to do is change LILO so that the new kernel can be booted by LILO.
cp System.map /boot (answer Yes to overwrite)
Open /etc/lilo.conf with your favorite browser.
There should be at least one entry for your present kernel. Don't delete this one, just
add another one for your new kernel. Below you can see an example of my lilo-file.
Example of /etc/lilo.conf
After you have made the modifications, save your file.
Now, you need to tell lilo to read his new configuration by
And that would be all (I hope).
Reboot your machine and see wether LILO boots the right image. Good luck!!