|
|
1.1 root 1: #!/bin/sh
2: #
3: # Copyright (c) 1983 Regents of the University of California.
4: # All rights reserved. The Berkeley software License Agreement
5: # specifies the terms and conditions for redistribution.
6: #
7: # @(#)get 4.25 (Berkeley) 6/6/86
8: #
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"
13: # step in a cold boot of 4.3 systems.
14: #
15: DISTROOT=/nbsd
16: #
17: if [ `pwd` = '/' ]
18: then
19: echo You just '(almost)' destroyed the root
20: exit
21: fi
22: cp $DISTROOT/sys/GENERIC/vmunix .
23: rm -rf bin; mkdir bin
24: rm -rf etc; mkdir etc
25: rm -rf a; mkdir a
26: rm -rf tmp; mkdir tmp
27: rm -rf usr; mkdir usr usr/mdec
28: rm -rf sys; mkdir sys sys/floppy sys/cassette sys/consolerl
29: cp $DISTROOT/etc/disktab etc
30: cp $DISTROOT/etc/newfs etc
31: cp $DISTROOT/etc/mkfs etc
32: cp $DISTROOT/etc/restore etc
33: cp $DISTROOT/etc/init etc
34: cp $DISTROOT/etc/mount etc
35: cp $DISTROOT/etc/mknod etc
36: cp $DISTROOT/etc/fsck etc
37: cp $DISTROOT/etc/umount etc
38: cp $DISTROOT/etc/arff etc
39: cp $DISTROOT/etc/flcopy etc
40: cp $DISTROOT/bin/mt bin
41: cp $DISTROOT/bin/ls bin
42: cp $DISTROOT/bin/sh bin
43: cp $DISTROOT/bin/mv bin
44: cp $DISTROOT/bin/sync bin
45: cp $DISTROOT/bin/cat bin
46: cp $DISTROOT/bin/mkdir bin
47: cp $DISTROOT/bin/stty bin; ln bin/stty bin/STTY
48: cp $DISTROOT/bin/echo bin
49: cp $DISTROOT/bin/rm bin
50: cp $DISTROOT/bin/cp bin
51: cp $DISTROOT/bin/expr bin
52: cp $DISTROOT/bin/[ bin
53: cp $DISTROOT/bin/awk bin
54: cp $DISTROOT/bin/make bin
55: cp $DISTROOT/usr/mdec/* usr/mdec
56: cp $DISTROOT/sys/floppy/[Ma-z0-9]* sys/floppy
57: cp $DISTROOT/sys/consolerl/[Ma-z0-9]* sys/consolerl
58: cp -r $DISTROOT/sys/cassette/[Ma-z0-9]* sys/cassette
59: cp $DISTROOT/sys/stand/boot boot
60: cp $DISTROOT/sys/stand/pcs750.bin pcs750.bin
61: cp $DISTROOT/.profile .profile
62: cat >etc/passwd <<EOF
63: root::0:10::/:/bin/sh
64: EOF
65: cat >etc/group <<EOF
66: wheel:*:0:
67: staff:*:10:
68: EOF
69: cat >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
75: EOF
76: cat >xtr <<'EOF'
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'}
80: echo 'Build root file system'
81: newfs ${disk}a ${type}
82: sync
83: echo 'Check the file system'
84: fsck /dev/r${disk}a
85: mount /dev/${disk}a /a
86: cd /a
87: echo 'Rewind tape'
88: mt -f /dev/${tape}0 rew
89: echo 'Restore the dump image of the root'
90: restore rsf 3 /dev/${tape}0
91: cd /
92: sync
93: umount /dev/${disk}a
94: sync
95: fsck /dev/r${disk}a
96: echo 'Root filesystem extracted'
97: echo
98: echo 'If this is an 8650 or 8600, update the console rl02'
99: echo 'If this is a 780 or 785, update the floppy'
100: echo 'If this is a 730, update the cassette'
101: EOF
102: chmod +x xtr
103: rm -rf dev; mkdir dev
104: cp $DISTROOT/sys/dist/MAKEDEV dev
105: chmod +x dev/MAKEDEV
106: cp /dev/null dev/MAKEDEV.local
107: cd 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*;
112: ./MAKEDEV ut0; mv rmt12 ut0; rm *mt*;
113: ./MAKEDEV mt0; mv rmt12 xt0; rm *mt*; mv xt0 mt0
114: cd ..
115: sync
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.