preremove revision fcf3ce441efd61da9bb2884968af01cb7c1452cc
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#! /usr/bin/sh
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# CDDL HEADER START
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# The contents of this file are subject to the terms of the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# Common Development and Distribution License (the "License").
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# You may not use this file except in compliance with the License.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# or http://www.opensolaris.org/os/licensing.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# See the License for the specific language governing permissions
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# and limitations under the License.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# When distributing Covered Code, include this CDDL HEADER in each
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# If applicable, add the following below this CDDL HEADER, with the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# fields enclosed by brackets "[]" replaced with your own identifying
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# information: Portions Copyright [yyyy] [name of copyright owner]
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# CDDL HEADER END
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright#
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright# Use is subject to license terms.
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross#
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwPATH="/usr/bin:/usr/sbin:${PATH}"
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwexport PATH
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon RossSERVICE="svc:/system/stmf:default"
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwdriver_installed()
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw{
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw grep $1 /etc/name_to_major >/dev/null 2>&1
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw return $?
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw}
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwremove_drv()
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw{
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw if driver_installed $1
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw then
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw /usr/sbin/rem_drv -b ${BASEDIR} $1 > /dev/null 2>&1
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw fi
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw}
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwsvcadm clear $SERVICE >/dev/null 2>&1
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Rosssvcadm disable $SERVICE >/dev/null 2>&1
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Rosssleep 2
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwremove_drv qlt
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwremove_drv fct
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwremove_drv stmf_sbd
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwecho 'stmf_allow_modunload/W 1' | /bin/mdb -kw >/dev/null 2>&1
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwremove_drv stmf
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Rossexit 0
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw