postinstall revision 7c478bd95313f5f23a4c958a745db2134aa03244
#!/bin/sh
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (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
#
#
#pragma ident "%Z%%M% %I% %E% SMI"
#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
PATH="/usr/bin:/usr/sbin:${PATH}"
export PATH
# Location of usb links, and the names of the types of links to remove
LINKDIR=${BASEDIR}/dev/usb
LINKFILES="hub* mass-storage* device*"
# since ohci, uhci and ehci are self probing nexus drivers,
# add_drv -n hid, hubd and usb_mid before add_drv ohci/uhci/ehci.
# ohci/uhci/ehci will create the hub and usb,device nodes and attach
# hubd and usb_mid drivers
not_installed() {
driver=$1
grep "^${driver} " $BASEDIR/etc/name_to_major > /dev/null 2>&1
return $?
}
EXIT=0
not_installed hid || add_drv -b ${BASEDIR} -m '* 0666 root sys' \
-i '"usbif,class3"' -n hid || EXIT=1
not_installed hubd || add_drv -b ${BASEDIR} -m '* 0644 root sys' \
-i '"usbif,class9"' -n hubd || EXIT=1
not_installed scsa2usb || add_drv -b ${BASEDIR} \
-i '"usbif,class8" "usb584,222"' -n scsa2usb || EXIT=1
not_installed usb_mid || add_drv -b ${BASEDIR} -i '"usb,device"' -n usb_mid ||
EXIT=1
not_installed usbprn || add_drv -b ${BASEDIR} -m '* 0666 root sys' \
-i '"usbif,class7.1"' -n usbprn || EXIT=1
not_installed usb_ac || add_drv -b ${BASEDIR} -m '* 0600 root sys' \
-i '"usbif,class1.1"' -n usb_ac || EXIT=1
not_installed usb_as || add_drv -b ${BASEDIR} -m '* 0600 root sys' \
-i '"usbif,class1.2"' -n usb_as || EXIT=1
not_installed ohci || add_drv -b ${BASEDIR} -m '* 0644 root sys' \
-i '"pciclass,0c0310"' ohci || EXIT=1
not_installed ehci || add_drv -b ${BASEDIR} -m '* 0644 root sys' \
-i '"pciclass,0c0320"' ehci || EXIT=1
not_installed uhci || add_drv -b ${BASEDIR} -m '* 0644 root sys' \
-i '"pciclass,0c0300"' uhci || EXIT=1
# Cleanup to wipe out any defunct links
if [ -d ${LINKDIR} ]
then
# ls -l shows linknames to curr dir and phys nodes relative to $LINKDIR
OLDDIR=`pwd`
cd ${LINKDIR}
# List all entries with devctl (will be entries pointing to phys nodes
# ending with "devctl"). Delete these entries & their physical nodes.
ls -l ${LINKFILES} 2>/dev/null | grep ":devctl$" | \
nawk '{print $9, $11}' | xargs rm -f
cd ${OLDDIR}
fi
exit $EXIT