OpenSolaris_b135/pkgdefs/SUNWrmodr/i.master

#!/bin/sh
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# ident	"%Z%%M%	%I%	%E% SMI"
#

#
# t is a temp file we can use to make copies of the dest
# file in.  Sometimes we cant just do simple appends of new
# entries.
#
t=/tmp/mstr$$

while read src dest
do
	if [ ! -f $dest ] ; then
		# Initial installation
		cp $src $dest
	else
		#
		# Preserve the installed version of
		# /boot/solaris/devicedb/master during upgrade
		#
		# New master file entries need to be duplicated here so
		# that upgrade of an installed version of the master file
		# includes any changes while preserving any user applied
		# changes, which would most likely come from third-party driver
		# additions.
		#

		#
		# Additional sbpro/joyst entries
		#
		while read i j
		do
		    grep "$i" $dest > /dev/null 2>&1
		    if [ $? = 1 ]; then
		    	echo $i $j >> $dest
		    fi
		done << EOF
ADS7180 sbpro oth all sbpro.bef "ADS Sound Blaster"
AZT1008 sbpro oth all sbpro.bef "Aztech AZT1008 Sound Device"
CTL0041 sbpro oth all sbpro.bef "Sound Blaster"
CTL0043 sbpro oth all sbpro.bef "Creative Labs Sound Blaster 16 Vibra"
CTL0044 sbpro oth all sbpro.bef "Creative Labs Sound Blaster AWE64 Gold"
ESS1868 sbpro oth all sbpro.bef "ESS ES1868 AudioDrive"
ESS6881 sbpro oth all sbpro.bef "Sound Blaster"
EOF

		grep CTL7002 $dest > /dev/null 2>&1
		if [ $? = 1 ]
		then
			cat >> $dest << EOF
CTL7002 joyst oth all joyst.bef "Game port (Joy stick)" 
EOF
		fi

		# New Entry for dnet:
		grep pci1011,19 $dest > /dev/null 2>&1
		if [ $? = 1 ]
		then
			cat >> $dest << EOF
pci1011,19 pci1011,19 net pci dnet.bef "DEC 21142/21143 Fast Ethernet"
EOF
		fi

		# Recognizing new SMC EtherPower II 10/100 (9432) cards
		# using their device id (included old supported
		# cards having SubSysID a011 and a015)
		# Entry for spwr:
		while read i j
                do
                    grep "$i" $dest > /dev/null 2>&1
                    if [ $? = 1 ]; then
                        echo $i $j >> $dest
                    fi
                done << EOF
pci10b8,5 pci10b8,5 net pci spwr.bef "SMC EtherPower II 10/100 (9432)"
EOF

		# New iprb server entry
		while read i j
		do
		    grep "$i" $dest > /dev/null 2>&1
		    if [ $? = 1 ]; then
		    	echo $i $j >> $dest
		    fi
		done << EOF
