1 #!/bin/ksh 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 # Copyright 2009 Sun Microsystems, Inc. All rights reserved. 24 # Use is subject to license terms. 25 # 26 27 PATH="/usr/bin:/usr/sbin:${PATH}"; export PATH 28 29 driver_not_installed() 30 { 31 grep $1 $BASEDIR/etc/name_to_major >/dev/null 2>&1 32 if [ $? -eq 0 ] 33 then 34 return 1 35 else 36 return 0 37 fi 38 } 39 40 driver_add() 41 { 42 add_drv -n -b "${BASEDIR}" -m '* 0666 root sys' $1 > /dev/null 2>&1 43 if [ $? -ne 0 ]; then 44 echo "Failed add_drv $1\n" >&2 45 exit 1 46 fi 47 } 48 49 # Remove old sbd driver (if found) 50 if [ ${ARCH} = "sparc" ]; then 51 RMSBD="$BASEDIR/kernel/drv/sbd.conf $BASEDIR/kernel/drv/sparcv9/sbd" 52 CHKSBD="$BASEDIR/kernel/drv/sparcv9/sbd" 53 else 54 RMSBD="$BASEDIR/kernel/drv/sbd.conf $BASEDIR/kernel/drv/sbd $BASEDIR/kernel/drv/amd64/sbd" 55 CHKSBD="$BASEDIR/kernel/drv/amd64/sbd" 56 fi 57 58 if [ -f $CHKSBD ]; then 59 strings $CHKSBD |grep COMSTAR >/dev/null 2>&1 60 if [ $? -eq 0 ]; then 61 rem_drv -b "${BASEDIR}" sbd >/dev/null 2>&1 62 /bin/rm -f $RMSBD 63 fi 64 fi 65 66 # Now add the new drivers 67 if driver_not_installed stmf 68 then 69 driver_add stmf 70 fi 71 72 if driver_not_installed stmf_sbd 73 then 74 driver_add stmf_sbd 75 fi 76 77 if driver_not_installed fct 78 then 79 driver_add fct 80 fi 81 82 if driver_not_installed qlt 83 then 84 driver_add qlt 85 fi 86 87 add_drv -n -b "${BASEDIR}" -m '* 0666 root sys' pppt > /dev/null 2>&1 88 89 exit 0 90