Commit | Line | Data |
---|---|---|
ed001f41 | 1 | #! /bin/sh |
ec6dea8c | 2 | # @(#)MAKEDEV 4.3 %G% |
cb946633 SL |
3 | # |
4 | # Device "make" file. Valid arguments: | |
5 | # std standard devices (for 730 must be followed by tu0 & tu1) | |
6 | # local configuration specific devices | |
7 | # Tapes: | |
8 | # ht* massbus tm03 & tu?? | |
9 | # tm* unibus tm11 & te10 emulations (e.g. Emulex tc-11) | |
10 | # ts* unibus ts11 | |
11 | # mt* massbus tu78 | |
12 | # ut* unibus tu45 emulations (e.g.si 9700) | |
13 | # tu* 730 tu58 console cassettes (tu0 in front, tu1 on side) | |
14 | # Disks: | |
15 | # hp* massbus rm?? | |
16 | # hk* unibus rk06 and rk07 | |
17 | # up* other unibus devices (e.g. on Emulex sc-21v controller) | |
18 | # ra* unibus uda50 w/ ra?? | |
19 | # rb* 730 idc w/ rb80 and/or rb02 | |
20 | # Terminal multiplexors: | |
21 | # dz* unibus dz11 and dz32 | |
22 | # dh* unibus dh11 and emulations (e.g. Able dmax, Emulex cs-11) | |
23 | # dmf* unibus dmf32 | |
24 | # Pseudo terminals: | |
25 | # pty* set of 16 master and slave pseudo terminals | |
26 | # Line printers: | |
27 | # lp* unibus lp11 parallel interface | |
28 | # Call units: | |
29 | # dn* unibus dn11 and emulations (e.g. Able Quadracall) | |
30 | umask 77 | |
31 | for i | |
32 | do | |
33 | case $i in | |
34 | ||
35 | std) | |
36 | /etc/mknod console c 0 0 | |
37 | /etc/mknod drum c 7 0 ; chmod 644 drum | |
38 | /etc/mknod floppy c 8 0 | |
39 | /etc/mknod kUmem c 3 3 ;: no one has ever tried using this | |
40 | /etc/mknod kmem c 3 1 ; chmod 644 kmem | |
41 | /etc/mknod mem c 3 0 ; chmod 644 mem | |
42 | /etc/mknod null c 3 2 ; chmod 666 null | |
43 | /etc/mknod tty c 2 0 ; chmod 666 tty | |
44 | ;; | |
45 | ||
46 | ht*|tm*|ts*|mt*|ut*) | |
47 | umask 0 ; unit=`expr $i : '..\(.*\)'` | |
48 | case $i in | |
49 | ht*) blk=1; chr=5 ;; | |
50 | tm*) blk=5; chr=14;; | |
51 | ts*) blk=6; chr=16;; | |
52 | mt*) blk=7; chr=19;; | |
53 | ut*) blk=10; chr=17;; | |
54 | esac | |
55 | case $unit in | |
56 | 0|1|2|3|4|5|6|7) | |
57 | four=`expr $unit + 4` ; eight=`expr $unit + 8` | |
58 | twelve=`expr $unit + 12`; twenty=`expr $unit + 20` | |
59 | /etc/mknod mt$unit b $blk $unit | |
60 | /etc/mknod mt$four b $blk $four | |
61 | /etc/mknod mt$eight b $blk $eight | |
62 | /etc/mknod mt$twelve b $blk $twelve | |
63 | /etc/mknod nmt$unit b $blk $four ;: sanity w/pdp11 v7 | |
64 | /etc/mknod nmt$eight b $blk $twelve ;: ditto | |
65 | /etc/mknod nrmt$unit c $chr $four ;: sanity w/pdp11 v7 | |
66 | /etc/mknod nrmt$eight c $chr $twelve ;: ditto | |
67 | /etc/mknod rmt$unit c $chr $unit | |
68 | /etc/mknod rmt$four c $chr $four | |
69 | /etc/mknod rmt$eight c $chr $eight | |
70 | /etc/mknod rmt$twelve c $chr $twelve | |
ed001f41 | 71 | if [ $i = ut ] |
cb946633 SL |
72 | then |
73 | /etc/mknod mt$twelve b $blk $twenty | |
74 | /etc/mknod rmt$twenty c $chr $twenty | |
75 | fi | |
76 | umask 77 | |
77 | ;; | |
78 | *) | |
79 | bad unit for tape in: $1 | |
80 | ;; | |
81 | esac | |
82 | ;; | |
83 | ||
84 | hp*|hk*|up*|ra*|rb*) | |
85 | unit=`expr $i : '..\(.*\)'` | |
86 | case $i in | |
87 | hp*) name=hp; blk=0; chr=4;; | |
88 | hk*) name=hk; blk=3; chr=11;; | |
89 | up*) name=up; blk=2; chr=13;; | |
90 | ra*) name=ra; blk=9; chr=9;; | |
91 | rb*) name=rb; blk=13; chr=23;; | |
92 | esac | |
93 | case $unit in | |
94 | 0|1|2|3|4|5|6|7) | |
95 | /etc/mknod ${name}${unit}a b $blk `expr $unit '*' 8 + 0` | |
96 | /etc/mknod ${name}${unit}b b $blk `expr $unit '*' 8 + 1` | |
97 | /etc/mknod ${name}${unit}c b $blk `expr $unit '*' 8 + 2` | |
98 | /etc/mknod ${name}${unit}g b $blk `expr $unit '*' 8 + 6` | |
99 | /etc/mknod r${name}${unit}a c $chr `expr $unit '*' 8 + 0` | |
100 | /etc/mknod r${name}${unit}b c $chr `expr $unit '*' 8 + 1` | |
101 | /etc/mknod r${name}${unit}c c $chr `expr $unit '*' 8 + 2` | |
102 | /etc/mknod r${name}${unit}g c $chr `expr $unit '*' 8 + 6` | |
103 | if [ $name != hk ] | |
104 | then | |
105 | /etc/mknod ${name}${unit}d b $blk `expr $unit '*' 8 + 3` | |
106 | /etc/mknod ${name}${unit}e b $blk `expr $unit '*' 8 + 4` | |
107 | /etc/mknod ${name}${unit}f b $blk `expr $unit '*' 8 + 5` | |
108 | /etc/mknod ${name}${unit}h b $blk `expr $unit '*' 8 + 7` | |
109 | /etc/mknod r${name}${unit}d c $chr `expr $unit '*' 8 + 3` | |
110 | /etc/mknod r${name}${unit}e c $chr `expr $unit '*' 8 + 4` | |
111 | /etc/mknod r${name}${unit}f c $chr `expr $unit '*' 8 + 5` | |
112 | /etc/mknod r${name}${unit}h c $chr `expr $unit '*' 8 + 7` | |
113 | fi | |
114 | ;; | |
115 | *) | |
116 | echo bad unit for disk in: $i | |
117 | ;; | |
118 | esac | |
119 | ;; | |
120 | ||
121 | dz*) | |
122 | unit=`expr $i : 'dz\(.*\)'` | |
123 | case $unit in | |
124 | 0|1|2|3|4|5|6|7) | |
125 | eval `echo $unit | awk ' { u = $1 } END { | |
126 | for (i = 0; i < 8; i++) | |
127 | printf("/etc/mknod tty%02d c 1 %d; ",u*8+i,u*8+i); }'` | |
128 | ;; | |
129 | *) | |
130 | echo bad unit for dz in: $i | |
131 | ;; | |
132 | esac | |
133 | ;; | |
134 | ||
135 | dh*|dmf*) | |
136 | case $i in | |
137 | dh*) name=dh; major=12;; | |
138 | dmf*) name=dmf; major=22;; | |
139 | esac | |
140 | unit=`expr $i : "$name\(.*\)"` | |
141 | case $unit in | |
142 | 0) ch=h ;; 1) ch=i ;; 2) ch=j ;; 3) ch=k ;; | |
143 | 4) ch=l ;; 5) ch=m ;; 6) ch=n ;; 7) ch=o ;; | |
144 | *) echo bad unit for $name in: $i ;; | |
145 | esac | |
146 | case $ch in | |
147 | h|i|j|k|l|m|n|o) | |
148 | eval `echo $ch $unit $major | | |
149 | awk ' { ch = $1; u = 16 * $2; m = $3 } END { | |
150 | for (i = 0; i < 16; i++) | |
151 | printf("/etc/mknod tty%s%x c %d %d; ",ch,i,m,u+i); }'` | |
152 | ;; | |
153 | esac | |
154 | ;; | |
155 | ||
156 | lp*) | |
157 | unit=`expr $i : 'lp\(.*\)'` | |
158 | case $unit in | |
159 | 0|1|2|3|4|5|6|7) | |
160 | /etc/mknod $i c 15 $unit; | |
161 | chmod 666 $i | |
162 | ;; | |
163 | *) | |
164 | echo bad unit for lp in: $i | |
165 | ;; | |
166 | esac | |
167 | ;; | |
168 | ||
169 | pty*) | |
170 | class=`expr $i : 'pty\(.*\)'` | |
171 | case $class in | |
172 | 0) offset=0 name=p;; | |
173 | 1) offset=16 name=q;; | |
174 | 2) offset=32 name=r;; | |
175 | *) echo bad unit for pty in: $i;; | |
176 | esac | |
177 | case $class in | |
178 | 0|1|2) | |
179 | umask 0 | |
180 | eval `echo $class $name | awk ' { b=$1; n=$2 } END { | |
181 | for (i = 0; i < 16; i++) | |
182 | printf("/etc/mknod tty%s%x c 20 %d; \ | |
183 | /etc/mknod pty%s%x c 21 %d; ", \ | |
184 | n, i, b+i, n, i, b+i); }'` | |
185 | umask 77 | |
186 | ;; | |
187 | esac | |
188 | ;; | |
189 | ||
190 | dn*) | |
191 | unit=`expr $i : 'dn\(.*\)'` | |
ec6dea8c | 192 | case $unit in |
cb946633 SL |
193 | 0|1|2|3|4|5|6|7) |
194 | umask 0 | |
195 | /etc/mknod cu${unit} c 24 ${unit} | |
196 | umask 77 | |
197 | ;; | |
198 | *) | |
199 | echo bad unit for dn in: $i | |
200 | ;; | |
201 | esac | |
202 | ;; | |
203 | ||
204 | local) | |
205 | echo 'no "local" devices defined' | |
206 | ;; | |
207 | esac | |
208 | done |