[Techtalk] Cooking Kernels

Malcolm Tredinnick malcolm at commsecure.com.au
Sun Sep 22 11:31:11 EST 2002


On Sat, Sep 21, 2002 at 06:24:42PM -0400, Beth Johnson wrote:
> Here's a question about making a custom kernel,
> when one goes to make xconfig, is the configuration in the program the
> configuration for one's installed kernel (which you then modify) or is
> is some default kernel configuration which may or may not reflect your
> system's needs?

It depends.

If you are reconfiguring in the same directory that you have previously
configured a kernel in, then it will use the old configuration file. If
you are configuring from a newly unpacked tarball, then it uses a
default. The default will almost work on most systems, but it's likely
to not have some filesystems you need (ext3 is not on by default, for
example) and the network driver you need may not be selected (by default
you only get eepro 100, I seem to recall). So don't just build the
default -- but I guess that's obvious.

The one thing the kernel build process cannot do is work out what
options you chose for the kernel you are running now ("installed kernel"
makes no sense, since you can have multiple kernels available at boot
time).

The configuration information after each run of 'make *config' is stored
in a file called .config in the top level source directory (linux/ or
linux-<version>/). It's a fairly common trick to copy this file
somewhere safe and name it after the kernel you were configuring. So,
for example, after running 'make xconfig', you might do

	cp .config ~/LINUX-config-2.4.19

Then, the next time you are building a kernel, you copy the most recent
config file back into .config and run 'make oldconfig' on it. This
upgrades and old .config file to include any new options from the
current kernel (so you can use the configuration file from a 2.4.18
kernel to seed your 2.4.19 build, for example). I think the config file
I use on my desktop box is about two years old, since I keep recycling
it in this fashion.

> Is that a clear question?

Yep. Is it a clear answer? :-)

Cheers,
Malcolm



More information about the Techtalk mailing list