postinstall revision 69b3e10436272b0970d58743de375d0dd61046ce
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews# CDDL HEADER START
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews# The contents of this file are subject to the terms of the
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews# Common Development and Distribution License (the "License").
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews# You may not use this file except in compliance with the License.
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews# See the License for the specific language governing permissions
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews# and limitations under the License.
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews# When distributing Covered Code, include this CDDL HEADER in each
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews# If applicable, add the following below this CDDL HEADER, with the
f97d56e757b9a293ffbaa915ca4d792ae84ba85aTinderbox User# fields enclosed by brackets "[]" replaced with your own identifying
f97d56e757b9a293ffbaa915ca4d792ae84ba85aTinderbox User# information: Portions Copyright [yyyy] [name of copyright owner]
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews# CDDL HEADER END
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews# Copyright 2010 Sun Microsystems, Inc. All rights reserved.
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews# Use is subject to license terms.
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews# postinstall script for SUNWos86r package.
94315060c2b0d9deafabe72d6a0482405fd9d377Evan Hunt# check_add_drv() checks if the module has an entry in
421d4a06479e61fbdc35087f3c4abc9fe65ad72aEvan Hunt# etc/name_to_major. If not, it simply calls add_drv with the arguments
421d4a06479e61fbdc35087f3c4abc9fe65ad72aEvan Hunt# given. If there is such an entry in name_to_major file, it adds
421d4a06479e61fbdc35087f3c4abc9fe65ad72aEvan Hunt# entries in driver_aliases driver_classes and minor_perm if necessary.
421d4a06479e61fbdc35087f3c4abc9fe65ad72aEvan Hunt# The syntax of this function is the same as add_drv.
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews while getopts i:b:m:c:n opt
421d4a06479e61fbdc35087f3c4abc9fe65ad72aEvan Hunt \?) echo "check_add_drv can not handle this option"
94315060c2b0d9deafabe72d6a0482405fd9d377Evan Hunt /usr/bin/grep "^$drvname[ ]" $basedir/etc/name_to_major > /dev/null 2>&1
94315060c2b0d9deafabe72d6a0482405fd9d377Evan Hunt if [ $? -ne 0 ]
94315060c2b0d9deafabe72d6a0482405fd9d377Evan Hunt # entry already in name_to_major, add alias, class, minorperm
94315060c2b0d9deafabe72d6a0482405fd9d377Evan Hunt /usr/bin/egrep "^$drvname[ ]+$i" $basedir/etc/driver_aliases>/dev/null 2>&1
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews if [ $? -ne 0 ]
94315060c2b0d9deafabe72d6a0482405fd9d377Evan Hunt /usr/bin/egrep "^$drvname[ ]+$class( | |$)" $basedir/etc/driver_classes > /dev/null 2>&1
94315060c2b0d9deafabe72d6a0482405fd9d377Evan Hunt if [ $? -ne 0 ]
421d4a06479e61fbdc35087f3c4abc9fe65ad72aEvan Hunt echo "$drvname\t$class" >> $basedir/etc/driver_classes
94315060c2b0d9deafabe72d6a0482405fd9d377Evan Hunt /usr/bin/grep "^$drvname:" $basedir/etc/minor_perm > /dev/null 2>&1
94315060c2b0d9deafabe72d6a0482405fd9d377Evan Hunt if [ $? -ne 0 ]
94315060c2b0d9deafabe72d6a0482405fd9d377Evan Hunt # The following clone device/dev is needed for Custom Jumpstart
421d4a06479e61fbdc35087f3c4abc9fe65ad72aEvan Hunt set `/usr/bin/grep "^clone[ ]" $basedir/etc/name_to_major`
421d4a06479e61fbdc35087f3c4abc9fe65ad72aEvan Hunt set `/usr/bin/grep "^$drvname[ ]" $basedir/etc/name_to_major`
94315060c2b0d9deafabe72d6a0482405fd9d377Evan Hunt mknod $basedir/$CLONE_DEVICE c $CLONE_MAJ $DRIVER_MAJ
94315060c2b0d9deafabe72d6a0482405fd9d377Evan Hunt# check_rem_drv() checks if the module has an entry in
94315060c2b0d9deafabe72d6a0482405fd9d377Evan Hunt# etc/name_to_major. If so, it simply calls rem_drv with the arguments
94315060c2b0d9deafabe72d6a0482405fd9d377Evan Hunt# given to remove the driver from the system. The syntax of this
94315060c2b0d9deafabe72d6a0482405fd9d377Evan Hunt# function is the same as rem_drv.
421d4a06479e61fbdc35087f3c4abc9fe65ad72aEvan Hunt while getopts b: opt
94315060c2b0d9deafabe72d6a0482405fd9d377Evan Hunt \?) echo "check_rem_drv can not handle this option"
421d4a06479e61fbdc35087f3c4abc9fe65ad72aEvan Hunt /usr/bin/grep "^$drvname[ ]" $basedir/etc/name_to_major > /dev/null 2>&1
421d4a06479e61fbdc35087f3c4abc9fe65ad72aEvan Hunt if [ $? -eq 0 ]
94315060c2b0d9deafabe72d6a0482405fd9d377Evan Hunt# Platform-specific drivers
421d4a06479e61fbdc35087f3c4abc9fe65ad72aEvan Hunt -i '"pci1011,2" "pci1011,9" "pci1011,14" "pci1011,19"
94315060c2b0d9deafabe72d6a0482405fd9d377Evan Hunt "pci1109,1400" "pci1109,2400" "pci10b8,2001" "pci2646,1"' \
94315060c2b0d9deafabe72d6a0482405fd9d377Evan Hunt -i '"pci1022,2000" "pci103c,104c"' \
94315060c2b0d9deafabe72d6a0482405fd9d377Evan Hunt -i '"pci1011,21" "pci1014,22"' \
94315060c2b0d9deafabe72d6a0482405fd9d377Evan Hunt -i '"pci1000,1" "pci1000,2" "pci1000,3" "pci1000,4"
94315060c2b0d9deafabe72d6a0482405fd9d377Evan Hunt "pci1000,6" "pci1000,c" "pci1000,f" "pci1000,8f" ' \
94315060c2b0d9deafabe72d6a0482405fd9d377Evan Hunt -i '"pci8086,1029" "pci8086,1229"
94315060c2b0d9deafabe72d6a0482405fd9d377Evan Hunt "pci8086,1229.8086.1" "pci8086,1229.8086.2"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1229.8086.3" "pci8086,1229.8086.4"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1229.8086.5" "pci8086,1229.8086.6"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1229.8086.7" "pci8086,1229.8086.8"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1229.8086.9" "pci8086,1229.8086.a"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1229.8086.b" "pci8086,1229.8086.c"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1229.8086.d" "pci8086,1229.8086.e"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1229.8086.f" "pci8086,1229.8086.10"
421d4a06479e61fbdc35087f3c4abc9fe65ad72aEvan Hunt "pci8086,1229.8086.11" "pci8086,1229.8086.12"
421d4a06479e61fbdc35087f3c4abc9fe65ad72aEvan Hunt "pci8086,1229.8086.13" "pci8086,1229.8086.30"
421d4a06479e61fbdc35087f3c4abc9fe65ad72aEvan Hunt "pci8086,1229.8086.31" "pci8086,1229.8086.40"
421d4a06479e61fbdc35087f3c4abc9fe65ad72aEvan Hunt "pci8086,1229.8086.41" "pci8086,1229.8086.42"
421d4a06479e61fbdc35087f3c4abc9fe65ad72aEvan Hunt "pci8086,1229.8086.50" "pci8086,1229.8086.1009"
421d4a06479e61fbdc35087f3c4abc9fe65ad72aEvan Hunt "pci8086,1229.8086.100c" "pci8086,1229.8086.1012"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1229.8086.1013" "pci8086,1229.8086.1015"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1229.8086.1016" "pci8086,1229.8086.1017"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1229.8086.1030" "pci8086,1229.8086.1040"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1229.8086.1041" "pci8086,1229.8086.1042"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1229.8086.1050" "pci8086,1229.8086.1051"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1229.8086.1052" "pci8086,1229.8086.10f0"
94315060c2b0d9deafabe72d6a0482405fd9d377Evan Hunt "pci8086,1229.8086.1229" "pci8086,1229.8086.2009"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1229.8086.200d" "pci8086,1229.8086.200e"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1229.8086.200f" "pci8086,1229.8086.2010"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1229.8086.2013" "pci8086,1229.8086.2016"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1229.8086.2017" "pci8086,1229.8086.2018"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1229.8086.2019" "pci8086,1229.8086.2101"
7b4b6f361b2fb2291c2019b377a9c0c8e80cfd6bMark Andrews "pci8086,1229.8086.2102" "pci8086,1229.8086.2103"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1229.8086.2104" "pci8086,1229.8086.2105"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1229.8086.2106" "pci8086,1229.8086.2107"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1229.8086.2108" "pci8086,1229.8086.2200"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1229.8086.2201" "pci8086,1229.8086.2202"
9fee08f655527a5dd849b171daeeee1dbbccca76Vernon Schryver "pci8086,1229.8086.2203" "pci8086,1229.8086.2204"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1229.8086.2205" "pci8086,1229.8086.2206"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1229.8086.2207" "pci8086,1229.8086.2208"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1229.8086.2402" "pci8086,1229.8086.2407"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1229.8086.2408" "pci8086,1229.8086.2409"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1229.8086.240f" "pci8086,1229.8086.2410"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1229.8086.2411" "pci8086,1229.8086.2412"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1229.8086.2413" "pci8086,1229.8086.3000"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1229.8086.3001" "pci8086,1229.8086.3002"
9fee08f655527a5dd849b171daeeee1dbbccca76Vernon Schryver "pci8086,1229.8086.3006" "pci8086,1229.8086.3007"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1229.8086.3008" "pci8086,1229.8086.3010"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1229.8086.3011" "pci8086,1229.8086.3012"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1229.8086.301a" "pci8086,1229.8086.3411"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1030" "pci8086,1031" "pci8086,1032" "pci8086,1038"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1039" "pci8086,103d" "pci8086,1050" "pci8086,1059"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,103d.8086.103d" "pci8086,1050.8086.3020"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1050.8086.302f" "pci8086,1050.8086.3427"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,1068" "pci8086,1069" "pci8086,1092" "pci8086,1209"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,2449" "pci8086,27dc"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,2449.8086.3010" "pci8086,2449.8086.3011"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,2449.8086.3012" "pci8086,2449.8086.3013"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,2449.8086.3014" "pci8086,2449.8086.3015"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,2449.8086.3016" "pci8086,2449.8086.3017"
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews "pci8086,2449.8086.3018" "pci8086,27dc.8086.308d"' \
94315060c2b0d9deafabe72d6a0482405fd9d377Evan Hunt -i '"pci10b8,5"' \
94315060c2b0d9deafabe72d6a0482405fd9d377Evan Hunt # The sd driver should be installed to the system before rcs9.sh
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews # is called.
94315060c2b0d9deafabe72d6a0482405fd9d377Evan Hunt -m '* 0640 root sys' \
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews -i '"scsiclass,00" "scsiclass,05"' \
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews # Call the rcs9.sh script to update necessary files in case of upgrade
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews # for the PCI physical device pathname change from 2.4.
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews # Also used to preserve escd.rf (devconf configuration information)
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews # saved on floppy during an install boot.
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews # If there is no data in OWconfig, remove it.
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews if [ ! -s $pathname ]; then
87708bde16713bc02ff2598f4a82f98c699a2f2dMark Andrews# Remove erroneous entry for Symbios Logic 53c875/95 (ncrs)
94315060c2b0d9deafabe72d6a0482405fd9d377Evan Huntsed -e '/^ncrs "pci1000,1000"$/d' ${BASEDIR}/etc/driver_aliases >$TMPFILE