postinstall revision d73ae94e59c019f5cc3221ee0a0012d02091b40e
f743002678eb67b99bbc29fee116b65d9530fec0wrowe#!/bin/sh
80833bb9a1bf25dcf19e814438a4b311d2e1f4cffuankg#
6736c640e65e06990ef33af71ee81fac4df4ff5fjim# CDDL HEADER START
85eacfc96a04547ef25aabbc06440039715084c2jorton#
85eacfc96a04547ef25aabbc06440039715084c2jorton# The contents of this file are subject to the terms of the
85eacfc96a04547ef25aabbc06440039715084c2jorton# Common Development and Distribution License (the "License").
1d8d7e58e1d31d7b6fb7a518e09649a4dbb315e9trawick# You may not use this file except in compliance with the License.
1d8d7e58e1d31d7b6fb7a518e09649a4dbb315e9trawick#
1d8d7e58e1d31d7b6fb7a518e09649a4dbb315e9trawick# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
f34da68471f256dca0ff770257c3e1f982f74cf1trawick# or http://www.opensolaris.org/os/licensing.
f34da68471f256dca0ff770257c3e1f982f74cf1trawick# See the License for the specific language governing permissions
f34da68471f256dca0ff770257c3e1f982f74cf1trawick# and limitations under the License.
8b645fd3c950da73513b546366c7cfa7476c5c06jim#
8b645fd3c950da73513b546366c7cfa7476c5c06jim# When distributing Covered Code, include this CDDL HEADER in each
8b645fd3c950da73513b546366c7cfa7476c5c06jim# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
8b645fd3c950da73513b546366c7cfa7476c5c06jim# If applicable, add the following below this CDDL HEADER, with the
193f0bb6057d67593ed652fbf58f043def51c642jim# fields enclosed by brackets "[]" replaced with your own identifying
193f0bb6057d67593ed652fbf58f043def51c642jim# information: Portions Copyright [yyyy] [name of copyright owner]
193f0bb6057d67593ed652fbf58f043def51c642jim#
68ba377fc3b124baa759662077c48077ebadb186minfrin# CDDL HEADER END
68ba377fc3b124baa759662077c48077ebadb186minfrin#
68ba377fc3b124baa759662077c48077ebadb186minfrin#
68ba377fc3b124baa759662077c48077ebadb186minfrin#pragma ident "%Z%%M% %I% %E% SMI"
00566fb187849626180724394a21ddcd28419fb2minfrin#
00566fb187849626180724394a21ddcd28419fb2minfrin# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
00566fb187849626180724394a21ddcd28419fb2minfrin# Use is subject to license terms.
00566fb187849626180724394a21ddcd28419fb2minfrin#
d776b0a2d2889ce1d13494873368f34327a2e1bbtrawick
d776b0a2d2889ce1d13494873368f34327a2e1bbtrawickPATH="/usr/bin:/usr/sbin:${PATH}"
f4ca9f6f002fece336168a16355434ca966f96a9trawickexport PATH
57db302f0875a6c93a79333b8941cea4c1827272jim
57db302f0875a6c93a79333b8941cea4c1827272jimif [ "${BASEDIR:=/}" != "/" ]
57db302f0875a6c93a79333b8941cea4c1827272jimthen
57db302f0875a6c93a79333b8941cea4c1827272jim BASEDIR_OPT="-b $BASEDIR"
92b1631880b0bf43fe8b2663a03c8571eb04e433jimfi
92b1631880b0bf43fe8b2663a03c8571eb04e433jim
92b1631880b0bf43fe8b2663a03c8571eb04e433jim# Location of usb links, and the names of the types of links to remove
89225e8e84d38b07a8335922497997e83d872e75jimLINKDIR=${BASEDIR}/dev/usb
89225e8e84d38b07a8335922497997e83d872e75jimLINKFILES="hub* mass-storage* device*"
89225e8e84d38b07a8335922497997e83d872e75jim
78f94f1d06c4e6828ce04d618221e0fcecb57849humbedooh# since ohci, uhci and ehci are self probing nexus drivers,
78f94f1d06c4e6828ce04d618221e0fcecb57849humbedooh# add_drv -n hid, hubd, usb_ia and usb_mid before add_drv ohci/uhci/ehci.
78f94f1d06c4e6828ce04d618221e0fcecb57849humbedooh# ohci/uhci/ehci will create the hub and usb,device nodes and attach
f5e28c78424d2f71c61ba457009f100bba38bc68chrisd# hubd, usb_mid and usb_ia drivers
f5e28c78424d2f71c61ba457009f100bba38bc68chrisd
f5e28c78424d2f71c61ba457009f100bba38bc68chrisdnot_installed() {
f4a715f904b014060ea6237fe29481ed21f5c7d0jorton driver=$1
f4a715f904b014060ea6237fe29481ed21f5c7d0jorton grep "^${driver} " $BASEDIR/etc/name_to_major > /dev/null 2>&1
f4a715f904b014060ea6237fe29481ed21f5c7d0jorton
536d2e7cd1fdec1255b8c3bdf41fdc714c506a54trawick return $?
536d2e7cd1fdec1255b8c3bdf41fdc714c506a54trawick}
536d2e7cd1fdec1255b8c3bdf41fdc714c506a54trawick
536d2e7cd1fdec1255b8c3bdf41fdc714c506a54trawickEXIT=0
70caa242e6b90e0d6f0fabb56b8c5c2fb51717b3jorton
985a4368b93c3e9171a57897ad9454c8dbf4cdf6jortonnot_installed hid || add_drv ${BASEDIR_OPT} -m '* 0600 root sys' \
70caa242e6b90e0d6f0fabb56b8c5c2fb51717b3jorton -i '"usbif,class3"' -n hid || EXIT=1
70caa242e6b90e0d6f0fabb56b8c5c2fb51717b3jorton
109e2a09790de3fb315d36d6232a14ab66c8eb0ahumbedoohnot_installed hubd || add_drv ${BASEDIR_OPT} -m '* 0644 root sys' \
109e2a09790de3fb315d36d6232a14ab66c8eb0ahumbedooh -i '"usbif,class9"' -n hubd || EXIT=1
109e2a09790de3fb315d36d6232a14ab66c8eb0ahumbedooh
4be250c774bdac977eef29a02183ca78de29fb41rjungnot_installed scsa2usb || add_drv ${BASEDIR_OPT} \
4be250c774bdac977eef29a02183ca78de29fb41rjung -i '"usbif,class8" "usb584,222"' -n scsa2usb || EXIT=1
4be250c774bdac977eef29a02183ca78de29fb41rjung
12b5dc9afa1844df5ac8acab98fb538432a2fa1crjungnot_installed usb_ia || add_drv ${BASEDIR_OPT} -i '"usb,ia"' -n usb_ia ||
12b5dc9afa1844df5ac8acab98fb538432a2fa1crjungEXIT=1
12b5dc9afa1844df5ac8acab98fb538432a2fa1crjung
12b5dc9afa1844df5ac8acab98fb538432a2fa1crjungnot_installed usb_mid || add_drv ${BASEDIR_OPT} -i '"usb,device"' -n usb_mid ||
74e7a30182af5e68f14ccb8d57918b22b982db8bhumbedoohEXIT=1
74e7a30182af5e68f14ccb8d57918b22b982db8bhumbedooh
74e7a30182af5e68f14ccb8d57918b22b982db8bhumbedoohnot_installed usbprn || add_drv ${BASEDIR_OPT} -m '* 0666 root sys' \
10961a2f60207cb873d889bb28b1f0ef707a4311humbedooh -i '"usbif,class7.1"' -n usbprn || EXIT=1
10961a2f60207cb873d889bb28b1f0ef707a4311humbedooh
10961a2f60207cb873d889bb28b1f0ef707a4311humbedoohnot_installed usb_ac || add_drv ${BASEDIR_OPT} -m '* 0600 root sys' \
0448378b899e8df0c060360f17c0af692adf17bchumbedooh -i '"usbif,class1.1"' -n usb_ac || EXIT=1
0448378b899e8df0c060360f17c0af692adf17bchumbedooh
0448378b899e8df0c060360f17c0af692adf17bchumbedoohnot_installed usb_as || add_drv ${BASEDIR_OPT} -m '* 0600 root sys' \
60a765cccbd3f3b5997b65b0034220c79f78369etrawick -i '"usbif,class1.2"' -n usb_as || EXIT=1
60a765cccbd3f3b5997b65b0034220c79f78369etrawick
60a765cccbd3f3b5997b65b0034220c79f78369etrawicknot_installed ohci || add_drv ${BASEDIR_OPT} -m '* 0644 root sys' \
e7ca863b04ee2a7aea7738cadbf51ce5e6c5245dhumbedooh -i '"pciclass,0c0310"' ohci || EXIT=1
e7ca863b04ee2a7aea7738cadbf51ce5e6c5245dhumbedooh
e7ca863b04ee2a7aea7738cadbf51ce5e6c5245dhumbedoohnot_installed ehci || add_drv ${BASEDIR_OPT} -m '* 0644 root sys' \
e7ca863b04ee2a7aea7738cadbf51ce5e6c5245dhumbedooh -i '"pciclass,0c0320"' ehci || EXIT=1
91654e263480f0fdc2a03d782ff23f8dad07cf79humbedooh
91814c869ca39ce45dfe147307d2a831cac6ecbehumbedoohnot_installed uhci || add_drv ${BASEDIR_OPT} -m '* 0644 root sys' \
91654e263480f0fdc2a03d782ff23f8dad07cf79humbedooh -i '"pciclass,0c0300"' uhci || EXIT=1
79c5787b92ac5f0e1cc82393816c77a006399316trawick
79c5787b92ac5f0e1cc82393816c77a006399316trawick# Cleanup to wipe out any defunct links
79c5787b92ac5f0e1cc82393816c77a006399316trawick
79c5787b92ac5f0e1cc82393816c77a006399316trawickif [ -d ${LINKDIR} ]
79c5787b92ac5f0e1cc82393816c77a006399316trawickthen
79c5787b92ac5f0e1cc82393816c77a006399316trawick # ls -l shows linknames to curr dir and phys nodes relative to $LINKDIR
79c5787b92ac5f0e1cc82393816c77a006399316trawick OLDDIR=`pwd`
79c5787b92ac5f0e1cc82393816c77a006399316trawick cd ${LINKDIR}
79c5787b92ac5f0e1cc82393816c77a006399316trawick
12b987b969f03ef98d9175a53d849ab62f5684fecovener # List all entries with devctl (will be entries pointing to phys nodes
12b987b969f03ef98d9175a53d849ab62f5684fecovener # ending with "devctl"). Delete these entries & their physical nodes.
099c357f282d4aebf2b32264f7dce6ffc0497c37sf ls -l ${LINKFILES} 2>/dev/null | grep ":devctl$" | \
099c357f282d4aebf2b32264f7dce6ffc0497c37sf nawk '{print $9, $11}' | xargs rm -f
099c357f282d4aebf2b32264f7dce6ffc0497c37sf
099c357f282d4aebf2b32264f7dce6ffc0497c37sf cd ${OLDDIR}
50f8c80eb4d3989ebf3f1341aeef4d2d302af162sffi
50f8c80eb4d3989ebf3f1341aeef4d2d302af162sf
4bb0a88a01fb7b494bb02a8b881b5eab0308bda6sfexit $EXIT
50f8c80eb4d3989ebf3f1341aeef4d2d302af162sf