Home | History | Annotate | Download | only in common_files
      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 #ident	"%Z%%M%	%I%	%E% SMI"
     24 #
     25 # Copyright 2008 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 obsolete()
     33 {
     34 	nawk 'BEGIN {
     35 		obs["xbox"] = 1;
     36 		obs["sbi"] = 1;
     37 	} !($1 in obs) {print $0}'
     38 }
     39 while read src dest
     40 do
     41 	if [ ! -f $dest ] ; then
     42 		cp $src $dest
     43 	else
     44 		obsolete < $dest > /tmp/odc.$$.tmp
     45 		cp /tmp/odc.$$.tmp $dest
     46 		rm -f /dev/odc.$$.tmp
     47 
     48 		sed -e '/^\"QLGC,isp\"[	]*scsi$/d' \
     49 		    -e '/^\"SUNW,isp\"[	]*scsi$/d' \
     50 		    -e '/^ncr[	]*scsi$/d' \
     51 		    -e '/^vme[ 	]*vme$/d' \
     52 		    -e '/^pci[ 	]*pci$/d' \
     53 		    $dest > /tmp/rest.$$ 2>/dev/null
     54 		cp /tmp/rest.$$ $dest
     55 		grep '^isp	scsi' $dest > /dev/null 2>&1
     56 		if [ $? != 0 ] ; then
     57 			echo 'isp	scsi' >> $dest
     58 		fi
     59 		grep '^pcipsy[ 	].*pci' $dest > /dev/null 2>&1
     60 		if [ $? != 0 ] ; then
     61 			echo 'pcipsy	pci' >> $dest
     62 		fi
     63 		grep '^pcisch[ 	].*pci' $dest > /dev/null 2>&1
     64 		if [ $? != 0 ] ; then
     65 			echo 'pcisch	pci' >> $dest
     66 		fi
     67 		grep '^pci_pci[ 	].*pci' $dest > /dev/null 2>&1
     68 		if [ $? != 0 ] ; then
     69 			echo 'pci_pci	pci' >> $dest
     70 		fi
     71 		grep '^fas[ 	].*scsi' $dest > /dev/null 2>&1
     72 		if [ $? != 0 ] ; then
     73 			echo 'fas	scsi' >> $dest
     74 		fi
     75 		grep '^ebus	ebus' $dest > /dev/null 2>&1
     76 		if [ $? != 0 ] ; then
     77 			echo 'ebus	ebus' >> $dest
     78 		fi
     79 		grep '^glm	scsi' $dest > /dev/null 2>&1
     80 		if [ $? != 0 ] ; then
     81 			echo 'glm	scsi' >> $dest
     82 		fi
     83 		grep '^uata	dada' $dest > /dev/null 2>&1
     84 		if [ $? != 0 ] ; then
     85 			echo 'uata	dada' >> $dest
     86 		fi
     87 		grep '^uata	scsi' $dest > /dev/null 2>&1
     88 		if [ $? != 0 ] ; then
     89 			echo 'uata	scsi' >> $dest
     90 		fi
     91 		grep '^simba[ 	]*pci' $dest > /dev/null 2>&1
     92 		if [ $? != 0 ] ; then
     93 			echo 'simba	pci' >> $dest
     94 		fi
     95 		grep '^mpt[ 	].*scsi' $dest > /dev/null 2>&1
     96 		if [ $? != 0 ] ; then
     97 			echo 'mpt	scsi' >> $dest
     98 		fi
     99 		grep '^scsi_vhci[ 	].*scsi-self-identifying' $dest > /dev/null 2>&1
    100 		if [ $? != 0 ] ; then
    101 			echo 'scsi_vhci	scsi-self-identifying' >> $dest
    102 		fi
    103 	fi
    104 done
    105 rm -f /tmp/rest.$$
    106 
    107 exit 0
    108