#!/bin/sh
#*******************************************************************************
#
# NAME:		postinstall
# SUMMARY:	Script to disable RDAC deadlock detection
# COMPONENT:	
# VERSION:	2
# UPDATE DATE:	3/05/97
# PROGRAMMER:	rjantz
# 
#		Copyright 1997 by Symbios Logic Inc.
#		
# MODIFICATION HISTORY:
#       rjantz@symbios.com: Original script author.
#       petej@eng.sun.com:  Converted this script to work as a postinstall
#                           script designed to remove /etc/rcS.d/S46rdac 
#                           (if it exists), then patch the in-memory version
#                           of rdriver.
#
# DESCRIPTION:
# This script runs at the end of patch installation time to disable
# deadlock detection in the RDAC driver.
#
# NOTES:
# This script depends on adb to do its job.
#
# REFERENCE:
#
#
# CODING STANDARD WAIVERS:
#
#
#*******************************************************************************

MODINFO=/usr/sbin/modinfo
GREP=/bin/grep
ADB=/usr/bin/adb
RM=/usr/bin/rm
REMOVEF=/usr/sbin/removef

# First check to see if /etc/rcS.d/S46rdac exists
# if it does, remove it and update the package contents
if [ -f /etc/rcS.d/S46rdac ]; then
   echo "The following files are no longer part of this package 
	 and are being removed."
   $REMOVEF SUNWosar /etc/rcS.d/S46rdac
   $RM -f /etc/rcS.d/S46rdac
   $REMOVEF -f SUNWosar 
fi

if $MODINFO | $GREP rdriver >/dev/null 2>&1
then
	if [ -x $ADB ]
	then
		$ADB -kw >/dev/null 2>&1 <<-EOF
		RdacTimerFlag/W 0
		EOF
	fi
fi
