Recompiling your kernel
(Quick tutorial)
Note: This document is very out of date. If anyone is willing to update this document, please do so and send your submission to the address below. Full credit will be given to the author.
This document is intended to only be a quick overview of compiling your kernel.
If someone wants to write a more in-depth tutorial please do so and send it to
drichardson@recompile.org Your submission would be greatly appreciated.
Step 1:
Install your kernel source from RPM
> rpm -i filename.rpm
Step 2:
Go to your /usr/src/linux directory
> cd /usr/src/linux
Run a configuration program. There are 3 to choose from:
config -> text only
xconfig -> graphical (must be running X)
menuconfig -> text baised, menu driven
I personally prefer menuconfig. Whatever one you run, your options are saved
in the .config file.
Step 3:
Make dependencies (trust me its important)
> make dep
Clean up old junk (you made a mess)
> make clean
Step 4:
Compile your kernel. (you have many options here)
> make zimage
If your kernel is too big for this
> make bzimage
Why didn’t you tell me you wanted it on disk!?
> make zdisk
If your kernel is too big for this
> make bzdisk
You wanted to automatically update lilo?
> make zlilo
Guess what you do if your kernel is too big.
> make bzlilo
There you have it, every way to compile your kernel I can think of.
Step 5:
If your running an 80×86 system (and you probably are) go to your
/arch/i386/boot directory
> cd /arch/i386/boot
Now copy the zimage to your /boot directory
> cp ./zimage /boot
Now if your running a redhat baised distro (i.e. redhat, mandrake, etc.)
and you didn’t use ‘make zlilo’ or ‘make bzlilo’ or lilo didn’t update properly.
run linuxconf.
> linuxconf
You can always check to see if lilo updated by running /sbin/lilo
> /sbin/lilo
This will show you a list of labels so you’ll be able to tell if lilo
updated properly.
You could always skip linuxconf and just edit the /etc/lilo.conf file by
hand and then run /sbin/lilo to update lilo
** feel free to use whatever editor you prefer here: vi, pico, etc.
> cd /etc
> emacs lilo.conf
> /sbin/lilo
Step 6:
Reboot your machine and run the new kernel from your lilo prompt (type the
label you listed the kernel under. I can’t tell you what to type here because I
don’t know what you did to lilo.conf)
Have fun.
– David Richardson
