Commit | Line | Data |
---|---|---|
7860f7bc | 1 | #!/bin/sh - |
b1078c35 | 2 | # |
7860f7bc TH |
3 | # Copyright (c) 1990 The Regents of the University of California. |
4 | # All rights reserved. | |
b1078c35 | 5 | # |
1c15e888 C |
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. | |
157748eb | 19 | # |
1c15e888 | 20 | # @(#)get 4.27 (Berkeley) 7/5/90 |
157748eb | 21 | # |
7860f7bc TH |
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 | ||
e2973259 SL |
31 | if [ `pwd` = '/' ] |
32 | then | |
33 | echo You just '(almost)' destroyed the root | |
34 | exit | |
35 | fi | |
7860f7bc TH |
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 | |
157748eb | 77 | cp $DISTROOT/.profile .profile |
7860f7bc | 78 | |
aa9df5c4 SL |
79 | cat >etc/passwd <<EOF |
80 | root::0:10::/:/bin/sh | |
81 | EOF | |
7860f7bc | 82 | |
aa9df5c4 | 83 | cat >etc/group <<EOF |
157748eb | 84 | wheel:*:0: |
aa9df5c4 SL |
85 | staff:*:10: |
86 | EOF | |
7860f7bc | 87 | |
e2973259 SL |
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 | |
7860f7bc | 95 | |
e2973259 | 96 | cat >xtr <<'EOF' |
ed504d30 SL |
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'} | |
4d286db3 | 100 | echo 'Build root file system' |
ed504d30 | 101 | newfs ${disk}a ${type} |
e2973259 | 102 | sync |
4d286db3 | 103 | echo 'Check the file system' |
ed504d30 SL |
104 | fsck /dev/r${disk}a |
105 | mount /dev/${disk}a /a | |
157748eb | 106 | cd /a |
4d286db3 | 107 | echo 'Rewind tape' |
a94e4ab0 | 108 | mt -f /dev/${tape}0 rew |
4d286db3 | 109 | echo 'Restore the dump image of the root' |
f4902232 | 110 | restore rsf 3 /dev/${tape}0 |
157748eb | 111 | cd / |
e2973259 | 112 | sync |
ed504d30 | 113 | umount /dev/${disk}a |
e2973259 | 114 | sync |
ed504d30 | 115 | fsck /dev/r${disk}a |
e2973259 SL |
116 | echo 'Root filesystem extracted' |
117 | echo | |
8e4459f4 | 118 | echo 'If this is an 8650 or 8600, update the console rl02' |
fe9e0195 | 119 | echo 'If this is a 780 or 785, update the floppy' |
e2973259 SL |
120 | echo 'If this is a 730, update the cassette' |
121 | EOF | |
122 | chmod +x xtr | |
123 | rm -rf dev; mkdir dev | |
7860f7bc | 124 | cp $DISTROOT/dev/MAKEDEV dev |
157748eb | 125 | chmod +x dev/MAKEDEV |
aa9df5c4 | 126 | cp /dev/null dev/MAKEDEV.local |
e2973259 SL |
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*; | |
ed001f41 | 132 | ./MAKEDEV ut0; mv rmt12 ut0; rm *mt*; |
809429f0 | 133 | ./MAKEDEV mt0; mv rmt12 xt0; rm *mt*; mv xt0 mt0 |
e2973259 SL |
134 | cd .. |
135 | sync |