Commit | Line | Data |
---|---|---|
5a3cd8f3 | 1 | #!/bin/sh |
b1078c35 | 2 | # |
8e477dea | 3 | # Copyright (c) 1983 Regents of the University of California. |
b1078c35 KM |
4 | # All rights reserved. The Berkeley software License Agreement |
5 | # specifies the terms and conditions for redistribution. | |
6 | # | |
eb2d9c6c | 7 | # @(#)get 4.26 (Berkeley) %G% |
157748eb | 8 | # |
e2973259 SL |
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" | |
8e477dea | 13 | # step in a cold boot of 4.3 systems. |
e2973259 | 14 | # |
157748eb SL |
15 | DISTROOT=/nbsd |
16 | # | |
e2973259 SL |
17 | if [ `pwd` = '/' ] |
18 | then | |
19 | echo You just '(almost)' destroyed the root | |
20 | exit | |
21 | fi | |
5a3cd8f3 | 22 | cp $DISTROOT/sys/GENERIC/vmunix . |
e2973259 SL |
23 | rm -rf bin; mkdir bin |
24 | rm -rf etc; mkdir etc | |
25 | rm -rf a; mkdir a | |
edd8b1e6 SL |
26 | rm -rf tmp; mkdir tmp |
27 | rm -rf usr; mkdir usr usr/mdec | |
13ea6bc1 | 28 | rm -rf sys; mkdir sys sys/floppy sys/cassette sys/consolerl |
157748eb | 29 | cp $DISTROOT/etc/disktab etc |
8e477dea MK |
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 | |
eb2d9c6c | 41 | cp $DISTROOT/bin/ed bin |
8e477dea MK |
42 | cp $DISTROOT/bin/ls bin |
43 | cp $DISTROOT/bin/sh bin | |
44 | cp $DISTROOT/bin/mv bin | |
45 | cp $DISTROOT/bin/sync bin | |
46 | cp $DISTROOT/bin/cat bin | |
47 | cp $DISTROOT/bin/mkdir bin | |
48 | cp $DISTROOT/bin/stty bin; ln bin/stty bin/STTY | |
49 | cp $DISTROOT/bin/echo bin | |
50 | cp $DISTROOT/bin/rm bin | |
51 | cp $DISTROOT/bin/cp bin | |
52 | cp $DISTROOT/bin/expr bin | |
53 | cp $DISTROOT/bin/[ bin | |
54 | cp $DISTROOT/bin/awk bin | |
55 | cp $DISTROOT/bin/make bin | |
157748eb | 56 | cp $DISTROOT/usr/mdec/* usr/mdec |
5a3cd8f3 | 57 | cp $DISTROOT/sys/floppy/[Ma-z0-9]* sys/floppy |
13ea6bc1 | 58 | cp $DISTROOT/sys/consolerl/[Ma-z0-9]* sys/consolerl |
68ab3038 | 59 | cp -r $DISTROOT/sys/cassette/[Ma-z0-9]* sys/cassette |
5a3cd8f3 | 60 | cp $DISTROOT/sys/stand/boot boot |
db965a92 | 61 | cp $DISTROOT/sys/stand/pcs750.bin pcs750.bin |
157748eb | 62 | cp $DISTROOT/.profile .profile |
aa9df5c4 SL |
63 | cat >etc/passwd <<EOF |
64 | root::0:10::/:/bin/sh | |
65 | EOF | |
66 | cat >etc/group <<EOF | |
157748eb | 67 | wheel:*:0: |
aa9df5c4 SL |
68 | staff:*:10: |
69 | EOF | |
e2973259 SL |
70 | cat >etc/fstab <<EOF |
71 | /dev/hp0a:/a:xx:1:1 | |
72 | /dev/up0a:/a:xx:1:1 | |
73 | /dev/hk0a:/a:xx:1:1 | |
74 | /dev/ra0a:/a:xx:1:1 | |
75 | /dev/rb0a:/a:xx:1:1 | |
76 | EOF | |
77 | cat >xtr <<'EOF' | |
ed504d30 SL |
78 | : ${disk?'Usage: disk=xx0 type=tt tape=yy xtr'} |
79 | : ${type?'Usage: disk=xx0 type=tt tape=yy xtr'} | |
80 | : ${tape?'Usage: disk=xx0 type=tt tape=yy xtr'} | |
4d286db3 | 81 | echo 'Build root file system' |
ed504d30 | 82 | newfs ${disk}a ${type} |
e2973259 | 83 | sync |
4d286db3 | 84 | echo 'Check the file system' |
ed504d30 SL |
85 | fsck /dev/r${disk}a |
86 | mount /dev/${disk}a /a | |
157748eb | 87 | cd /a |
4d286db3 | 88 | echo 'Rewind tape' |
a94e4ab0 | 89 | mt -f /dev/${tape}0 rew |
4d286db3 | 90 | echo 'Restore the dump image of the root' |
f4902232 | 91 | restore rsf 3 /dev/${tape}0 |
157748eb | 92 | cd / |
e2973259 | 93 | sync |
ed504d30 | 94 | umount /dev/${disk}a |
e2973259 | 95 | sync |
ed504d30 | 96 | fsck /dev/r${disk}a |
e2973259 SL |
97 | echo 'Root filesystem extracted' |
98 | echo | |
8e4459f4 | 99 | echo 'If this is an 8650 or 8600, update the console rl02' |
fe9e0195 | 100 | echo 'If this is a 780 or 785, update the floppy' |
e2973259 SL |
101 | echo 'If this is a 730, update the cassette' |
102 | EOF | |
103 | chmod +x xtr | |
104 | rm -rf dev; mkdir dev | |
157748eb SL |
105 | cp $DISTROOT/sys/dist/MAKEDEV dev |
106 | chmod +x dev/MAKEDEV | |
aa9df5c4 | 107 | cp /dev/null dev/MAKEDEV.local |
e2973259 SL |
108 | cd dev |
109 | ./MAKEDEV std hp0 hk0 up0 ra0 rb0 | |
110 | ./MAKEDEV ts0; mv rmt12 ts0; rm *mt*; | |
111 | ./MAKEDEV tm0; mv rmt12 tm0; rm *mt*; | |
112 | ./MAKEDEV ht0; mv rmt12 ht0; rm *mt*; | |
ed001f41 | 113 | ./MAKEDEV ut0; mv rmt12 ut0; rm *mt*; |
809429f0 | 114 | ./MAKEDEV mt0; mv rmt12 xt0; rm *mt*; mv xt0 mt0 |
e2973259 SL |
115 | cd .. |
116 | sync |