BSD 4_3_Reno release
[unix-history] / usr / src / sys / vaxdist / get
CommitLineData
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
28DISTROOT=/mnt
29DISTUSR=/mnt/usr/DISTUSR
30
e2973259
SL
31if [ `pwd` = '/' ]
32then
33 echo You just '(almost)' destroyed the root
34 exit
35fi
7860f7bc
TH
36cp /tmp/stripped_vmunix vmunix
37
38# create necessary directories
39DIRLIST="bin dev etc a tmp stand sbin usr usr/mdec sys sys/floppy \
40 sys/cassette sys/consolerl"
41rm -rf $DIRLIST
42mkdir $DIRLIST
43
44ETC="disktab"
45for i in $ETC; do
46 cp $DISTROOT/etc/$i etc/$i
47done
48
49# disklabel
50SBIN="fsck ifconfig init mknod mount newfs restore \
51 rrestore umount"
52USBIN="arff flcopy"
53for i in $SBIN; do
54 cp $DISTROOT/sbin/$i sbin/$i
55done
56for i in $USBIN; do
57 cp $DISTUSR/sbin/$i sbin/$i
58done
59
60# ed
61BIN="[ cat cp dd echo expr ls mkdir mv rcp rm sh stty sync"
62UBIN="awk make mt"
63for i in $BIN; do
64 cp $DISTROOT/bin/$i bin/$i
65done
66for i in $UBIN; do
67 cp $DISTUSR/bin/$i bin/$i
68done
69ln bin/stty bin/STTY
70
71cp /nbsd/sys/floppy/[Ma-z0-9]* sys/floppy
72cp /nbsd/sys/consolerl/[Ma-z0-9]* sys/consolerl
73#cp -r /nbsd/sys/cassette/[Ma-z0-9]* sys/cassette
74cp /nbsd/sys/cassette/[Ma-z0-9]* sys/cassette
75cp $DISTROOT/boot boot
76cp $DISTROOT/pcs750.bin pcs750.bin
157748eb 77cp $DISTROOT/.profile .profile
7860f7bc 78
aa9df5c4
SL
79cat >etc/passwd <<EOF
80root::0:10::/:/bin/sh
81EOF
7860f7bc 82
aa9df5c4 83cat >etc/group <<EOF
157748eb 84wheel:*:0:
aa9df5c4
SL
85staff:*:10:
86EOF
7860f7bc 87
e2973259
SL
88cat >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
94EOF
7860f7bc 95
e2973259 96cat >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 100echo 'Build root file system'
ed504d30 101newfs ${disk}a ${type}
e2973259 102sync
4d286db3 103echo 'Check the file system'
ed504d30
SL
104fsck /dev/r${disk}a
105mount /dev/${disk}a /a
157748eb 106cd /a
4d286db3 107echo 'Rewind tape'
a94e4ab0 108mt -f /dev/${tape}0 rew
4d286db3 109echo 'Restore the dump image of the root'
f4902232 110restore rsf 3 /dev/${tape}0
157748eb 111cd /
e2973259 112sync
ed504d30 113umount /dev/${disk}a
e2973259 114sync
ed504d30 115fsck /dev/r${disk}a
e2973259
SL
116echo 'Root filesystem extracted'
117echo
8e4459f4 118echo 'If this is an 8650 or 8600, update the console rl02'
fe9e0195 119echo 'If this is a 780 or 785, update the floppy'
e2973259
SL
120echo 'If this is a 730, update the cassette'
121EOF
122chmod +x xtr
123rm -rf dev; mkdir dev
7860f7bc 124cp $DISTROOT/dev/MAKEDEV dev
157748eb 125chmod +x dev/MAKEDEV
aa9df5c4 126cp /dev/null dev/MAKEDEV.local
e2973259
SL
127cd 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
134cd ..
135sync