#!/bin/sh
#
# Copyright (c) 1999 by Sun Microsystems, Inc.
# All rights reserved.
#

#pragma ident	"@(#)devfsadm	1.1	99/03/21 SMI"

case "$1" in
'start')
	/usr/lib/devfsadm/devfseventd >/dev/console 2>&1
	/usr/lib/devfsadm/devfsadmd >/dev/console 2>&1

	if [ -n "$_INIT_RECONFIG" ]; then
	        if [ -x /usr/ucb/ucblinks -a -f /usr/ucblib/ucblinks.awk ]; then
	                echo 'Configuring the /dev directory (compatibility devices)'
	                /usr/ucb/ucblinks >/dev/null 2>&1
	        fi
	fi

	# Establish the default framebuffer name.

	fbdev=`/usr/sbin/prtconf -F 2>/dev/null`

	if [ $? -eq 0 ]; then
		set -- /devices$fbdev*
		if [ -c $1 ]; then
			rm -f /dev/fb
			ln -s $1 /dev/fb
		fi
	fi
	;;

'stop')
	/usr/bin/pkill -x -u 0 -f /usr/lib/devfsadm/devfsadmd
	/usr/bin/pkill -x -u 0 -f /usr/lib/devfsadm/devfseventd
	;;	

*)
	echo "Usage: $0 { start | stop }"
	;;

esac
exit 0