pci8086,1029 pci8086,1029 net pci iprb.bef "Intel Pro/100 Network Adapter"
pci8086,1030 pci8086,1030 net pci iprb.bef "Intel InBusiness 10/100 Network Adapter"
pci8086,1031 pci8086,1031 net pci iprb.bef "Intel Pro/100 VE Ethernet"
pci8086,1032 pci8086,1032 net pci iprb.bef "Intel Pro/100 VE Ethernet"
pci8086,1038 pci8086,1038 net pci iprb.bef "Intel 82559 PRO/100 VM Ethernet"
pci8086,1039 pci8086,1039 net pci iprb.bef "Intel 82801DB Ethernet 82562ET/EZ PHY"
pci8086,103d pci8086,103d net pci iprb.bef "Intel 82801DB PRO/100 VE Ethernet"
pci8086,1050 pci8086,1050 net pci iprb.bef "Intel 82562EZ PRO/100 VE Ethernet"
pci8086,1059 pci8086,1059 net pci iprb.bef "Intel 82551QM PRO/100 VE Ethernet"
pci8086,1068 pci8086,1068 net pci iprb.bef "Intel 82562ET/EZ/GT/GZ - PRO/100 VE Ethernet"
pci8086,1069 pci8086,1069 net pci iprb.bef "Intel 82562EM/EX/GX - PRO/100 VM Ethernet"
pci8086,1229 pci8086,1229 net pci iprb.bef "Intel Pro100/B Fast Ethernet"
pci8086,1229.8086.1009 pci8086,1229 net pci iprb.bef "Intel Pro100/B Fast Ethernet"
pci8086,1229.8086.100c pci8086,1229 net pci iprb.bef "Intel Pro100/B Fast Ethernet"
pci8086,1229.8086.1012 pci8086,1229 net pci iprb.bef "Intel Pro100/B Fast Ethernet"
pci8086,1229.8086.1013 pci8086,1229 net pci iprb.bef "Intel Pro100/B Fast Ethernet"
pci8086,1229.8086.1015 pci8086,1229 net pci iprb.bef "Intel Pro100/B Fast Ethernet"
pci8086,1229.8086.1016 pci8086,1229 net pci iprb.bef "Intel Pro100/B Fast Ethernet"
pci8086,1229.8086.1017 pci8086,1229 net pci iprb.bef "Intel Pro100/B Fast Ethernet"
pci8086,2449 pci8086,2449 net pci iprb.bef "Intel i815/82559 Ethernet"
pci8086,27dc pci8086,27dc net pci iprb.bef "Intel ICH7 82801G Ethernet"
EOF

		# New igige server entry
		while read i j
		do
			grep "$i" $dest > /dev/null 2>&1
			if [ $? = 1 ]; then
				echo $i $j >> $dest
			fi	
		done << EOF
pci8086,1000 pci8086,1000 net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,1001 pci8086,1001 net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,1004 pci8086,1004 net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,1008 pci8086,1008 net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,1009 pci8086,1009 net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,100d pci8086,100d net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,100e pci8086,100e net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,100f pci8086,100f net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,1010 pci8086,1010 net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,1011 pci8086,1011 net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,1012 pci8086,1012 net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,1013 pci8086,1013 net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,1014 pci8086,1014 net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,1015 pci8086,1015 net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,1016 pci8086,1016 net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,1017 pci8086,1017 net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,1018 pci8086,1018 net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,1019 pci8086,1019 net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,101a pci8086,101a net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,101d pci8086,101d net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,101e pci8086,101e net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,1026 pci8086,1026 net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,1027 pci8086,1027 net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,1028 pci8086,1028 net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,105a pci8086,105a net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,105b pci8086,105b net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,105c pci8086,105c net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,105e pci8086,105e net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,105f pci8086,105f net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,1060 pci8086,1060 net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,1061 pci8086,1061 net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,1062 pci8086,1062 net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,1063 pci8086,1063 net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,1075 pci8086,1075 net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,1076 pci8086,1076 net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,1077 pci8086,1077 net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,1079 pci8086,1079 net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,107a pci8086,107a net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,107b pci8086,107b net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,107c pci8086,107c net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,107d pci8086,107d net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,107e pci8086,107e net pci none "Intel(R) PRO/1000 Server Adapter Driver"
pci8086,108a pci8086,108a net pci none "Intel(R) PRO/1000 Server Adapter Driver"
EOF

		# New adpu320 server entry
		while read i j
		do
			grep "$i" $dest > /dev/null 2>&1
			if [ $? = 1 ]; then
				echo $i $j >> $dest
			fi	
		done << EOF
