freebsd-nq/sbin/devd/devd-generic
Warner Losh e530e0446b devd. A daemon that hooks into the kernel's /dev/devctl to produce
arbitrary commands when devices come and go in the device tree (which is
different than the /dev directory).

This is an initial version.  Much of the planned power isn't here.
Instead of doing the full matching, we always run /etc/devd-generic.
/etc/devd.generic will go away at some point, I think.

I'm committing it in this early state so I can start getting feedback
from early adapters.

Approved by: re
2002-10-20 22:15:17 +00:00

27 lines
600 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
# Script called by devd(8) whenever a device appears or disappears.
#
# XXX this is a temporary hack that will go away soon
dev="$1"
startstop="$2"
driver="${dev%%[0-9]*}"
unit="${dev##*[^0-9]}"
if [ -z "$driver" -o -z "$unit" ]; then
echo "cannot parse device \"$dev\"" 1>&2
exit 1
fi
case "$driver" in
an|ar|awi|bge|cm|cnw|cs|dc|de|ed|el|em|ep|ex|fe|fxp|gem|gx|hme|ie|lge|lnc|my| \
nge|pcn|ray|rl|sf|sis|sk|sn|snc|ste|ti|tl|tx|txp|vr|vx|wb|wi|xe|xl)
# An ethernet interface; call pccard_ether to do the real work
/etc/pccard_ether "$dev" "$startstop"
;;
esac