# @(#)src/sol/packaging/vxfs/postinstall.lic	3.6.10.1 12 Feb 1998 13:44:36
#ident "@(#)src/sol/packaging/vxfs/postinstall.lic	3.6.10.1"

# Copyright (c) 1993 VERITAS Software Corporation.  ALL RIGHTS RESERVED.
# UNPUBLISHED -- RIGHTS RESERVED UNDER THE COPYRIGHT
# LAWS OF THE UNITED STATES.  USE OF A COPYRIGHT NOTICE
# IS PRECAUTIONARY ONLY AND DOES NOT IMPLY PUBLICATION
# OR DISCLOSURE.
#
# THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION AND
# TRADE SECRETS OF VERITAS SOFTWARE.  USE, DISCLOSURE,
# OR REPRODUCTION IS PROHIBITED WITHOUT THE PRIOR
# EXPRESS WRITTEN PERMISSION OF VERITAS SOFTWARE.
#
#               RESTRICTED RIGHTS LEGEND
# USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT IS
# SUBJECT TO RESTRICTIONS AS SET FORTH IN SUBPARAGRAPH
# (C) (1) (ii) OF THE RIGHTS IN TECHNICAL DATA AND
# COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013.
#               VERITAS SOFTWARE
# 4800 GREAT AMERICA PARKWAY, SANTA CLARA, CA 95054

rm -f $BASEDIR/kernel/fs/vxfs 
OSPOINT=`uname -r | cut -c 1-5`
if [ $OSPOINT = "5.5.1" ]
then   
        echo "Installing kernel binaries for Solaris 2.5.1"
	SUFFIX=5_5_1
else
        echo "Installing kernel binaries for Solaris 2.6"
	SUFFIX=5_6
fi

ln -s /kernel/fs/vxfs$SUFFIX $BASEDIR/kernel/fs/vxfs

#
# if we are installing using -R option than ensure that
# appropiate system directories and files are present.
# We don't have this in prototype as we are not
# installling components in this directories but stuff like
# add_drv would need it.
#

[ -d $BASEDIR/dev ] || mkdir -p $BASEDIR/dev
[ -d $BASEDIR/etc ] || mkdir -p $BASEDIR/etc

if [ ! -f $BASEDIR/etc/name_to_major ]
then
	> $BASEDIR/etc/name_to_major
fi

if [ ! -f $BASEDIR/etc/driver_aliases ]
then
	> $BASEDIR/etc/driver_aliases
fi

if [ $BASEDIR = "/" -o -z $BASEDIR ]
then
	add_drv vxportal
else
	add_drv -b $BASEDIR vxportal
fi

rm -f $BASEDIR/dev/vxportal
ln -s /devices/pseudo/vxportal@0:0 $BASEDIR/dev/vxportal

#
# Check for presense of license only if BASEDIR is set to /
#

LICFEATURE=80
if [ $BASEDIR = "/" -a -f /etc/vx/elm/$LICFEATURE ]
then
	vxfsserial -t $LICFEATURE 2>&1 > /dev/null
	if [ $? = 0 ]
	then
		exit 0
	fi
fi

[ -f $BASEDIR/etc/vx/elm ] || mkdir -p $BASEDIR/etc/vx/elm

#
# Note that if we are bing installed with -R option and VxFS
# existed in this directory even then we would print the
# following message. This is minor enough not to change documents.
#

echo
echo "You must install license keys before using VxFS."
echo
echo "Send the machine type and the hostid of your machine to"
echo "Veritas Customer support to get the license key."
echo
echo "The machine type and hostid of your system can be obtained "
echo "by running the commands:"
echo
echo "  uname -i"
echo
echo "  hostid"
echo
echo "To install the license after you receive the license key"
echo "you should run the following command:"
echo
echo "  vxfsserial -c"
echo
echo

exit 0
