i.sdconf_sparc revision 5c44817c0d1a2b9b02dbbf343823da0b064f0ee7
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#!/bin/sh
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# CDDL HEADER START
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# The contents of this file are subject to the terms of the
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# Common Development and Distribution License (the "License").
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# You may not use this file except in compliance with the License.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# or http://www.opensolaris.org/os/licensing.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# See the License for the specific language governing permissions
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# and limitations under the License.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# When distributing Covered Code, include this CDDL HEADER in each
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# If applicable, add the following below this CDDL HEADER, with the
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# fields enclosed by brackets "[]" replaced with your own identifying
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# information: Portions Copyright [yyyy] [name of copyright owner]
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# CDDL HEADER END
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ebbab6bbae913efeadfa3c6a1b082664a125f95bDan Price#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# Use is subject to license terms.
ebbab6bbae913efeadfa3c6a1b082664a125f95bDan Price#
ebbab6bbae913efeadfa3c6a1b082664a125f95bDan Price#ident "%Z%%M% %I% %E% SMI"
ebbab6bbae913efeadfa3c6a1b082664a125f95bDan Price#
ebbab6bbae913efeadfa3c6a1b082664a125f95bDan Price
ebbab6bbae913efeadfa3c6a1b082664a125f95bDan PricePATH="/usr/bin:/usr/sbin:${PATH}"
ebbab6bbae913efeadfa3c6a1b082664a125f95bDan Priceexport PATH
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazaadd_mpt_entry() {
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazacat >> $dest << EOF
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# Enable Target 7 for the mpt SCSI/SAS/SATA driver. Target 7 has
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# traditionally been reserved for legacy SCSI HBAs, but SAS controllers
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# supported by the mpt driver do not use target 7 for that purpose.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# Enabling Target 7 allows the use of 8 disks on those controllers.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazaname="sd" parent="mpt"
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza target=7 lun=0;
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaEOF
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza}
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazaadd_self_identifying_entry() {
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazacat >> $dest <<EOF
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# The following stub node is needed for pathological bottom-up
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza# devid resolution on a self-identifying transport.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza#
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazaname="sd" class="scsi-self-identifying";
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane PrazaEOF
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza}
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazawhile read src dest; do
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza if [ ! -f $dest ]; then
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza cp $src $dest
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza else
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza line1="name=\"sd\" parent=\"mpt\""
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza line2="target=7 lun=0;"
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza echo `cat $dest` | grep "$line1[# ]*$line2" >/dev/null
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza if [ $? -ne 0 ]; then
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza add_mpt_entry
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza fi
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza echo `cat $dest` | grep "scsi-self-identifying" > /dev/null
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza if [ $? -ne 0 ]; then
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza add_self_identifying_entry
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza fi
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza fi
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazadone
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazaexit 0
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza