devd.conf revision 114852
1108983Simp# $FreeBSD: head/etc/devd.conf 114852 2003-05-09 05:58:22Z imp $
2108983Simp#
3108983Simp# Refer to devd.conf(5) and devd(8) man pages for the details on how to
4108983Simp# run and configure devd.
5108983Simp#
6108983Simp
7108983Simp# NB: All regular expressions have an implicit ^$ around them.
8108983Simp# NB: device-name is shorthand for 'match device-name'
9108983Simp
10108983Simpoptions {
11108983Simp	# Each directory directive adds a directory the list of directories
12108983Simp	# that we scan for files.  Files are read-in in the order that they
13108983Simp	# are returned from readdir(3).  The rule-sets are combined to
14108983Simp	# create a DFA that's used to match events to actions.
15108983Simp	directory "/etc/devd";
16108983Simp	directory "/usr/local/etc/devd";
17108983Simp	pid-file "/var/run/devd.pid";
18108983Simp
19108983Simp	# Setup some shorthand for regex that we use later in the file.
20108983Simp	set ethernet-nic-regex 
21111971Ssam		"(an|ar|ath|aue|awi|bge|cm|cnw|cs|cue|dc|de|ed|el|em|ep|ex|\
22114577Sakiyama		fe|fxp|gem|gx|hme|ie|kue|lge|lnc|my|nge|pcn|ray|rl|rue|\
23108983Simp		sf|sis|sk|sn|snc|ste|ti|tl|tx|txp|vr|vx|wb|wi|xe|xl)[0-9]+";
24108983Simp	set scsi-controller-regex
25108983Simp		"(adv|advw|aic|aha|ahb|ahc|ahd|bt|ct|iir|isp|mly|mpt|ncv|nsp|\
26108983Simp		stg|sym|wds)[0-9]+";
27108983Simp};
28108983Simp
29108983Simp# Note that the attach/detach with the highest value wins, so that one can
30108983Simp# override these general rules.
31108983Simp
32108983Simp#
33108983Simp# For ethernet like devices, the default is to run dhclient.  Due to
34108983Simp# a historical accident, the name of this script it called pccard_ether
35108983Simp#
36108983Simpattach 0 {
37108983Simp	device-name "$ethernet-nic-regex";
38108983Simp	action "/etc/pccard_ether $device-name start";
39108983Simp};
40108983Simp
41108983Simpdetach 0 {
42108983Simp	device-name "$ethernet-nic-regex";
43108983Simp	action "/etc/pccard_ether $device-name stop";
44108983Simp};
45108983Simp
46108983Simp# An entry like this might be in a different file, but is included here
47108983Simp# as an example of how to override things.  Normally 'ed50' would match
48108983Simp# the above attach/detach stuff, but the value of 100 makes it
49108983Simp# ed50 is hard wired to 1.2.3.4
50108983Simpattach 100 {
51108983Simp	device-name "ed50";
52108983Simp	action "ifconfig $device-name inet 1.2.3.4 netmask 0xffff0000";
53108983Simp};
54108983Simpdetach 100 {
55108983Simp	device-name "ed50";
56108983Simp};
57108983Simp
58108983Simp#
59108983Simp# Rescan scsi device-names on attach, but not detach.
60108983Simp#
61108983Simpattach 0 {
62108983Simp	device-name "$scsi-controller-regex";
63108983Simp	action "camcontrol rescan all";
64108983Simp};
65108983Simp
66108983Simp# Don't even try to second guess what to do about drivers that don't
67114799Simp# match here.  Instead, pass it off to syslog.  Commented out for the
68114799Simp# moment, as pnpinfo isn't set in devd yet
69114852Simp#nomatch 0 {
70114852Simp#	action "logger Unknown device: $pnpinfo $location $bus";
71114852Simp#};
72108983Simp
73108983Simp/* EXAMPLES TO END OF FILE
74108983Simp
75108983Simp# The following might be an example of something that a vendor might
76108983Simp# install if you were to add their device.  This might reside in
77108983Simp# /usr/local/etc/devd/deqna.conf.  A deqna is, in this hypothetical
78108983Simp# example, a pccard ethernet-like device.  Students of history may
79108983Simp# know other devices by this name, and will get the in-jokes in this
80108983Simp# entry.
81108983Simpnomatch 10 {
82108983Simp	match "bus" "pccard[0-9]+";
83108983Simp	match "manufacturer" "0x1234";
84108983Simp	match "product" "0x2323";
85108983Simp	action "kldload if_deqna";
86108983Simp};
87108983Simpattach 10 {
88108983Simp	device-name "deqna[0-9]+";
89108983Simp	action "/etc/pccard_ether $device-name start";
90108983Simp};
91108983Simpdetach 10 {
92108983Simp	device-name "deqna[0-9]+";
93108983Simp	action "/etc/pccard_ether $device-name stop";
94108983Simp};
95108983Simp
96108983Simp*/
97