Page MenuHomeFreeBSD

Move kernel module options to kern.opts.mk so we can build modules from a naked sys tree as well as the kernel.
ClosedPublic

Authored by imp on Aug 4 2014, 4:33 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, May 9, 2:51 AM
Unknown Object (File)
Sun, May 5, 12:25 PM
Unknown Object (File)
Mar 9 2024, 5:21 PM
Unknown Object (File)
Feb 26 2024, 12:28 AM
Unknown Object (File)
Jan 17 2024, 2:49 AM
Unknown Object (File)
Jan 13 2024, 10:47 AM
Unknown Object (File)
Dec 24 2023, 2:39 PM
Unknown Object (File)
Dec 19 2023, 8:40 PM
Subscribers
None

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

imp retitled this revision from to Move kernel module options to kern.opts.mk so we can build modules from a naked sys tree as well as the kernel..
imp updated this object.
imp edited the test plan for this revision. (Show Details)

You mentioned this on the list as broken, and I didn't know that this is what you meant. This should fix it. Please let me know if there are other build issues.

Let me try this. I think you had posted a variant of this before at BSDCan? This is indeed the only issue I currently see (that I am aware of)

Is there any reason you can think that this should be using SYSDIR instead of .CURDIR? (Though maybe that wouldn't work for the standalone "cd /sys/modules/foo; make" case?)

(I don't think I had a variation of this patch before bsdcan, but I could be wrong)

I didn't think SYSDIR was guaranteed to be defined. I think that it might be better to define one, if possible. The standalone case makes it harder. We get around that with bsd.kmod.mk, and we could do similar things for this too so we get the matching kern.opts.mk file...

20 modules makefiles files have something that looks like:
SYSDIR?=../../..
in them. Perhaps we should exploit that?

On the other hand, I'd rather we have a bsd.kopt.mk that we include at the top of this file that
will define SYSDIR (ala the current bsd.kmod.mk) as well as the .mk files so that these 20 files
could be converted over.

However, that solution would require the very -m flags we are looking to avoid, or lots of
transitionary special code in each file, no?

If you install bsd.kopt.mk into /usr/share/mk you wouldn't need the -m hack. It could be a wrapper ala bsd.kmod.mk that just determines SYSDIR so that other includes can depend on that. Not sure if we could get by only having a single bsd.<foo>.mk that gets installed to /usr/share/mk to set SYSDIR and then change module Makefile's to include SYSDIR/conf/bsd.kopts.mk and SYSDIR/conf/kmod.mk (could call it conf/kopts.mk perhaps?)

I'm about to update the patch. After fixing the opt_inet.h issues, the number of Makefiles that need the include is much much smaller. I've started to define SYSDIR conditionally and use it in preference to the CURDIR/../../etc junk. I'm not quite ready to push to installing a new kern.opts.mk-type file. I think we really need to unify the one and a half different build systems we have in the system today...

imp edited edge metadata.

Update after other changes designed to reduce the scope of the change.

Updating D529: Move kernel module options to kern.opts.mk so we can build modules

from a naked sys tree as well as the kernel.

imp updated this revision to Diff 1043.

Closed by commit rS269812 (authored by @imp).