pci9005,8000 pci9005,8000 msd pci adpu320.bef "Adaptec SCSI Card 29320A(H1B) - Ultra320 SCSI"
pci9005,8010 pci9005,8010 msd pci adpu320.bef "Adaptec SCSI Card 39320 - Ultra320 SCSI"
pci9005,8011 pci9005,8011 msd pci adpu320.bef "Adaptec SCSI Card 39320D - Ultra320 SCSI"
pci9005,8012 pci9005,8012 msd pci adpu320.bef "Adaptec SCSI Card 29320 - Ultra320 SCSI"
pci9005,8014 pci9005,8014 msd pci adpu320.bef "Adaptec SCSI Card 29320LP - Ultra320 SCSI"
pci9005,8015 pci9005,8015 msd pci adpu320.bef "Adaptec SCSI Card 39320(H2B) - Ultra320 SCSI"
pci9005,8016 pci9005,8016 msd pci adpu320.bef "Adaptec SCSI Card 39320A - Ultra320 SCSI"
pci9005,8017 pci9005,8017 msd pci adpu320.bef "Adaptec SCSI Card 29320ALP(H1B) - Ultra320 SCSI"
pci9005,801d pci9005,801d msd pci adpu320.bef "Adaptec SCSI Card AIC-7902B - Ultra320 SCSI"
pci9005,801e pci9005,801e msd pci adpu320.bef "Adaptec SCSI Card AIC-7901A - Ultra320 SCSI"
pci9005,801f pci9005,801f msd pci adpu320.bef "Adaptec AIC-7902 - Ultra320 SCSI"
EOF

		# New bge server entry
		while read i j
		do
			grep "$i" $dest > /dev/null 2>&1
			if [ $? = 1 ]; then
				echo $i $j >> $dest
			fi	
		done << EOF
pci14e4,1644 pci14e4,1644 net pci none "Broadcom 5700 Gigabit Ethernet"
pci14e4,1645 pci14e4,1645 net pci none "Broadcom 5701 Gigabit Ethernet"
pci14e4,1647 pci14e4,1647 net pci none "Broadcom 5703C Gigabit Ethernet"
pci14e4,1648 pci14e4,1648 net pci none "Broadcom 5704C Gigabit Ethernet"
pci14e4,16a7 pci14e4,16a7 net pci none "Broadcom 5703S Gigabit Ethernet"
pci14e4,16c7 pci14e4,16c7 net pci none "Broadcom 5703 Gigabit Ethernet"
pci14e4,16a8 pci14e4,16a8 net pci none "Broadcom 5704S Gigabit Ethernet"
pci14e4,165d pci14e4,165d net pci none "Broadcom 5705M Gigabit Ethernet"
pci14e4,165e pci14e4,165e net pci none "Broadcom 5705MA3 Gigabit Ethernet"
pci14e4,1677 pci14e4,1677 net pci none "Broadcom 5751 Gigabit Ethernet"
pci14e4,167d pci14e4,167d net pci none "Broadcom 5751M Gigabit Ethernet"
pci14e4,1659 pci14e4,1659 net pci none "Broadcom 5721 Gigabit Ethernet"
pci14e4,1696 pci14e4,1696 net pci none "Broadcom 5782 Gigabit Ethernet"
pci14e4,169c pci14e4,169c net pci none "Broadcom 5788 Gigabit Ethernet"

EOF

   		# New rtls server entry
		while read i j
		do
                  	grep "$i" $dest > /dev/null 2>&1
			if [ $? = 1 ]; then
				echo $i $j >> $dest
			fi
		done << EOF
pci10ec,8139 pci10ec,8139 net pci none "Realtek 8139 Fast Ethernet"
EOF

		# New AAC entries
		while read i j
		do
			grep "$i" $dest > /dev/null 2>&1
			if [ $? = 1 ]; then
				echo $i $j >> $dest
			fi
		done << EOF
pci1028,a pci1028,a msd pci none "PERC 3/DI RAID Controller"
pci9005,285 pci9005,285 msd pci none "Adaptec AdvancedRAID Controller"
EOF

		# New AMR entries
		while read i j
		do
			grep "$i" $dest > /dev/null 2>&1
			if [ $? = 1 ]; then
				echo $i $j >> $dest
			fi
		done << EOF
