|
|
1.1 root 1: #!/bin/sh -
2: #
3: # Copyright (c) 1988 Regents of the University of California.
4: # All rights reserved.
5: #
6: # Redistribution and use in source and binary forms are permitted
7: # provided that the above copyright notice and this paragraph are
8: # duplicated in all such forms and that any documentation,
9: # advertising materials, and other materials related to such
10: # distribution and use acknowledge that the software was developed
11: # by the University of California, Berkeley. The name of the
12: # University may not be used to endorse or promote products derived
13: # from this software without specific prior written permission.
14: # THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
15: # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
16: # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17: #
18: # @(#)MAKEDEV 5.7 (Berkeley) 7/7/88
19: #
20: # Device "make" file. Valid arguments:
21: # std standard devices
22: # local configuration specific devices
23: # Tapes:
24: # cy* Cipher
25: # Disks:
26: # dk* VDDC or SMDE disk
27: # Terminal multiplexors:
28: # vx* VIOC
29: # mp* MPCC
30: # Pseudo terminals:
31: # pty* set of 32 master and slave pseudo terminals
32: # Printers:
33: # Call units:
34: # Special purpose devices:
35: # enp* CMC Ethernet interface for loading RAM
36: # dr* IKON DR-11W
37: # ik* IKON DR-11W w/ E&S PS300
38: #
39: umask 77
40: for i
41: do
42: case $i in
43:
44: std)
45: /etc/mknod CP c 0 0
46: /etc/mknod console c 0 1
47: /etc/mknod remote c 0 2
48: /etc/mknod drum c 8 0 ; chmod 640 drum ; chgrp kmem drum
49: /etc/mknod mem c 3 0 ; chmod 640 mem ; chgrp kmem mem
50: /etc/mknod kmem c 3 1 ; chmod 640 kmem ; chgrp kmem kmem
51: /etc/mknod null c 3 2 ; chmod 666 null
52: /etc/mknod vmem c 3 3 ; chmod 640 vmem ; chgrp kmem vmem
53: /etc/mknod tty c 2 0 ; chmod 666 tty
54: /etc/mknod klog c 15 0 ; chmod 400 klog
55: ;;
56:
57: cy*)
58: umask 0 ; unit=`expr $i : '..\(.*\)'`
59: case $i in
60: cy*) blk=3; chr=7 ;;
61: esac
62: case $unit in
63: 0|1|2|3|4|5|6|7)
64: four=`expr $unit + 4`
65: eight=`expr $unit + 8`
66: twelve=`expr $unit + 12`
67: # twenty=`expr $unit + 20`
68: /etc/mknod mt$unit b $blk $unit
69: /etc/mknod mt$four b $blk $four
70: /etc/mknod mt$eight b $blk $eight
71: /etc/mknod mt$twelve b $blk $twelve
72: ln mt$four nmt$unit ;: sanity
73: ln mt$twelve nmt$eight ;: ditto
74: /etc/mknod rmt$unit c $chr $unit
75: /etc/mknod rmt$four c $chr $four
76: /etc/mknod rmt$eight c $chr $eight
77: /etc/mknod rmt$twelve c $chr $twelve
78: ln rmt$four nrmt$unit ;: sanity
79: ln rmt$twelve nrmt$eight ;: ditto
80: # if [ $i = ut ]
81: # then
82: # /etc/mknod mt$twenty b $blk $twenty
83: # /etc/mknod rmt$twenty c $chr $twenty
84: # fi
85: umask 77
86: ;;
87: *)
88: echo bad unit for tape in: $1
89: ;;
90: esac
91: ;;
92:
93: dk*)
94: unit=`expr $i : '..\(.*\)'`
95: case $i in
96: dk*) name=dk; blk=1; chr=5;;
97: esac
98: case $unit in
99: 0|1|2|3|4|5|6|7|8|9|a|b|c|d|e|f|g|h)
100: case $unit in
101: a) u=10 ;;
102: b) u=11 ;;
103: c) u=12 ;;
104: d) u=13 ;;
105: e) u=14 ;;
106: f) u=15 ;;
107: g) u=16 ;;
108: h) u=17 ;;
109: *) u=$unit ;;
110: esac
111:
112: /etc/mknod ${name}${unit}a b $blk `expr $u '*' 8 + 0`
113: /etc/mknod ${name}${unit}b b $blk `expr $u '*' 8 + 1`
114: /etc/mknod ${name}${unit}c b $blk `expr $u '*' 8 + 2`
115: /etc/mknod ${name}${unit}d b $blk `expr $u '*' 8 + 3`
116: /etc/mknod ${name}${unit}e b $blk `expr $u '*' 8 + 4`
117: /etc/mknod ${name}${unit}f b $blk `expr $u '*' 8 + 5`
118: /etc/mknod ${name}${unit}g b $blk `expr $u '*' 8 + 6`
119: /etc/mknod ${name}${unit}h b $blk `expr $u '*' 8 + 7`
120: /etc/mknod r${name}${unit}a c $chr `expr $u '*' 8 + 0`
121: /etc/mknod r${name}${unit}b c $chr `expr $u '*' 8 + 1`
122: /etc/mknod r${name}${unit}c c $chr `expr $u '*' 8 + 2`
123: /etc/mknod r${name}${unit}d c $chr `expr $u '*' 8 + 3`
124: /etc/mknod r${name}${unit}e c $chr `expr $u '*' 8 + 4`
125: /etc/mknod r${name}${unit}f c $chr `expr $u '*' 8 + 5`
126: /etc/mknod r${name}${unit}g c $chr `expr $u '*' 8 + 6`
127: /etc/mknod r${name}${unit}h c $chr `expr $u '*' 8 + 7`
128:
129: chmod 640 ${name}${unit}[a-h]
130: chgrp operator ${name}${unit}[a-h]
131: chmod 640 r${name}${unit}[a-h]
132: chgrp operator r${name}${unit}[a-h]
133: ;;
134: *)
135: echo bad unit for disk in: $i
136: ;;
137: esac
138: ;;
139:
140: vx*|mp*)
141: case $i in
142: vx*) name=vx; major=1; count=16;
143: unit=`expr $i : "$name\(.*\)"`
144: case $unit in
145: 0|1|2|3|4|5|6|7|8|9|a|b|c|d|e|f) ch=$unit ;;
146: *) echo bad unit for $name in: $i ;;
147: esac
148: ;;
149: mp*) name=mp; major=12; count=16;
150: unit=`expr $i : "$name\(.*\)"`
151: case $unit in
152: 0) ch=A ;; 1) ch=B ;; 2) ch=C ;; 3) ch=D ;;
153: 4) ch=E ;; 5) ch=F ;; 6) ch=G ;; 7) ch=H ;;
154: 8) ch=I ;; 9) ch=J ;; a) ch=K ;; b) ch=L ;;
155: c) ch=M ;; d) ch=N ;; e) ch=O ;; f) ch=P ;;
156: *) echo bad unit for $name in: $i ;;
157: esac
158: ;;
159: esac
160:
161: case $unit in
162: a) un=10 ;; b) un=11 ;; c) un=12 ;; d) un=13 ;;
163: e) un=14 ;; f) un=15 ;; *) un=$unit ;;
164: esac
165:
166: umask 044
167: eval `echo $ch $major $count $un |
168: awk ' { ch = $1; u = $3 * $4; m = $2; cnt = $3; nd = $4 } END {
169: if (m == 12)
170: printf("/etc/mknod mpcc%d c 11 %d; /bin/chmod 0600 mpcc%d; ",nd,u,nd);
171: for (i = 0; i < cnt; i++)
172: if (i < 10)
173: printf("/etc/mknod tty%s%x c %d %d; ",ch,i,m,u+i);
174: else
175: printf("/etc/mknod tty%s%c c %d %d; ",ch,87+i,m,u+i); }'`
176: umask 77
177: ;;
178:
179: pty*)
180: class=`expr $i : 'pty\(.*\)'`
181: case $class in
182: 0) offset=0 name=p;;
183: 1) offset=16 name=q;;
184: 2) offset=32 name=r;;
185: 3) offset=48 name=s;;
186: 4) offset=64 name=s;;
187: 5) offset=80 name=s;;
188: *) echo bad unit for pty in: $i;;
189: esac
190: case $class in
191: 0|1|2|3|4|5)
192: umask 0
193: eval `echo $offset $name | awk ' { b=$1; n=$2 } END {
194: for (i = 0; i < 16; i++)
195: printf("/etc/mknod tty%s%x c 9 %d; \
196: /etc/mknod pty%s%x c 10 %d; ", \
197: n, i, b+i, n, i, b+i); }'`
198: umask 77
199: ;;
200: esac
201: ;;
202:
203: enp*)
204: unit=`expr $i : 'enp\(.*\)'`
205: case $unit in
206: [0-6])
207: /etc/mknod enp${unit}ram c 16 $unit; chmod 644 enp${unit}ram
208: ;;
209: *)
210: echo bad unit for enp in: $i
211: ;;
212: esac
213: ;;
214:
215: dr*)
216: unit=`expr $i : 'dr\(.*\)'`
217: case $unit in
218: [0-6])
219: /etc/mknod dr${unit} c 18 $unit; chmod 644 dr${unit}
220: ;;
221: *)
222: echo bad unit for dr in: $i
223: ;;
224: esac
225: ;;
226:
227: ik*)
228: unit=`expr $i : 'ik\(.*\)'`
229: case $unit in
230: [0-9])
231: /etc/mknod ik${unit} c 20 $unit; chmod 644 ik${unit}
232: ;;
233: *)
234: echo bad unit for ik in: $i
235: ;;
236: esac
237: ;;
238:
239: local)
240: sh MAKEDEV.local
241: ;;
242: esac
243: done
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.