postinstall revision 0f1702c5201310f0529cd5abb77652e5e9b241b6
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis#!/bin/sh
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis#
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis# CDDL HEADER START
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis#
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis# The contents of this file are subject to the terms of the
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis# Common Development and Distribution License (the "License").
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis# You may not use this file except in compliance with the License.
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis#
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis# or http://www.opensolaris.org/os/licensing.
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis# See the License for the specific language governing permissions
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis# and limitations under the License.
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis#
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis# When distributing Covered Code, include this CDDL HEADER in each
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis# If applicable, add the following below this CDDL HEADER, with the
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis# fields enclosed by brackets "[]" replaced with your own identifying
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis# information: Portions Copyright [yyyy] [name of copyright owner]
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis#
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis# CDDL HEADER END
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis#
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis# Use is subject to license terms.
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis#
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr JasiukajtisPATH="/usr/bin:/usr/sbin:${PATH}"
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtisexport PATH
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr JasiukajtisSDP4_SOCK_ENTRY=" 2 2 257 socksdp"
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr JasiukajtisSDP6_SOCK_ENTRY=" 26 2 257 socksdp"
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtisif [ "${BASEDIR:=/}" != "/" ]
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtisthen
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis BASEDIR_OPT="-b $BASEDIR"
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtisfi
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtisnot_installed() {
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis driver=$1
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis grep "^${driver} " $BASEDIR/etc/name_to_major > /dev/null 2>&1
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis return $?
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis}
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr JasiukajtisEXIT=0
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtisnot_installed sdp || add_drv ${BASEDIR_OPT} -m '* 0644 root sys' sdp || EXIT=1
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis# Check sdp4 entry exists in sock2path
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtisegrep "$SDP4_SOCK_ENTRY" $BASEDIR/etc/sock2path > /dev/null 2>&1
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtisif [ $? -ne 0 ]
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtisthen
echo "$SDP4_SOCK_ENTRY" >> $BASEDIR/etc/sock2path
if [ "${BASEDIR:=/}" = "/" ]
then
soconfig $SDP4_SOCK_ENTRY || EXIT=1
fi
fi
# Check sdp6 entry exists in sock2path
egrep "$SDP6_SOCK_ENTRY" $BASEDIR/etc/sock2path > /dev/null 2>&1
if [ $? -ne 0 ]
then
echo "$SDP6_SOCK_ENTRY" >> $BASEDIR/etc/sock2path
if [ "${BASEDIR:=/}" = "/" ]
then
soconfig $SDP6_SOCK_ENTRY || EXIT=1
fi
fi
exit $EXIT