postinstall revision 26594249d18446b4a5ff8ff6d34611c718757251
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# CDDL HEADER START
52671ce4f644d565b2acd71a8ce4f6d20829a67cAdam Moore# The contents of this file are subject to the terms of the
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# Common Development and Distribution License (the "License").
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# You may not use this file except in compliance with the License.
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# See the License for the specific language governing permissions
02fc09f797e83e80199c96adc4751c230dccc973Adam Moore# and limitations under the License.
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# When distributing Covered Code, include this CDDL HEADER in each
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
52671ce4f644d565b2acd71a8ce4f6d20829a67cAdam Moore# If applicable, add the following below this CDDL HEADER, with the
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# fields enclosed by brackets "[]" replaced with your own identifying
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore# information: Portions Copyright [yyyy] [name of copyright owner]
c4f19796d319a7ec9a1e76d48adc82c9c5ae2f27Adam Moore# CDDL HEADER END
b46f3d670b654847b0ce60afdba1b461c492a5c9Adam Moore# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
08e054017132cdd838955bc0af15889f1f2a7b42Adam Moore# Use is subject to license terms.
52671ce4f644d565b2acd71a8ce4f6d20829a67cAdam Moore# Driver info
9c42541e375e7bb70c53012b3012d70f1a380254Adam Moore# Function: check_add_drv()
9c42541e375e7bb70c53012b3012d70f1a380254Adam Moore# This function will check if add_drv has been executed.
9c42541e375e7bb70c53012b3012d70f1a380254Adam Moore# If not simply calls add_drv. Otherwise adds entries to
9c42541e375e7bb70c53012b3012d70f1a380254Adam Moore# driver_aliases, driver_classes and minor_perm if necessary.
02fc09f797e83e80199c96adc4751c230dccc973Adam Moore# The syntax of this function is the same as add_drv.
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore while getopts i:b: opt 2>/dev/null; do
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore ALIAS=`echo ${OPTARG} | /usr/bin/sed -e "s/'//g"`
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore # Make sure add_drv has not been previously executed
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore /usr/bin/egrep -s "^${DRIVER}[ ]" "$BASEDIR"/etc/name_to_major
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore if [ $? -ne 0 ]; then
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore if [ $? -ne 0 ]; then
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore for i in ${ALIAS}; do
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moore if [ $? -ne 0 ]; then
80d2034f65b9348e5fd36291f03b0819181efb89Adam Moorecheck_add_drv -b "${BASEDIR}" -i "'${DRVALIAS}'" ${DRV}