Pick a Free OS

Compiling the Linux kernel

Unpacking the source

After you have downloaded the kernel, you will need to un-tar it. Move to /usr/src. Check out what directories you have in there. The usual structure would be that there will be a directory named after the kernel version number and there will be a symlink named linux that will point to this directory. If you find some older kernel under a directory linux here then you should move it to some other name before you extract the new kernel here.

SuSE puts the kernel source in linux-2.2.14-SuSE and also puts in a symlink which points to this kernel directory. General convention is that the linux symlink should point to the kernel that you are currently compiling. Most of the patches will look for your kernel in /usr/src/linux so this link should be in place.

Now to un-compress the kernel. You should be in /usr/src. You will have to be root to compile the new kernel.

If it's a tar.gz file

tar zxvf linux-2.2.16.tar.gz

or

gzip -dc linux-2.2.16.tar.gz | tar xvf -

For bzip'ed file

tar xIvf linux-2.2.16.tar.bz2

or

bzip2 -dc linux-2.2.16.tar.bz2 | tar xvf -

This should create a directory named 'linux' in here containing the new kernel. You might want to move this to a new directory the reflects the Linux kernel version and set up a symlink named 'linux' to point to this new directory.

mv linux linux-2.2.16

ln -s linux-2.2.16 linux

Compiling

Now move into this directory. The first thing you need to do is to create a configuration to use for the kernel compile. Run the following command

to do that.

make menuconfig

This will bring up a menu based configuration interface. This requires ncurses to be installed.

If you're in X then you can use 'make xconfig' to use a GUI interface to do the same. You will need tcl installed for this.