:
# This shell script build a full ULTRIX-11 V3.1 master
# distribution tape on TK50 (or other) boot tape. It
# is based on a tape dump provided by Wilko Bulte, and
# maintains all original files.
#
# Author: Fred N. van Kempen <fred@microwalt.nl>
#         ... with the support of many, now and in the past.
#
# Several of the included tools were either developed by 
# others trying to read or create tapes, or come from the
# ULTRIX-11 source distribution kit.

TAPE=/dev/nrtk0

  echo Creating ULTRIX-11 V3.1 Master Distribution on TK50.
  echo "----------------------------------------------------"
  echo ""

  if [ ! -f ./maketape ]; then
	echo Compiling MAKETAPE tool...
	cc -o ./maketape src/maketape.c
  fi

  if [ ! -f ./tdtk50.bv ]; then
	echo 'Generating the Tape Definition file (for TK50)...'
	cp src/tdtk50.bv ./tdtk50.bv
  fi

  echo Rewinding tape...
  mt -f $TAPE rewind

  # Create the first tape file with uboot, boot and /sas.
  echo Creating boot record on tape...
  ./maketape $TAPE ./tdtk50.bv

  # Write the SAS file system image. (2048-byte blocks!)
  echo Writing SAS file system image...
  dd if=fs/md-sas.dsk of=$TAPE bs=2048 count=128

  # SAS tree
  echo Writing SAS dump...
  dd if=data/file14 of=$TAPE bs=10240

  # Fortran77
  echo Writing F77 dump...
  dd if=data/file15 of=$TAPE bs=10240

  # Pascal
  echo Writing Pascal dump...
  dd if=data/file16 of=$TAPE bs=10240

  # Plot
  echo Writing PLOT dump...
  dd if=data/file17 of=$TAPE bs=10240

  # SCCS
  echo Writing SCCS dump...
  dd if=data/file18 of=$TAPE bs=10240

  # Usat
  echo Writing Usat dump...
  dd if=data/file19 of=$TAPE bs=10240

  # Usep
  echo Writing Usep dump...
  dd if=data/file20 of=$TAPE bs=10240

  # TCPIP
  echo Writing TCP/IP dump...
  dd if=data/file21 of=$TAPE bs=10240

  # UUCP
  echo Writing UUCP dump...
  dd if=data/file22 of=$TAPE bs=10240

  # Spell
  echo Writing Spell dump...
  dd if=data/file23 of=$TAPE bs=10240

  # Userdev
  echo Writing Userdev dump...
  dd if=data/file24 of=$TAPE bs=10240

  # Docprep
  echo Writing DocPrep dump...
  dd if=data/file25 of=$TAPE bs=10240

  # Learn
  echo Writing Learn dump...
  dd if=data/file26 of=$TAPE bs=10240

  # LibSA
  echo Writing LibSA dump...
  dd if=data/file27 of=$TAPE bs=10240

  # Dict
  echo Writing Dict dump...
  dd if=data/file28 of=$TAPE bs=10240

  # orphans
  echo Writing Orphans dump...
  dd if=data/file29 of=$TAPE bs=10240

  # Games
  echo Writing Games dump...
  dd if=data/file30 of=$TAPE bs=10240

  # Manuals
  echo Writing Manuals dump...
  dd if=data/file31 of=$TAPE bs=10240

  # SYSGEN
  echo Writing SYSGEN dump...
  dd if=data/file32 of=$TAPE bs=10240

  # Root FS Dump
  echo Writing Root File System dump...
  dd if=data/file33 of=$TAPE bs=10240

  # Usr FS Dump
  echo Writing Usr File System dump...
  dd if=data/file34 of=$TAPE bs=10240

  # SRCKIT
  echo Writing SOURCE KIT dump...
  dd if=data/file35 of=$TAPE bs=10240


  echo ""
  echo "---------------------------------------"
  echo Rewinding tape...
  mt -f $TAPE rewind
  rm -f ./maketape ./tdtk50.bv
  echo All done !
