|
|
1.1 root 1: #!/bin/sh -
2: #
3: # Copyright (c) 1990 The Regents of the University of California.
4: # All rights reserved.
5: #
6: # Redistribution and use in source and binary forms, with or without
7: # modification, are permitted provided that the following conditions
8: # are met:
9: # 1. Redistributions of source code must retain the above copyright
10: # notice, this list of conditions and the following disclaimer.
11: # 2. Redistributions in binary form must reproduce the above copyright
12: # notice, this list of conditions and the following disclaimer in the
13: # documentation and/or other materials provided with the distribution.
14: # 3. All advertising materials mentioning features or use of this software
15: # must display the following acknowledgement:
16: # This product includes software developed by the University of
17: # California, Berkeley and its contributors.
18: # 4. Neither the name of the University nor the names of its contributors
19: # may be used to endorse or promote products derived from this software
20: # without specific prior written permission.
21: #
22: # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23: # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24: # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25: # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26: # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27: # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28: # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29: # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30: # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31: # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32: # SUCH DAMAGE.
33: #
34: # @(#)get 4.27 (Berkeley) 7/5/90
35: #
36:
37: # Shell script to build a mini-root file system in preparation for building
38: # a distribution tape. The file system created here is image copied onto
39: # tape, then image copied onto disk as the "first" step in a cold boot o
40: # 4.3 systems.
41:
42: DISTROOT=/mnt
43: DISTUSR=/mnt/usr/DISTUSR
44:
45: if [ `pwd` = '/' ]
46: then
47: echo You just '(almost)' destroyed the root
48: exit
49: fi
50: cp /tmp/stripped_vmunix vmunix
51:
52: # create necessary directories
53: DIRLIST="bin dev etc a tmp stand sbin usr usr/mdec sys sys/floppy \
54: sys/cassette sys/consolerl"
55: rm -rf $DIRLIST
56: mkdir $DIRLIST
57:
58: ETC="disktab"
59: for i in $ETC; do
60: cp $DISTROOT/etc/$i etc/$i
61: done
62:
63: # disklabel
64: SBIN="fsck ifconfig init mknod mount newfs restore \
65: rrestore umount"
66: USBIN="arff flcopy"
67: for i in $SBIN; do
68: cp $DISTROOT/sbin/$i sbin/$i
69: done
70: for i in $USBIN; do
71: cp $DISTUSR/sbin/$i sbin/$i
72: done
73:
74: # ed
75: BIN="[ cat cp dd echo expr ls mkdir mv rcp rm sh stty sync"
76: UBIN="awk make mt"
77: for i in $BIN; do
78: cp $DISTROOT/bin/$i bin/$i
79: done
80: for i in $UBIN; do
81: cp $DISTUSR/bin/$i bin/$i
82: done
83: ln bin/stty bin/STTY
84:
85: cp /nbsd/sys/floppy/[Ma-z0-9]* sys/floppy
86: cp /nbsd/sys/consolerl/[Ma-z0-9]* sys/consolerl
87: #cp -r /nbsd/sys/cassette/[Ma-z0-9]* sys/cassette
88: cp /nbsd/sys/cassette/[Ma-z0-9]* sys/cassette
89: cp $DISTROOT/boot boot
90: cp $DISTROOT/pcs750.bin pcs750.bin
91: cp $DISTROOT/.profile .profile
92:
93: cat >etc/passwd <<EOF
94: root::0:10::/:/bin/sh
95: EOF
96:
97: cat >etc/group <<EOF
98: wheel:*:0:
99: staff:*:10:
100: EOF
101:
102: cat >etc/fstab <<EOF
103: /dev/hp0a:/a:xx:1:1
104: /dev/up0a:/a:xx:1:1
105: /dev/hk0a:/a:xx:1:1
106: /dev/ra0a:/a:xx:1:1
107: /dev/rb0a:/a:xx:1:1
108: EOF
109:
110: cat >xtr <<'EOF'
111: : ${disk?'Usage: disk=xx0 type=tt tape=yy xtr'}
112: : ${type?'Usage: disk=xx0 type=tt tape=yy xtr'}
113: : ${tape?'Usage: disk=xx0 type=tt tape=yy xtr'}
114: echo 'Build root file system'
115: newfs ${disk}a ${type}
116: sync
117: echo 'Check the file system'
118: fsck /dev/r${disk}a
119: mount /dev/${disk}a /a
120: cd /a
121: echo 'Rewind tape'
122: mt -f /dev/${tape}0 rew
123: echo 'Restore the dump image of the root'
124: restore rsf 3 /dev/${tape}0
125: cd /
126: sync
127: umount /dev/${disk}a
128: sync
129: fsck /dev/r${disk}a
130: echo 'Root filesystem extracted'
131: echo
132: echo 'If this is an 8650 or 8600, update the console rl02'
133: echo 'If this is a 780 or 785, update the floppy'
134: echo 'If this is a 730, update the cassette'
135: EOF
136: chmod +x xtr
137: rm -rf dev; mkdir dev
138: cp $DISTROOT/dev/MAKEDEV dev
139: chmod +x dev/MAKEDEV
140: cp /dev/null dev/MAKEDEV.local
141: cd dev
142: ./MAKEDEV std hp0 hk0 up0 ra0 rb0
143: ./MAKEDEV ts0; mv rmt12 ts0; rm *mt*;
144: ./MAKEDEV tm0; mv rmt12 tm0; rm *mt*;
145: ./MAKEDEV ht0; mv rmt12 ht0; rm *mt*;
146: ./MAKEDEV ut0; mv rmt12 ut0; rm *mt*;
147: ./MAKEDEV mt0; mv rmt12 xt0; rm *mt*; mv xt0 mt0
148: cd ..
149: sync
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.