#!/bin/sh
#
#pragma ident	"@(#)postinstall	1.1	06/01/20 SMI"
#
# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
EXIT=0

# check if user has disabled vold through commenting out
# vold actions
if [ -f $BASEDIR/etc/vold.conf ]; then
	egrep "^(eject|insert|notify|remount)" $BASEDIR/etc/vold.conf > /dev/null 2>&1
	if [ $? != '0' ]; then
		exit $EXIT
	fi
fi

# check volfs should be enabled (volfs.tmp was set in
# preinstall)
if [ -f $BASEDIR/var/volfs.tmp ]; then
	touch  $BASEDIR/var/svc/profile/upgrade
	cat >> $BASEDIR/var/svc/profile/upgrade <<\_VOLFS
if [ `/sbin/zonename` = global ]; then
	/usr/sbin/svcadm enable svc:/network/rpc/smserver:default 
	/usr/sbin/svcadm enable svc:/system/filesystem/volfs:default
fi
_VOLFS
	rm -f $BASEDIR/var/volfs.tmp
fi

exit $EXIT
