Attach/detach devices

M. Warner Losh imp at bsdimp.com
Fri Aug 11 20:25:20 UTC 2006


In message: <867j1fyt2g.fsf at xps.des.no>
            des at des.no (Dag-Erling Smørgrav) writes:
: "Johnny Choque" <jchoque at tlmat.unican.es> writes:
: > I sent an email to this mailing list some day ago (August 2) explaining a
: > problem that I had with devd.conf. Using devd -dD, I detected that removing
: > the wireless pc card the rules that are included in the detach section do
: > not happen to run, but anybody answered my question :-(
: 
: That's because you didn't ask here; you asked on freebsd-questions,
: which nobody capable of answering your question ever reads.
: 
: http://lists.freebsd.org/pipermail/freebsd-questions/2006-August/127990.html

The problem is chicken and egg.  I see how you are doing this now...

detach 0 {
	media-type "802.11";
	action "/etc/pccard_ether $device-name stop"; };

The problem is that by the time the 'detach' comes, the device is no
longer in the system.  It is long gone.  So when we do the comparison
against media type, we have no clue what kind of media it is, and the
test fails.

For now, add a rule matching device name wi.

Warner


More information about the freebsd-hackers mailing list