debug mode for config(1)

2013-12-28 Thread Paul Goyette

Is there a debug mode available for config?

I would like to know why a particular source file is being included in 
my kernel.  :)


The file in question is net/zlib.c and the only reference I can locate 
for this file is in sys/conf/files


filenet/zlib.c (ppp  ppp_deflate) | opencrypto | vnd_compression

As I understand the configuration syntax, this means that the file is 
required when any of the other conditions are included in the kernel.


I don't have ppp or vnd in this kernel, and I can't seem to find any 
other component that would reference opencrypto.  I've searched through 
all of the files, files.*, std, and std.* files within src/sys 
and nothing appears to bring in opencrypto.  (The only one that looked 
even remotely relevant was sys/netipsec/files.netipsec but I do not have 
IPSEC in this kernel, either.)


Yet, net/zlib and all the other opencrypto objects are part of the 
compiled kernel.


So, how do I find out why net/zlib is included in the kernel?


Why do I care, if everything works?  Well, VND_COMPRESSION is defined 
when building src/sys/modules/vnd/ and that appears to require access to 
the stuff in net/zlib.c.  But net/zlib.c is not linked as part of the 
module, so loading the module would/should fail if the appropriate 
symbols/routines are not available in the kernel.  So it would seem that 
some mechanism needs to exist to ensure that the zlib stuff can be made 
available, perhaps as a separate module (similar to the way that the 
dev/dksubr.c stuff is now available for use in the vnd, cgd, and ccd 
modules).




-
| Paul Goyette | PGP Key fingerprint: | E-mail addresses:   |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com|
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer |  | pgoyette at netbsd.org  |
-


Re: debug mode for config(1)

2013-12-28 Thread Paul Goyette

On Sat, 28 Dec 2013, Paul Goyette wrote:


Is there a debug mode available for config?

I would like to know why a particular source file is being included in my 
kernel.  :)


snip

OK, problem solved, with a large dose of embarassment!

It seems that I had forgotten that my kernel config included both of

pseudo-device crypto
pseudo-device swcrypto

which obviously cause all of opencrypto to be brought in to the kernel.

snip

Why do I care, if everything works?  Well, VND_COMPRESSION is defined when 
building src/sys/modules/vnd/ and that appears to require access to the stuff 
in net/zlib.c.  But net/zlib.c is not linked as part of the module, so 
loading the module would/should fail if the appropriate symbols/routines are 
not available in the kernel.  So it would seem that some mechanism needs to 
exist to ensure that the zlib stuff can be made available, perhaps as a 
separate module (similar to the way that the dev/dksubr.c stuff is now 
available for use in the vnd, cgd, and ccd modules).


Yup.  If I remove the pseudo-devices from my kernel config, then the vnd 
module fails to load.


I'll make net/zlib.c into its own tiny module tomorrow.


-
| Paul Goyette | PGP Key fingerprint: | E-mail addresses:   |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com|
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer |  | pgoyette at netbsd.org  |
-