devfs revision 119166
198184Sgordon#!/bin/sh 298184Sgordon# 398184Sgordon# $FreeBSD: head/etc/rc.d/devfs 119166 2003-08-20 06:15:18Z mtm $ 498184Sgordon# 598184Sgordon 698184Sgordon# PROVIDE: devfs 798184Sgordon# REQUIRE: LOGIN 8114735Smtm# BEFORE: securelevel 998184Sgordon# KEYWORD: FreeBSD 1098184Sgordon 1198184Sgordon. /etc/rc.subr 1298184Sgordon 1398184Sgordonname="devfs" 14119166Smtmstart_cmd='devfs_start' 15114769Sdougbstop_cmd=':' 1698184Sgordon 17119166Smtmdevfs_start() 18119166Smtm{ 19119166Smtm if [ -n "$devfs_system_ruleset" ]; then 20119166Smtm devfs_init_rulesets 21119166Smtm devfs_set_ruleset $devfs_system_ruleset /dev 22119166Smtm devfs_apply_ruleset $devfs_system_ruleset /dev 23119166Smtm fi 24119166Smtm read_devfs_conf 25119166Smtm} 26119166Smtm 27114769Sdougbread_devfs_conf() 28114769Sdougb{ 29114769Sdougb if [ -r /etc/devfs.conf ]; then 30114769Sdougb cd /dev 31114769Sdougb while read action device parameter; do 32114769Sdougb case "${action}" in 33114769Sdougb l*) if [ -c ${device} -a ! -e ${parameter} ]; then 34114769Sdougb ln -fs ${device} ${parameter} 35114769Sdougb fi 36114769Sdougb ;; 37114769Sdougb o*) if [ -c ${device} ]; then 38114769Sdougb chown ${parameter} ${device} 39114769Sdougb fi 40114769Sdougb ;; 41114769Sdougb p*) if [ -c ${device} ]; then 42114769Sdougb chmod ${parameter} ${device} 43114769Sdougb fi 44114769Sdougb ;; 45114769Sdougb esac 46114769Sdougb done < /etc/devfs.conf 47114769Sdougb fi 48114769Sdougb} 49114769Sdougb 5098184Sgordonload_rc_config $name 51114769Sdougbrun_rc_command "$1" 52