pci1028,e pci1028,e msd pci none "PERC 4/DI RAID Controller"
pci1028,f pci1028,f msd pci none "PERC 4/DI RAID Controller"
pci1028,493 pci1028,493 msd pci none "PERC 3/DC RAID Controller"
pci1028,518 pci1028,518 msd pci none "PERC 4/DC RAID Controller"
pci1028,520 pci1028,520 msd pci none "PERC 4/SC RAID Controller"
pci1000,532 pci1000,532 msd pci none "MegaRAID SCSI 320-2x"
EOF

                # New ncrs entries
                grep pci1000,6 $dest > /dev/null 2>&1
                if [ $? = 1 ]
                then
                        cat >> $dest << EOF
pci1000,6 pci1000,6 msd pci ncrs.bef "Symbios Logic 53c865 SCSI"
pci1000,c pci1000,c msd pci ncrs.bef "Symbios Logic 53c895 SCSI"
pci1000,f pci1000,f msd pci ncrs.bef "Symbios Logic 53c875 SCSI"
EOF
                fi

                # New ncrpqs entries
                grep "pci101a,f2[def]" $dest > /dev/null 2>&1
                if [ $? = 1 ]
                then
                        cat >> $dest << EOF
pci101a,f2d scsi msd pci none "NCR PDS/PQS 53C896-based PCI SCSI Adapter" compatible="pci101a,f2d"
pci101a,f2e scsi msd pci none "NCR PDS/PQS 53C896-based PCI SCSI Adapter" compatible="pci101a,f2e"
pci101a,f2f scsi msd pci none "NCR PDS/PQS 53C896-based PCI SCSI Adapter" compatible="pci101a,f2f"
EOF
                fi

                # New Diamond Fireport 40 ncrs entry
                grep pci1000,8f $dest > /dev/null 2>&1
                if [ $? = 1 ]
                then
                        cat >> $dest << EOF
pci1000,8f pci1000,8f msd pci ncrs.bef "Diamond Fireport 40 (SYM53C876)"
EOF
                fi

		# Now make sure all the elxl entries are present
		for devid in 9000 9001 9004 9005 9006 9050 9051 9055 9056 9200 9800 9805 ; do
			grep pci10b7,$devid $dest > /dev/null 2>&1
			if [ $? = 1 ]
			then
				grep pci10b7,$devid >> $dest << EOF
pci10b7,9000 pci10b7,9000 net pci elxl.bef "3Com 3C900-TPO Etherlink XL"
pci10b7,9001 pci10b7,9001 net pci elxl.bef "3Com 3C900-COMBO Etherlink XL"
pci10b7,9004 pci10b7,9004 net pci elxl.bef "3Com 3C900B-TPO Etherlink XL"
pci10b7,9005 pci10b7,9005 net pci elxl.bef "3Com 3C900B-COMBO Etherlink XL"
pci10b7,9006 pci10b7,9006 net pci elxl.bef "3Com 3C900B-TPC Etherlink XL"
pci10b7,9050 pci10b7,9050 net pci elxl.bef "3Com 3C905-TX Fast Etherlink XL 10/100"
pci10b7,9051 pci10b7,9051 net pci elxl.bef "3Com 3C905-T4 Fast Etherlink XL 10/100"
pci10b7,9055 pci10b7,9055 net pci elxl.bef "3Com 3C905B-TX Fast Etherlink XL 10/100"
pci10b7,9056 pci10b7,9056 net pci elxl.bef "3Com 3C905B-T4 Fast Etherlink XL 10/100"
pci10b7,9200 pci10b7,9200 net pci elxl.bef "3Com 3C905C-TX-M Fast Etherlink XL 10/100"
pci10b7,9800 pci10b7,9800 net pci elxl.bef "3Com 3C980-TX Fast Etherlink Server 10/100"
pci10b7,9805 pci10b7,9805 net pci elxl.bef "3Com 3C980C-TXM Fast Etherlink Server 10/100"
EOF
			fi
		done

		grep 'pci class entries:' $dest > /dev/null 2>&1
                if [ $? = 1 ]
                then
                        cat >> $dest << EOF
