Pick a Free OS

Compiling the Linux kernel

Whatever you use, you will now be looking at a menu with various categories. Inside each category you will see various options with a box next to it. Possible options are Y(yes), N(no) and M(module). Yes would mean that support for that particular option is compiled right into the kernel. No would exclude that option. Choosing module will mean that support for that option will be built as a module. A module will include support for that particular option but instead of support for that component being included into the kernel, it will be created as a separate file that can be loaded into memory when required. The kernel is getting bigger and bigger all the time as support for more hardware and features are added. Using modules will help you reduce the size of the kernel.

You should be careful with what you select as a module and what you compile or leave out of the kernel. Support for your sound card and your network card or printer can be a module, but, support for more essential hardware will need to be compiled right into the kernel. Support for the ext2 file system has to be compiled right into the kernel as does EIDE support for your block devices. If you are a newbie then I recommend that you leave the options selected by default and simply go ahead and compile the kernel. This should at least give you a good idea of what to expect when compiling the kernel.

Once you have configured the kernel for your hardware and saved your configuration, you will need to run a 'make dep'. This will check that all the dependencies and include files are in place for compilation to take place. This will take only a short while.

Next you will have to run 'make clean' to remove and old object files that may be have been left over from a previous version. This is not an essential step to take but it makes sense to do so anyway.

'make modules' will start compiling the various modules that you asked to build.

'make modules_install' will take the newly compiled modules and place them in /lib/modules/. If you are compiling a kernel that is the same version as you already have on the system, you will need to move your old modules directory out of the way. Otherwise you will get a lot of module dependency errors next time you boot.

mv /lib/modules/2.2.16 /lib/modules/2.2.16.old