fix files in /usr/src/new
[unix-history] / usr / src / sys / vax / dist / get
CommitLineData
5a3cd8f3 1#!/bin/sh
b1078c35
KM
2#
3# Copyright (c) 1980 Regents of the University of California.
4# All rights reserved. The Berkeley software License Agreement
5# specifies the terms and conditions for redistribution.
6#
8e4459f4 7# @(#)get 4.23 (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"
edd8b1e6 13# step in a cold boot of 4.2 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
a93e539e 30cp $DISTROOT/etc/newfs etc; strip etc/newfs
157748eb 31cp $DISTROOT/etc/mkfs etc; strip etc/mkfs
f4902232 32cp $DISTROOT/etc/restore etc; strip etc/restore
157748eb
SL
33cp $DISTROOT/etc/init etc; strip etc/init
34cp $DISTROOT/etc/mount etc; strip etc/mount
35cp $DISTROOT/etc/mknod etc; strip etc/mknod
36cp $DISTROOT/etc/fsck etc; strip etc/fsck
37cp $DISTROOT/etc/umount etc; strip etc/umount
38cp $DISTROOT/etc/arff etc; strip etc/arff
39cp $DISTROOT/etc/flcopy etc; strip etc/flcopy
40cp $DISTROOT/bin/mt bin; strip bin/mt
41cp $DISTROOT/bin/ls bin; strip bin/ls
42cp $DISTROOT/bin/sh bin; strip bin/sh
43cp $DISTROOT/bin/mv bin; strip bin/mv
44cp $DISTROOT/bin/sync bin; strip bin/sync
45cp $DISTROOT/bin/cat bin; strip bin/cat
46cp $DISTROOT/bin/mkdir bin; strip bin/mkdir
47cp $DISTROOT/bin/stty bin; strip bin/stty; ln bin/stty bin/STTY
48cp $DISTROOT/bin/echo bin; strip bin/echo
49cp $DISTROOT/bin/rm bin; strip bin/rm
50cp $DISTROOT/bin/cp bin; strip bin/cp
51cp $DISTROOT/bin/expr bin; strip bin/expr
754b1261 52cp $DISTROOT/bin/[ bin; strip bin/[
157748eb 53cp $DISTROOT/bin/awk bin; strip bin/awk
f4902232 54cp $DISTROOT/bin/make bin; strip bin/make
157748eb 55cp $DISTROOT/usr/mdec/* usr/mdec
5a3cd8f3 56cp $DISTROOT/sys/floppy/[Ma-z0-9]* sys/floppy
13ea6bc1 57cp $DISTROOT/sys/consolerl/[Ma-z0-9]* sys/consolerl
68ab3038 58cp -r $DISTROOT/sys/cassette/[Ma-z0-9]* sys/cassette
5a3cd8f3 59cp $DISTROOT/sys/stand/boot boot
db965a92 60cp $DISTROOT/sys/stand/pcs750.bin pcs750.bin
157748eb 61cp $DISTROOT/.profile .profile
aa9df5c4
SL
62cat >etc/passwd <<EOF
63root::0:10::/:/bin/sh
64EOF
65cat >etc/group <<EOF
157748eb 66wheel:*:0:
aa9df5c4
SL
67staff:*:10:
68EOF
e2973259
SL
69cat >etc/fstab <<EOF
70/dev/hp0a:/a:xx:1:1
71/dev/up0a:/a:xx:1:1
72/dev/hk0a:/a:xx:1:1
73/dev/ra0a:/a:xx:1:1
74/dev/rb0a:/a:xx:1:1
75EOF
76cat >xtr <<'EOF'
ed504d30
SL
77: ${disk?'Usage: disk=xx0 type=tt tape=yy xtr'}
78: ${type?'Usage: disk=xx0 type=tt tape=yy xtr'}
79: ${tape?'Usage: disk=xx0 type=tt tape=yy xtr'}
4d286db3 80echo 'Build root file system'
ed504d30 81newfs ${disk}a ${type}
e2973259 82sync
4d286db3 83echo 'Check the file system'
ed504d30
SL
84fsck /dev/r${disk}a
85mount /dev/${disk}a /a
157748eb 86cd /a
4d286db3 87echo 'Rewind tape'
a94e4ab0 88mt -f /dev/${tape}0 rew
4d286db3 89echo 'Restore the dump image of the root'
f4902232 90restore rsf 3 /dev/${tape}0
157748eb 91cd /
e2973259 92sync
ed504d30 93umount /dev/${disk}a
e2973259 94sync
ed504d30 95fsck /dev/r${disk}a
e2973259
SL
96echo 'Root filesystem extracted'
97echo
8e4459f4 98echo 'If this is an 8650 or 8600, update the console rl02'
fe9e0195 99echo 'If this is a 780 or 785, update the floppy'
e2973259
SL
100echo 'If this is a 730, update the cassette'
101EOF
102chmod +x xtr
103rm -rf dev; mkdir dev
157748eb
SL
104cp $DISTROOT/sys/dist/MAKEDEV dev
105chmod +x dev/MAKEDEV
aa9df5c4 106cp /dev/null dev/MAKEDEV.local
e2973259
SL
107cd dev
108./MAKEDEV std hp0 hk0 up0 ra0 rb0
109./MAKEDEV ts0; mv rmt12 ts0; rm *mt*;
110./MAKEDEV tm0; mv rmt12 tm0; rm *mt*;
111./MAKEDEV ht0; mv rmt12 ht0; rm *mt*;
ed001f41 112./MAKEDEV ut0; mv rmt12 ut0; rm *mt*;
e2973259
SL
113./MAKEDEV mt0; mv rmt4 xt0; rm *mt*; mv xt0 mt0
114cd ..
115sync