postinstall revision 6f45ec7b0b964c3be967c4880e8867ac1e7763a5
278N/A#!/sbin/sh
278N/A#
278N/A# CDDL HEADER START
278N/A#
910N/A# The contents of this file are subject to the terms of the
851N/A# Common Development and Distribution License (the "License").
278N/A# You may not use this file except in compliance with the License.
278N/A#
919N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
919N/A# or http://www.opensolaris.org/os/licensing.
919N/A# See the License for the specific language governing permissions
919N/A# and limitations under the License.
919N/A#
919N/A# When distributing Covered Code, include this CDDL HEADER in each
919N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
919N/A# If applicable, add the following below this CDDL HEADER, with the
919N/A# fields enclosed by brackets "[]" replaced with your own identifying
919N/A# information: Portions Copyright [yyyy] [name of copyright owner]
919N/A#
919N/A# CDDL HEADER END
919N/A#
919N/A#
919N/A# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
919N/A# Use is subject to license terms.
919N/A#
278N/A# ident "%Z%%M% %I% %E% SMI"
278N/A#
278N/A
278N/Aset -u
493N/A
278N/APATH="/usr/bin:/usr/sbin:${PATH}"
278N/Aexport PATH
851N/A
278N/A#
911N/A# Driver info
911N/A#
911N/ADRV=nxge
911N/ADRVALIAS=" \"pciex108e,abcd\" \"SUNW,niusl\""
278N/A
278N/ADRVPERM='* 0600 root sys'
278N/A# POLICY='read_priv_set=net_rawaccess write_priv_set=net_rawaccess'
278N/AMAJORDEV=11
278N/A
278N/A#
278N/A# Select the correct add_drv options to execute.
278N/A#
278N/Aif [ "${BASEDIR}" = "/" ]; then
278N/A #
278N/A # Irrespective of whether hardware exists
493N/A # or not don't attempt to attach driver
278N/A # to the hardware. This is to avoid problems
278N/A # with installing a 32 bit driver on a 64 bit
910N/A # running system.
910N/A #
278N/A ADD_DRV="add_drv -n"
278N/Aelse
278N/A #
278N/A # On a client,
278N/A # modify the system files and touch/reconfigure
493N/A # for reconfigure reboot
278N/A #
278N/A ADD_DRV="add_drv -b ${BASEDIR}"
493N/Afi
278N/A
354N/A#
493N/A# Make sure add_drv has *not* been previously executed
278N/A# before attempting to add the driver.
910N/A#
910N/Agrep -w "${DRV}" ${BASEDIR}/etc/name_to_major > /dev/null 2>&1
278N/Aif [ $? -eq 1 ]; then
910N/A ${ADD_DRV} -m "${DRVPERM}" -i "${DRVALIAS}" ${DRV}
278N/A if [ $? -ne 0 ]; then
278N/A echo "\nFailed add_drv!\n" >&2
278N/A exit 1
851N/A fi
278N/Aelse
910N/A echo " add_drv Failed; ${DRV} is already in ${BASEDIR}/etc/name_to_major"
851N/A exit 0
851N/Afi
278N/A
278N/Aexit 0
851N/A