postinstall revision fcf3ce441efd61da9bb2884968af01cb7c1452cc
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt#!/bin/ksh
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt#
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt# CDDL HEADER START
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt#
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt# The contents of this file are subject to the terms of the
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt# Common Development and Distribution License (the "License").
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt# You may not use this file except in compliance with the License.
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt#
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt# or http://www.opensolaris.org/os/licensing.
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt# See the License for the specific language governing permissions
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt# and limitations under the License.
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt#
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt# When distributing Covered Code, include this CDDL HEADER in each
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User# If applicable, add the following below this CDDL HEADER, with the
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# fields enclosed by brackets "[]" replaced with your own identifying
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# information: Portions Copyright [yyyy] [name of copyright owner]
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt#
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# CDDL HEADER END
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt#
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt#
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Use is subject to license terms.
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt#
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt
b66b333f59cf51ef87f973084a5023acd9317fb2Evan HuntPATH="/usr/bin:/usr/sbin:${PATH}"; export PATH
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Huntdriver_not_installed()
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt{
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt grep $1 /etc/name_to_major >/dev/null 2>&1
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt if [ $? -eq 0 ]
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt then
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt return 1
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt else
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt return 0
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt fi
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt}
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Huntdriver_add()
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt{
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt if [ "${BASEDIR}" = "/" ]; then
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt add_drv -n -m '* 0666 root sys' $1 > /dev/null 2>&1
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt else
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt add_drv -n -b "${BASEDIR}" -m '* 0666 root sys' $1 > /dev/null 2>&1
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt fi
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt}
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Remove old sbd driver (if found)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntif [ ${ARCH} = "sparc" ]; then
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt RMSBD="/kernel/drv/sbd.conf /kernel/drv/sparcv9/sbd"
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt CHKSBD="/kernel/drv/sparcv9/sbd"
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Huntelse
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt RMSBD="/kernel/drv/sbd.conf /kernel/drv/sbd /kernel/drv/amd64/sbd"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt CHKSBD="/kernel/drv/amd64/sbd"
30eec077db2bdcb6f2a0dc388a3cdde2ede75ec1Mark Andrewsfi
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Huntif [ -f $CHKSBD ]; then
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt strings $CHKSBD |grep COMSTAR >/dev/null 2>&1
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt if [ $? -eq 0 ]; then
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt rem_drv sbd >/dev/null 2>&1
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt /bin/rm -f $RMSBD
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt fi
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Huntfi
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt# Now add the new drivers
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntif driver_not_installed stmf
30eec077db2bdcb6f2a0dc388a3cdde2ede75ec1Mark Andrewsthen
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt driver_add stmf
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Huntfi
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Huntif driver_not_installed stmf_sbd
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Huntthen
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt driver_add stmf_sbd
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Huntfi
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Huntif driver_not_installed fct
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Huntthen
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt driver_add fct
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Huntfi
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Huntif driver_not_installed qlt
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Huntthen
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt driver_add qlt
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Huntfi
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Huntexit 0
b66b333f59cf51ef87f973084a5023acd9317fb2Evan Hunt