#!/bin/sh
#


PATH="/usr/bin:/usr/sbin:${PATH}"
export PATH

RAW=""

REV=`uname -r`

case $REV in
4.1.3*)
    RAW=`(   while read blk mp type junk
	do
	    case $blk in
	    '#'* | '')
		continue;;
	    esac
	    if [ "$mp" = "/" -a "$type" = "4.2" ]
	    then
		echo $blk | sed -e "s;^/dev/;/dev/r;"
		break
	    fi
	done
    ) </etc/fstab`
	
    ;;


*)
    echo "Incorrect OS Rev \"$REV\", should be SunOS 4.1.3" 1>&2
    exit 1
esac


if /usr/kvm/mdec/installblk /usr/kvm/mdec/resume.blk $RAW
then
    echo "New boot block installed on $RAW"
else
    echo "	Failed to install boot block on root device $RAW"
    echo "	Save/Resume will not function without a new ufs bootblk"
fi
exit 0
