Home | History | Annotate | Download | only in SUNWuedg
      1 #!/bin/sh
      2 #
      3 # CDDL HEADER START
      4 #
      5 # The contents of this file are subject to the terms of the
      6 # Common Development and Distribution License (the "License").
      7 # You may not use this file except in compliance with the License.
      8 #
      9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
     10 # or http://www.opensolaris.org/os/licensing.
     11 # See the License for the specific language governing permissions
     12 # and limitations under the License.
     13 #
     14 # When distributing Covered Code, include this CDDL HEADER in each
     15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     16 # If applicable, add the following below this CDDL HEADER, with the
     17 # fields enclosed by brackets "[]" replaced with your own identifying
     18 # information: Portions Copyright [yyyy] [name of copyright owner]
     19 #
     20 # CDDL HEADER END
     21 #
     22 #
     23 #pragma ident	"%Z%%M%	%I%	%E% SMI"
     24 #
     25 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
     26 # Use is subject to license terms.
     27 #
     28  
     29 PATH="/usr/bin:/usr/sbin:${PATH}"
     30 export PATH
     31 
     32 if [ "${BASEDIR:=/}" != "/" ] 
     33 then
     34 	BASEDIR_OPT="-b $BASEDIR" 
     35 fi
     36 
     37 installed() {
     38 	driver=$1
     39 	grep "^${driver} " $BASEDIR/etc/name_to_major > /dev/null 2>&1
     40 
     41 	return $?
     42 }
     43 
     44 update_driver() {
     45 	driver=$1
     46 	aliases=$2
     47 	for alias in ${aliases}
     48 	do
     49 		egrep "^${driver}[ 	]+${alias}" ${BASEDIR}/etc/driver_aliases > /dev/null 2>&1
     50 		if [ $? -ne 0 ]
     51 		then
     52 			echo "${driver} ${alias}" >> ${BASEDIR}/etc/driver_aliases
     53 		fi
     54 	done
     55 }
     56 
     57 EXIT=0
     58 
     59 USBSER_EDGE_ALIASES="\
     60 	\"usbif1608,1.config1.0\" \
     61 	\"usbif1608,3.config1.0\" \
     62 	\"usbif1608,4.config1.0\" \
     63 	\"usbif1608,5.config1.0\" \
     64 	\"usbif1608,6.config1.0\" \
     65 	\"usbif1608,7.config1.0\" \
     66 	\"usbif1608,c.config1.0\" \
     67 	\"usbif1608,d.config1.0\" \
     68 	\"usbif1608,e.config1.0\" \
     69        	\"usbif1608,f.config1.0\" \
     70 	\"usbif1608,10.config1.0\" \
     71 	\"usbif1608,11.config1.0\" \
     72 	\"usbif1608,12.config1.0\" \
     73 	\"usbif1608,13.config1.0\" \
     74 	\"usbif1608,14.config1.0\" \
     75 	\"usbif1608,201.config1.0\" \
     76 	\"usbif1608,205.config1.0\" \
     77 	\"usbif1608,206.config1.0\" \
     78 	\"usbif1608,207.config1.0\" \
     79 	\"usbif1608,20c.config1.0\" \
     80 	\"usbif1608,20d.config1.0\" \
     81 	\"usbif1608,215.config1.0\" \
     82 	\"usbif1608,217.config1.0\" \
     83 	\"usbif1608,21a.config1.0\" \
     84 	\"usbif1608,240.config1.0\" \
     85 	\"usbif1608,241.config1.0\" \
     86 	\"usbif1608,242.config1.0\" \
     87 	\"usbif1608,243.config1.0\" \
     88 	\"usbif1608,244.config1.0\" \
     89 	\"usbif1608,247.config1.0\" \
     90 	\"usbif1608,1.100.config1.0\" \
     91 	"
     92 
     93 if installed usbser_edge ; then
     94 	update_driver usbser_edge "${USBSER_EDGE_ALIASES}" || EXIT=1
     95 else
     96 	add_drv ${BASEDIR_OPT} -m '* 0666 root sys' \
     97 	    -i "${USBSER_EDGE_ALIASES}" -n usbser_edge || \
     98 	    EXIT=1
     99 fi
    100 
    101 exit $EXIT
    102