#!/bin/sh #******************************************************************************* # # NAME: preinstall # SUMMARY: %description% # COMPONENT: SUNWroot # VERSION: 5 # UPDATE DATE: %date_modified: Tue Aug 5 11:23:18 1997 % # # CONTACTS: # Originator: # Owner: # Backup: # Updater: %created_by: bmyers % # # Copyright 1997 by Symbios Logic Inc. # # DESCRIPTION: Remove files made obsolete by release 6.01 # # # NOTES: # # # REFERENCE: # 1. PIP0003C.DOC, Source Code Integrity Measures # # # CODING STANDARD WAIVERS: # # #******************************************************************************* # When this preinstall script executes, the package database already has # knowledge of this installation attempt. Therefore we must determine if the # package is indeed this attempt or a previous version. If it is this attempt, # we will proceed with the installation. PACKAGE=`pkginfo -l | grep SUNWosar | cut -d: -f2` PREVIOUSVERSION=`pkgparam SUNWosar VSTOCK` if [ "$PREVIOUSVERSION" = "$VSTOCK" ]; then # proceed with the install of this package # save conf files if root/boot if grep rootdev ${BASEDIR}/etc/system | grep -v "^*" | grep rdriver >/dev/null 2>&1 then cp ${BASEDIR}/kernel/drv/rdnexus.conf ${BASEDIR}/var/osa/rdnexus.conf >/dev/null 2>&1 cp ${BASEDIR}/kernel/drv/rdriver.conf ${BASEDIR}/var/osa/rdriver.conf >/dev/null 2>&1 fi exit 0 fi # Do not allow pkgadd of the current package if previous SUNWosa package(s) exist # unless we are root/boot. If the array is the boot device and we remove the old # packges, we will not be able to reboot. In this case we must remove obsolete files. if pkginfo | grep SUNWosar >/dev/null 2>&1 then if grep rootdev ${BASEDIR}/etc/system | grep -v "^*" | grep rdriver >/dev/null 2>&1 then break; else echo echo " *** WARNING ***" echo echo " A previous instance of SUNWosar and/or SUNWosau is installed on this" echo " system Please remove the package(s) using the pkgrm utility, then" echo " execute pkgadd of $PKGINST again." echo echo " Aborting pkgadd of $PKGINST" echo exit 1 fi fi if [ -f $BASEDIR/etc/rcS.d/S45rdac ] then removef SUNWosar $BASEDIR/etc/rcS.d/S45rdac 2>/dev/null rm $BASEDIR/etc/rcS.d/S45rdac 2>/dev/null fi removef -f SUNWosar exit 0