#
# pci class entries:
#
EOF
		fi

		grep '^pciclass,0101[0-9A-Fa-f][0-9A-Fa-f]' $dest > /dev/null 2>&1
		if [ $? = 0 ]
		then
			#
			# Remove old pciclass entries for pci-ide
			#
			sed -e \
			'/^pciclass,0101[0-9A-Fa-f][0-9A-Fa-f].*$/                                      d
			/^# Note that there are some entries which may require driver changes to.*$/	d
			/^# work properly (pciclass,0101\[4-6,c-e\]\[0-f\]). These say that.*$/		d
			/^# separately-disableable IDE channels are supported, but the primary.*$/	d
			/^# and\/or secondary channel is disabled\..*$/					d
			' $dest > $t

			cp $t $dest

		fi

		#
		#  Add the new wildcard pciclass entry for pci-ide if it does not exist already
		#
		grep '^pciclass,0101 pci-ide msd pciclass ata.bef "IDE controller"' $dest > /dev/null 2>&1
		if [ $? = 1 ]
		then
		cat >> $dest << EOF
#
# PCI Class entries with 2 byte class codes are treated as wildcard class
# specifiers (with the 3rd byte (programming interface) as the wildcard). Hence,
# the following entry will match ALL devices whose pci classes begin with "0101"
# (any programming interface version)
#
pciclass,0101 pci-ide msd pciclass ata.bef "PCI IDE controller"
EOF
		fi

		# Add Silicon Image SATA controller-specific entries
		while read i j
		do
			grep "$i" $dest > /dev/null 2>&1
			if [ $? = 1 ]; then
				echo $i $j >> $dest
			fi	
		done << EOF
pci1095,3112 pci-ide msd pci ata.bef "Silicon Image 3112 SATA Controller"
pci1095,3114 pci-ide msd pci ata.bef "Silicon Image 3114 SATA Controller"
pci1095,3512 pci-ide msd pci ata.bef "Silicon Image 3512 SATA Controller"
EOF

		#
		# Remove erroneous entry for Symbios Logic 53c875/95 (ncrs)
		#
		sed -e '/^pci1000,1000/d' $dest >$t
		cp $t $dest

		#
		#  Check for new pcn support
		#
		grep CSI2203 $dest > /dev/null 2>&1
		if [ $? = 1 ]
		then
			sed -e '/^PNP8231/s/PNP8231|ATK1500|ADV55AA|PNP828C/PNP8231|ATK1500|ADV55AA|PNP828C|CSI2203/' $dest > $t
			cp $t $dest
		fi

		#
                #  Remove obsolete driver entries
                #
		sed     -e '/el\.bef/d'		\
			-e '/elx\.bef/d'	\
			-e '/elink\.bef/d'	\
			-e '/riles\.bef/d'	\
			-e '/aha1540\.bef/d'	\
			-e '/aha1740\.bef/d'	\
			-e '/aic\.bef/d'	\
			-e '/blogic\.bef/d'	\
			-e '/eepro\.bef/d'	\
			-e '/pe3\.bef/d'	\
			-e '/smc\.bef/d'	\
			-e '/trantor\.bef/d'	\
			-e '/esa\.bef/d'	\
			-e '/iee\.bef/d'	\
			-e '/ieef\.bef/d'	\
			-e '/nei\.bef/d'	\
			-e '/tr\.bef/d'		\
			-e '/nee\.bef/d'	\
			-e '/smce\.bef/d'	\
			-e '/smcf\.bef/d'	\
			-e '/smceu\.bef/d'	\
			-e '/nfe\.bef/d'	\
			-e '/^pci10b8,0005/d'	\
			$dest > $t
		cp $t $dest

		#
                #  Remove all MCA device database entries
                #
		sed     -e '/ mca /d'		\
			-e '/^# Micro-channel/,/^#$/d'	\
			$dest > $t
		cp $t $dest

		#
		# Remove all ACPI000x entries
		#
		sed	-e '/^ACPI0001/d'	\
			-e '/^ACPI0002/d'	\
			-e '/^ACPI0003/d'	\
			-e '/^ACPI0004/d'	\
			-e '/^ACPI0005/d'	\
			-e '/^ACPI0006/d'	\
			-e '/^ACPI0007/d'	\
			-e '/^ACPI0008/d'	\
			-e '/^ACPI0009/d'	\
			-e '/^ACPI000A/d'	\
			-e '/^ACPI000B/d'	\
			$dest > $t
		cp $t $dest

		#
		#  Console redesign changes
		#
		grep "pnpPNP,900" $dest > /dev/null 2>&1
		if [ $? = 1 ]
		then
		    sed \
			-e 's/chanmux/display/g'	\
			-e 's/kdmouse/mouse/g'	\
			-e '/^SUN0006/s/$/ compatible="pnpPNP,900"/'	\
			-e '/^PNP0900/s/$/ compatible="pnpPNP,900"/'	\
			-e '/^PNP0902/s/$/ compatible="pnpPNP,900"/'	\
			-e '/^PNP0302/s/kd/keyboard/'			\
			-e '/^PNP0302/s/PNP0302/PNP0301|PNP0303/'	\
			$dest > $t
		    cat >> $t << EOF
