use new form of suser()
[unix-history] / usr / src / sys / tahoe / dist / maketape
CommitLineData
8249ff6a 1#!/bin/sh -
a15338de 2#
8249ff6a
KB
3# Copyright (c) 1988 Regents of the University of California.
4# All rights reserved.
a15338de 5#
8249ff6a
KB
6# Redistribution and use in source and binary forms are permitted
7# provided that the above copyright notice and this paragraph are
8# duplicated in all such forms and that any documentation,
9# advertising materials, and other materials related to such
10# distribution and use acknowledge that the software was developed
11# by the University of California, Berkeley. The name of the
12# University may not be used to endorse or promote products derived
13# from this software without specific prior written permission.
14# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
15# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
16# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
a15338de 17#
8249ff6a
KB
18# @(#)maketape 5.5 (Berkeley) %G%
19#
20
21# maketape [ 6250 | 1600 [ tapename [ remotetapemachine ] ] ]
a15338de 22miniroot=dk4a
0a5681aa 23bootroot=dk2b
a15338de
KM
24nbsd=dk1a
25nbsdusr=dk2c
db4af07e
MK
26tape=/dev/rmt20
27type=6250
0a5681aa
KB
28block=40
29tflag=cbf
30bprog="/usr/local/20b 20480"
a15338de
KM
31
32if [ $# -gt 0 ]; then type=$1; fi
33if [ $# -gt 1 ]; then tape=$2; fi
34tartape=$tape
35if [ $# -gt 2 ]; then remote=$3; tartape='-'; fi
36
37$remote mt -t ${tape} rew
38date
39umount /dev/$nbsdusr
40umount /dev/$nbsd
41mount -r /dev/$nbsd /nbsd
42mount -r /dev/$nbsdusr /nbsd/usr
43cd /nbsd
44sync
45
db4af07e
MK
46if [ $type = '1600a' ]
47then
48 type=1600
49fi
50
a15338de 51echo "Add image of bootstrap file system"
0a5681aa
KB
52eval dd if=/dev/r${bootroot} count=600 bs=1024 conv=sync ${remote+"| rsh"} \
53 ${remote-"of=$tape"} ${remote+'/usr/local/20b 1024 ">" $tape'}
db4af07e 54
a15338de 55echo "Add image of mini-root file system"
0a5681aa 56eval dd if=/dev/r${miniroot} count=205 bs=10240 conv=sync ${remote+"| rsh"} \
a15338de 57 ${remote-"of=$tape"} ${remote+'/usr/local/20b ">" $tape'}
db4af07e 58
a15338de
KM
59echo "Add full dump of real file system"
60/etc/${remote+r}dump 0uf $remote${remote+:}${tape} /nbsd
61echo "Add tar image of /usr"
0a5681aa 62cd /nbsd/usr; eval tar ${tflag} ${block} ${tartape} adm bin dict doc games \
a15338de
KM
63 guest hosts include lib local man msgs new \
64 preserve pub spool tmp ucb \
0a5681aa 65 ${remote+'| $remote ${bprog} ">" $tape'}
a15338de
KM
66if [ ${type} != '6250' ]
67then
68 echo "Done, rewinding first tape"
69 $remote mt -t ${tape} rew &
70 echo "Mount second tape and hit return when ready"
71 echo "(or type name of next tape drive)"
72 read x
73 if [ "$x" != "" ]
74 then tape=$x
75 fi
76fi
db4af07e
MK
77
78: tape2:
a15338de 79echo "Add user source code"
0a5681aa
KB
80cd /nbsd/usr/src; eval tar ${tflag} ${block} ${tartape} Makefile bin cci \
81 etc games include lib local man old ucb undoc usr.bin usr.lib \
82 ${remote+'| $remote ${bprog} ">" $tape'}
db4af07e 83
a15338de 84#echo "Add varian fonts"
0a5681aa
KB
85#cd /usr/lib/vfont; eval tar ${tflag} ${block} ${tartape} . \
86# ${remote+'| $remote ${bprog} ">" $tape'}
a15338de
KM
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
db4af07e
MK
98
99: tape3:
0a5681aa
KB
100echo "Add tar image of system sources"
101cd /nbsd/sys; eval tar ${tflag} ${block} ${tartape} . \
102 ${remote+'| $remote ${bprog} ">" $tape'}
103
a15338de 104echo "Add user contributed software"
db4af07e
MK
105# standard (always uncompressed) directories:
106new="README Makefile B X ansi apl bib courier cpm dipress dsh \
107 enet help hyper jove kermit mkmf news notes nntp np100 \
108 patch pathalias rcs rn spms sunrpc tac tools umodem xns"
109uncompress="emacs icon mh mmdf sumacc pup"
110compress="emacs.tar.Z icon.tar.Z mh.tar.Z mmdf.tar.Z sumacc.tar.Z pup.tar.Z"
0a5681aa
KB
111cd /nbsd/usr/src/new; eval tar ${tflag} ${block} ${tartape} ${new} \
112 ${compress} ${remote+'| $remote ${bprog} ">" $tape'}
db4af07e
MK
113
114#echo "Add ingres source"
0a5681aa
KB
115#cd /nbsd/usr/ingres; eval tar ${tflag} ${block} ${tartape} . \
116# ${remote+'| $remote ${bprog} ">" $tape'}
db4af07e 117
a15338de
KM
118echo "Done, rewinding tape"
119$remote mt -t ${tape} rew &