#! /sbin/sh
###############
# Product: HPVM
# Fileset: HPVM-KRN
# postremove
# @(#) $Revision: 7737 $
################

########################################################################
#
# (c) Copyright Hewlett-Packard Company, 2005-2006
#
########################################################################

typeset -r UTILS="/usr/lbin/sw/control_utils"
if [[ ! -f $UTILS ]]
then
     echo "ERROR:   Cannot find $UTILS"
     exit 1
fi
. $UTILS

typeset -r LOCALSCRIPTS=${SW_CONTROL_DIRECTORY}/common_scripts
if [[ ! -f $LOCALSCRIPTS ]]
then
     msg "ERROR:   Cannot find $LOCALSCRIPTS"
     exit 1
fi
. $LOCALSCRIPTS

exitval=$SUCCESS

##########################################################
# If unconfiguring a diskless client, or a disk that had #
# been mounted as an alternate root during swinstall,    #
# perform all necessary kernel modifications.            #
##########################################################

if [[ -z "${SW_DEFERRED_KERNBLD}" ]]; then
    remove_modules_and_tunables
fi

########################################################################
# Exit status
########################################################################
exit ${exitval}
