postinstall revision 18c2aff776a775d34a4c9893a4c72e0434d68e36
18727N/A#
14364N/A# CDDL HEADER START
12667N/A#
12667N/A# The contents of this file are subject to the terms of the
12667N/A# Common Development and Distribution License (the "License").
12667N/A# You may not use this file except in compliance with the License.
12667N/A#
12667N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
12667N/A# or http://www.opensolaris.org/os/licensing.
12666N/A# See the License for the specific language governing permissions
12666N/A# and limitations under the License.
12666N/A#
14364N/A# When distributing Covered Code, include this CDDL HEADER in each
12666N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
14364N/A# If applicable, add the following below this CDDL HEADER, with the
14364N/A# fields enclosed by brackets "[]" replaced with your own identifying
14364N/A# information: Portions Copyright [yyyy] [name of copyright owner]
14364N/A#
12667N/A# CDDL HEADER END
14364N/A#
14364N/A#
14364N/A# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
14364N/A# Use is subject to license terms.
14364N/A#
12667N/A# ident "%Z%%M% %I% %E% SMI"
14364N/A#
14364N/A
# Preinstall script will create this file if HAL service was already
# installed, in which case we preserve current service state,
# be it enabled or disabled.
if [ -f $PKG_INSTALL_ROOT/var/tmp/hal_installed.tmp ]; then
rm -f $PKG_INSTALL_ROOT/var/tmp/hal_installed.tmp
else
# enable HAL only in global zone
if [ "$UPDATE" = yes ]; then
# upgrade
cat >> ${PKG_INSTALL_ROOT}/var/svc/profile/upgrade <<-EOF
/usr/sbin/svcadm enable svc:/system/hal:default
EOF
elif [ "${PKG_INSTALL_ROOT:-/}" = "/" ]; then
# live system
/usr/sbin/svcadm enable svc:/system/hal:default
fi
fi
exit 0