#!/sbin/sh
#############################################################################
#  Product: HSCFibreCh
#  Fileset: FCHSC-KRN
#  configure
#  @(#) $Revision: 1.1.98.2 $
#############################################################################
# (c) Copyright Hewlett-Packard Company, 1994
#############################################################################

####### add our entry to the kernel config file only if on a client system
if [ -z "$SW_DEFERRED_KERNBLD" ] ; then
    # we are on a standalone or server; the postinstall script has already
    # updated the kernel config file
    exit 0
fi

####### setup environment 
UTILS="/usr/lbin/sw/control_utils"
if [ ! -f $UTILS ] ; then
    echo "ERROR:   Cannot find \"$UTILS\"."
    exit 1
fi
. $UTILS

####### For now, do something only if this is a Series 800 machine

ARCHITECTURE=`get_arch`
if [ $ARCHITECTURE -ne "800" ]; then
    exit $SUCCESS
fi


####### add our entry to the kernel config file
EXITVAL=0
RES0=0

mod_systemfile $SW_SYSTEM_FILE_PATH -a fcgsc_lan
RES0=$?
if [ $RES0 -ne 0 ] ; then
    echo "ERROR:   Cannot modify the kernel configuration file.  The"
    echo "         fcgsc driver must be manually configured"
    echo "         into the kernel."
    EXITVAL=1
fi

#
# Export the master file to the FCHSC-RUN fileset.
#
file="${SW_LOCATION}usr/conf/master.d/fcgsc"
if swlist -l file $PRODUCT.$FILESET 2>/dev/null | grep -q $file
then        # master file not yet exported
  export_master $file
  if [[ $? -ne 0 ]]
    then
      echo "WARNING: Cannot give the master file(s) \"$file\""
      echo "         to ${FILESET%%-KRN}-RUN.  If you delete this"
      echo "         fileset, SAM will not be able to handle your"
      echo "         device files"
      if [[ $EXITVAL -ne $FAILURE ]]
        then
          EXITVAL=$WARNING
      fi # [[ $EXITVAL -ne $FAILURE ]]
    fi # [[ $? -ne 0 ]]
fi # swlist -l file $PRODUCT.$FILESET


exit $EXITVAL
