#! /bin/sh
#
# mksysback
#
# Create a BOS boot and Installation/Maintenance 8mm tape.
# AIX version 3.1.x

if [ $# != 1 ]
   then echo " "
        echo "Usage : mksysback device"
        echo " "
        echo "E.G.  : mksysback rmt0"
        echo " "
        exit
fi

PATH=/bin:/usr/bin:/etc:/usr/ucb
export PATH

# Directory with a lot of space in it (at least 4 Mb):
bigdir=/tmp

mkszfile -f
chdev -l "$1" -a "block_size=512"
lsattr -E -l "$1" 
tctl -f /dev/"$1" rewind
/bin/rm -f $bigdir/tape.fs $bigdir/tape.image $bigdir/bosinst.image
bosboot -m -p /usr/bin/tape.proto -d /dev/"$1" \
	 -f $bigdir/tape.fs -b $bigdir/tape.image
dd if=$bigdir/tape.image of=/dev/"$1".5 bs=512 conv=sync
/usr/lpp/bosinst/diskette/mkinstdskt $bigdir/bosinst.image
dd if=$bigdir/bosinst.image of=/dev/"$1".5 bs=512 conv=sync
dd if=/bootrec of=/dev/"$1".5 bs=512 conv=sync

mksysb /dev/"$1".1