Request for help: how do teach module building about kernel options?

Adrian Chadd adrian at freebsd.org
Tue Jan 3 17:30:23 UTC 2012


On 3 January 2012 06:24, John Baldwin <jhb at freebsd.org> wrote:

>> Working off the cuff, I'd propose the following API:
>>
>> KERNOPTS=foo baz
>> SRC_FOO = foo.c
>> SRC_BAZ = baz.c
>> SRC= a.c b.c d.c
>>
>> And have the magic needed to conditionally add SRC_FOO and SRC_BAZ to SRC in bsd.kern.mk.

I'd be happy with the former to begin with, based on all the options.
Devices would be nice too, but that can come later.
How about:

KERNOPTS=foo baz
KERNDEVICES=a b c d e

Or if we're goign for linux-like config.mk (which would save on line
length issues, for very large kernel config files?):

KERNOPTS_foo=
KERNOPTS_bar=XXX
KERNOPTS_baz=YYY

> Not only that, but it would be nice if the list of modules to be built could
> be tailored to what options are enabled.  For example, if I build a kernel that
> doesn't have inet or inet6 then it shouldn't try to build ipfw, etc.

That'd be nice too, but it's almost like we'd need another domain
specific language just to describe how to build sys/modules/Makefile.
:-)

So how about we do up say, the KERNOPTS field first, which would be a
big win. Then KERNDEVICES too, if that's possible?


Adrian


More information about the freebsd-arch mailing list