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