#!/bin/ksh
#
#pragma ident   "@(#)sliceinfo 1.12     05/06/15 SMI"
#
# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# sliceinfo collects information from config.s+h.info file that was created when make.slice utility
#
# sliceinfo collects information from config.s+h.info file that was created when make.slice utility
# created slices on the drives under test. If config.s+h.info file is missing then it filters /etc/mnttab
# for the information on the slices

conf_file="/opt/SUNWstaf/config-util/config.s+h.info"
mount_file="/opt/SUNWstaf/config-util/mount.info"

if [ -f ${mount_file} ]; then
	while read line
	do
		echo "reserved"
		echo "$line"
		echo "hcts"
		echo "hcts"
	done<${mount_file}
else
	echo "!ERROR: Can't open ${mount_file}"
	exit 1
fi

if [ -f ${conf_file} ]; then
        while read line
        do
                device=`echo $line | awk '{print $1}'`
                echo "/dev/dsk/${device}s0 /test.${device}s0"
                echo "/dev/rdsk/${device}s1 raw"
                echo "/dev/dsk/${device}s2 /test.${device}s2"
                echo "/dev/rdsk/${device}s3 raw"
        done<${conf_file}
else
	echo "!Error: Can't open ${conf_file}"
        exit 1
fi
