|
|
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 1.7 (Berkeley) 7/4/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 of
26: # 4.3BSD systems.
27: #
28: DISTROOT=/nbsd
29: #
30: if [ `pwd` = '/' ]
31: then
32: echo You just '(almost)' destroyed the root
33: exit
34: fi
35:
36: # copy in kernel
37: cp $DISTROOT/sys/GENERIC.alltahoe/vmunix .
38:
39: # create necessary directories
40: DIRLIST="bin dev etc a tmp stand sbin"
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: SBIN="disklabel fsck ifconfig init mknod mount newfs restore \
50: rrestore umount"
51: for i in $SBIN; do
52: cp $DISTROOT/sbin/$i sbin/$i
53: done
54:
55: BIN="[ cat cp dd echo ed expr ls mkdir mv rcp rm sh stty sync"
56: UBIN="awk make mt"
57: for i in $BIN; do
58: cp $DISTROOT/bin/$i bin/$i
59: done
60: for i in $UBIN; do
61: cp $DISTROOT/usr/bin/$i bin/$i
62: done
63: ln bin/stty bin/STTY
64:
65: STAND="copy vdformat"
66: for i in $STAND; do
67: cp $DISTROOT/stand/$i stand/$i
68: done
69:
70: DOT=".profile boot fppoc fppwcs poc poc1 poc2 wcs"
71: #DOT=".profile boot"
72: for i in $DOT; do
73: cp $DISTROOT/$i $i
74: done
75:
76: # initialize /dev
77: cp $DISTROOT/dev/MAKEDEV dev/MAKEDEV
78: chmod +x dev/MAKEDEV
79: cp /dev/null dev/MAKEDEV.local
80: (cd dev; ./MAKEDEV std hd0; ./MAKEDEV cy0; mv rmt12 cy0; rm *mt*)
81:
82: # initialize /etc/passwd
83: cat >etc/passwd <<EOF
84: root::0:10::/:/bin/sh
85: EOF
86:
87: # initialize /etc/group
88: cat >etc/group <<EOF
89: wheel:*:0:
90: staff:*:10:
91: EOF
92:
93: # initialize /etc/fstab
94: cat >etc/fstab <<EOF
95: /dev/xfd0a:/a:xx:1:1
96: /dev/hd0a:/a:xx:1:1
97: EOF
98:
99: # create xtr script
100: cat >xtr <<'EOF'
101: #!/bin/sh -e
102: : ${disk?'Usage: disk=xx0 tape=yy xtr'}
103: : ${tape?'Usage: disk=xx0 tape=yy xtr'}
104: echo 'Build root file system'
105: newfs ${disk}a
106: sync
107: echo 'Check the file system'
108: fsck /dev/r${disk}a
109: mount /dev/${disk}a /a
110: cd /a
111: echo 'Rewind tape'
112: mt -f /dev/${tape}0 rew
113: echo 'Restore the dump image of the root'
114: restore rsf 3 /dev/${tape}0
115: cd /
116: sync
117: umount /a
118: sync
119: fsck /dev/r${disk}a
120: echo 'Root filesystem extracted'
121: EOF
122:
123: # make xtr script executable
124: chmod +x xtr
125:
126: sync
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.