summaryrefslogtreecommitdiffstats
path: root/etc/rc.d/devfs
diff options
context:
space:
mode:
authordougb <dougb@FreeBSD.org>2003-05-06 01:10:33 +0000
committerdougb <dougb@FreeBSD.org>2003-05-06 01:10:33 +0000
commit5f6dec68a2cee60d28ba7cdf8a39357b3e902a7b (patch)
tree60c99871fb95d76bbe236e301681b3c56e3bcda4 /etc/rc.d/devfs
parent980fa69b23ff24b888fa4d3fb14d3619afb5503a (diff)
downloadFreeBSD-src-5f6dec68a2cee60d28ba7cdf8a39357b3e902a7b.zip
FreeBSD-src-5f6dec68a2cee60d28ba7cdf8a39357b3e902a7b.tar.gz
Allow users to configure stuff in /dev once again by re-doing the devfs
script to read /etc/devfs.conf, and take appropriate actions based on what it finds there. The (commented out) examples in the new devfs.conf file are taken in part from the old rc.devfs script.
Diffstat (limited to 'etc/rc.d/devfs')
-rw-r--r--etc/rc.d/devfs39
1 files changed, 26 insertions, 13 deletions
diff --git a/etc/rc.d/devfs b/etc/rc.d/devfs
index 437aad9..aaf828b 100644
--- a/etc/rc.d/devfs
+++ b/etc/rc.d/devfs
@@ -11,18 +11,31 @@
. /etc/rc.subr
name="devfs"
+start_cmd='read_devfs_conf'
+stop_cmd=':'
-load_rc_config $name
-
-# Setup DEVFS, ie permissions, links etc.
-#
-if [ -c /dev/ttyv0 -a ! -e /dev/vga ];then
- ln -fs /dev/ttyv0 /dev/vga
-fi
+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
+}
-# XXX - in case the user has a customized /etc/rc.devfs we need to keep
-# pulling it in until we have a better way of doing this in rc.d.
-#
-if [ -r /etc/rc.devfs ]; then
- sh /etc/rc.devfs
-fi
+load_rc_config $name
+run_rc_command "$1"
OpenPOWER on IntegriCloud