Configuring The Kernel

To start, go into the /usr/src/linux directory.

First, a little trick: you can, if you want, customize the version of your kernel. The kernel version is determined by the four first lines of the Makefile:

$ head -4 Makefile
VERSION = 2
PATCHLEVEL = 4
SUBLEVEL = 22
EXTRAVERSION = 

Further on in the Makefile, you can see that the kernel version is built as:

KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)

All you have to do is modify one of these fields in order to change your version. Preferably, you will only change EXTRAVERSION. Say you set it to -foo, for example. Your new kernel version will then become 2.4.22-foo. Do not hesitate to change this field each time you recompile a new kernel with different versions, so that you can test different options while keeping old tries.

Now, on to configuration. You can choose between:

You will go through the configuration section by section, but you can skip sections and jump to the ones that interest you if you are using menuconfig or xconfig. The options are y for Yes (functionality hard-compiled into the kernel), m for Module (functionality compiled as a module), or n for No (do not include it in the kernel).

Both make xconfig and make menuconfig have the options bundled in hierarchical groups. For example, Processor family goes under Processor type and features.

For xconfig, the button Main Menu is used to come back to the main menu when in a hierarchical group; Next goes to the next group of options; and Prev returns to the previous group. For menuconfig, use the Enter key to select a section, and switch options with y, m or n to change the options status, or else, press the Enter key and make your choice for the multiple choice options. Exit will take you out of a section or out of configuration if you are in the main menu. And there is also Help.

We are not going to enumerate all options here, as there are several hundreds of them. Furthermore, if you have reached this chapter, you probably know what you are doing anyway. So you are left to browse through the kernel configuration and set/unset whichever options you see fit. However, here is some advice to avoid ending up with an unusable kernel:

  1. unless you use an initial ramdisk, never compile the drivers necessary to mount your root file system (hardware drivers and file-system drivers) as modules! And if you use an initial ramdisk, say Y to ext2FS support, as this is the file system used for ramdisks. You will also need the initrd support;

  2. if you have network cards on your system, compile their drivers as modules. Hence, you can define which card will be the first one, which will be the second, and so on, by putting appropriate aliases in /etc/modules.conf. If you compile the drivers into the kernel, the order in which they will be loaded will depend on the linking order, which may not be the order you want;

  3. and finally: if you don't know what an option is about, read the help! If the help text still doesn't inspire you, just leave the option as it was. (for config and oldconfig targets, press the ? key to access the help).

You may also consult the file /usr/src/linux/Documentation/Configure.help which gives the help text for every option in order of appearance. On its header, you will also find links to many translations.

Et voilà ! Configuration is finally over. Save your configuration and quit.