1#!/bin/sh - 2# 3# Copyright (c) 1992, 1993 4# The Regents of the University of California. All rights reserved. 5# 6# %sccs.include.redist.sh% 7# 8# @(#)maketape 8.1 (Berkeley) 06/10/93 9# 10 11# maketape [ 6250 | 1600 [ tapename [ remotetapemachine ] ] ] 12miniroot=ra1b 13nbsd=ra1a 14nbsdusr=/mnt/usr/DISTUSR 15tape=/dev/rmt20 16type=6250 17block=40 18tflag=cbf 19bprog="/usr/local/20b 20480" 20 21if [ $# -gt 0 ]; then 22 type=$1; 23fi 24 25if [ $# -gt 1 ]; then 26 tape=$2; 27fi 28 29tartape=$tape 30if [ $# -gt 2 ]; then 31 remote=$3; 32 tartape='-'; 33fi 34 35rsh $remote mt -t ${tape} rew 36date 37#umount /dev/$nbsdusr 38umount /dev/$nbsd 39mount -r /dev/$nbsd /nbsd 40#mount -r /dev/$nbsdusr /nbsd/usr 41cd /nbsd 42sync 43 44if [ $type = '1600a' ] 45then 46 type=1600 47fi 48 49cd /nbsd/sys/vaxdist/tp 50tp cmf /tmp/tape.$$ boot copy format 51cd /nbsd/sys/mdec 52echo "Build 1st level boot block file" 53cat tsboot htboot tmboot mtboot utboot noboot noboot /tmp/tape.$$ | \ 54 rsh $remote dd of=${tape} obs=512 conv=sync 55 56echo "Add image of mini-root file system" 57eval dd if=/dev/r${miniroot} count=205 bs=20b conv=sync ${remote+"| rsh"} \ 58 ${remote-"of=$tape"} ${remote+'/usr/local/20b ">" $tape'} 59 60echo "Add full dump of real file system" 61/sbin/${remote+r}dump 0f $remote${remote+:}${tape} /dev/r${nbsd} 62 63echo "Add tar image of /usr" 64cd ${nbsdusr} 65tar ${tflag} ${block} ${tartape} bin contrib games include lib libdata \ 66 libexec local mdec obj old sbin share | rsh $remote ${bprog} ">" $tape 67 68if [ ${type} != '6250' ] 69then 70 echo "Done, rewinding first tape" 71 rsh $remote mt -t ${tape} rew & 72 echo "Mount second tape and hit return when ready" 73 echo "(or type name of next tape drive)" 74 read x 75 if [ "$x" != "" ] 76 then tape=$x 77 fi 78fi 79 80: tape2: 81echo "Add user source code" 82FILES="Makefile bin etc games include kerberosIV lib libexec old \ 83 pgrm sbin share usr.bin usr.sbin" 84cd /nbsd/usr/src 85tar ${tflag} ${block} ${tartape} ${FILES} | rsh $remote ${bprog} ">" $tape 86 87if [ ${type} != '6250' ] 88then 89 echo "Done, rewinding second tape" 90 $remote mt -t ${tape} rew & 91 echo "Mount third tape and hit return when ready" 92 echo "(or type name of next tape drive)" 93 read x 94 if [ "$x" != "" ] 95 then tape=$x 96 fi 97fi 98 99: tape3: 100echo "Add tar image of system sources" 101cd /nbsd/usr/src/sys 102tar ${tflag} ${block} ${tartape} . | rsh $remote ${bprog} ">" $tape 103 104echo "Add user contributed software" 105# standard (always uncompressed) directories: 106FILES="Makefile Makefile.inc ansi bib emacs emacs-18.55.tar.Z jove kermit \ 107 mh.tar.Z patch rcs vmsprep" 108cd /nbsd/usr/src/contrib 109tar ${tflag} ${block} ${tartape} ${FILES} | rsh $remote ${bprog} ">" $tape 110 111 112echo "Done, rewinding tape" 113rsh $remote mt -t ${tape} rew & 114