postinstall revision 7c478bd95313f5f23a4c958a745db2134aa03244
ac4e70ff8955669341f435bc0a734a17c01af124Mark Andrews#!/bin/sh
5ae0e2c8b72fa44237edeb37d1945b1c3535ca39Automatic Updater#
5ae0e2c8b72fa44237edeb37d1945b1c3535ca39Automatic Updater# CDDL HEADER START
59dd3b3cd954239d98ef52cd26328856cb6f2975Automatic Updater#
59dd3b3cd954239d98ef52cd26328856cb6f2975Automatic Updater# The contents of this file are subject to the terms of the
7af91d15b2ce1ce32f7320f6d5cc3b83621c241aAutomatic Updater# Common Development and Distribution License, Version 1.0 only
7b67cfadd077feb0ec3e6c78385ba0d845a9789bMark Andrews# (the "License"). You may not use this file except in compliance
59dd3b3cd954239d98ef52cd26328856cb6f2975Automatic Updater# with the License.
a3b428812703d22a605a9f882e71ed65f0ffdc65Mark Andrews#
bb93c8542756719b53096b9939e4041d0966026fAutomatic Updater# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# or http://www.opensolaris.org/os/licensing.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# See the License for the specific language governing permissions
ac4e70ff8955669341f435bc0a734a17c01af124Mark Andrews# and limitations under the License.
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater#
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# When distributing Covered Code, include this CDDL HEADER in each
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
5c0fc20d6e59216d9a142409e5fdb498153aeaa5Automatic Updater# If applicable, add the following below this CDDL HEADER, with the
56874aef380a64a2c183b7c282c3e7a361d67fa1Automatic Updater# fields enclosed by brackets "[]" replaced with your own identifying
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# information: Portions Copyright [yyyy] [name of copyright owner]
56874aef380a64a2c183b7c282c3e7a361d67fa1Automatic Updater#
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews# CDDL HEADER END
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews#
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews#
7eda3642eea03f1181e41540c7c8791a57759383Automatic Updater# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews# Use is subject to license terms.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews#
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews# ident "%Z%%M% %I% %E% SMI"
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews#
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# SUNWcti2 postinstall script
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson#
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews
aa1d397c4736cd86540555193d71e55fa3b37b2aMark AndrewsPATH="/usr/bin:/usr/sbin:${PATH}"
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafssonexport PATH
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian WellingtonDEVLINKTB="${BASEDIR}/etc/devlink.tab"
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrewsif test ! -f ${DEVLINKTB} -o ! -w ${DEVLINKTB}; then
fc3576328379e813ccf6b3a6e66d9bb701a79c83Automatic Updater echo "SUNWcti2: file ${DEVLINKTB} is missing/inaccessible." >&2
298c514fff250c1a147176cfbbc1c0ca441d1ea5Automatic Updater exit 1
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrewsfi
bbb069be941f649228760edcc241122933c066d2Automatic Updater
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrewstrap "rm -f /tmp/$$.*;exit 1" 1 2 3 13 15
3098364bcdd7a719fbafa5fc8d2cc9e90e5a5989Automatic UpdaterTMP=/tmp/$$
9d330c054e02f52cefd8dc0e71550b0fe07e077eAutomatic Updater
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews#
ca904804e43f663f08eb1ac9d6d617930b9a3cd3Automatic Updater# rem_devlink - removes an entry from ${DEVLINKTB}
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews#
3a6600c8d319275d73c36eb625f77103cd83e824Automatic Updaterrem_devlink()
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews{
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews PATTERN="$1"
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews LINK="$2"
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson PLINK="`echo $LINK | sed 's/[$*^|\]/\\\&/g'`"
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews grep -v "^$PATTERN $PLINK$" ${DEVLINKTB} >$TMP.devlink
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews #
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews # Must use 'cp' here in order to preserve the original
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews # mode, owner and group of devlink.tab
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson #
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews cp $TMP.devlink ${DEVLINKTB}
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews rm -f $TMP.devlink
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson}
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews
d145b64cacc8d9cda51f9924ec70cd4661c3e2cfAutomatic Updaternot_installed() {
bb93c8542756719b53096b9939e4041d0966026fAutomatic Updater driver=$1
2a31bd531072824ef252c18303859d6af7451b00Francis Dupont grep "^${driver} " ${BASEDIR}/etc/name_to_major > /dev/null 2>&1
2a31bd531072824ef252c18303859d6af7451b00Francis Dupont return $?
2a31bd531072824ef252c18303859d6af7451b00Francis Dupont}
2a31bd531072824ef252c18303859d6af7451b00Francis Dupont
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark AndrewsEXIT=0
7af91d15b2ce1ce32f7320f6d5cc3b83621c241aAutomatic Updater
7af91d15b2ce1ce32f7320f6d5cc3b83621c241aAutomatic Updaterrem_devlink 'type=ddi_pseudo;name=scsb' 'pcihpc/scsb\N0'
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrewsnot_installed acebus || add_drv -b ${BASEDIR} -n acebus || EXIT=1
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrewsnot_installed scsb || add_drv -b ${BASEDIR} -i '"nct-ATML,at27c64"' -n scsb || EXIT=1
4d0520004a9663324a6a30f2d1716565e6d0024cAutomatic Updater
7af91d15b2ce1ce32f7320f6d5cc3b83621c241aAutomatic Updaterexit $EXIT
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews