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