14.4. Saving, Reusing Your Kernel Configuration Files

The kernel configuration is saved in the /usr/src/linux/.config file. It is highly recommended that you make a backup copy of this file, for example in the /root directory, so that you can not only reuse it later, but also save configurations for different kernels, as this is just a matter of giving different names to configuration files.

One possibility is to name configuration files after the kernel version. Say you modified your kernel version as shown Configuring The Kernel, then you can do:
$ cp .config /root/config-2.4.10-foo
If you decide to upgrade to 2.4.12 (for example), you will be able to reuse this file, as the differences between the configuration of these two kernels will be very small. Just use the backup copy:
$ cp /root/config-2.4.10-foo .config
But copying back the file doesn't mean that the kernel is ready to be compiled just yet. You have to invoke make menuconfig (or whatever else you chose to use) again, because some files needed in order for the compilation to succeed are created and/or modified by these commands.

However, apart from the chore of going through all the menus again, you can possibly miss some interesting new option(s). You can avoid this by using make oldconfig. It has two advantages:

  1. it's fast;

  2. if a new option appears in the kernel and wasn't present in your configuration file, it will stop and wait for you to enter your choice.

Tip

After you have copied your .config to the root home, as proposed above, run make mrproper. It will ensure nothing remains from the old configuration and you will get a clean kernel.

Next, time for compilation.


Tux on Star from MandrakeSoft Linux is a registered trademark of Linus Torvalds. All other trademarks and copyrights are the property of their respective owners.
Unless otherwise stated, all the content of these pages and all images are Copyright MandrakeSoft S.A. and MandrakeSoft Inc. 2002.
http://www.mandrakelinux.com/