pciclass,030000|pciclass,000100 display vid pciclass none "VGA compatible display adapter"
pciclass,030001 display vid pciclass none "VGA+8514 compatible display adapter"
EOF
		    cp $t $dest
		fi

		#
		# Add an entry for C&T VGAs - some BIOSes don't mark them
		# as compatible with generic VGAs.
		#
		grep "PNP0931" $dest > /dev/null 2>&1
		if [ $? = 1 ]
		then
		    cat >> $dest << EOF
PNP0931 display vid all none "Chips & Tech VGA Display Adapter" compatible="pnpPNP,900"
EOF
		fi

		#
		#  Add pnpisa modems
		#
		grep "HSM0240" $dest > /dev/null 2>&1
		if [ $? = 1 ]
		then
		    sed \
			-e 's/SUP1381/SUP1381|HSM0240/'	\
			$dest > $t
		    cp $t $dest
		fi

		#
		# Replace the entire keyboard line
		#
		keyboard_ids="PNP0300|PNP0301|PNP0302|PNP0303|PNP0304|PNP0305|PNP0306|PNP0307|PNP0308|PNP0309|PNP030A|PNP030B|PNP0320|PNP0321|PNP0322|PNP0323|PNP0324|PNP0325|PNP0326|PNP0327|PNP0340|PNP0341|PNP0342|PNP0343|PNP0344"
                grep "key.bef" $dest > /dev/null 2>&1
                if [ $? = 0 ]
                then
                    sed \
                        -e '/key.bef/s/.*\(keyboard.*key.*all.*key\.bef.*\)/'$keyboard_ids' \1/'  \
                        $dest > $t
                    cp $t $dest
                fi

		#
		#  Remove all original keyboard entries (but not
		#  customer additions)
		#
		grep "^PNP0301|PNP0303[^|]" $dest > /dev/null 2>&1
		if [ $? = 1 ]
		then
			sed     -e '/^PNP0301|PNP0303[^|]/d'		\
			$dest > $t
		    cp $t $dest
		fi
		#
		#  Create new mouse and keyboard entries.
		#
		while read i j
		do
		    grep "$i" $dest > /dev/null 2>&1
		    if [ $? = 1 ]; then
		    	echo $i $j >> $dest
		    fi
		done << EOF
