postinstall revision ff0e937b36dcde1a47ff7b00aa76a491c0dc07a8
4141N/A#!/bin/sh
4141N/A#
4141N/A# CDDL HEADER START
4141N/A#
4141N/A# The contents of this file are subject to the terms of the
4141N/A# Common Development and Distribution License (the "License").
4141N/A# You may not use this file except in compliance with the License.
4141N/A#
4141N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
4141N/A# or http://www.opensolaris.org/os/licensing.
4141N/A# See the License for the specific language governing permissions
4141N/A# and limitations under the License.
4141N/A#
4141N/A# When distributing Covered Code, include this CDDL HEADER in each
4141N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
4141N/A# If applicable, add the following below this CDDL HEADER, with the
4141N/A# fields enclosed by brackets "[]" replaced with your own identifying
4141N/A# information: Portions Copyright [yyyy] [name of copyright owner]
4141N/A#
4141N/A# CDDL HEADER END
4141N/A#
4141N/A#
4141N/A#
4141N/A# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
4141N/A# Use is subject to license terms.
4141N/A#
4141N/A
4141N/APATH="/usr/bin:/usr/sbin:${PATH}"
4141N/Aexport PATH
4309N/A
4141N/Aif [ "${BASEDIR:=/}" != "/" ]
4141N/Athen
4141N/A BASEDIR_OPT="-b $BASEDIR"
4141N/Afi
4141N/A
4141N/A# Location of usb links, and the names of the types of links to remove
4141N/ALINKDIR=${BASEDIR}/dev/usb
4141N/ALINKFILES="hub* mass-storage* device*"
4141N/A
4141N/A# since ohci, uhci and ehci are self probing nexus drivers,
4141N/A# add_drv -n hid, hubd, usb_ia and usb_mid before add_drv ohci/uhci/ehci.
4141N/A# ohci/uhci/ehci will create the hub and usb,device nodes and attach
4141N/A# hubd, usb_mid and usb_ia drivers
4141N/A
4141N/Anot_installed() {
4141N/A driver=$1
4141N/A grep "^${driver} " $BASEDIR/etc/name_to_major > /dev/null 2>&1
4141N/A
4141N/A return $?
4141N/A}
4141N/A
4141N/AEXIT=0
4141N/A
4297N/Anot_installed hid || add_drv ${BASEDIR_OPT} -m '* 0600 root sys' \
4297N/A -i '"usbif,class3"' -n hid || EXIT=1
4141N/A
4141N/Anot_installed hubd || add_drv ${BASEDIR_OPT} -m '* 0644 root sys' \
4141N/A -i '"usbif,class9"' -n hubd || EXIT=1
4141N/A
4141N/Anot_installed scsa2usb || add_drv ${BASEDIR_OPT} \
4141N/A -i '"usbif,class8" "usb584,222"' -n scsa2usb || EXIT=1
4141N/A
4141N/Anot_installed usb_ia || add_drv ${BASEDIR_OPT} -i '"usb,ia"' -n usb_ia ||
4141N/AEXIT=1
4141N/A
4141N/Anot_installed usb_mid || add_drv ${BASEDIR_OPT} -i '"usb,device"' -n usb_mid ||
4141N/AEXIT=1
4141N/A
4141N/Anot_installed usbprn || add_drv ${BASEDIR_OPT} -m '* 0666 root sys' \
4141N/A -i '"usbif,class7.1"' -n usbprn || EXIT=1
4141N/A
4141N/Anot_installed wusb_ca || add_drv ${BASEDIR_OPT} -m '* 0666 root sys' \
4141N/A -i '"usbif,classef.3.1"' -n wusb_ca || EXIT=1
4141N/A
4141N/Anot_installed wusb_df || add_drv ${BASEDIR_OPT} -m '* 0666 root sys' \
4141N/A -i '"usb3495,3007" "usb15a9,5"' -n wusb_df || EXIT=1
4141N/A
4141N/Anot_installed hwahc || add_drv ${BASEDIR_OPT} -m '* 0644 root sys' \
4141N/A -i '"usbif,classe0.2.1"' -n hwahc || EXIT=1
4141N/A
4141N/Anot_installed hwarc || add_drv ${BASEDIR_OPT} -m '* 0644 root sys' \
4141N/A -i '"usbif,classe0.1.2"' -n hwarc || EXIT=1
4141N/A
4141N/Anot_installed usb_ac || add_drv ${BASEDIR_OPT} -m '* 0600 root sys' \
4141N/A -i '"usbif,class1.1"' -n usb_ac || EXIT=1
4141N/A
4141N/Anot_installed usb_as || add_drv ${BASEDIR_OPT} -m '* 0600 root sys' \
4141N/A -i '"usbif,class1.2"' -n usb_as || EXIT=1
4141N/A
4141N/Anot_installed ohci || add_drv ${BASEDIR_OPT} -m '* 0644 root sys' \
4141N/A -i '"pciclass,0c0310"' ohci || EXIT=1
4141N/A
4141N/Anot_installed ehci || add_drv ${BASEDIR_OPT} -m '* 0644 root sys' \
4141N/A -i '"pciclass,0c0320"' ehci || EXIT=1
4309N/A
4309N/Anot_installed uhci || add_drv ${BASEDIR_OPT} -m '* 0644 root sys' \
4309N/A -i '"pciclass,0c0300"' uhci || EXIT=1
4309N/A
4309N/A# Cleanup to wipe out any defunct links
4309N/A
4309N/Aif [ -d ${LINKDIR} ]
4309N/Athen
4309N/A # ls -l shows linknames to curr dir and phys nodes relative to $LINKDIR
4309N/A OLDDIR=`pwd`
4302N/A cd ${LINKDIR}
4141N/A
4141N/A # List all entries with devctl (will be entries pointing to phys nodes
4141N/A # ending with "devctl"). Delete these entries & their physical nodes.
4309N/A ls -l ${LINKFILES} 2>/dev/null | grep ":devctl$" | \
4141N/A nawk '{print $9, $11}' | xargs rm -f
4141N/A
4141N/A cd ${OLDDIR}
4141N/Afi
4350N/A
4350N/Aexit $EXIT
4350N/A