1 # $FreeBSD: src/etc/devd.conf,v 1.42 2008/06/27 12:04:36 rpaulo Exp $
3 # Refer to devd.conf(5) and devd(8) man pages for the details on how to
4 # run and configure devd.
7 # NB: All regular expressions have an implicit ^$ around them.
8 # NB: device-name is shorthand for 'match device-name'
11 # Each directory directive adds a directory the list of directories
12 # that we scan for files. Files are read-in in the order that they
13 # are returned from readdir(3). The rule-sets are combined to
14 # create a DFA that's used to match events to actions.
15 directory "/etc/devd";
16 directory "/usr/local/etc/devd";
18 # Setup some shorthand for regex that we use later in the file.
19 #XXX Yes, these are gross -- imp
20 set scsi-controller-regex
21 "(aac|adv|adw|ahc|ahd|aic|amd|amr|asr|bt|ciss|ct|dpt|\
22 esp|ida|iir|ips|isp|mlx|mly|mpt|ncr|ncv|nsp|stg|sym|trm|wds)\
26 # Note that the attach/detach with the highest value wins, so that one can
27 # override these general rules.
30 # Configure the interface on attach. Due to a historical accident, this
31 # script is called pccard_ether.
34 # match "system" "IFNET";
35 # match "type" "ATTACH";
36 # action "/etc/pccard_ether $subsystem start";
40 # match "system" "IFNET";
41 # match "type" "DETACH";
42 # action "/etc/pccard_ether $subsystem stop";
46 # Try to start dhclient on Ethernet like interfaces when the link comes
47 # up. Only devices that are configured to support DHCP will actually
48 # run it. No link down rule exists because dhclient automaticly exits
49 # when the link goes down.
52 # match "system" "IFNET";
53 # match "type" "LINK_UP";
54 # media-type "ethernet";
55 # action "/etc/rc.d/dhclient start $subsystem";
59 # Like Ethernet devices, but separate because
60 # they have a different media type. We may want
61 # to exploit this later.
64 # media-type "802.11";
65 # action "/etc/pccard_ether $device-name stop";
68 # media-type "802.11";
69 # action "/etc/pccard_ether $device-name start";
72 # match "system" "IFNET";
73 # match "type" "LINK_UP";
74 # media-type "802.11";
75 # action "/etc/rc.d/dhclient start $subsystem";
79 # An entry like this might be in a different file, but is included here
80 # as an example of how to override things. Normally 'ed50' would match
81 # the above attach/detach stuff, but the value of 100 makes it
82 # hard wired to 1.2.3.4.
85 # action "ifconfig $device-name inet 1.2.3.4 netmask 0xffff0000";
92 # When a USB Bluetooth dongle appears activate it.
93 # XXX FIX for DragonFly XXX
95 # device-name "ubt[0-9]+";
96 # action "/etc/rc.d/bluetooth start $device-name";
99 # device-name "ubt[0-9]+";
100 # action "/etc/rc.d/bluetooth stop $device-name";
104 # When a USB keyboard arrives, attach it as the console keyboard.
105 # XXX Fix for DragonFly XXX
107 # device-name "ukbd0";
108 # action "/etc/rc.d/syscons setkeyboard /dev/ukbd0";
111 # device-name "ukbd0";
112 # action "/etc/rc.d/syscons setkeyboard /dev/kbd0";
116 # device-name "ums[0-9]+";
117 # action "/etc/rc.d/moused start $device-name";
121 # device-name "ums[0-9]+";
122 # action "/etc/rc.d/moused stop $device-name";
126 # Rescan scsi device-names on attach, but not detach. However, it is
127 # disabled by default due to reports of problems.
130 # device-name "$scsi-controller-regex";
131 # action "camcontrol rescan all";
134 # Don't even try to second guess what to do about drivers that don't
135 # match here. Instead, pass it off to syslog. Commented out for the
136 # moment, as the pnpinfo variable isn't set in devd yet. Individual
137 # variables within the bus supplied pnpinfo are set.
139 # action "logger Unknown device: $pnpinfo $location $bus";
143 # Various logging of unknown devices.
145 # match "bus" "uhub[0-9]+";
146 # action "logger Unknown USB device: vendor $vendor product $product \
151 # Some PC-CARDs don't offer numerical manufacturer/product IDs, just
152 # show the CIS info there.
154 # match "bus" "pccard[0-9]+";
155 # match "manufacturer" "0xffffffff";
156 # match "product" "0xffffffff";
157 # action "logger Unknown PCCARD device: CISproduct $cisproduct \
158 # CIS-vendor $cisvendor bus $bus";
162 # match "bus" "pccard[0-9]+";
163 # action "logger Unknown PCCARD device: manufacturer $manufacturer \
164 # product $product CISproduct $cisproduct CIS-vendor \
165 # $cisvendor bus $bus";
169 # match "bus" "cardbus[0-9]+";
170 # action "logger Unknown Cardbus device: device $device class $class \
171 # vendor $vendor bus $bus";
175 # Switch power profiles when the AC line state changes.
177 # match "system" "ACPI";
178 # match "subsystem" "ACAD";
179 # action "/etc/rc.d/power_profile $notify";
183 # Notify all users before beginning emergency shutdown when we get
184 # a _CRT or _HOT thermal event and we're going to power down the system
187 # match "system" "ACPI";
188 # match "subsystem" "Thermal";
189 # match "notify" "0xcc";
190 # action "logger -p kern.emerg \
191 # 'WARNING: system temperature too high, shutting down soon!'";
195 # User requested suspend, so perform preparation steps and then execute
196 # the actual suspend process.
198 # match "system" "ACPI";
199 # match "subsystem" "Suspend";
200 # action "/etc/rc.suspend acpi $notify";
203 # match "system" "ACPI";
204 # match "subsystem" "Resume";
205 # action "/etc/rc.resume acpi $notify";
209 # The next blocks enable volume hotkeys that can be found on the Asus EeePC
210 # XXX ASUS-Eee subsystem isn't available in DragonFly
212 # match "system" "ACPI";
213 # match "subsystem" "ASUS-Eee";
214 # match "notify" "0x13";
219 # match "system" "ACPI";
220 # match "subsystem" "ASUS-Eee";
221 # match "notify" "0x14";
222 # action "mixer vol -10";
226 # match "system" "ACPI";
227 # match "subsystem" "ASUS-Eee";
228 # match "notify" "0x15";
229 # action "mixer vol +10";
233 # The following might be an example of something that a vendor might
234 # install if you were to add their device. This might reside in
235 # /usr/local/etc/devd/deqna.conf. A deqna is, in this hypothetical
236 # example, a pccard ethernet-like device. Students of history may
237 # know other devices by this name, and will get the in-jokes in this
240 # match "bus" "pccard[0-9]+";
241 # match "manufacturer" "0x1234";
242 # match "product" "0x2323";
243 # action "kldload if_deqna";
246 # device-name "deqna[0-9]+";
247 # action "/etc/pccard_ether $device-name start";
250 # device-name "deqna[0-9]+";
251 # action "/etc/pccard_ether $device-name stop";
255 # Examples of notify hooks. A notify is a generic way for a kernel
256 # subsystem to send event notification to userland.
258 # Here are some examples of ACPI notify handlers. ACPI subsystems that
259 # generate notifies include the AC adapter, power/sleep buttons,
260 # control method batteries, lid switch, and thermal zones.
262 # Information returned is not always the same as the ACPI notify
263 # events. See the ACPI specification for more information about
264 # notifies. Here is the information returned for each subsystem:
266 # ACAD: AC line state (0 is offline, 1 is online)
267 # Button: Button pressed (0 for power, 1 for sleep)
268 # CMBAT: ACPI battery events
269 # Lid: Lid state (0 is closed, 1 is open)
270 # Suspend, Resume: Suspend and resume notification
271 # Thermal: ACPI thermal zone events
273 # This example calls a script when the AC state changes, passing the
274 # notify value as the first argument. If the state is 0x00, it might
275 # call some sysctls to implement economy mode. If 0x01, it might set
276 # the mode to performance.
278 # match "system" "ACPI";
279 # match "subsystem" "ACAD";
280 # action "/etc/acpi_ac $notify";