#!/bin/ksh
#
#ident	"@(#)make.slices.info	1.4	04/12/08 SMI"
#
# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# make.smash.info - create default config.s+h.info file as input for
# config.s+h script.
#
# usage: make.smash.info

# This script helps create a default config.s+h.info file on the test
# system. This file can be used directly or edited if necessary.  
# Default is to use all disks attached to the system and 
# then configure 6 slices on each (3 filesystems and 3 raw slices).
# The config.s+h.info file entries will look like this: c0t0d0 4 fr test


prtvtoc /dev/rdsk/c*d*s2 2> /dev/null | grep "partition map" > /tmp/prtvlist 2>/dev/null
cat /tmp/prtvlist | awk ' { print $2 } ' >/tmp/disklist

for rpath in `cat /tmp/disklist`
do
	cat /tmp/disklist | grep "$rpath" > /dev/null
	if [ $? -ne 0 ] 
	then echo "WARNING: $rpath is not a disk"
	fi
done

cat /tmp/disklist | sed '{
s/s2//g
s/\/dev\/rdsk\///g
s/$/ 8 fr test/g
}' > /tmp/devlist 2>/dev/null
cat /tmp/devlist > config.s+h.info
rm /tmp/*list
