#
# Copyright (c) 1994 Sun Microsystems
#
# postinstall script for SUNWos86r package.
#

# add drivers

# The following scripts are executed only when BASEDIR is "/".

if [ ${BASEDIR} = "/" ]
then
	
	if [ -f /kernel/drv/xsvc -a -h /dev/xsvc ]
	then
		rem_drv xsvc
		rm -f /dev/xsvc
	fi
		
	add_drv xsvc
	
	if [ "$?" != 0 ]
	then
		echo "Adding driver xsvc failed."
	else 
		ln -s ../../devices/pseudo/xsvc@0:xsvc /dev/xsvc 
	fi
	
	if [ -f /kernel/drv/p9000 ]
	then
	        rem_drv p9000 > /dev/null 2>&1 
	fi
	
	add_drv p9000 > /dev/null 2>&1
else

# The following scripts are executed only when BASEDIR is not "/". This implies
# to install from server for the client and reboot is required.

	if [ -f ${BASEDIR}/kernel/drv/xsvc -a -h ${BASEDIR}/dev/xsvc ]
	then
	        rem_drv -b ${BASEDIR} xsvc
	        rm -f ${BASEDIR}/dev/xsvc
	fi
	
	add_drv -b ${BASEDIR} xsvc
	
	if [ "$?" != 0 ]
	then
	        echo "Adding driver xsvc failed."
	else
	        ln -s ../../devices/pseudo/xsvc@0:xsvc ${BASEDIR}/dev/xsvc
	fi
	
	if [ -f ${BASEDIR}/kernel/drv/p9000 ]
	then
	        rem_drv -b ${BASEDIR} p9000 > /dev/null 2>&1
	fi
	
	add_drv -b ${BASEDIR} p9000 > /dev/null 2>&1
fi

exit 0
