#! /sbin/sh
########
# Product: OS-CORE
# Fileset: KERN-RUN
# checkremove
# @(#) $Revision: 1.2.98.2 $
#########
#
# (c) Copyright Hewlett-Packard Company, 1993
#
#########

# The global variables SUCCESS, FAILURE, WARNING, EXCLUDE, PATH, ROOT,
# SW_CTL_SCRIPT_NAME, _pf, PRODUCT, and FILESET are all set by control_utils.

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

. $UTILS

exit_status=0

if [[ $SW_SESSION_IS_KERNEL = "TRUE" ]]; then
    print "ERROR:   Removal of the $FILESET fileset is not allowed.  The system"
    print "         cannot boot without the files contained in it."
    exit_status=$FAILURE
else
    print "WARNING: Removal of the $FILESET fileset will make it impossible"
    print "         to build a new kernel.  This precludes changing certain"
    print "         system parameters and installing products that modify or"
    print "         add to the kernel."
    exit_status=$WARNING
fi
exit $exit_status
