Commit | Line | Data |
---|---|---|
ed001f41 | 1 | #! /bin/sh |
e804469b | 2 | # @(#)MAKEDEV 4.7 2/20/83 |
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 | |
cebb3f9a | 26 | # Printers: |
cb946633 | 27 | # lp* unibus lp11 parallel interface |
cebb3f9a SL |
28 | # va* unibus varian parallel interface |
29 | # vp* unibus versatec parallel interface | |
cb946633 SL |
30 | # Call units: |
31 | # dn* unibus dn11 and emulations (e.g. Able Quadracall) | |
32 | umask 77 | |
33 | for i | |
34 | do | |
35 | case $i in | |
36 | ||
37 | std) | |
38 | /etc/mknod console c 0 0 | |
39 | /etc/mknod drum c 7 0 ; chmod 644 drum | |
40 | /etc/mknod floppy c 8 0 | |
41 | /etc/mknod kUmem c 3 3 ;: no one has ever tried using this | |
42 | /etc/mknod kmem c 3 1 ; chmod 644 kmem | |
43 | /etc/mknod mem c 3 0 ; chmod 644 mem | |
44 | /etc/mknod null c 3 2 ; chmod 666 null | |
45 | /etc/mknod tty c 2 0 ; chmod 666 tty | |
46 | ;; | |
47 | ||
48 | ht*|tm*|ts*|mt*|ut*) | |
49 | umask 0 ; unit=`expr $i : '..\(.*\)'` | |
50 | case $i in | |
51 | ht*) blk=1; chr=5 ;; | |
52 | tm*) blk=5; chr=14;; | |
53 | ts*) blk=6; chr=16;; | |
54 | mt*) blk=7; chr=19;; | |
55 | ut*) blk=10; chr=17;; | |
56 | esac | |
57 | case $unit in | |
58 | 0|1|2|3|4|5|6|7) | |
59 | four=`expr $unit + 4` ; eight=`expr $unit + 8` | |
60 | twelve=`expr $unit + 12`; twenty=`expr $unit + 20` | |
61 | /etc/mknod mt$unit b $blk $unit | |
62 | /etc/mknod mt$four b $blk $four | |
63 | /etc/mknod mt$eight b $blk $eight | |
64 | /etc/mknod mt$twelve b $blk $twelve | |
65 | /etc/mknod nmt$unit b $blk $four ;: sanity w/pdp11 v7 | |
66 | /etc/mknod nmt$eight b $blk $twelve ;: ditto | |
67 | /etc/mknod nrmt$unit c $chr $four ;: sanity w/pdp11 v7 | |
68 | /etc/mknod nrmt$eight c $chr $twelve ;: ditto | |
69 | /etc/mknod rmt$unit c $chr $unit | |
70 | /etc/mknod rmt$four c $chr $four | |
71 | /etc/mknod rmt$eight c $chr $eight | |
72 | /etc/mknod rmt$twelve c $chr $twelve | |
ed001f41 | 73 | if [ $i = ut ] |
cb946633 | 74 | then |
4c90b0b7 | 75 | /etc/mknod mt$twenty b $blk $twenty |
cb946633 SL |
76 | /etc/mknod rmt$twenty c $chr $twenty |
77 | fi | |
78 | umask 77 | |
79 | ;; | |
80 | *) | |
81 | bad unit for tape in: $1 | |
82 | ;; | |
83 | esac | |
84 | ;; | |
85 | ||
86 | hp*|hk*|up*|ra*|rb*) | |
87 | unit=`expr $i : '..\(.*\)'` | |
88 | case $i in | |
89 | hp*) name=hp; blk=0; chr=4;; | |
90 | hk*) name=hk; blk=3; chr=11;; | |
91 | up*) name=up; blk=2; chr=13;; | |
92 | ra*) name=ra; blk=9; chr=9;; | |
93 | rb*) name=rb; blk=13; chr=23;; | |
94 | esac | |
95 | case $unit in | |
96 | 0|1|2|3|4|5|6|7) | |
97 | /etc/mknod ${name}${unit}a b $blk `expr $unit '*' 8 + 0` | |
98 | /etc/mknod ${name}${unit}b b $blk `expr $unit '*' 8 + 1` | |
99 | /etc/mknod ${name}${unit}c b $blk `expr $unit '*' 8 + 2` | |
100 | /etc/mknod ${name}${unit}g b $blk `expr $unit '*' 8 + 6` | |
101 | /etc/mknod r${name}${unit}a c $chr `expr $unit '*' 8 + 0` | |
102 | /etc/mknod r${name}${unit}b c $chr `expr $unit '*' 8 + 1` | |
103 | /etc/mknod r${name}${unit}c c $chr `expr $unit '*' 8 + 2` | |
104 | /etc/mknod r${name}${unit}g c $chr `expr $unit '*' 8 + 6` | |
105 | if [ $name != hk ] | |
106 | then | |
107 | /etc/mknod ${name}${unit}d b $blk `expr $unit '*' 8 + 3` | |
108 | /etc/mknod ${name}${unit}e b $blk `expr $unit '*' 8 + 4` | |
109 | /etc/mknod ${name}${unit}f b $blk `expr $unit '*' 8 + 5` | |
110 | /etc/mknod ${name}${unit}h b $blk `expr $unit '*' 8 + 7` | |
111 | /etc/mknod r${name}${unit}d c $chr `expr $unit '*' 8 + 3` | |
112 | /etc/mknod r${name}${unit}e c $chr `expr $unit '*' 8 + 4` | |
113 | /etc/mknod r${name}${unit}f c $chr `expr $unit '*' 8 + 5` | |
114 | /etc/mknod r${name}${unit}h c $chr `expr $unit '*' 8 + 7` | |
115 | fi | |
116 | ;; | |
117 | *) | |
118 | echo bad unit for disk in: $i | |
119 | ;; | |
120 | esac | |
121 | ;; | |
122 | ||
123 | dz*) | |
124 | unit=`expr $i : 'dz\(.*\)'` | |
125 | case $unit in | |
126 | 0|1|2|3|4|5|6|7) | |
127 | eval `echo $unit | awk ' { u = $1 } END { | |
128 | for (i = 0; i < 8; i++) | |
129 | printf("/etc/mknod tty%02d c 1 %d; ",u*8+i,u*8+i); }'` | |
130 | ;; | |
131 | *) | |
132 | echo bad unit for dz in: $i | |
133 | ;; | |
134 | esac | |
135 | ;; | |
136 | ||
137 | dh*|dmf*) | |
138 | case $i in | |
139 | dh*) name=dh; major=12;; | |
140 | dmf*) name=dmf; major=22;; | |
141 | esac | |
142 | unit=`expr $i : "$name\(.*\)"` | |
143 | case $unit in | |
144 | 0) ch=h ;; 1) ch=i ;; 2) ch=j ;; 3) ch=k ;; | |
145 | 4) ch=l ;; 5) ch=m ;; 6) ch=n ;; 7) ch=o ;; | |
146 | *) echo bad unit for $name in: $i ;; | |
147 | esac | |
148 | case $ch in | |
149 | h|i|j|k|l|m|n|o) | |
150 | eval `echo $ch $unit $major | | |
151 | awk ' { ch = $1; u = 16 * $2; m = $3 } END { | |
152 | for (i = 0; i < 16; i++) | |
153 | printf("/etc/mknod tty%s%x c %d %d; ",ch,i,m,u+i); }'` | |
154 | ;; | |
155 | esac | |
156 | ;; | |
157 | ||
cebb3f9a SL |
158 | lp*|va*|vp*) |
159 | case $i in | |
160 | lp*) name=lp; major=15;; | |
161 | va*) name=va; major=10;; | |
162 | vp*) name=vp; major=6;; | |
163 | esac | |
164 | unit=`expr $i : "$name\(.*\)"` | |
cb946633 SL |
165 | case $unit in |
166 | 0|1|2|3|4|5|6|7) | |
cebb3f9a | 167 | /etc/mknod $i c $major $unit; |
cb946633 SL |
168 | chmod 666 $i |
169 | ;; | |
170 | *) | |
cebb3f9a | 171 | echo bad unit for $name in: $i |
cb946633 SL |
172 | ;; |
173 | esac | |
174 | ;; | |
175 | ||
176 | pty*) | |
177 | class=`expr $i : 'pty\(.*\)'` | |
178 | case $class in | |
179 | 0) offset=0 name=p;; | |
180 | 1) offset=16 name=q;; | |
181 | 2) offset=32 name=r;; | |
182 | *) echo bad unit for pty in: $i;; | |
183 | esac | |
184 | case $class in | |
185 | 0|1|2) | |
186 | umask 0 | |
118b143d | 187 | eval `echo $offset $name | awk ' { b=$1; n=$2 } END { |
cb946633 SL |
188 | for (i = 0; i < 16; i++) |
189 | printf("/etc/mknod tty%s%x c 20 %d; \ | |
190 | /etc/mknod pty%s%x c 21 %d; ", \ | |
191 | n, i, b+i, n, i, b+i); }'` | |
192 | umask 77 | |
193 | ;; | |
194 | esac | |
195 | ;; | |
196 | ||
197 | dn*) | |
198 | unit=`expr $i : 'dn\(.*\)'` | |
ec6dea8c | 199 | case $unit in |
cb946633 SL |
200 | 0|1|2|3|4|5|6|7) |
201 | umask 0 | |
202 | /etc/mknod cu${unit} c 24 ${unit} | |
203 | umask 77 | |
204 | ;; | |
205 | *) | |
206 | echo bad unit for dn in: $i | |
207 | ;; | |
208 | esac | |
209 | ;; | |
210 | ||
211 | local) | |
18993499 | 212 | sh MAKEDEV.local |
cb946633 SL |
213 | ;; |
214 | esac | |
215 | done |