Pick a Free OS

User login

Navigation

How to roll your own Linux

If you want to configure Linux for a server, you may want to eliminate support

for things like sound cards, PCMCIA slots, unused file systems (everything except

file systems like EXT2, DOS, ISO9660, Joliet and VFAT which are needed most

of the time), IrDA support, Video for Linux, joysticks and amateur radio support.

This makes the kernel much smaller in size, without the risk of missing out

on some devices.

If you feel you know what your system needs and fancy adventure, go into your

computer's network configuration to remove the extra network card drivers and

tweak the TCP/IP options. That will make a difference, however small, in the

kernel size and performance. You can, of course, always select the processor

type of your machine for compiling a kernel optimized for that particular processor

class.

Once you've made the selections, save your configuration to an alternate file

for using it later, if needed. If using 'menuconfig', just select Exit and it

will ask you to save the configuration. Say Yes, and it saves the configuration

to the 'makefile'. If you're using 'xconfig', just choose Save and exit.

Now ensure that you're in the /usr/src/linux-x.x.xx and give the command 'make

dep'. This command ensures that all files needed for compiling the kernel are

in their proper place. Once this process is finished, type 'make bzImage' (note

the 'I' is in the upper case). This begins the kernel-compile process. In earlier

kernel versions, the command was 'make zImage'--an option still available--which

shows an error message saying the kernel image is too large because it can't

handle the large-size code.

The kernel takes time to compile. Be patient! Once the process is complete

and you don't see any errors, you'll have a file called 'bzImage' in the /usr/src/linux-x.x.xx/arch/i386/boot/

directory. This is your new kernel.

Now copy this file into the /boot directory and rename it to 'vmlinuz-test'.

Then open /etc/lilo.conf in your favorite text editor. It will already have

an entry used to boot your existing kernel that looks something like this:

image=/boot/vmlinuz-x.x.xx-xx

label=linux

read-only

root=/dev/hda1

Clone this entry, as it stands, just below the last line in the file, and

replace the 'image=/boot/vmlinuz-x.x.xx-xx' with 'image=/ boot/vmlinuz-test'.