#! /bin/sh
# @(#) preinstall 97/07/29 7.1.3.2       97/07/31     Copyright 1993,94,95,96 Performance Technologies, Inc.

# Preinstall script for PTIptisp

# Save basedir
SAVEBASE=$BASEDIR
BASEDIR=""; export BASEDIR

# the following is a hack. don't complain unless you have a better solution.
#
# we only want to have one install floppy for the ptisp board for all
# Solaris versions, both above and below Solaris 2.4.  2.4 is when the
# SCSI HA API changed (necessitating shipping 2 ptisp drivers) and the
# /kernel/drv/classes file got moved and renamed to /etc/driver_classes.
#
# the first part of our solution is to install both a ptisp.2.3 and a ptisp.2.4
# driver in $BASEDIR (typically /kernel/drv) and have our postinstall script
# do a cp of the correct version to create a ptisp and then do an installf to
# tell the pkg database that ptisp is now part of our pkg.
#
# the second part of our solution involves the /kernel/drv/classes and
# /etc/driver_classes files and the installation sed scripts which edit them.
# we have to have a sed script for each file, but pkgadd will complain and
# fail the install when it doesn't see /etc/driver_classes on 2.3 and below
# or /kernel/drv/classes on 2.4 and above. to work around this we have the
# preinstall script create the missing classes file to make pkgadd happy.
# we then have the postinstall script blow this dummy file away.
# preremove and postremove must do the same thing to allow pkgrm to execute
# the remove part of the sed scripts.
#
# 3/19/96 RRD
# Add the additional script for installing 3 different ptisp: Solaris2.[345]
# Several items that has been changed in solaris 2.5: scsi_pkt data structures
# and scsi ha api
# 6/19/97 RRD
# I am getting rid of the sed classes so.. the above assumption is definitely
# not apply anymore.
 
# minor_rev=`uname -r | awk -F. '{print $2}'` || exit 2
 
# if [ $minor_rev -le 3 ]; then 
#        touch /etc/driver_classes || exit 2 
# else
#        touch /kernel/drv/classes || exit 2 
# fi 

exit 0
