[nSLUG] The .config file for compiling a kernel

D G Teed donald.teed at gmail.com
Fri Mar 13 10:58:03 ADT 2015

On Wed, Mar 11, 2015 at 11:01 AM, Dave Flogeras <dflogeras2 at gmail.com> wrote:
> I also highly recommend doing an out-of-tree build when you are
> experimenting, it makes it very easy to start over if you wish to get
> back to a known state without polluting your src tree. It also means
> you can configure and build as a normal user (always a bad idea to run
> X/gui tools as root).  Finally, it's nice if you keep multiple build
> configurations for the same kernel.  You only have one copy of the
> src/ dir, but multiple build dirs; one for each config.
> Start in your /usr/src/linux directory (or wherever your sources are installed):
> - make O=/path/to/some/place/to/build defconfig (that's a capital oh, not zero)
> - cd /path/to/some/place/to/build
> - cp /my/known/good/oldconfig .config
> - make oldconfig

Lots of really good answers here.  I can only contribute that
make oldconfig is tiresome.  It will ask about a zillion devices,
one at a time, which have been added to the kernel since the last
.config was generated.

I am an ncurses fan, so I use make menuconfig, which sets a default
answer for all of the new devices and options added to the kernel
since the previous kernel.  It allows one to enter the configuration
in a context where you can drill down.  That way, you only
mess with the particular hardware setting you wanted to support,
and then write out the config.    When there is a newer kernel
and you only want to recompile, then menuconfig handles it
with defaults for all the new stuff.  make menuconfig, save
the .config, and exit.  Much faster.

More information about the nSLUG mailing list