postinstall revision fcf3ce441efd61da9bb2884968af01cb7c1452cc
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq# CDDL HEADER START
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq# The contents of this file are subject to the terms of the
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq# Common Development and Distribution License (the "License").
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq# You may not use this file except in compliance with the License.
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq# See the License for the specific language governing permissions
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq# and limitations under the License.
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq# When distributing Covered Code, include this CDDL HEADER in each
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq# If applicable, add the following below this CDDL HEADER, with the
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq# fields enclosed by brackets "[]" replaced with your own identifying
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq# information: Portions Copyright [yyyy] [name of copyright owner]
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq# CDDL HEADER END
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq# Use is subject to license terms.
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq# Set variables
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniqDRVDIR64=${PKG_INSTALL_ROOT}/${BASEDIR}/usr/kernel/drv/${OS_MACH}
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniqDSCFG_UPGRADE="${PKG_INSTALL_ROOT}/etc/opt/SUNWesm/dscfg.cf.upgrade"
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq #### NOTICE #####\n
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniqThe previous version of this software cannot be unloaded (busy).\n
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniqTo load the new modules you must reboot the system."
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq# Set specific command syntax (if needed)
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq# For least privileges add option -P sys_devices,sys_config
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq ADD_DRV="add_drv -P sys_devices,sys_config -b ${PKG_INSTALL_ROOT}"
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq# Functions
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq# Setup the service to enable. This is necessary to deal
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq# with upgrade situations. It also sets the proper dependency type for the
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq# local filesystems service
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq# $1: name of service to enable
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq if [ $? -ne 0 ]
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq # workaround for 6221374--let local-fs know that it depends on us
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq if [ $? -ne 0 ]
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq svccfg -s $FS_LOCAL_SVC setprop ${1}-local-fs/grouping=require_all
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq if [ $? -ne 0 ]
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq message "Warning: Unable to set dependency for $1 service"
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq if [ $? -ne 0 ]
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq# if the main module is still loaded then it has refused to unload
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq# and we have to force a reboot.
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq # still loaded
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq# Error messages
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniqERROR: The installation cannot be completed due to an error removing the
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq${MODULE} loadable module. The file ${ERROR_LOG} contains the errors.
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniqExiting...Please fix problem and re-run pkgadd."
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniqERROR: The installation cannot be completed due to an error adding the
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq${MODULE} loadable module. The file ${ERROR_LOG} contains the errors.
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniqExiting...Please fix problem and re-run pkgadd."
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniqERROR: The installation cannot be completed due to an error configuring the
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq${MODULE} loadable module. The file ${ERROR_LOG} contains the errors.
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniqExiting...Please fix problem and re-run pkgadd."
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq# If module has been previously installed, unload it and remove it...
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniqgrep -w ${MODULE} ${PKG_INSTALL_ROOT}/etc/name_to_major > /dev/null
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq# Install the module
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq${ADD_DRV} $NOPT -m '* 0666 root sys' ${MODULE} > ${ERROR_LOG} 2>&1
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq# deal with upgrades from AVS 3.2
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq if [ $? = 1 ]
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniq# Finalization of pkg database updates
ac45a43afbf38aa4a91c1402c6beef6ef8a2696dniqremovef -R ${PKG_INSTALL_ROOT} -f ${PKGINST} >/dev/null 2>&1