#!/bin/ksh
# IBM_PROLOG_BEGIN_TAG 
# This is an automatically generated prolog. 
#  
# bos720 src/bos/usr/lib/nim/methods/fast_vscsi_boot.script.sh 1.1 
#  
# Licensed Materials - Property of IBM 
#  
# Restricted Materials of IBM 
#  
# COPYRIGHT International Business Machines Corp. 2010 
# All Rights Reserved 
#  
# US Government Users Restricted Rights - Use, duplication or 
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp. 
#  
# IBM_PROLOG_END_TAG 

echo 'PdAt:'>/tmp/pdat.out
echo '       uniquetype = "disk/vscsi/vdisk"'>>/tmp/pdat.out
echo '       attribute = "queue_depth"'>>/tmp/pdat.out
echo '       deflt = "10"'>>/tmp/pdat.out
echo '       values = "1-256,1"'>>/tmp/pdat.out
echo '       width = ""'>>/tmp/pdat.out
echo '       type = "R"'>>/tmp/pdat.out
echo '       generic = "UD"'>>/tmp/pdat.out
echo '       rep = "nr"'>>/tmp/pdat.out
echo '       nls_index = 12'>>/tmp/pdat.out

printf "Updating bootimage spot\n"
cd /usr/lib/objrepos
if [[ -f PdAt.copy ]]
then
	printf "Backup Copy of PdAt ODM Exists\n"
else
	printf "Saving Copy of PdAt ODM\n"
	cp PdAt PdAt.copy
fi

if [[ -f /tmp/pdat.out ]]
then
	odmget -q "uniquetype='disk/vscsi/vdisk' and attribute like queue_depth" PdAt
	printf "Deleting PdAt Stanza\n"
	odmdelete -o PdAt -q "uniquetype='disk/vscsi/vdisk' and attribute like queue_depth"
	printf "Updating PdAt ODM\n"
	odmadd /tmp/pdat.out
	printf "Check New ODM Setting"
	odmget -q "uniquetype='disk/vscsi/vdisk' and attribute like queue_depth" PdAt
else
	printf "Stanza update file does not exist, /tmp/pdat.out!\n"
fi