SVI0101 SVI0101 oth all none "Sun Fire B100x BSC"
PNP0300 keyboard key all none "IBM PC/XT keyboard controller (83-key)"
PNP0302 keyboard key all none "IBM PC/XT keyboard controller (84-key)"
PNP0301 keyboard key all none "IBM PC/AT keyboard controller (86-key)"
PNP0303 keyboard key all none "IBM Enhanced (101/102-key, PS/2 mouse support)"
PNP0304 keyboard key all none "Olivetti Keyboard (83-key)"
PNP0305 keyboard key all none "Olivetti Keyboard (102-key)"
PNP0306 keyboard key all none "Olivetti Keyboard (86-key)"
PNP0307 keyboard key all none "Microsoft Windows(R) Keyboard"
PNP0308 keyboard key all none "General Input Device Emulation Interface (GIDEI) legacy"
PNP0309 keyboard key all none "Olivetti Keyboard (A101/102 key)"
PNP030A keyboard key all none "AT&T 302 keyboard"
PNP030B keyboard key all none "Reserved by Microsoft"
PNP0320 keyboard key all none "Japanese 101-key keyboard"
PNP0321 keyboard key all none "Japanese AX keyboard"
PNP0322 keyboard key all none "Japanese 106-key keyboard A01"
PNP0323 keyboard key all none "Japanese 106-key keyboard 002/003"
PNP0324 keyboard key all none "Japanese 106-key keyboard 001"
PNP0325 keyboard key all none "Japanese Toshiba Desktop keyboard"
PNP0326 keyboard key all none "Japanese Toshiba Laptop keyboard"
PNP0327 keyboard key all none "Japanese Toshiba Notebook keyboard"
PNP0340 keyboard key all none "Korean 84-key keyboard"
PNP0341 keyboard key all none "Korean 86-key keyboard"
PNP0342 keyboard key all none "Korean Enhanced keyboard"
PNP0343 keyboard key all none "Korean Enhanced keyboard 101b"
PNP0343 keyboard key all none "Korean Enhanced keyboard 101c"
PNP0344 keyboard key all none "Korean Enhanced keyboard 103"
PNP0F01 mouse ptr all none "Microsoft Serial Mouse"
PNP0F02 mouse ptr all none "Microsoft InPort Mouse"
PNP0F04 mouse ptr all none "Mouse Systems Mouse"
PNP0F05 mouse ptr all none "Mouse Systems 3-Button Mouse (COM2)"
PNP0F06 mouse ptr all none "Genius Mouse (COM1)"
PNP0F07 mouse ptr all none "Genius Mouse (COM2)"
PNP0F08 mouse ptr all none "Logitech Serial Mouse"
PNP0F09 mouse ptr all none "Microsoft BallPoint Serial Mouse"
PNP0F0A mouse ptr all none "Microsoft Plug and Play Mouse"
PNP0F0B mouse ptr all none "Microsoft Plug and Play BallPoint Mouse"
PNP0F0C mouse ptr all none "Microsoft-compatible Serial Mouse"
PNP0F0D mouse ptr all none "Microsoft-compatible InPort-compatible Mouse"
PNP0F0E mouse ptr all none "Microsoft-compatible PS/2-style Mouse"
PNP0F0F mouse ptr all none "Microsoft-compatible Serial BallPoint-compatible Mouse"
PNP0F10 mouse ptr all none "Texas Instruments QuickPort Mouse"
PNP0F11 mouse ptr all none "Microsoft-compatible Bus Mouse"
PNP0F14 mouse ptr all none "Microsoft Kids Mouse"
PNP0F16 mouse ptr all none "Logitech SWIFT device"
PNP0F17 mouse ptr all none "Logitech-compatible serial mouse"
PNP0F18 mouse ptr all none "Logitech-compatible bus mouse"
PNP0F1A mouse ptr all none "Logitech-compatible SWIFT Device"
PNP0F1B mouse ptr all none "HP Omnibook Mouse"
PNP0F1D mouse ptr all none "Compaq LTE Trackball Serial Mouse"
PNP0F1E mouse ptr all none "Microsoft Kids Trackball Mouse"
PNP0F1F mouse ptr all none "Reserved by Microsoft Input Device Group"
PNP0F20 mouse ptr all none "Reserved by Microsoft Input Device Group"
PNP0F21 mouse ptr all none "Reserved by Microsoft Input Device Group"
PNP0F22 mouse ptr all none "Reserved by Microsoft Input Device Group"
PNP0F23 mouse ptr all none "Reserved by Microsoft Input Device Group"
PNP0FFF mouse ptr all none "Reserved by Microsoft Systems"
SYN010B mouse ptr all none "Synaptics mouse pad"
EOF

		rm -f $t
	fi
done

exit 0