1*7fcedef2SRobert Johnston#!/usr/bin/perl -w 2*7fcedef2SRobert Johnston# 3*7fcedef2SRobert Johnston# CDDL HEADER START 4*7fcedef2SRobert Johnston# 5*7fcedef2SRobert Johnston# The contents of this file are subject to the terms of the 6*7fcedef2SRobert Johnston# Common Development and Distribution License (the "License"). 7*7fcedef2SRobert Johnston# You may not use this file except in compliance with the License. 8*7fcedef2SRobert Johnston# 9*7fcedef2SRobert Johnston# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*7fcedef2SRobert Johnston# or http://www.opensolaris.org/os/licensing. 11*7fcedef2SRobert Johnston# See the License for the specific language governing permissions 12*7fcedef2SRobert Johnston# and limitations under the License. 13*7fcedef2SRobert Johnston# 14*7fcedef2SRobert Johnston# When distributing Covered Code, include this CDDL HEADER in each 15*7fcedef2SRobert Johnston# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*7fcedef2SRobert Johnston# If applicable, add the following below this CDDL HEADER, with the 17*7fcedef2SRobert Johnston# fields enclosed by brackets "[]" replaced with your own identifying 18*7fcedef2SRobert Johnston# information: Portions Copyright [yyyy] [name of copyright owner] 19*7fcedef2SRobert Johnston# 20*7fcedef2SRobert Johnston# CDDL HEADER END 21*7fcedef2SRobert Johnston# 22*7fcedef2SRobert Johnston# 23*7fcedef2SRobert Johnston# Copyright 2009 Sun Microsystems, Inc. All rights reserved. 24*7fcedef2SRobert Johnston# Use is subject to license terms. 25*7fcedef2SRobert Johnston# 26*7fcedef2SRobert Johnston 27*7fcedef2SRobert Johnston$num_bays = 4; 28*7fcedef2SRobert Johnston$bay_label = "HD"; 29*7fcedef2SRobert Johnston 30*7fcedef2SRobert Johnstonprint <<EOF; 31*7fcedef2SRobert Johnston<topology name='disk' scheme='hc'> 32*7fcedef2SRobert Johnston <range name='bay' min='0' max='3'> 33*7fcedef2SRobert JohnstonEOF 34*7fcedef2SRobert Johnston 35*7fcedef2SRobert Johnston$controller = 0; 36*7fcedef2SRobert Johnstonfor ($bay = 0; $bay < $num_bays; $bay++) { 37*7fcedef2SRobert Johnston $hpath = "/pci\@0,0/pci1022,7458\@11/pci1000,3060\@4"; 38*7fcedef2SRobert Johnston $tpath = sprintf("/sd\@%x,0", $bay); 39*7fcedef2SRobert Johnston $apoint = sprintf(":scsi::dsk/c%dt%dd0", 40*7fcedef2SRobert Johnston $controller + 1, $bay); 41*7fcedef2SRobert Johnston 42*7fcedef2SRobert Johnston print <<EOF; 43*7fcedef2SRobert Johnston <node instance='$bay'> 44*7fcedef2SRobert Johnston <propgroup name='protocol' version='1' name-stability='Private' 45*7fcedef2SRobert Johnston data-stability='Private'> 46*7fcedef2SRobert Johnston <propval name='label' type='string' value='$bay_label$bay' /> 47*7fcedef2SRobert Johnston </propgroup> 48*7fcedef2SRobert Johnston <propgroup name='io' version='1' name-stability='Private' 49*7fcedef2SRobert Johnston data-stability='Private'> 50*7fcedef2SRobert Johnston <propval name='ap-path' type='string' value='/devices$hpath$apoint' /> 51*7fcedef2SRobert Johnston </propgroup> 52*7fcedef2SRobert Johnston <propgroup name='binding' version='1' name-stability='Private' 53*7fcedef2SRobert Johnston data-stability='Private'> 54*7fcedef2SRobert Johnston <propval name='occupant-path' type='string' 55*7fcedef2SRobert Johnston value='$hpath$tpath' /> 56*7fcedef2SRobert Johnston </propgroup> 57*7fcedef2SRobert Johnston </node> 58*7fcedef2SRobert JohnstonEOF 59*7fcedef2SRobert Johnston} 60*7fcedef2SRobert Johnston 61*7fcedef2SRobert Johnstonprint <<EOF; 62*7fcedef2SRobert Johnston <dependents grouping='children'> 63*7fcedef2SRobert Johnston <range name='disk' min='0' max='0'> 64*7fcedef2SRobert Johnston <enum-method name='disk' version='1' /> 65*7fcedef2SRobert Johnston </range> 66*7fcedef2SRobert Johnston </dependents> 67*7fcedef2SRobert Johnston </range> 68*7fcedef2SRobert Johnston</topology> 69*7fcedef2SRobert JohnstonEOF 70