#! /sbin/sh

###############
# Product: Streams-TIO
# Fileset: STRTIO-KRN
# postinstall
# @(#) $Revision: 1.3.98.1 $
################
#
# (c) Copyright Hewlett-Packard Company, 1993
#
########################################################################
#                                                                      #
# General requirements:                                                #
#                                                                      #
########################################################################

#set -a                          # Export all variables

SUCCESS=0			# SD expected return codes
WARNING=2
FAILURE=1

exitval=$SUCCESS                # Anticipate success

# Variable declarations.

UTILS=/usr/lbin/sw/control_utils
if [[ ! -f $UTILS ]]
then
    print "ERROR:   Cannot find the sh functions library $UTILS."
    exit $FAILURE
fi
. $UTILS

#set_env			# sets ARCH, PATH, ROOT, PRODUCT & FILESET

########################################################
# Only modify the system file on the root file system. #
# If this is an NFSdiskless installation, or alternate #
# root, then configure will handle it.                 #
########################################################

if [[ -z "${SW_DEFERRED_KERNBLD}" ]]
then
    
    ##########################################
    #                                        #
    # Place any drivers into /stand/system   #
    # (Using SW_SYSTEM_FILE_PATH set by SD). #
    #                                        #
    ##########################################
    
    for driver in \
	ldterm \
	ptem \
	pts \
	ptm \
	pckt
    do
        mod_systemfile $SW_SYSTEM_FILE_PATH -a "$driver"
        if [[ $? -ne 0 ]]
        then
            print "ERROR:   Cannot update $SW_SYSTEM_FILE_PATH to"
            print "         include $driver ($FILESET functionality)."
            exitval=$FAILURE 
        fi
    done
    
    ########################################
    #				           #
    # Modify any tunable kernel parameters #
    #				           #
    ########################################

    for tunable in \
	nstrpty=60
    do
        mod_systemfile $SW_SYSTEM_FILE_PATH -t ${tunable%%=*} "${tunable##*=}"
        if [[ $? -ne 0 ]]
        then
            print "ERROR: Cannot update $SW_SYSTEM_FILE_PATH to alter"
            print "       tunable parameter ${tunable%%=*} to ${tunable##*=}"
            exitval=$FAILURE
        fi
    done

    #############
    # Finished. #
    #############

fi	# end of "if [[ -z ${SW_DEFERRED_KERNBLD}" ]]

exit $exitval
