#!/bin/sh
#
# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# ident	"@(#)postinstall	1.8	08/03/19 SMI"

PATH=/usr/bin:/usr/sbin

#
# Check for the correct kernel support.  We might find 127111 here:
#
#     Patch: 127111-01 Obsoletes: Requires:
#
# Or somewhere in the Obsoletes list:
#
#     Patch: XXXXXX-04 Obsoletes: YYYYYY-05 127111-01 Requires:
#
# So we simply look to see if the string " 127111" is somewhere between
# "Patch:" and "Requires:".
#
LC_ALL=C; LANG=C patchadd -p -R $BASEDIR | \
    egrep -s "^Patch:.* 127111-.*Requires:"

if [ $? -ne 0 ]; then
	echo "WARNING: Creating solaris9 branded zones requires" \
	    "patch 127111, which does\n\tnot appear to be installed."
	echo "Install patch 127111 or a newer patch that obsoletes" \
	    "127111 and reboot before attempting\n\tto create a solaris9" \
	    "branded zone."
fi

exit 0
