If you have the source-code to your Linux kernel, you will find a
hidden file (name begins with a ".") such as:
/usr/src/linux/.config
This file contains a very large number of "options"...
Code:
# CONFIG_64BIT is not set
CONFIG_X86_32=y
# CONFIG_X86_64 is not set
CONFIG_X86=y
CONFIG_GENERIC_TIME=y
CONFIG_GENERIC_CMOS_UPDATE=y
CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
etc...
When you
compile the kernel, using the
make command, many intermediate-files are built which are used during the compilation process. These files determine exactly which source-files will be compiled, and exactly what source-code will be included in them.
For instance, in the configuration above, we see a comment that advises us that the option
CONFIG_X86_64 is not set. Therefore (because "the option is not set," not due to the human-readable comment to that effect...), any and all code in the Linux source-tree that pertains (in this case...) to "Intel x86 64-bit architectures" will not be included when I compile my kernel.
But code to handle "
GENERIC_CLOCKEVENTS_BROADCAST"
will be. (Exactly what does that consist of? Dunno... "use the source, Luke.")
You don't have to remember what all of these options are: your distro writer might do it for you, or
make menuconfig (et al...) will walk you through the setup process graphically and give you an explanation of each one.
So... this process allows the kernel developers to support many different possible configurations while writing only a single source-file (or set of related files). You include and omit whatever
you need.
For instance, my system is a 32-bit x86 box with embarrassingly-small amounts of memory, so I don't need 64-bit support or "huge memory" support. Therefore, when I compile a kernel for my box, that support literally
isn't there. But
you could take the same kernel-source, provide different options, and build
from the same kernel source tree an entirely-different setup ... for
your "IBM honkin-big-mainframe with 400
-abytes of RAM." The only difference is the configuration-options that you used.
Quote:
P.S.:
".config" is an ordinary file and you would be well-advised to keep distinct backup-copies of each version of it, say in a subdirectory of"/root" and/or on a thumb-drive. It is priceless to be able to answer the question of "exactly what changed between this configuration and that one" using nothing more than the diff command...
|