postinstall revision 4ab75253616c6d68e967c10221bb663c0bfa99df
75c0816e8295e180f4bc7f10db3d0d880383bc1cMark Andrews# CDDL HEADER START
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# The contents of this file are subject to the terms of the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Common Development and Distribution License (the "License").
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# You may not use this file except in compliance with the License.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# See the License for the specific language governing permissions
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# and limitations under the License.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# When distributing Covered Code, include this CDDL HEADER in each
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# If applicable, add the following below this CDDL HEADER, with the
e21a2904f02a03fa06b6db04d348f65fe9c67b2bMark Andrews# fields enclosed by brackets "[]" replaced with your own identifying
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# information: Portions Copyright [yyyy] [name of copyright owner]
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# CDDL HEADER END
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# Use is subject to license terms.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein#ident "%Z%%M% %I% %E% SMI"
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews# postinstall script for SUNWos86r package.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# check_add_drv() checks if the module has an entry in
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# etc/name_to_major. If not, it simply calls add_drv with the arguments
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# given. If there is such an entry in name_to_major file, it adds
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# entries in driver_aliases driver_classes and minor_perm if necessary.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein# The syntax of this function is the same as add_drv.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein while getopts i:b:m:c:n opt
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein \?) echo "check_add_drv can not handle this option"
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein drvname=`echo $drvname | /usr/bin/sed 's;.*/;;g'`
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein /usr/bin/grep "^$drvname[ ]" $basedir/etc/name_to_major > /dev/null 2>&1
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein if [ $? -ne 0 ]
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # entry already in name_to_major, add alias, class, minorperm
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein /usr/bin/egrep "^$drvname[ ]+$i" $basedir/etc/driver_aliases>/dev/null 2>&1
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein if [ $? -ne 0 ]
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein echo "$drvname $i" >> $basedir/etc/driver_aliases
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein /usr/bin/egrep "^$drvname[ ]+$class( | |$)" $basedir/etc/driver_classes > /dev/null 2>&1
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein if [ $? -ne 0 ]
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein echo "$drvname\t$class" >> $basedir/etc/driver_classes
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein /usr/bin/grep "^$drvname:" $basedir/etc/minor_perm > /dev/null 2>&1
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein if [ $? -ne 0 ]
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein # The following clone device/dev is needed for Custom Jumpstart
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein set `/usr/bin/grep "^clone[ ]" $basedir/etc/name_to_major`
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein set `/usr/bin/grep "^$drvname[ ]" $basedir/etc/name_to_major`
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein mknod $basedir/$CLONE_DEVICE c $CLONE_MAJ $DRIVER_MAJ
# etc/name_to_major. If so, it simply calls rem_drv with the arguments
basedir=/
OPTIND=1
while getopts b: opt
drvname=$1
if [ $? -eq 0 ]
eval $cmd
i386)
-i '"pci1011,2" "pci1011,9" "pci1011,14" "pci1011,19" "pci1109,1400" "pci1109,2400" "pci10b8,2001" "pci2646,1"' \
'"pci10b7,9000" "pci10b7,9001" "pci10b7,9004" "pci10b7,9005" "pci10b7,9006" "pci10b7,9050" "pci10b7,9051" "pci10b7,9055" "pci10b7,9056" "pci10b7,9200" "pci10b7,9800" "pci10b7,9805"' \
-c scsi \
-i '"pci1000,1" "pci1000,2" "pci1000,3" "pci1000,4" "pci1000,6" "pci1000,c" "pci1000,f" "pci1000,8f" ' \
-i '"pci8086,1029" "pci8086,1229" "pci8086,1229.8086.1009" "pci8086,1229.8086.100c" "pci8086,1229.8086.1012" "pci8086,1229.8086.1013" "pci8086,1229.8086.1015" "pci8086,1229.8086.1016" "pci8086,1229.8086.1017" "pci8086,1030" "pci8086,1031" "pci8086,1032" "pci8086,1038" "pci8086,1039" "pci8086,103d" "pci8086,2449"' \
# The sd driver should be installed to the system before rcs9.sh
# Call the rcs9.sh script to update necessary files in case of upgrade
# Also used to preserve escd.rf (devconf configuration information)
while read pathname
if [ ! -s $pathname ]; then