Reno tape -- separate TAHOE and HCX-9 stuff into two categories
[unix-history] / usr / src / sys / vax / dist / get
CommitLineData
5a3cd8f3 1#!/bin/sh
b1078c35 2#
8e477dea 3# Copyright (c) 1983 Regents of the University of California.
b1078c35
KM
4# All rights reserved. The Berkeley software License Agreement
5# specifies the terms and conditions for redistribution.
6#
eb2d9c6c 7# @(#)get 4.26 (Berkeley) %G%
157748eb 8#
e2973259
SL
9# Shell script to build a mini-root file system
10# in preparation for building a distribution tape.
11# The file system created here is image copied onto
12# tape, then image copied onto disk as the "first"
8e477dea 13# step in a cold boot of 4.3 systems.
e2973259 14#
157748eb
SL
15DISTROOT=/nbsd
16#
e2973259
SL
17if [ `pwd` = '/' ]
18then
19 echo You just '(almost)' destroyed the root
20 exit
21fi
5a3cd8f3 22cp $DISTROOT/sys/GENERIC/vmunix .
e2973259
SL
23rm -rf bin; mkdir bin
24rm -rf etc; mkdir etc
25rm -rf a; mkdir a
edd8b1e6
SL
26rm -rf tmp; mkdir tmp
27rm -rf usr; mkdir usr usr/mdec
13ea6bc1 28rm -rf sys; mkdir sys sys/floppy sys/cassette sys/consolerl
157748eb 29cp $DISTROOT/etc/disktab etc
8e477dea
MK
30cp $DISTROOT/etc/newfs etc
31cp $DISTROOT/etc/mkfs etc
32cp $DISTROOT/etc/restore etc
33cp $DISTROOT/etc/init etc
34cp $DISTROOT/etc/mount etc
35cp $DISTROOT/etc/mknod etc
36cp $DISTROOT/etc/fsck etc
37cp $DISTROOT/etc/umount etc
38cp $DISTROOT/etc/arff etc
39cp $DISTROOT/etc/flcopy etc
40cp $DISTROOT/bin/mt bin
eb2d9c6c 41cp $DISTROOT/bin/ed bin
8e477dea
MK
42cp $DISTROOT/bin/ls bin
43cp $DISTROOT/bin/sh bin
44cp $DISTROOT/bin/mv bin
45cp $DISTROOT/bin/sync bin
46cp $DISTROOT/bin/cat bin
47cp $DISTROOT/bin/mkdir bin
48cp $DISTROOT/bin/stty bin; ln bin/stty bin/STTY
49cp $DISTROOT/bin/echo bin
50cp $DISTROOT/bin/rm bin
51cp $DISTROOT/bin/cp bin
52cp $DISTROOT/bin/expr bin
53cp $DISTROOT/bin/[ bin
54cp $DISTROOT/bin/awk bin
55cp $DISTROOT/bin/make bin
157748eb 56cp $DISTROOT/usr/mdec/* usr/mdec
5a3cd8f3 57cp $DISTROOT/sys/floppy/[Ma-z0-9]* sys/floppy
13ea6bc1 58cp $DISTROOT/sys/consolerl/[Ma-z0-9]* sys/consolerl
68ab3038 59cp -r $DISTROOT/sys/cassette/[Ma-z0-9]* sys/cassette
5a3cd8f3 60cp $DISTROOT/sys/stand/boot boot
db965a92 61cp $DISTROOT/sys/stand/pcs750.bin pcs750.bin
157748eb 62cp $DISTROOT/.profile .profile
aa9df5c4
SL
63cat >etc/passwd <<EOF
64root::0:10::/:/bin/sh
65EOF
66cat >etc/group <<EOF
157748eb 67wheel:*:0:
aa9df5c4
SL
68staff:*:10:
69EOF
e2973259
SL
70cat >etc/fstab <<EOF
71/dev/hp0a:/a:xx:1:1
72/dev/up0a:/a:xx:1:1
73/dev/hk0a:/a:xx:1:1
74/dev/ra0a:/a:xx:1:1
75/dev/rb0a:/a:xx:1:1
76EOF
77cat >xtr <<'EOF'
ed504d30
SL
78: ${disk?'Usage: disk=xx0 type=tt tape=yy xtr'}
79: ${type?'Usage: disk=xx0 type=tt tape=yy xtr'}
80: ${tape?'Usage: disk=xx0 type=tt tape=yy xtr'}
4d286db3 81echo 'Build root file system'
ed504d30 82newfs ${disk}a ${type}
e2973259 83sync
4d286db3 84echo 'Check the file system'
ed504d30
SL
85fsck /dev/r${disk}a
86mount /dev/${disk}a /a
157748eb 87cd /a
4d286db3 88echo 'Rewind tape'
a94e4ab0 89mt -f /dev/${tape}0 rew
4d286db3 90echo 'Restore the dump image of the root'
f4902232 91restore rsf 3 /dev/${tape}0
157748eb 92cd /
e2973259 93sync
ed504d30 94umount /dev/${disk}a
e2973259 95sync
ed504d30 96fsck /dev/r${disk}a
e2973259
SL
97echo 'Root filesystem extracted'
98echo
8e4459f4 99echo 'If this is an 8650 or 8600, update the console rl02'
fe9e0195 100echo 'If this is a 780 or 785, update the floppy'
e2973259
SL
101echo 'If this is a 730, update the cassette'
102EOF
103chmod +x xtr
104rm -rf dev; mkdir dev
157748eb
SL
105cp $DISTROOT/sys/dist/MAKEDEV dev
106chmod +x dev/MAKEDEV
aa9df5c4 107cp /dev/null dev/MAKEDEV.local
e2973259
SL
108cd dev
109./MAKEDEV std hp0 hk0 up0 ra0 rb0
110./MAKEDEV ts0; mv rmt12 ts0; rm *mt*;
111./MAKEDEV tm0; mv rmt12 tm0; rm *mt*;
112./MAKEDEV ht0; mv rmt12 ht0; rm *mt*;
ed001f41 113./MAKEDEV ut0; mv rmt12 ut0; rm *mt*;
809429f0 114./MAKEDEV mt0; mv rmt12 xt0; rm *mt*; mv xt0 mt0
e2973259
SL
115cd ..
116sync