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