Re: Auto kernel module loading

From: M. Warner Losh <imp_at_bsdimp.com>
Date: Tue, 22 Apr 2003 06:45:48 -0600 (MDT)
In message: <3EA531A0.3060209_at_tcoip.com.br>
            "Daniel C. Sobral" <dcs_at_tcoip.com.br> writes:
: M. Warner Losh wrote:
: > In message: <3E9EB7DF.4040104_at_tcoip.com.br>
: >             "Daniel C. Sobral" <dcs_at_tcoip.com.br> writes:
: > : Plan once was for loader to identify the PNP IDs and load the 
: > : appropriate modules. What the appropriate modules were would be infered 
: > : from a configuration file.
: > : 
: > : I think Mike decided that wasn't such a good idea after all, but I 
: > : wasn't much in touch with FreeBSD at the time, so I remember it only 
: > : vaguely.
: > 
: > Yes.  My plan is to make devd deal with most of the problem...  You'll
: > still need to compile / device into your kernel, however.
: 
: Mmmm? The point is having a minimal kernel.ko. If you still have to 
: compile the device in the kernel, it does nothing at all to reach the 
: desired goal.

You misunderstand.  I have a fairly minimal kernel.ko.  You have to
compile "/ device" into your kernel means that you have to compile the
device that you get your "/" partition from.

Sorry if that didn't parse.

Right now I have kinda gross things like the following in my devd.conf
file:

nomatch 10 {
	match "bus" "cardbus[0-9]+";
	match "vendor" "0x10b7";
	match "device" "0x5257";
	action "kldload if_xl";
};

nomatch 10 {
	match "bus" "pccard[0-9]+";
	match "manufacturer" "0x015f";
	match "product" "0x000a";
	action "kldload if_an";
};

I've just gotten this working with devd, so I've not had a chance to
optimize things completely at this point in time.  However, the above
entries have allowed me to compile a minimal kernel.ko and have the
devices loaded on demand.  I don't bother trying to unload them on
last use, however, since that is a big pita...

Warner
Received on Tue Apr 22 2003 - 03:46:33 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:04 UTC