|
|
1.1 root 1: #! /bin/sh
2: # @(#)get 4.13 7/19/83
3: #
4: # Shell script to build a mini-root file system
5: # in preparation for building a distribution tape.
6: # The file system created here is image copied onto
7: # tape, then image copied onto disk as the "first"
8: # step in a cold boot of 4.2 systems.
9: #
10: DISTROOT=/nbsd
11: #
12: if [ `pwd` = '/' ]
13: then
14: echo You just '(almost)' destroyed the root
15: exit
16: fi
17: cp $DISTROOT/a/sys/GENERIC/vmunix .
18: rm -rf bin; mkdir bin
19: rm -rf etc; mkdir etc
20: rm -rf a; mkdir a
21: rm -rf tmp; mkdir tmp
22: rm -rf usr; mkdir usr usr/mdec
23: rm -rf sys; mkdir sys sys/floppy sys/cassette
24: cp $DISTROOT/etc/disktab etc
25: cp $DISTROOT/etc/newfs etc; strip etc/newfs
26: cp $DISTROOT/etc/mkfs etc; strip etc/mkfs
27: cp $DISTROOT/etc/restore etc; strip etc/restore
28: cp $DISTROOT/etc/init etc; strip etc/init
29: cp $DISTROOT/etc/mount etc; strip etc/mount
30: cp $DISTROOT/etc/mknod etc; strip etc/mknod
31: cp $DISTROOT/etc/fsck etc; strip etc/fsck
32: cp $DISTROOT/etc/umount etc; strip etc/umount
33: cp $DISTROOT/etc/arff etc; strip etc/arff
34: cp $DISTROOT/etc/flcopy etc; strip etc/flcopy
35: cp $DISTROOT/bin/mt bin; strip bin/mt
36: cp $DISTROOT/bin/ls bin; strip bin/ls
37: cp $DISTROOT/bin/sh bin; strip bin/sh
38: cp $DISTROOT/bin/mv bin; strip bin/mv
39: cp $DISTROOT/bin/sync bin; strip bin/sync
40: cp $DISTROOT/bin/cat bin; strip bin/cat
41: cp $DISTROOT/bin/mkdir bin; strip bin/mkdir
42: cp $DISTROOT/bin/stty bin; strip bin/stty; ln bin/stty bin/STTY
43: cp $DISTROOT/bin/echo bin; strip bin/echo
44: cp $DISTROOT/bin/rm bin; strip bin/rm
45: cp $DISTROOT/bin/cp bin; strip bin/cp
46: cp $DISTROOT/bin/expr bin; strip bin/expr
47: cp $DISTROOT/bin/awk bin; strip bin/awk
48: cp $DISTROOT/bin/make bin; strip bin/make
49: cp $DISTROOT/usr/mdec/* usr/mdec
50: cp $DISTROOT/a/sys/floppy/[Ma-z0-9]* sys/floppy
51: cp $DISTROOT/a/sys/cassette/[Ma-z0-9]* sys/cassette
52: cp $DISTROOT/a/sys/stand/boot boot
53: cp $DISTROOT/.profile .profile
54: cat >etc/passwd <<EOF
55: root::0:10::/:/bin/sh
56: EOF
57: cat >etc/group <<EOF
58: wheel:*:0:
59: staff:*:10:
60: EOF
61: cat >etc/fstab <<EOF
62: /dev/hp0a:/a:xx:1:1
63: /dev/up0a:/a:xx:1:1
64: /dev/hk0a:/a:xx:1:1
65: /dev/ra0a:/a:xx:1:1
66: /dev/rb0a:/a:xx:1:1
67: EOF
68: cat >xtr <<'EOF'
69: : ${disk?'Usage: disk=xx0 type=tt tape=yy xtr'}
70: : ${type?'Usage: disk=xx0 type=tt tape=yy xtr'}
71: : ${tape?'Usage: disk=xx0 type=tt tape=yy xtr'}
72: echo 'Build root file system'
73: newfs ${disk}a ${type}
74: sync
75: echo 'Check the file system'
76: fsck /dev/r${disk}a
77: mount /dev/${disk}a /a
78: cd /a
79: echo 'Rewind tape'
80: mt -t /dev/${tape}0 rew
81: echo 'Restore the dump image of the root'
82: restore rsf 3 /dev/${tape}0
83: cd /
84: sync
85: umount /dev/${disk}a
86: sync
87: fsck /dev/r${disk}a
88: echo 'Root filesystem extracted'
89: echo
90: echo 'If this is a 780, update floppy'
91: echo 'If this is a 730, update the cassette'
92: EOF
93: chmod +x xtr
94: rm -rf dev; mkdir dev
95: cp $DISTROOT/sys/dist/MAKEDEV dev
96: chmod +x dev/MAKEDEV
97: cp /dev/null dev/MAKEDEV.local
98: cd dev
99: ./MAKEDEV std hp0 hk0 up0 ra0 rb0
100: ./MAKEDEV ts0; mv rmt12 ts0; rm *mt*;
101: ./MAKEDEV tm0; mv rmt12 tm0; rm *mt*;
102: ./MAKEDEV ht0; mv rmt12 ht0; rm *mt*;
103: ./MAKEDEV ut0; mv rmt12 ut0; rm *mt*;
104: ./MAKEDEV mt0; mv rmt4 xt0; rm *mt*; mv xt0 mt0
105: cd ..
106: sync
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.