postinstall revision de81e71e031139a0a7f13b7bf64152c3faa76698
1117N/A#!/bin/sh
1117N/A#
1117N/A# CDDL HEADER START
1117N/A#
1117N/A# The contents of this file are subject to the terms of the
1117N/A# Common Development and Distribution License (the "License").
1117N/A# You may not use this file except in compliance with the License.
1117N/A#
1117N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
1117N/A# or http://www.opensolaris.org/os/licensing.
1117N/A# See the License for the specific language governing permissions
1117N/A# and limitations under the License.
1117N/A#
1117N/A# When distributing Covered Code, include this CDDL HEADER in each
1117N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1117N/A# If applicable, add the following below this CDDL HEADER, with the
1117N/A# fields enclosed by brackets "[]" replaced with your own identifying
1117N/A# information: Portions Copyright [yyyy] [name of copyright owner]
1117N/A#
1117N/A# CDDL HEADER END
1117N/A
1117N/A#
1117N/A# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
1117N/A# Use is subject to license terms.
1117N/A#
1117N/A
1117N/APATH="/usr/bin:/usr/sbin:${PATH}"
1117N/Aexport PATH
1117N/A
1117N/Aif [ "${BASEDIR:=/}" != "/" ]
1117N/Athen
1117N/A BASEDIR_OPT="-b $BASEDIR"
1117N/Afi
1117N/A
1117N/Ainstalled() {
1117N/A driver=$1
1117N/A grep "^${driver} " $BASEDIR/etc/name_to_major > /dev/null 2>&1
1117N/A
1117N/A return $?
1117N/A}
1117N/A
1117N/Aupdate_driver() {
1117N/A driver=$1
1117N/A aliases=$2
1117N/A for alias in ${aliases}
1117N/A do
1117N/A egrep "^${driver}[ ]+${alias}" ${BASEDIR}/etc/driver_aliases > /dev/null 2>&1
1117N/A if [ $? -ne 0 ]
1117N/A then
1117N/A echo "${driver} ${alias}" >> ${BASEDIR}/etc/driver_aliases
1117N/A fi
1117N/A done
1117N/A}
1117N/A
1117N/AEXIT=0
1117N/A
1117N/A# "usb403,6001" FTDI serial device, the rest are clones..
1117N/A
1117N/AUSBFTDI_ALIASES="\
1117N/A \"usb403,6001\" \
1117N/A \"usb403,fc82\" \
1117N/A \"usb403,fc08\" \
1117N/A \"usb403,fc09\" \
1117N/A \"usb403,fc0b\" \
1117N/A \"usb403,fc0c\" \
1117N/A \"usb403,fc0d\" \
1117N/A \"usb403,fa00\" \
1117N/A \"usb403,fa01\" \
1117N/A \"usb403,fa02\" \
1117N/A \"usb403,fa03\" \
1117N/A \"usb403,fa04\" \
1117N/A \"usb403,cc48\" \
1117N/A \"usb403,cc49\" \
1117N/A \"usb403,cc4a\" \
1117N/A \"usb403,e888\" \
1117N/A \"usb403,e889\" \
1117N/A \"usb403,e88c\" \
1117N/A \"usb403,e88b\" \
1117N/A \"usb403,e88c\" \
1117N/A \"usb7cc,0421\" \
1117N/A \"usb93c,0601\" \
1117N/A \"usb93c,0701\" \
1117N/A \"usb856,ac01\" \
1117N/A \"usb411,00b3\" \
1117N/A "
1117N/A
1117N/Aif installed usbftdi ; then
1117N/A update_driver usbftdi "${USBFTDI_ALIASES}" || EXIT=1
1117N/Aelse
1117N/A add_drv ${BASEDIR_OPT} -m '* 0666 root sys' \
1117N/A -i "${USBFTDI_ALIASES}" -n usbftdi || EXIT=1
1117N/Afi
1117N/A
1117N/Aexit $EXIT
1117N/A