2002-06-13 22:14:37 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: devfs
|
|
|
|
# REQUIRE: LOGIN
|
2003-05-05 15:38:41 +00:00
|
|
|
# BEFORE: securelevel
|
2002-06-13 22:14:37 +00:00
|
|
|
# KEYWORD: FreeBSD
|
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="devfs"
|
2003-08-20 06:15:18 +00:00
|
|
|
start_cmd='devfs_start'
|
2003-05-06 01:10:33 +00:00
|
|
|
stop_cmd=':'
|
2002-06-13 22:14:37 +00:00
|
|
|
|
2003-08-20 06:15:18 +00:00
|
|
|
devfs_start()
|
|
|
|
{
|
|
|
|
if [ -n "$devfs_system_ruleset" ]; then
|
|
|
|
devfs_init_rulesets
|
|
|
|
devfs_set_ruleset $devfs_system_ruleset /dev
|
|
|
|
devfs_apply_ruleset $devfs_system_ruleset /dev
|
|
|
|
fi
|
|
|
|
read_devfs_conf
|
|
|
|
}
|
|
|
|
|
2003-05-06 01:10:33 +00:00
|
|
|
read_devfs_conf()
|
|
|
|
{
|
|
|
|
if [ -r /etc/devfs.conf ]; then
|
|
|
|
cd /dev
|
|
|
|
while read action device parameter; do
|
|
|
|
case "${action}" in
|
|
|
|
l*) if [ -c ${device} -a ! -e ${parameter} ]; then
|
|
|
|
ln -fs ${device} ${parameter}
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
o*) if [ -c ${device} ]; then
|
|
|
|
chown ${parameter} ${device}
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
p*) if [ -c ${device} ]; then
|
|
|
|
chmod ${parameter} ${device}
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done < /etc/devfs.conf
|
|
|
|
fi
|
|
|
|
}
|
2003-05-02 08:10:58 +00:00
|
|
|
|
2003-05-06 01:10:33 +00:00
|
|
|
load_rc_config $name
|
|
|
|
run_rc_command "$1"
|