i.ssdconf revision 5c44817c0d1a2b9b02dbbf343823da0b064f0ee7
9N/A#!/bin/sh
9N/A#
9N/A# CDDL HEADER START
9N/A#
9N/A# The contents of this file are subject to the terms of the
9N/A# Common Development and Distribution License (the "License").
9N/A# You may not use this file except in compliance with the License.
9N/A#
9N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9N/A# or http://www.opensolaris.org/os/licensing.
9N/A# See the License for the specific language governing permissions
9N/A# and limitations under the License.
9N/A#
9N/A# When distributing Covered Code, include this CDDL HEADER in each
9N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
9N/A# If applicable, add the following below this CDDL HEADER, with the
9N/A# fields enclosed by brackets "[]" replaced with your own identifying
9N/A# information: Portions Copyright [yyyy] [name of copyright owner]
9N/A#
9N/A# CDDL HEADER END
5506N/A#
9N/A# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
9N/A# Use is subject to license terms.
9N/A#
9N/A#ident "%Z%%M% %I% %E% SMI"
814N/A#
1470N/A
814N/APATH="/usr/bin:/usr/sbin:${PATH}"
814N/Aexport PATH
814N/A
814N/Aadd_self_identifying_entry() {
814N/Acat >> $dest <<EOF
814N/A
1845N/A#
814N/A# The following stub node is needed for pathological bottom-up
1845N/A# devid resolution on a self-identifying transport.
1845N/A#
1845N/Aname="ssd" class="scsi-self-identifying";
1845N/AEOF
1845N/A}
3441N/A
3441N/Awhile read src dest; do
1845N/A if [ ! -f $dest ]; then
1845N/A cp $src $dest
1845N/A else
814N/A # Remove obsoleted drivers
814N/A grep -v 'name="ssd" parent="SUNW,pln" port=' $dest > /tmp/d.$$
1470N/A grep -v 'name="ssd" parent="scsi_vhci" target=0;' /tmp/d.$$ > /tmp/d.$$
1470N/A mv /tmp/d.$$ $dest
1470N/A
1470N/A # Process conf files for missing entries
1470N/A while read confline; do
1470N/A if echo "$confline" | egrep "^[\t| ]*#|^[\t| ]*$" > /dev/null; then
1470N/A continue
16N/A fi
16N/A
16N/A grep "$confline" $dest > /dev/null
16N/A if [ $? -ne 0 ]; then
16N/A echo $confline >> $dest
1470N/A fi
9N/A done < $src
16N/A echo `cat $dest` | grep "scsi-self-identifying" > /dev/null
1470N/A
16N/A if [ $? -ne 0 ]; then
16N/A add_self_identifying_entry
1470N/A fi
1470N/A fi
16N/Adone
16N/A
1470N/Aexit 0
5506N/A