postinstall revision 87c96ac5a6c9b01221de7ef130275e5af84330f9
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews# CDDL HEADER START
938440694b33cd752e9e4b71a526368b4811c177Tinderbox User# The contents of this file are subject to the terms of the
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews# Common Development and Distribution License (the "License").
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews# You may not use this file except in compliance with the License.
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews# See the License for the specific language governing permissions
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews# and limitations under the License.
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews# When distributing Covered Code, include this CDDL HEADER in each
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews# If applicable, add the following below this CDDL HEADER, with the
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews# fields enclosed by brackets "[]" replaced with your own identifying
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews# information: Portions Copyright [yyyy] [name of copyright owner]
b79fc6723bc9896ad6eb79e1bed1f9b37c4915ebMark Andrews# CDDL HEADER END
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews# Use is subject to license terms.
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews# Driver info
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark AndrewsDRVALIAS='"usb7d1,3c03" "usbb05,1723" "usb13b1,20" "usb7d1,3c04"
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews "usb15a9,4" "usb148f,2573"'
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews# Function: check_add_drv()
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews# This function will check if add_drv has been executed.
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews# If not simply calls add_drv. Otherwise adds entries to
024cf50d122a16a3ce190692d3669ecee47c23aaTinderbox User# driver_aliases, driver_classes and minor_perm if necessary.
938440694b33cd752e9e4b71a526368b4811c177Tinderbox User# The syntax of this function is the same as add_drv.
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews while getopts i:b: opt 2>/dev/null; do
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews ALIAS=`echo ${OPTARG} | /usr/bin/sed -e "s/'//g"`
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews \?) echo "check_add_drv(): Unknown option $opt"
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews # Make sure add_drv has not been previously executed
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews /usr/bin/egrep -s "^${DRIVER}[ ]" "$BASEDIR"/etc/name_to_major
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews if [ $? -ne 0 ]; then
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews if [ $? -ne 0 ]; then
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews for i in ${ALIAS}; do
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews /usr/bin/egrep -s "^${DRIVER}[ ]+$i" ${ALIASDIR}
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrews if [ $? -ne 0 ]; then
1cefb9df3fa34d08734f29005cfafa6be5cf3e93Mark Andrewscheck_add_drv -b "${BASEDIR}" -i "'${DRVALIAS}'" ${DRV}