kernel config =?> kernel code

perryh at perryh at
Sun Jan 2 09:11:22 UTC 2011

This feels like a really dumb (as in, the answer should be obvious)
question, but so far it has eluded me:  Given an option name in the
kernel configuration file, how -- exactly -- does the directive to
include or exclude that option get translated into particular code
(source lines, .o files, symbols, etc.) that are thereby included in
or excluded from the kernel?

For example, the presence or absence of GEOM_PART_BSD or
GEOM_PART_MBR presumably results in the inclusion or exclusion
of _some_ code _somewhere_, but I've been unable to figure out
how the correspondence is established.  There's a mapping from
option names to .h files in conf/options -- both GEOM_PART_BSD
and GEOM_PART_MBR map to opt_geom.h -- and I suppose this is
what causes config to create lines like

  #define GEOM_PART_MBR 1


  #define GEOM_PART_BSD 1

in <kernelname>/opt_geom.h, but I haven't found any #ifdef's
or other uses of those symbols anywhere under /usr/src/sys or

More information about the freebsd-questions mailing list