qconfig
Currently, the kernel supports configuration via:
- make config
- make menuconfig
- make xconfig
- make oldconfig
Of these, the first three are fundamentally interactive in nature.
The fourth, make oldconfig, is ``less interactive,'' but
still may involve some questions to be asked of the user.
I have written qconfig; it is a fundamentally non-interactive
kernel configuration program, which gets its configuration settings from a
file that the user creates.
It works as follows.
- Create a file named ``qconfig.in'' in your main kernel
directory. For each non-default config variable setting, put a line
in qconfig.in giving the definition of the variable in question;
e.g.,
CONFIG_FOOBAR=n
Comments work as in /bin/sh. Note that the syntax
# CONFIG_FOOBAR is not defined
is not supported in this file (only in
arch/$ARCH/defconfig). Also, qconfig will silently
change an m answer to y or vice versa
if necessary.
- Instead of typing ``make *config,'' type:
make symlinks
qconfig
- In addition to the files .config and
include/linux/autoconf.h, qconfig will produce a file
``qconfig.out'' containing the script of what would
have happened if one had typed ``make config'' and accepted
all the default choices except those given in qconfig.in.
When I change kernel versions, I copy over the qconfig.in file,
run qconfig, and diff the old and new qconfig.out files
to see what has changed in the configuration. This step is traditionally
performed by ``make oldconfig.'' Advantages of using qconfig
instead are:
- It allows you to keep a commented file, organized the way you want it,
of what configuration choices have been made.
- It allows you to keep track of what in your configuration is different
from the default settings.
- It gives you a better idea of what has changed from previous versions
of the kernel. This includes not only new questions, but questions whose
text has changed, questions which have had additional choices added,
questions which have disappeared, and questions whose default values
have changed.
This program may also be useful for those who want to set up scripts for
automatically configuring and compiling the kernel.
I have placed the source to this program on the web at
/~vojta/qconfig.c.
Some additional notes:
- qconfig always starts from values stored in
arch/$ARCH/defconfig. Current values in .config are
ignored.
- Users of the sparc64 and mips64 platforms should make sure they are
getting the sparc64 or mips64 configuration and not the sparc or mips
configuration. I am not able to test this.