preremove revision 7c478bd95313f5f23a4c958a745db2134aa03244
246N/A#! /bin/sh
246N/A#
246N/A# CDDL HEADER START
246N/A#
246N/A# The contents of this file are subject to the terms of the
246N/A# Common Development and Distribution License, Version 1.0 only
246N/A# (the "License"). You may not use this file except in compliance
246N/A# with the License.
246N/A#
246N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
246N/A# or http://www.opensolaris.org/os/licensing.
246N/A# See the License for the specific language governing permissions
246N/A# and limitations under the License.
246N/A#
246N/A# When distributing Covered Code, include this CDDL HEADER in each
246N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
246N/A# If applicable, add the following below this CDDL HEADER, with the
246N/A# fields enclosed by brackets "[]" replaced with your own identifying
246N/A# information: Portions Copyright [yyyy] [name of copyright owner]
246N/A#
246N/A# CDDL HEADER END
246N/A#
246N/A#
246N/A#pragma ident "%Z%%M% %I% %E% SMI"
246N/A#
246N/A# Copyright (c) 1999,2001 by Sun Microsystems, Inc.
618N/A# All rights reserved.
246N/A#
246N/A
246N/APATH="/usr/bin:/usr/sbin:${PATH}"
246N/Aexport PATH
246N/A
246N/ADEVLINKTB="$BASEDIR/etc/devlink.tab"
246N/A
246N/ATMP=/tmp/$$
246N/A
246N/A#
246N/A# rem_devlink - removes an entry from ${DEVLINKTB}
246N/A#
246N/Arem_devlink()
246N/A{
246N/A PATTERN="$1"
246N/A LINK="$2"
246N/A PLINK="`echo $LINK | sed 's/[$*^|\]/\\\&/g'`"
246N/A grep -v "^$PATTERN $PLINK$" ${DEVLINKTB} >$TMP.devlink
246N/A #
246N/A # Must use 'cp' here in order to preserve the original
246N/A # mode, owner and group of devlink.tab
246N/A #
246N/A cp $TMP.devlink ${DEVLINKTB}
246N/A rm -f $TMP.devlink
246N/A}
246N/A
246N/Acase "${ARCH}" in
246N/Asparc)
246N/A rem_drv -b ${BASEDIR} pcs
246N/A rem_drv -b ${BASEDIR} stp4020
246N/A rem_drv -b ${BASEDIR} pcic
246N/A rem_drv -b ${BASEDIR} pem
rm -f ${BASEDIR}/dev/stp4020
rm -f ${BASEDIR}/dev/pcic
;;
i386)
rem_drv -b ${BASEDIR} pcs
rem_drv -b ${BASEDIR} pcic
rem_drv -b ${BASEDIR} pem
rm -f ${BASEDIR}/dev/pcic
;;
esac
rem_devlink 'type=pcmcia:event;name=pem' 'pem'
rem_devlink 'type=ddi_ctl:devctl;minor=initpcmcia' 'pcmcia/\N0'
rem_devlink 'type=ddi_ctl:devctl;minor=probepcmcia' 'pcmcia/probe_\N0'
exit 0