xref: /csrg-svn/sys/pmax/dist/maketape (revision 63212)
153211Sralph#!/bin/sh -
253211Sralph#
3*63212Sbostic# Copyright (c) 1992, 1993
4*63212Sbostic#	The Regents of the University of California.  All rights reserved.
553211Sralph#
653211Sralph# %sccs.include.redist.sh%
753211Sralph#
8*63212Sbostic#	@(#)maketape	8.1 (Berkeley) 06/10/93
953211Sralph#
1053211Sralph
1153211Sralph# maketape [ 6250 | 1600 [ tapename [ remotetapemachine ] ] ]
1253211Sralphminiroot=ra1b
1353211Sralphnbsd=ra1a
1453211Sralphnbsdusr=/mnt/usr/DISTUSR
1553211Sralphtape=/dev/rmt20
1653211Sralphtype=6250
1753211Sralphblock=40
1853211Sralphtflag=cbf
1953211Sralphbprog="/usr/local/20b 20480"
2053211Sralph
2153211Sralphif [ $# -gt 0 ]; then
2253211Sralph	type=$1;
2353211Sralphfi
2453211Sralph
2553211Sralphif [ $# -gt 1 ]; then
2653211Sralph	tape=$2;
2753211Sralphfi
2853211Sralph
2953211Sralphtartape=$tape
3053211Sralphif [ $# -gt 2 ]; then
3153211Sralph	remote=$3;
3253211Sralph	tartape='-';
3353211Sralphfi
3453211Sralph
3553211Sralphrsh $remote mt -t ${tape} rew
3653211Sralphdate
3753211Sralph#umount /dev/$nbsdusr
3853211Sralphumount /dev/$nbsd
3953211Sralphmount -r /dev/$nbsd /nbsd
4053211Sralph#mount -r /dev/$nbsdusr /nbsd/usr
4153211Sralphcd /nbsd
4253211Sralphsync
4353211Sralph
4453211Sralphif [ $type = '1600a' ]
4553211Sralphthen
4653211Sralph	type=1600
4753211Sralphfi
4853211Sralph
4953211Sralphcd /nbsd/sys/vaxdist/tp
5053211Sralphtp cmf /tmp/tape.$$ boot copy format
5153211Sralphcd /nbsd/sys/mdec
5253211Sralphecho "Build 1st level boot block file"
5353211Sralphcat tsboot htboot tmboot mtboot utboot noboot noboot /tmp/tape.$$ | \
5453211Sralph        rsh $remote dd of=${tape} obs=512 conv=sync
5553211Sralph
5653211Sralphecho "Add image of mini-root file system"
5753211Sralpheval dd if=/dev/r${miniroot} count=205 bs=20b conv=sync ${remote+"| rsh"} \
5853211Sralph	${remote-"of=$tape"} ${remote+'/usr/local/20b ">" $tape'}
5953211Sralph
6053211Sralphecho "Add full dump of real file system"
6153211Sralph/sbin/${remote+r}dump 0f $remote${remote+:}${tape} /dev/r${nbsd}
6253211Sralph
6353211Sralphecho "Add tar image of /usr"
6453211Sralphcd ${nbsdusr}
6553211Sralphtar ${tflag} ${block} ${tartape} bin contrib games include lib libdata \
6653211Sralph	libexec local mdec obj old sbin share | rsh $remote ${bprog} ">" $tape
6753211Sralph
6853211Sralphif [ ${type} != '6250' ]
6953211Sralphthen
7053211Sralph	echo "Done, rewinding first tape"
7153211Sralph	rsh $remote mt -t ${tape} rew &
7253211Sralph	echo "Mount second tape and hit return when ready"
7353211Sralph	echo "(or type name of next tape drive)"
7453211Sralph	read x
7553211Sralph	if [ "$x" != "" ]
7653211Sralph	then	tape=$x
7753211Sralph	fi
7853211Sralphfi
7953211Sralph
8053211Sralph: tape2:
8153211Sralphecho "Add user source code"
8253211SralphFILES="Makefile bin etc games include kerberosIV lib libexec old \
8353211Sralph	pgrm sbin share usr.bin usr.sbin"
8453211Sralphcd /nbsd/usr/src
8553211Sralphtar ${tflag} ${block} ${tartape} ${FILES} | rsh $remote ${bprog} ">" $tape
8653211Sralph
8753211Sralphif [ ${type} != '6250' ]
8853211Sralphthen
8953211Sralph	echo "Done, rewinding second tape"
9053211Sralph	$remote mt -t ${tape} rew &
9153211Sralph	echo "Mount third tape and hit return when ready"
9253211Sralph	echo "(or type name of next tape drive)"
9353211Sralph	read x
9453211Sralph	if [ "$x" != "" ]
9553211Sralph	then	tape=$x
9653211Sralph	fi
9753211Sralphfi
9853211Sralph
9953211Sralph: tape3:
10053211Sralphecho "Add tar image of system sources"
10153211Sralphcd /nbsd/usr/src/sys
10253211Sralphtar ${tflag} ${block} ${tartape} . | rsh $remote ${bprog} ">" $tape
10353211Sralph
10453211Sralphecho "Add user contributed software"
10553211Sralph# standard (always uncompressed) directories:
10653211SralphFILES="Makefile Makefile.inc ansi bib emacs emacs-18.55.tar.Z jove kermit \
10753211Sralph	mh.tar.Z patch rcs vmsprep"
10853211Sralphcd /nbsd/usr/src/contrib
10953211Sralphtar ${tflag} ${block} ${tartape} ${FILES} | rsh $remote ${bprog} ">" $tape
11053211Sralph
11153211Sralph
11253211Sralphecho "Done, rewinding tape"
11353211Sralphrsh $remote mt -t ${tape} rew &
114