Annotation of src/etc/MAKEDEV.mi, Revision 1.50
1.1 todd 1: include(MAKEDEV.sub)dnl
2: dnl
1.50 ! miod 3: vers(a, {-$OpenBSD: MAKEDEV.mi,v 1.49 2002/06/18 00:53:45 fgsch Exp $-})dnl
1.1 todd 4: dnl
5: divert(1)dnl
6: {-#-}
1.33 deraadt 7: {-#-} Copyright (c) 2001,2002 Todd T. Fries <todd@OpenBSD.org>
1.1 todd 8: {-#-} All rights reserved.
9: {-#-}
10: {-#-} Redistribution and use in source and binary forms, with or without
11: {-#-} modification, are permitted provided that the following conditions
12: {-#-} are met:
13: {-#-} 1. Redistributions of source code must retain the above copyright
14: {-#-} notice, this list of conditions and the following disclaimer.
15: {-#-} 2. The name of the author may not be used to endorse or promote products
16: {-#-} derived from this software without specific prior written permission.
17: {-#-}
18: {-#-} THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
19: {-#-} INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
20: {-#-} AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
21: {-#-} THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22: {-#-} EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23: {-#-} PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
24: {-#-} OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25: {-#-} WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26: {-#-} OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
27: {-#-} ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28: {-#-}
29: dnl
30: dnl Diversions: (upon termination, concatenated output queues)
31: dnl
32: dnl 0 - very top
33: dnl 1 - descriptions of devices
34: dnl 2 - init of script, function definitions, etc
35: dnl 3 - beginning of global recursive R() function
36: dnl 7 - body of MAKEDEV, device creations, etc
37: dnl 9 - end
38: dnl
39: dnl HOW TO ADD A DEVICE:
40: dnl
41: dnl In this file, you must use at least two macros:
42: dnl
1.29 todd 43: dnl Use '__devitem(uniqueid, name-pattern, description)' to create an entry
1.1 todd 44: dnl in the description at the top of the generated MAKEDEV file:
45: dnl
1.29 todd 46: dnl __devitem(sca, sca*, Sugar Generic device)dnl
1.41 todd 47: dnl __devitem(cry, crypto, hardware crypto access driver)dnl
1.1 todd 48: dnl
49: dnl This is ultimately shown as:
50: dnl
51: dnl # sca* Sugar Generic device
1.41 todd 52: dnl # crypto hardware crypto access driver
1.1 todd 53: dnl
1.29 todd 54: dnl Use '_mkdev(uniqueid, shell-pattern, {-shell-script-})dnl' to create
1.1 todd 55: dnl a shell script fragment used to 'create' the device (be sure to match
56: dnl the uniqueid from above):
57: dnl
1.29 todd 58: dnl _mkdev(sca, sca*, {-M sca$U c major_sca_c $U
59: dnl M rsca$U b major_sca_b Add($U, 128)-})dnl
1.41 todd 60: dnl _mkdev(cry, crypto, {-M crypto c major_cry_c 0-})dnl
1.1 todd 61: dnl
62: dnl This is ultimately expanded into:
63: dnl
1.41 todd 64: dnl sca*)
65: dnl M sca$U c 24 $U
66: dnl M sca$U b 42 $(($U+128))
67: dnl ;;
68: dnl
69: dnl crypto)
70: dnl M crypto c 47 0
71: dnl ;;
1.1 todd 72: dnl
1.29 todd 73: dnl In the MAKEDEV.md file, add a '_DEV(uniqueid, charmajor, blockmajor)'
1.1 todd 74: dnl entry:
75: dnl
1.29 todd 76: dnl _DEV(sca, 24, 42)
1.41 todd 77: dnl _DEV(cry, 47)
1.1 todd 78: dnl
1.41 todd 79: dnl Final step is to use the 'target/twrget' macros to have the 'all)' target
80: dnl generate one or more device(s). Usage of 'target/twrget' is:
81: dnl target(target_name, device_name [, append_string ] .. )
82: dnl twrget(target_name, uniqueid, device_name, [, append_string ] .. )
1.1 todd 83: dnl
1.41 todd 84: dnl target_name a unique name that later is used as an argument to
85: dnl 'show_target()' (which expands all devices for a
86: dnl given 'target_name').
87: dnl uniqueid same as 'uniqueid' above
88: dnl device_name string representing the device to be mknod'ed
89: dnl append_string for each append_string, `device_name' is prepended
90: dnl
91: dnl Note: 'target(a,b,c)' is equivalent to 'twrget(a,b,b,c)'
92: dnl
93: dnl
94: dnl For a short example:
95: dnl
96: dnl target(all, std)dnl
97: dnl target(all, sca, 0, 1, 2, 3)dnl
98: dnl twrget(all, cry, crypto)dnl
1.1 todd 99: dnl
100: dnl would expand to:
101: dnl
102: dnl all)
1.41 todd 103: dnl R std sca0 sca1 sca2 sca3 crypto
1.1 todd 104: dnl ;;
105: dnl
1.41 todd 106: dnl presuming '_DEV(sca, ?, ?)' and '_DEV(std)' were in the MAKEDEV.md file.
1.1 todd 107: dnl
108: dnl
109: dnl Everything is 'automatically' added to 'MAKEDEV' based on whether or
110: dnl not the '_DEV()' entry has a corresponding _mkdev() and __devitem()
1.41 todd 111: dnl entry in MAKEDEV.mi (this file).
1.1 todd 112: dnl
113: dnl Note: be very wary of adding whitespace, carriage returns, or not
114: dnl finishing a macro with ')dnl' .. otherwise, extra blank lines show up
115: dnl in the output.
116: dnl
1.31 todd 117: dnl TODO:
118: dnl
119: dnl make a 'disktgt' macro that automatically does:
1.34 deraadt 120: dnl disktgt(rd, {-rd-})
1.31 todd 121: dnl
122: dnl target(all,rd,0)
123: dnl target(ramd,rd,0)
124: dnl disk_q(rd)
1.34 deraadt 125: dnl __devitem(rd, {-rd*-}, {-rd-})dnl
1.31 todd 126: dnl
1.41 todd 127: dnl Note: not all disks are generated in 'all)'. (e.g. vax has a lot of
128: dnl disks that are not generated by 'all)')
129: dnl
1.31 todd 130: dnl
1.29 todd 131: _mkdev(loc, local, {-test -s $T.local && sh $T.local-})dnl
1.1 todd 132: dnl
1.29 todd 133: __devtitle(make, Device "make" file. Valid arguments)dnl
134: __devitem({-all-}, {-all-},
1.4 todd 135: {-makes all known devices{-,-} including local devices.
1.1 todd 136: {-#-} Tries to make the ``standard'' number of each type.-})dnl
137: dnl
138: dnl
1.29 todd 139: target(all, mcd, 0)dnl
140: twrget(all, fdesc, fd)dnl
141: target(all, st, 0, 1)dnl
142: target(all, std)dnl
143: target(all, raid, 0, 1, 2, 3)dnl
144: target(all, rz, 0, 1, 2, 3, 4)dnl
145: target(all, hp, 0, 1, 2, 3)dnl
146: target(all, ra, 0, 1, 2, 3)dnl
147: target(all, rx, 0, 1)dnl
148: target(all, wd, 0, 1, 2, 3)dnl
149: target(all, xd, 0, 1, 2, 3)dnl
150: twrget(all, aflo, fd, 0, 1, 2, 3)dnl
1.46 provos 151: target(all, systrace)dnl
1.29 todd 152: target(all, pctr)dnl
153: target(all, pctr0)dnl
154: target(all, altq)dnl
155: target(all, pf)dnl
156: twrget(all, cry, crypto)dnl
157: target(all, apm)dnl
158: twrget(all, tth, ttyh, 0, 1)dnl
159: target(all, ttyA, 0, 1)dnl
160: target(all, ttyB, 0, 1, 2, 3, 4, 5)dnl
1.40 deraadt 161: twrget(all, attyB, ttyB, 0, 1, 2, 3, 4)dnl
1.29 todd 162: target(all, tty0, 0, 1, 2, 3)dnl
163: twrget(all, mac_tty0, tty0, 0, 1)dnl
164: twrget(all, tzs, tty, a, b, c, d)dnl
165: twrget(all, czs, cua, a, b, c, d)dnl
166: target(all, ttyc, 0, 1, 2, 3, 4, 5, 6, 7)dnl
167: twrget(all, com, tty0, 0, 1, 2, 3)dnl
168: twrget(all, mac_ttye, ttye, 0)dnl
169: target(all, ttye, 0, 1, 2, 3, 4, 5, 6)dnl
170: target(all, lkm)dnl
171: twrget(all, mmcl, mmclock)dnl
172: target(all, lpt, 0, 1, 2)dnl
173: twrget(all, lpt, lpa, 0, 1, 2)dnl
174: target(all, joy, 0, 1)dnl
1.41 todd 175: twrget(all, rnd, random)dnl
1.29 todd 176: target(all, uk, 0)dnl
177: target(all, wt, 0)dnl
178: target(all, wdt, 0)dnl
179: twrget(all, au, audio, 0)dnl
180: twrget(all, speak, speaker)dnl
181: target(all, asc, 0)dnl
182: target(all, music, 0)dnl
183: target(all, radio, 0)dnl
184: target(all, tuner, 0)dnl
185: target(all, rmidi, 0, 1, 2, 3, 4, 5, 6, 7)dnl
186: target(all, usbs)dnl
187: target(all, adb)dnl
188: target(all, iop, 0, 1)dnl
189: target(all, pci)dnl
190: twrget(all, wsmouse, wscons)dnl
191: twrget(all, btw, bwtwo, 0)dnl
192: twrget(all, ctw, cgtwo, 0)dnl
193: twrget(all, ctr, cgthree, 0)dnl
194: twrget(all, cfr, cgfour, 0)dnl
195: twrget(all, csx, cgsix, 0)dnl
196: twrget(all, ceg, cgeight, 0)dnl
197: twrget(all, cfo, cgfourteen, 0)dnl
198: target(all, tcx, 0)dnl
1.40 deraadt 199: twrget(all, grf_mac, grf, 0, 1, 2, 3)dnl
1.29 todd 200: twrget(all, grf_amiga, grf, 0, 1, 2, 3, 4, 5, 6)dnl
201: target(all, par, 0)dnl
202: twrget(all, amouse, mouse, 0, 1)dnl
203: twrget(all, akbd, kbd)dnl
204: target(all, apci, 0)dnl
205: target(all, ppi, 0)dnl
206: target(all, view0, 0, 1, 2, 3, 4, 5)dnl
207: target(all, local)dnl
1.49 fgsch 208: target(all, gpr, 0)dnl
1.18 todd 209: dnl
1.29 todd 210: _mkdev(all, {-all-}, {-dnl
1.18 todd 211: show_target(all)dnl
212: -})dnl
213: dnl
1.34 deraadt 214: __devitem(ramdisk, ramdisk, devices to be put on ramdisk-based media)dnl
1.29 todd 215: __devitem(std, {-std-}, standard devices)dnl
1.1 todd 216: dnl
1.18 todd 217: dnl
218: dnl
1.1 todd 219: dnl _std
220: dnl
221: dnl $1: tty
222: dnl $2: memstuff
223: dnl $3: ksyms
224: dnl $4: drum
225: dnl $5: klog
226: dnl
1.29 todd 227: define({-_std-}, {-dnl
1.1 todd 228: std)
229: M console c 0 0 600
230: M tty c $1 0
231: M mem c $2 0 640 kmem
232: M kmem c $2 1 640 kmem
233: M null c $2 2
234: M zero c $2 12
235: M stdin c major_fdesc_c 0
236: M stdout c major_fdesc_c 1
237: M stderr c major_fdesc_c 2
238: M ksyms c $3 0 640 kmem
239: M drum c $4 0 640 kmem
240: M klog c $5 0 600-})dnl
241: dnl
1.29 todd 242: target(usb, usb, 0, 1)dnl
243: target(usb, urio, 0)dnl
244: twrget(usb, uscan, uscanner, 0)dnl
245: target(usb, uhid, 0, 1, 2, 3)dnl
246: target(usb, ulpt, 0, 1)dnl
247: target(usb, ugen, 0, 1)dnl
248: target(usb, utty, 0, 1)dnl
1.18 todd 249: dnl
1.29 todd 250: __devitem({-usbs-}, usbs, make USB devices)dnl
251: _mkdev(usbs, usbs, {-dnl
1.18 todd 252: show_target({-usb-})dnl
253: -})dnl
1.29 todd 254: __devtitle(tap, Tapes)dnl
255: __devitem(wt, {-wt* -}, QIC-interface (e.g. not SCSI) 3M cartridge tape)dnl
256: _mkdev(wt, wt*,
1.1 todd 257: {-name=wt
1.29 todd 258: n=Mult($U, 8) m=Add($n, 4)
1.1 todd 259: M $name$U b major_wt_b $n 640 operator
260: M r$name$U c major_wt_c $n 640 operator
261: M n$name$U b major_wt_b $m 640 operator
262: M nr$name$U c major_wt_c $m 640 operator-})dnl
1.29 todd 263: __devitem(tz, tz*, {-SCSI tapes{-,-} DEC TK50 cartridge tape-})dnl
264: __devitem(st, {-st*-}, SCSI tapes)dnl
265: _mkdev(st, st*, {-n=Mult($U, 16)
1.1 todd 266: for pre in " " n e en
267: do
268: M ${pre}st$U b major_st_b $n 660 operator
269: M ${pre}rst$U c major_st_c $n 660 operator
1.29 todd 270: n=Add($n, 1)
1.1 todd 271: done-})dnl
1.29 todd 272: __devitem(ct, ct*, HP300 HP-IB cartridge tape)dnl
273: __devitem(mt, mt*, (Magnetic) 9-track reel tape)dnl
274: __devitem(ht, ht*, massbus tm03 & tu??)dnl
275: __devitem(tm, tm*, unibus tm11 & te10 emulations (e.g. Emulex tc-11))dnl
276: __devitem(ts, ts*, unibus ts11)dnl
277: __devitem(ut, ut*, unibus tu45 emulations (e.g.si 9700))dnl
278: __devtitle(dis, Disks)dnl
279: __devitem(rz, rz*, SCSI disks)dnl
1.31 todd 280: __devitem(sd, {-sd*-}, {-SCSI disks, includes flopticals-})dnl
1.29 todd 281: __devitem(hd, {-hd*-}, HP300 HP-IB disks)dnl
282: __devitem(cd, {-cd*-}, SCSI cdrom drives)dnl
283: __devitem(acd, acd*, ATAPI cdrom drives)dnl
284: _mkdev(cd, cd*, {-dodisk2 cd $U major_cd_b major_cd_c $U 0{--}ifstep(cd)-})dnl
285: __devitem(mcd, mcd*, Mitsumi cdrom drives)dnl
286: _mkdev(mcd, mcd*, {-dodisk2 mcd $U major_mcd_b major_mcd_c $U 0{--}ifstep(mcd)dnl
287: -})dnl
288: __devitem(ch, {-ch*-}, SCSI media changer)dnl
289: _mcdev(ch, ch*, ch, {-major_ch_c-}, 660, operator)dnl
290: __devitem(uk, uk*, SCSI Unknown device)dnl
291: _mcdev(uk, uk*, uk, {-major_uk_c-}, 640, operator)dnl
292: __devitem(ss, ss*, SCSI scanners)dnl
1.31 todd 293: _mkdev(ss, ss*, {-M ss$U c major_ss_c Mult($U,16) 640 operator
294: M nss$U c major_ss_c Add(Mult($U,16),1) 640 operator
295: M enss$U c major_ss_c Add(Mult($U,16),3) 640 operator
1.1 todd 296: RMlist="$RMlist scan$U"
297: MKlist="$MKlist;umask 77;ln -s ss$U scan$U"-})dnl
1.29 todd 298: __devitem(ses, ses*, SES/SAF-TE SCSI devices)dnl
299: _mkdev(ses, ses*, {-M ses$U c major_ses_c $U 640 operator-})dnl
300: __devitem(ramd, ramdisk, makes all devices for a ramdisk kernel)dnl arc
301: _mkdev(ramd, ramdisk, {-dnl
1.20 todd 302: show_target(ramd)dnl
303: -})dnl
1.29 todd 304: ifelse(MACHINE, mvmeppc, {-dnl
1.32 todd 305: target(all, ses, 0)dnl
306: target(all, ch, 0)dnl
307: target(all, ss, 0, 1)dnl
308: target(all, xfs, 0)dnl
309: twrget(all, flo, fd, 0, 0B, 0C, 0D, 0E, 0F, 0G, 0H)dnl
310: twrget(all, flo, fd, 1, 1B, 1C, 1D, 1E, 1F, 1G, 1H)dnl
311: target(all, pty, 0, 1, 2)dnl
312: target(all, bpf, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)dnl
313: target(all, tun, 0, 1, 2, 3)dnl
314: target(all, xy, 0, 1, 2, 3)dnl
315: target(all, rd, 0)dnl
316: target(all, cd, 0, 1)dnl
317: target(all, sd, 0, 1, 2, 3, 4)dnl
318: target(all, vnd, 0, 1, 2, 3)dnl
319: target(all, ccd, 0, 1, 2, 3)dnl
1.29 todd 320: target(ramd, tty0, 0, 1, 2, 3)dnl
321: twrget(ramd, wsdisp, ttyC, 0)dnl
322: target(ramd, rd, 0)dnl
323: target(ramd, wd, 0, 1, 2, 3)dnl
324: target(ramd, sd, 0, 1, 2, 3, 4)dnl
325: target(ramd, cd, 0, 1)dnl
326: target(ramd, st, 0, 1)dnl
327: target(ramd, bpf, 0)dnl
328: target(ramd, rd, 0)dnl
329: -})dnl
330: ifelse(MACHINE, sparc, {-dnl
1.50 ! miod 331: twrget(wscons, wscons, ttyD, cfg, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b)dnl
1.32 todd 332: target(all, ses, 0)dnl
333: target(all, ch, 0)dnl
334: target(all, ss, 0, 1)dnl
335: target(all, xfs, 0)dnl
336: twrget(all, flo, fd, 0, 0B, 0C, 0D, 0E, 0F, 0G, 0H)dnl
337: twrget(all, flo, fd, 1, 1B, 1C, 1D, 1E, 1F, 1G, 1H)dnl
338: target(all, pty, 0, 1, 2)dnl
339: target(all, bpf, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)dnl
340: target(all, tun, 0, 1, 2, 3)dnl
341: target(all, xy, 0, 1, 2, 3)dnl
342: target(all, hk, 0, 1, 2, 3)dnl
343: target(all, rd, 0)dnl
344: target(all, cd, 0, 1)dnl
345: target(all, sd, 0, 1, 2, 3, 4)dnl
346: target(all, vnd, 0, 1, 2, 3)dnl
347: target(all, ccd, 0, 1, 2, 3)dnl
1.29 todd 348: target(ramd, fd, 0)dnl
349: target(ramd, sd, 0, 1, 2, 3)dnl
350: target(ramd, rd, 0)dnl
351: target(ramd, cd, 0)dnl
352: -})dnl
353: ifelse(MACHINE, sparc64, {-dnl
1.35 todd 354: twrget(wscons, wscons, ttyD, cfg, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b)dnl
1.32 todd 355: target(all, ccd, 0, 1, 2, 3)dnl
356: target(all, ses, 0)dnl
357: target(all, ch, 0)dnl
358: target(all, ss, 0, 1)dnl
359: target(all, xfs, 0)dnl
360: twrget(all, flo, fd, 0, 0B, 0C, 0D, 0E, 0F, 0G, 0H)dnl
361: twrget(all, flo, fd, 1, 1B, 1C, 1D, 1E, 1F, 1G, 1H)dnl
362: target(all, pty, 0, 1, 2)dnl
363: target(all, bpf, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)dnl
364: target(all, tun, 0, 1, 2, 3)dnl
365: target(all, xy, 0, 1, 2, 3)dnl
366: target(all, rd, 0)dnl
367: target(all, cd, 0, 1)dnl
368: target(all, sd, 0, 1, 2, 3, 4)dnl
369: target(all, vnd, 0, 1, 2, 3)dnl
1.29 todd 370: target(ramd, fd, 0)dnl
371: target(ramd, rd, 0)dnl
372: target(ramd, sd, 0, 1, 2, 3)dnl
373: target(ramd, wd, 0, 1, 2, 3)dnl
374: target(ramd, cd, 0, 1)dnl
375: target(ramd, st, 0, 1)dnl
376: target(ramd, bpf, 0)dnl
377: twrget(all, s64_tzs, tty, a, b, c, d)dnl
378: twrget(all, s64_czs, cua, a, b, c, d)dnl
379: __devitem(s64_tzs, tty[a-z]*, Zilog 8530 Serial Port)dnl
380: __devitem(s64_czs, cua[a-z]*, Zilog 8530 Serial Port)dnl
381: _mkdev(s64_tzs, {-tty[a-z]-}, {-u=${i#tty*}
1.23 todd 382: case $u in
383: a) n=0 ;;
384: b) n=1 ;;
385: c) n=2 ;;
386: d) n=3 ;;
387: *) echo unknown tty device $i ;;
388: esac
389: M tty$u c major_s64_tzs_c $n 660 dialer uucp-})dnl
1.29 todd 390: _mkdev(s64_czs, cua[a-z], {-u=${i#cua*}
1.23 todd 391: case $u in
392: a) n=0 ;;
393: b) n=1 ;;
394: c) n=2 ;;
395: d) n=3 ;;
1.41 todd 396: *) echo unknown cua device $i ;;
1.23 todd 397: esac
1.29 todd 398: M cua$u c major_s64_czs_c Add($n, 128) 660 dialer uucp-})dnl
1.18 todd 399: -})dnl
1.29 todd 400: ifelse(MACHINE, i386, {-dnl
1.32 todd 401: target(all, ses, 0)dnl
402: target(all, ch, 0)dnl
403: target(all, ss, 0, 1)dnl
404: target(all, xfs, 0)dnl
405: twrget(all, flo, fd, 0, 0B, 0C, 0D, 0E, 0F, 0G, 0H)dnl
406: twrget(all, flo, fd, 1, 1B, 1C, 1D, 1E, 1F, 1G, 1H)dnl
407: target(all, pty, 0, 1, 2)dnl
408: target(all, bpf, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)dnl
409: target(all, tun, 0, 1, 2, 3)dnl
410: target(all, xy, 0, 1, 2, 3)dnl
411: target(all, rd, 0)dnl
412: target(all, cd, 0, 1)dnl
413: target(all, sd, 0, 1, 2, 3, 4)dnl
414: target(all, vnd, 0, 1, 2, 3)dnl
415: target(all, ccd, 0, 1, 2, 3)dnl
1.42 fgsch 416: target(all, bktr, 0)dnl
1.29 todd 417: target(ramd, tty0, 0, 1, 2, 3)dnl
418: twrget(ramd, wsdisp, ttyC, 0)dnl
419: target(ramd, wt, 0)dnl
420: target(ramd, fd, 0)dnl
421: target(ramd, rd, 0)dnl
1.40 deraadt 422: target(ramd, wd, 0, 1, 2, 3)dnl
423: target(ramd, sd, 0, 1, 2, 3)dnl
1.29 todd 424: target(ramd, cd, 0, 1)dnl
425: target(ramd, st, 0, 1)dnl
1.40 deraadt 426: target(ramd, mcd, 0)dnl
1.29 todd 427: -})dnl
428: ifelse(MACHINE, alpha, {-dnl
1.32 todd 429: target(all, ses, 0)dnl
430: target(all, ch, 0)dnl
431: target(all, ss, 0, 1)dnl
432: target(all, xfs, 0)dnl
433: twrget(all, flo, fd, 0, 0B, 0C, 0D, 0E, 0F, 0G, 0H)dnl
434: twrget(all, flo, fd, 1, 1B, 1C, 1D, 1E, 1F, 1G, 1H)dnl
435: target(all, pty, 0, 1, 2)dnl
436: target(all, bpf, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)dnl
437: target(all, tun, 0, 1, 2, 3)dnl
438: target(all, xy, 0, 1, 2, 3)dnl
439: target(all, rd, 0)dnl
440: target(all, cd, 0, 1)dnl
441: target(all, sd, 0, 1, 2, 3, 4)dnl
442: target(all, vnd, 0, 1, 2, 3)dnl
443: target(all, ccd, 0, 1, 2, 3)dnl
1.29 todd 444: target(ramd, sd, 0, 1, 2)dnl
445: target(ramd, wd, 0)dnl
446: target(ramd, tty0, 0, 1)dnl
447: target(ramd, st, 0)dnl
448: target(ramd, cd, 0)dnl
449: target(ramd, ttyB, 0, 1)dnl
450: target(ramd, ttyE, 0, 1)dnl
451: -})dnl
452: ifelse(MACHINE, amiga, {-dnl
1.32 todd 453: target(all, ses, 0)dnl
454: target(all, ch, 0)dnl
455: target(all, ss, 0, 1)dnl
456: target(all, xfs, 0)dnl
457: twrget(all, flo, fd, 0, 0B, 0C, 0D, 0E, 0F, 0G, 0H)dnl
458: twrget(all, flo, fd, 1, 1B, 1C, 1D, 1E, 1F, 1G, 1H)dnl
459: target(all, pty, 0, 1, 2)dnl
460: target(all, bpf, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)dnl
461: target(all, tun, 0, 1, 2, 3)dnl
462: target(all, xy, 0, 1, 2, 3)dnl
463: target(all, rd, 0)dnl
464: target(all, cd, 0, 1)dnl
465: target(all, sd, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)dnl
466: target(all, vnd, 0, 1, 2, 3)dnl
467: target(all, ccd, 0, 1, 2, 3)dnl
1.29 todd 468: target(ramd, kbd)dnl
469: target(ramd, pty, 0)dnl
470: target(ramd, tty0, 0)dnl
471: target(ramd, ttyA, 0, 1)dnl
472: target(ramd, ttyB, 0, 1)dnl
473: target(ramd, ttye, 0, 1, 2, 3, 4, 5, 6)dnl
474: target(ramd, cd, 0, 1)dnl
475: target(ramd, sd, 0, 1, 2, 3)dnl
476: target(ramd, st, 0, 1)dnl
477: target(ramd, fd, 0, 1)dnl
478: target(ramd, wd, 0, 1)dnl
479: target(ramd, rd, 0)dnl
1.21 todd 480: -})dnl
1.29 todd 481: ifelse(MACHINE, hp300, {-dnl
1.32 todd 482: target(all, ses, 0)dnl
483: target(all, ch, 0)dnl
484: target(all, ss, 0, 1)dnl
485: target(all, xfs, 0)dnl
486: twrget(all, flo, fd, 0, 0B, 0C, 0D, 0E, 0F, 0G, 0H)dnl
487: twrget(all, flo, fd, 1, 1B, 1C, 1D, 1E, 1F, 1G, 1H)dnl
488: target(all, pty, 0, 1, 2)dnl
489: target(all, bpf, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)dnl
490: target(all, tun, 0, 1, 2, 3)dnl
491: target(all, xy, 0, 1, 2, 3)dnl
492: target(all, rd, 0)dnl
493: target(all, cd, 0, 1)dnl
494: target(all, sd, 0, 1, 2, 3, 4)dnl
495: target(all, vnd, 0, 1, 2, 3)dnl
1.29 todd 496: _mkdev(st_hp300, ct*|mt*|st*,
1.27 todd 497: {-case $i in
498: ct*) name=ct blk=major_ct_b chr=major_ct_c;;
499: mt*) name=mt blk=major_mt_b chr=major_mt_c;;
500: st*) name=st blk=major_st_hp300_b chr=major_st_hp300_c;;
501: esac
502: case $U in
503: [0-7])
1.29 todd 504: four=Add($U, 4) eight=Add($U, 8)
505: twelve=Add($U, 12) twenty=Add($U, 20)
1.27 todd 506: M r$name$U c $chr $U 660 operator
507: M r$name$four c $chr $four 660 operator
508: M r$name$eight c $chr $eight 660 operator
509: M r$name$twelve c $chr $twelve 660 operator
510: MKlist="$MKlist;ln r$name$four nr$name$U";: sanity w/pdp11 v7
511: MKlist="$MKlist;ln r$name$twelve nr$name$eight";: ditto
512: RMlist="$RMlist nr$name$U nr$name$eight"
513: ;;
514: *)
515: echo bad unit for tape in: $1
516: ;;
517: esac-})dnl
1.29 todd 518: __devitem(st_hp300, st*, Exabyte tape)dnl
519: __devitem(grf, grf*, raw interface to HP300 graphics devices)dnl
1.32 todd 520: target(all, ccd, 0, 1, 2, 3)dnl
1.29 todd 521: target( all, grf, 0)dnl
522: dnl XXX target( all, hil, 0, 1, 2, 3, 4, 5, 6, 7)dnl
523: target( all, hil, )dnl
524: twrget( all, st_hp300, st, 0, 1)dnl
525: target( all, dca, 0, 1)dnl
526: target( all, dcm, 0, 1, 2, 3)dnl
527: target( all, hd, 0, 1, 2)dnl
528: target( all, ct, 0, 1)dnl
529: target( all, ite, 0)dnl
530: target(ramd, ct, 0, 1)dnl
531: target(ramd, hd, 0, 1, 2)dnl
532: target(ramd, sd, 0, 1, 2)dnl
533: target(ramd, rd, 0, 1)dnl
534: target(ramd, pty, 0)dnl
535: target(ramd, hil, )dnl
536: target(ramd, grf, 0)dnl
537: target(ramd, apci, 0)dnl
538: target(ramd, ite, 0)dnl
539: target(ramd, dca, 0)dnl
540: target(ramd, dcm, 0, 1)dnl
541: target(ramd, bpf, 0, 1)dnl
542: target(ramd, tun, 0, 1)dnl
543: -})dnl
544: ifelse(MACHINE, hppa, {-dnl
1.32 todd 545: target(all, ses, 0)dnl
546: target(all, ch, 0)dnl
547: target(all, ss, 0, 1)dnl
548: target(all, xfs, 0)dnl
549: twrget(all, flo, fd, 0, 0B, 0C, 0D, 0E, 0F, 0G, 0H)dnl
550: twrget(all, flo, fd, 1, 1B, 1C, 1D, 1E, 1F, 1G, 1H)dnl
551: target(all, pty, 0, 1, 2)dnl
552: target(all, bpf, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)dnl
553: target(all, tun, 0, 1, 2, 3)dnl
554: target(all, xy, 0, 1, 2, 3)dnl
555: target(all, rd, 0)dnl
556: target(all, cd, 0, 1)dnl
557: target(all, sd, 0, 1, 2, 3, 4)dnl
558: target(all, vnd, 0, 1, 2, 3)dnl
559: target(all, ccd, 0, 1, 2, 3)dnl
1.29 todd 560: target(ramd, st, 0, 1)dnl
561: target(ramd, sd, 0, 1, 2, 3)dnl
562: target(ramd, rd, 0, 1)dnl
563: target(ramd, pty, 0)dnl
564: target(ramd, hil)dnl
565: target(ramd, com, 0, 1)dnl
566: target(ramd, bpf, 0, 1)dnl
567: target(ramd, tun, 0, 1)dnl
568: -})dnl
569: ifelse(MACHINE, mac68k, {-dnl
1.32 todd 570: target(all, ses, 0)dnl
571: target(all, sd, 0, 1, 2, 3, 4)dnl
572: target(all, vnd, 0, 1, 2, 3)dnl
573: target(all, ch, 0)dnl
574: target(all, ss, 0, 1)dnl
575: target(all, xfs, 0)dnl
576: twrget(all, flo, fd, 0, 0B, 0C, 0D, 0E, 0F, 0G, 0H)dnl
577: twrget(all, flo, fd, 1, 1B, 1C, 1D, 1E, 1F, 1G, 1H)dnl
578: target(all, pty, 0, 1, 2)dnl
579: target(all, bpf, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)dnl
580: target(all, tun, 0, 1, 2, 3)dnl
581: target(all, xy, 0, 1, 2, 3)dnl
582: target(all, rd, 0)dnl
583: target(all, cd, 0, 1)dnl
584: target(all, ccd, 0, 1, 2, 3)dnl
1.29 todd 585: target(ramd, sd, 0, 1, 2, 3)dnl
586: target(ramd, st, 0, 1)dnl
1.45 miod 587: target(ramd, rd, 0, 1)dnl
1.29 todd 588: target(ramd, adb)dnl
589: target(ramd, asc, 0)dnl
590: target(ramd, grf, 0, 1)dnl
1.40 deraadt 591: target(ramd, ttye, 0)dnl
1.29 todd 592: twrget(ramd, mac_tty0, tty0, 0, 1)dnl
593: target(ramd, pty, 0)dnl
594: -})dnl
595: ifelse(MACHINE, macppc, {-dnl
1.32 todd 596: target(all, ses, 0)dnl
597: target(all, ch, 0)dnl
598: target(all, ss, 0, 1)dnl
599: target(all, xfs, 0)dnl
600: twrget(all, flo, fd, 0, 0B, 0C, 0D, 0E, 0F, 0G, 0H)dnl
601: twrget(all, flo, fd, 1, 1B, 1C, 1D, 1E, 1F, 1G, 1H)dnl
602: target(all, pty, 0, 1, 2)dnl
603: target(all, bpf, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)dnl
604: target(all, tun, 0, 1, 2, 3)dnl
605: target(all, xy, 0, 1, 2, 3)dnl
606: target(all, rd, 0)dnl
607: target(all, cd, 0, 1)dnl
608: target(all, sd, 0, 1, 2, 3, 4)dnl
609: target(all, vnd, 0, 1, 2, 3)dnl
610: target(all, ccd, 0, 1, 2, 3)dnl
1.29 todd 611: target(ramd, sd, 0, 1, 2, 3, 4)dnl
612: target(ramd, wd, 0, 1, 2, 3, 4)dnl
613: target(ramd, st, 0, 1)dnl
614: target(ramd, cd, 0, 1)dnl)dnl
615: target(ramd, rd, 0)dnl
1.40 deraadt 616: target(ramd, ttyE, 0)dnl
1.29 todd 617: target(ramd, tty0, 0, 1)dnl
618: target(ramd, pty, 0)dnl
619: -})dnl
1.32 todd 620: ifelse(MACHINE, sun3, {-
621: target(all, ses, 0)dnl
622: target(all, ch, 0)dnl
623: target(all, ss, 0, 1)dnl
624: target(all, xfs, 0)dnl
625: twrget(all, flo, fd, 0, 0B, 0C, 0D, 0E, 0F, 0G, 0H)dnl
626: twrget(all, flo, fd, 1, 1B, 1C, 1D, 1E, 1F, 1G, 1H)dnl
627: target(all, pty, 0, 1, 2)dnl
628: target(all, bpf, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)dnl
629: target(all, tun, 0, 1, 2, 3)dnl
630: target(all, xy, 0, 1, 2, 3)dnl
631: target(all, hk, 0, 1, 2, 3)dnl
632: target(all, rd, 0)dnl
633: target(all, cd, 0, 1)dnl
634: target(all, sd, 0, 1, 2, 3, 4)dnl
635: target(all, vnd, 0, 1, 2, 3)dnl
636: target(all, ccd, 0, 1, 2, 3)dnl
637: -})dnl
1.29 todd 638: ifelse(MACHINE, vax, {-
1.32 todd 639: dnl target(all, ses, 0)dnl
640: dnl target(all, ut, 0)dnl
641: dnl target(all, ch, 0)dnl
642: target(all, ss, 0)dnl
643: dnl target(all, xfs, 0)dnl
644: target(all, pty, 0, 1)dnl
645: target(all, bpf, 0, 1, 2, 3, 4, 5, 6, 7)dnl
646: target(all, tun, 0, 1)dnl
647: dnl target(all, xy, 0, 1, 2, 3)dnl
648: dnl target(all, hk, 0, 1, 2, 3)dnl
649: dnl target(all, up, 0, 1, 2, 3)dnl
650: dnl target(all, rd, 0)dnl
651: target(all, cd, 0)dnl
652: target(all, sd, 0, 1, 2, 3)dnl
653: target(all, vnd, 0)dnl
1.30 todd 654: __devitem(dhu, dhu*, unibus dhu11)dnl
655: __devitem(dmz, dmz*, unibus dmz32)dnl
656: __devitem(dmf, dmf*, unibus dmf32)dnl
657: __devitem(dh, dh*, {-unibus dh11 and emulations (e.g. Able dmax, Emulex cs-11)-})
658: __devitem(vt, vt*, {-console-})dnl
659: __devitem(dz, dz*, unibus dz11 and dz32)dnl
1.31 todd 660: __devitem(dl, dl*, unibus dl11)dnl
1.30 todd 661: _mkdev(dz, dz*,
1.31 todd 662: {-case $U in
1.30 todd 663: [0-7])
664: i=0
665: while [ $i -lt 8 ]; do
1.31 todd 666: no=Add(Mult($U, 8), $i)
1.30 todd 667: if [ $no -lt 10 ]; then
668: no="0${no}"
669: fi
1.31 todd 670: M tty${no} c 1 $no 600
671: let i=i+1
1.30 todd 672: done
673: ;;
674: *)
675: echo bad unit for dz in: $i
676: ;;
677: esac-})dnl
678: dnl XXX split this up abit?
1.31 todd 679: _mkdev(dhu, dhu*|dmz*|dmf*|dh*|vt*,
1.30 todd 680: {-set -A cnvtbl 0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v
681: case $i in
682: vt*) name=vt; major=68; count=8;
1.31 todd 683: case $U in
1.30 todd 684: 0) ch=w ;;
685: *) echo bad unit for $name in: $i ;;
686: esac;;
687: dmz*) name=dmz; major=37; count=24;
1.31 todd 688: case $U in
1.30 todd 689: 0) ch=a ;; 1) ch=b ;; 2) ch=c ;; 3) ch=e ;; 4) ch=f ;;
690: *) echo bad unit for $name in: $i ;;
691: esac;;
692: dmf*) name=dmf; major=22; count=8;
1.31 todd 693: case $U in
1.30 todd 694: 0) ch=A ;; 1) ch=B ;; 2) ch=C ;; 3) ch=E ;;
695: 4) ch=F ;; 5) ch=G ;; 6) ch=H ;; 7) ch=I ;;
696: *) echo bad unit for $name in: $i ;;
697: esac;;
698: dhu*) name=dhu; major=34; count=16;
1.31 todd 699: case $U in
1.30 todd 700: 0) ch=S ;; 1) ch=T ;; 2) ch=U ;; 3) ch=V ;;
701: 4) ch=W ;; 5) ch=X ;; 6) ch=Y ;; 7) ch=Z ;;
702: *) echo bad unit for $name in: $i ;;
703: esac;;
704: dh*) name=dh; major=12; count=16;
1.31 todd 705: case $U in
1.30 todd 706: 0) ch=h ;; 1) ch=i ;; 2) ch=j ;; 3) ch=k ;;
707: 4) ch=l ;; 5) ch=m ;; 6) ch=n ;; 7) ch=o ;;
708: *) echo bad unit for $name in: $i ;;
709: esac;;
710: esac
711: i=0
712: while [ $i -lt $count ]; do
713: let=${cnvtbl[$i]}
714: if [ -n "$let" ] ;then
1.31 todd 715: M tty${ch}${let} c $major Add(Mult($U, $count), $i) 600
1.30 todd 716: else
1.31 todd 717: echo bad count for ${name}: $U, $count, $i
1.30 todd 718: fi
1.31 todd 719: let i=i+1
1.30 todd 720: done
721: ;;
722:
723: dl*)
724: major=66
1.31 todd 725: let=${cnvtbl[$U]}
1.30 todd 726: if [ -n "$let" ] ;then
1.31 todd 727: M ttyJ${let} c $major $U 600
1.30 todd 728: else
1.31 todd 729: echo bad number for ${name}: $U
1.30 todd 730: fi-})dnl
731: dnl
1.32 todd 732: target( all, ccd, 0)dnl
1.29 todd 733: target( all, hd, 0, 1, 2)dnl
1.31 todd 734: target( all, mt, 0, 1)dnl
735: target( all, ts, 0, 1)dnl
1.30 todd 736: target( all, uu, 0)dnl
1.31 todd 737: target( all, st, 0, 1)dnl
1.30 todd 738: target( all, dhu, 0)dnl
1.32 todd 739: dnl target( all, dmz, 0)dnl
740: dnl target( all, dmf, 0)dnl
741: dnl target( all, dh, 0)dnl
1.30 todd 742: target( all, dz, 0)dnl
1.31 todd 743: target( all, dl, 0)dnl
744: target( all, vt, 0)dnl
1.29 todd 745: target(ramd, fd, 0)dnl
746: target(ramd, sd, 0, 1, 2, 3)dnl
747: target(ramd, rd, 0)dnl
748: target(ramd, cd, 0)dnl
749: target(ramd, bpf, 0)dnl
750: -})dnl
751: target(ramd, std)dnl
752: target(ramd, random)dnl
753: target(ramd, bpf, 0)dnl
1.34 deraadt 754: __devitem(rd, {-rd*-}, "rd" pseudo-disks)dnl
1.29 todd 755: _mkdev(rd, rd*, {-dodisk2 rd $U major_rd_b major_rd_c $U 0{--}ifstep(rd)-})dnl
756: __devitem(xd, xd*, Xylogic 753/7053 disks)dnl
757: __devitem(xy, xy*, {- Xylogic 450/451 disks-})dnl
758: __devitem(flo, {-fd*-}, {-Floppy disk drives (3 1/2"{-,-} 5 1/4")-})dnl
759: _mkdev(flo, fd*,
1.1 todd 760: {-typnam=$U${i#fd[01]*}
761: case $typnam in
762: 0|1) typnum=0;; # no type specified, assume A
1.26 deraadt 763: *A) typnum=0; typnam=0;;
764: *B) typnum=1;;
765: *C) typnum=2;;
766: *D) typnum=3;;
767: *E) typnum=4;;
768: *F) typnum=5;;
769: *G) typnum=6;;
770: *H) typnum=7;;
771: *) echo bad type $typnam for $i; exit 1;;
1.1 todd 772: esac
773: case $U in
774: 0|1) blk=major_flo_b; chr=major_flo_c;;
775: *) echo bad unit $U for $i; exit 1;;
776: esac
777: nam=fd${typnam}
1.29 todd 778: n=Add(Mult($U, 128), Mult($typnum, 16))
1.1 todd 779: M ${nam}a b $blk $n 640 operator
1.29 todd 780: M ${nam}b b $blk Add($n, 1) 640 operator
781: M ${nam}c b $blk Add($n, 2) 640 operator
1.1 todd 782: M r${nam}a c $chr $n 640 operator
1.29 todd 783: M r${nam}b c $chr Add($n, 1) 640 operator
784: M r${nam}c c $chr Add($n, 2) 640 operator-}, 664)dnl
785: __devitem(aflo, ramdisk, devices needed for install floppies)dnl
786: _mkdev(aflo, fd*, {-case $U in 0|1|2|3)
787: M fd${U}a b major_aflo_b Mult($U, 16) 640 operator
788: M fd${U}b b major_aflo_b Add(Mult($U, 16), 1) 640 operator
789: M rfd${U}a c major_aflo_c Mult($U, 16) 640 operator
790: M rfd${U}b c major_aflo_c Add(Mult($U, 16), 1) 640 operator;;
1.1 todd 791: *) echo bad unit for floppy disk in: $i;;
792: esac-})dnl
1.29 todd 793: __devitem(iop, iop*, I2O controller device)dnl
794: _mcdev(iop, iop*, iop, {-major_iop_c-}, 660)dnl
795: __devitem(wdt, wdt0, watchdog timer)dnl
796: _mcdev(wdt, wdt0, wdt, {-major_wdt_c-}, 440, operator)dnl
797: __devitem(local, local, configuration specific devices)dnl
798: __devitem(wd, {-wd*-}, {-"winchester" disk drives (ST506, IDE, ESDI, RLL, ...)-})dnl
799: __devitem(ccd, ccd*, concatenated disk devices)dnl
800: __devitem(raid, raid*, RAIDframe disk devices)dnl
801: __devitem(vnd, vnd*, "file" pseudo-disks)dnl
802: _mkdev(vnd, vnd*, {-dodisk vnd $U major_vnd_b major_vnd_c $U 0{--}ifstep(vnd)
1.6 todd 803: dodisk svnd $U major_vnd_b major_vnd_c $U 128{--}ifstep(vnd)-})dnl
1.29 todd 804: __devitem(ra, ra*, {-MSCP disks (ra??, hd??)-})dnl
805: __devitem(hp, hp*, {-massbuss rm??-})dnl
806: __devitem(hk, hk*, {-unibus rk06 and rk07-})dnl
807: __devitem(up, up*, {-other unibus devices (e.g. on Emulex sc-21v controller)-})dnl
808: __devitem(rb, rb*, {-730 idc w/ rb80 and/or rb02-})dnl
809: __devitem(rx, rx*, {-MSCP floppy disk (rx33/50/...)-})dnl
810: __devitem(rl, rl*, {-unibus r102-})dnl
811: __devitem(hd, hd*, {-HDC9224 hd disks on VS2000-})dnl
1.1 todd 812: dnl
813: dnl For normal disk devices, add a disk_q entry; anything else define like
814: dnl the rest (such as vnd above).
815: dnl
1.18 todd 816: disk_q({-ccd-})dnl
817: disk_q({-hd-})dnl
818: disk_q({-hk-})dnl
819: disk_q({-hp-})dnl
820: disk_q({-ra-})dnl
821: disk_q({-raid-})dnl
822: disk_q({-rb-})dnl
823: disk_q({-rl-})dnl
824: disk_q({-rx-})dnl
825: disk_q({-sd-})dnl
1.1 todd 826: disk_q({-xy-})dnl
827: disk_q({-xd-})dnl
1.18 todd 828: disk_q({-up-})dnl
829: disk_q({-wd-})dnl
1.1 todd 830: disk_q({-rz-})dnl
831: dnl
1.29 todd 832: __devitem(loc, local, configuration specific devices)dnl
833: _mkdev(loc, local, {-test -s $T.local && sh $T.local-})dnl
834: _mkdev({-disks-}, {-undefine({-C_ase-})show_disks()undefine({-C_ase-})-},
1.1 todd 835: {-case $i in
836: show_disks2()dnl
1.6 todd 837: esac-})dnl
1.1 todd 838: __mkdev({-disks-}){--}dnl
839: dnl
1.29 todd 840: __devtitle(cons, Console ports)dnl
841: __devitem(ttyv0, ttyv0, pccons or pcvt screen 0)dnl
842: __devitem(ttyv, ttyv*, pcvt)dnl
843: __devitem(ttye, ttye*, ite bitmapped consoles)dnl
844: __devitem(mac_ttye, ttye*, ite bitmapped consoles)dnl
845: __devitem(wscons, ttyC0, wscons screen 0)dnl
1.35 todd 846: twrget(wscons, wscons, ttyC, cfg, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b)dnl
847: target(wscons, wsmux)dnl
848: target(wscons, wskbd, 0, 1, 2, 3)dnl
849: target(wscons, wsmouse, 0, 1, 2, 3)dnl
1.29 todd 850: _mkdev({-wscons-}, {-wscons-}, {-dnl
1.35 todd 851: show_target(wscons)dnl
852: -})dnl
1.36 todd 853: __devitem(wsdisp, ttyC-F*, wscons virtual consoles)dnl
1.35 todd 854: _mkdev({-wsdisp-}, tty[C-F]*, {-U=${i##tty[C-F]}
855: case $i in
856: ttyC*) n=C m=expr(0*256);;
857: ttyD*) n=D m=expr(1*256);;
858: ttyE*) n=E m=expr(2*256);;
859: ttyF*) n=F m=expr(3*256);;
860: esac
1.3 todd 861: case $U in
1.35 todd 862: [0-9a-f]) M tty$n$U c major_wsdisp_c {-$(( 16#$U + $m ))-} 600;;
863: cfg) M tty${n}cfg c major_wsdisp_c Add(255,$m) 600;;
1.3 todd 864: *) echo bad unit $U for $i; exit 1;;
1.6 todd 865: esac-})dnl
1.29 todd 866: __devitem(wskbd, wskbd*, wscons keyboards)dnl
867: _mkdev(wskbd, wskbd*, {-M wskbd$U c major_wskbd_c $U 600-})dnl
868: __devitem(wsmux, wsmux, wscons keyboard/mouse mux devices)dnl
869: _mkdev(wsmux, wsmux|wsmouse|wskbd, {-M wsmouse c major_wsmux_c 0 600
1.1 todd 870: M wskbd c major_wsmux_c 1 600-})dnl
1.29 todd 871: __devitem(pcons, console, PROM console)dnl
872: __devtitle(point, Pointing devices)dnl
873: __devitem(wsmouse, wsmouse*, wscons mice)dnl
874: _mkdev(wsmouse, wsmouse*, {-M wsmouse$U c major_wsmouse_c $U 600-})dnl
875: __devitem(quad, quadmouse, "quadrature mouse")dnl
876: __devtitle(pty, Pseudo terminals)dnl
877: __devitem(tty, tty*, set of 16 slave psuedo terminals)dnl
878: __devitem(pty, pty*, set of 16 master pseudo terminals)dnl
1.31 todd 879: _mkdev(pty, pty*, {-if [ $U -gt 15 ]; then
880: echo bad unit for pty in: $i
881: continue
882: fi
883: set -A tbl p q r s t u v w x y z P Q R S T
884: name=${tbl[$U]}
1.1 todd 885: n=0
886: while [ $n -lt 16 ]
887: do
888: nam=$name$(hex $n)
1.31 todd 889: off=Mult($U, 16)
1.29 todd 890: M tty$nam c major_tty_c Add($off, $n)
891: M pty$nam c major_pty_c Add($off, $n)
892: n=Add($n, 1)
1.1 todd 893: done-})dnl
1.29 todd 894: __devitem(dc, dc*, {-4 channel serial interface (keyboard{-,-} mouse{-,-}modem{-,-} printer)-})dnl
895: __devtitle(prn, Printers)dnl
896: __devitem(par, par*, motherboard parallel port)dnl
897: __devitem(lpt, lpt*, IEEE 1284 centronics printer)dnl
898: _mkdev(lpt, lpt*|lpa*,
1.1 todd 899: {-case $i in
900: lpt*) n=lpt f=0;;
901: lpa*) n=lpa f=128;;
902: esac
1.29 todd 903: M $n$U c major_lpt_c Add($U, $f) 600-})dnl
904: __devitem(lpa, lpa*, interruptless lp)dnl
905: __devitem(ppi, ppi*, HP-IB plotters)dnl
906: __devtitle({-usb-}, USB devices)dnl
907: __devitem({-usb-}, usb*, Bus control devices used by usbd for attach/detach)dnl
908: _mkdev({-usb-}, usb*, {-[ "$i" = "usb" ] && u= || u=$U
1.1 todd 909: M usb$u c major_usb_c $U 660-})dnl
1.29 todd 910: __devitem(uhid, uhid*, Generic HID devices)dnl
911: _mcdev({-uhid-}, uhid*, {-uhid-}, {-major_uhid_c-}, 660)dnl
912: __devitem(ulpt, ulpt*, Printer devices)dnl
913: _mcdev({-ulpt-}, ulpt*, {-ulpt-}, {-major_ulpt_c-}, 660)dnl
914: __devitem(utty, utty*, Serial ports)dnl
915: _mcdev({-utty-}, utty*, {-utty-}, {-major_utty_c-}, 660)dnl
916: __devitem(urio, urio*, Diamond Multimedia Rio 500)dnl
917: _mcdev({-urio-}, urio*, {-urio-}, {-major_urio_c-}, 660)dnl
918: __devitem(uscan, uscanner*, Scanners)dnl
919: _mcdev({-uscan-}, uscanner*, {-uscanner-}, {-major_uscan_c-}, 660)dnl
920: __devitem(ugen, ugen*, Generic device)dnl
921: _mkdev(ugen, ugen*, {-n=Mult($U, 16)
1.1 todd 922: for j in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
923: do
1.29 todd 924: M ugen$U.$j c major_ugen_c Add($n, $j) 660
1.1 todd 925: done-})dnl
1.29 todd 926: __devtitle(cpu, Cpus)dnl
927: __devitem(cpu, cpu*, cpus)dnl
928: __devtitle(call, Call units)dnl
929: __devtitle(term, Terminal ports)dnl
930: __devtitle(termp, Terminal multiplexers)dnl
931: __devitem(dca, dca*, HP200/300 single port serial interface)dnl
932: __devitem(dcm, dcm*, HP200/300 4 port serial mux interface)dnl
933: __devitem(apci, apci*, HP400 4 port serial mux interface)dnl
934: __devitem({-com-}, {-tty0*-}, NS16x50 serial ports)dnl
935: _mkdev(com, {-tty0*-}, {-M tty$U c major_com_c $U 660 dialer uucp
936: M cua$U c major_com_c Add($U, 128) 660 dialer uucp-})dnl
937: __devitem(ttyc, ttyc*, Cyclades serial ports)dnl
938: __devitem(tzs, tty[a-z]*, Zilog 8530 Serial Port)dnl
939: _mkdev(tzs, {-tty[a-z]-}, {-u=${i#tty*}
1.1 todd 940: case $u in
941: a) n=0 ;;
942: b) n=1 ;;
943: c) n=4 ;;
944: d) n=5 ;;
945: *) echo unknown tty device $i ;;
946: esac
947: M tty$u c major_tzs_c $n 660 dialer uucp-})dnl
1.29 todd 948: __devitem(tth, ttyh*, Sab82532 serial devices)dnl
949: _mkdev(tth, ttyh*, {-M ttyh$U c major_tth_c $U 660 dialer uucp-})dnl
950: __devitem(czs, cua[a-z]*, Zilog 8530 Serial Port)dnl
951: _mkdev(czs, cua[a-z], {-u=${i#cua*}
1.1 todd 952: case $u in
953: a) n=0 ;;
954: b) n=1 ;;
955: c) n=4 ;;
956: d) n=5 ;;
1.41 todd 957: *) echo unknown cua device $i ;;
1.1 todd 958: esac
1.29 todd 959: M cua$u c major_czs_c Add($n, 128) 660 dialer uucp-})dnl
960: __devitem(arm_tty, tty*, {-alias for PC COM ports{-,-} this is what the system really wants-})dnl
961: __devitem(tty0, tty00, standard serial port)dnl
962: __devitem(mac_tty0, tty00, standard serial port)dnl
963: __devitem(ttyA, ttyA*, mfc serial ports)dnl
964: __devitem(attyB, ttyB*, ISA COM ports)dnl amiga
965: __devitem(ttyz, tty[a-d], onboard zs serial ports)dnl
966: __devitem(cuaz, cua[a-d], onboard zs serial ports)dnl
967: __devitem(ttyB, ttyB?, DEC 3000 ZS8530 ("scc") serial ports)dnl
968: __devitem(scc, scc*, 82530 serial interface)dnl
969: __devitem(arc_ttyC, ttyC0, pccons)dnl
970: __devitem(i386_ttyC, ttyC*, pcvt)dnl
971: __devitem(ttyC, ttyC?, {-AlphaStation NS16550 ("com serial ports")-})dnl
972: __devitem(ttyE, ttyE?, Workstation console (framebuffer & keyboard) tty emulators)dnl
973: __devitem(ser02, ser02, {-serial2 port (channel A on 8530)-})dnl
974: __devitem(mdm02, mdm02, {-modem2 port (channel B on 8530)-})dnl
975: __devtitle(spec, Special purpose devices)dnl
976: __devitem(apm, apm , power management device)dnl
977: _mkdev(apm, apm*, {-M apm c major_apm_c 0 644
1.1 todd 978: M apmctl c major_apm_c 8 644-})dnl
1.29 todd 979: __devitem(pcmcia, pcmcia*, PCMCIA card drivers)dnl
980: __devitem(pctr, pctr*, PC Performance Tuning Register access device)dnl
981: _mkdev(pctr, pctr, {-M pctr c major_pctr_c 0 644-})dnl
1.46 provos 982: __devitem(systrace, systrace*, system call tracing device)dnl
983: _mkdev(systrace, systrace, {-M systrace c major_systrace_c 0 644-})dnl
1.29 todd 984: __devitem(au, audio*, audio device)dnl
985: _mkdev(au, audio*, {-M sound$U c major_au_c $U
986: M mixer$U c major_au_c Add($U, 16)
987: M audio$U c major_au_c Add($U, 128)
988: M audioctl$U c major_au_c Add($U, 192)
1.1 todd 989: MKlist="$MKlist;[ -e audio ] || ln -s audio$U audio"
990: MKlist="$MKlist;[ -e mixer ] || ln -s mixer$U mixer"
991: MKlist="$MKlist;[ -e sound ] || ln -s sound$U sound"
992: MKlist="$MKlist;[ -e audioctl ] || ln -s audioctl$U audioctl"-})dnl
1.29 todd 993: __devitem(asc, asc*, ASC Audio device)dnl
994: _mkdev(asc, asc*, {-M asc$U major_asc_c 0-})dnl
995: __devitem(music, music*, midi devices)dnl
996: _mkdev(music, music*, {-M music$U c major_music_c $U
997: M sequencer$U c major_music_c Add($U, 128)
1.1 todd 998: MKlist="$MKlist;[ -e music ] || ln -s music$U music"
999: MKlist="$MKlist;[ -e sequencer ] || ln -s sequencer$U sequencer"-})dnl
1.29 todd 1000: __devitem(radio, radio*, FM tuner device)dnl
1001: _mkdev(radio, radio*, {-M radio$U c major_radio_c $U
1.8 todd 1002: MKlist="$MKlist;[ -e radio ] || ln -s radio$U radio"-})dnl
1.29 todd 1003: __devitem(fdesc, fd, makes fd/* for the fdescfs)dnl
1004: _mkdev(fdesc, fd, {-RMlist="mkdir -p fd;$RMlist" n=0
1005: while [ $n -lt 64 ];do M fd/$n c major_fdesc_c $n;n=Add($n, 1);done
1.1 todd 1006: MKlist="$MKlist;chmod 555 fd"-})dnl
1.29 todd 1007: __devtitle(graph, Graphics devices)dnl
1008: __devitem(grf_mac, grf*, {-custom chip (grf0){-,-} Retina Z2/Z3 (grf1/grf2){-,-}
1.1 todd 1009: {-#-} Cirrus boards (grf3){-,-} A2410 (grf4) video or
1010: {-#-} CyberVision 64 (grf5)-})dnl
1.29 todd 1011: __devitem(grf_amiga, grf*, {-Motherboard bitmapped video.-})dnl
1012: __devitem(ite, ite*, terminal emulator interface to HP300 graphics devices)dnl
1013: __devitem({-hil-}, {-hil-}, HP300 HIL input devices)dnl
1014: __devitem(oppr, openprom)dnl
1015: _cdev(oppr, openprom, 70, 0)dnl
1016: __devitem(btw, bwtwo*)dnl
1017: _mcdev(btw, bwtwo*, bwtwo, {-major_btw_c-}, 666)dnl
1018: __devitem(ctw, cgtwo*)dnl
1019: _mcdev(ctw, cgtwo*, cgtwo, {-major_ctw_c-}, 666)dnl
1020: __devitem(ctr, cgthree*)dnl
1021: _mcdev(ctr, cgthree*, cgthree, {-major_ctr_c-}, 666)dnl
1022: __devitem(cfr, cgfour*)dnl
1023: _mcdev(cfr, cgfour*, cgfour, {-major_cfr_c-}, 666)dnl
1024: __devitem(csx, cgsix*)dnl
1025: _mcdev(csx, cgsix*, cgsix, {-major_csx_c-}, 666)dnl
1026: __devitem(ceg, cgeight*)dnl
1027: _mcdev(ceg, cgeight*, cgeight, {-major_ceg_c-}, 666)dnl
1028: __devitem(cfo, cgfourteen*)dnl
1029: _mcdev(cfo, cgfourteen*, cgfourteen, {-major_cfo_c-})dnl
1030: __devitem(tcx, tcx*)dnl
1031: _mcdev(tcx, tcx*, tcx, {-major_tcx_c-})dnl
1032: __devitem(cry, crypto, hardware crypto access driver)dnl
1033: _mkdev(cry, crypto, {-M crypto c major_cry_c-} 0)dnl
1034: __devitem(pf, pf*, Packet Filter)dnl
1035: _mkdev(pf, {-pf*-}, {-M pf c major_pf_c 0 600-})dnl
1036: __devitem(bpf, bpf*, Berkeley Packet Filter)dnl
1037: _mkdev(bpf, {-bpf*-}, {-M bpf$U c major_bpf_c $U 600-}, 600)dnl
1038: _mkdev(tun, {-tun*-}, {-M tun$U c major_tun_c $U 600-}, 600)dnl
1039: __devitem(altq, altq/, ALTQ control interface)dnl
1040: _mkdev(altq, altq, {-RMlist="mkdir -p altq;$RMlist"
1.1 todd 1041: for d in altq cbq wfq afm fifoq red rio localq hfsc cdnr blue priq; do
1042: M altq/$d c major_altq_c $U 644
1.29 todd 1043: U=Add($U, 1)
1.1 todd 1044: done-})dnl
1.29 todd 1045: __devitem(speak, speaker, pc speaker)dnl
1046: _mkdev(speak, speaker, {-M speaker c major_speak_c 0 600-})dnl
1047: __devitem(kbd, kbd, keyboard (provides events, for X11))dnl
1048: _cdev(kbd, kbd, {-major_kbd_c-}, 0, 600)dnl
1049: __devitem(kbd_atari, kbd, Atari keyboard)dnl
1050: __devitem(akbd, kbd, Amiga keyboard)dnl
1051: __devitem(rkbd, kbd, raw keyboard)dnl
1052: __devitem(kbdctl, kbdctl, keyboard control)dnl
1053: __devitem(beep, beep, riscpc speaker)dnl
1054: __devitem(iic, iic*, IIC bus device)dnl
1055: __devitem(rtc, rtc*, RTC device)dnl
1056: __devitem(view, view*, generic interface to graphic displays)dnl
1057: __devitem(aconf, aconf, {-autoconfig information (not yet)-})dnl
1058: __devitem(mouse-, mouse-*, "mouse link")dnl
1059: __devitem(mouse, mouse, mouse (provides events, for X11))dnl
1060: __devitem(amouse, mouse*, Amiga mice)dnl
1061: __devitem(lkm, lkm, loadable kernel modules interface)dnl
1062: _cdev(lkm, lkm, {-major_lkm_c-}, 0, 640, kmem)dnl
1063: __devitem(mmcl, mmclock, memory mapped clock)dnl
1064: __devitem(tun, tun*, network tunnel driver)dnl
1065: __devitem(rnd, *random, inkernel random data source)dnl
1066: _mkdev(rnd, *random, {-n=0
1.1 todd 1067: for pre in " " s u p a
1068: do
1069: M ${pre}random c major_rnd_c $n 644
1.29 todd 1070: n=Add($n, 1)
1071: done-}, 644)dnl
1072: __devitem(joy, joy*, joystick driver)dnl
1073: _mcdev(joy, joy*, joy, {-major_joy_c-}, 666)dnl
1074: __devitem(mag, magma*, magma card (makes 16 tty and 2 bpp))dnl
1075: __devitem(bppmag, bppmag[mno], magma parallel port device)dnl
1076: __devitem(spif, spif*, spif card (makes 8 tty and 1 bpp))dnl
1077: __devitem(bppsp, bpp[jkl], spif parallel port device)dnl
1078: _mkdev(mag, magma*, {-case $U in
1.18 todd 1079: 0) offset=0 nam=m;;
1080: 1) offset=16 nam=n;;
1081: 2) offset=32 nam=o;;
1082: *) echo "bad unit for $i: $U"; exit 127;;
1083: esac
1.29 todd 1084: offset=Mult($U, 64)
1.18 todd 1085: n=0
1086: while [ $n -lt 16 ]
1087: do
1088: name=${nam}`hex $n`
1.29 todd 1089: M tty$name c major_mag_c Add($offset, $n) 660 dialer uucp
1090: n=Add($n, 1)
1.18 todd 1091: done
1.29 todd 1092: M bpp${nam}0 c major_bppmag_c Add($offset, 0) 600
1093: M bpp${nam}1 c major_bppmag_c Add($offset, 1) 600-})dnl
1094: _mkdev(spif, spif*, {-case $U in
1.18 todd 1095: 0) offset=0 nam=j;;
1096: 1) offset=16 nam=k;;
1097: 2) offset=32 nam=l;;
1098: *) echo "bad unit for $i: $U"; exit 127;;
1099: esac
1.29 todd 1100: offset=Mult($U, 64)
1.18 todd 1101: n=0
1102: while [ $n -lt 8 ]
1103: do
1104: name=${nam}`hex $n`
1.29 todd 1105: M tty$name c major_spif_c Add($offset, $n) 660 dialer uucp
1106: n=Add($n, 1)
1.18 todd 1107: done
1.29 todd 1108: M bpp${nam}0 c major_bppsp_c Add($offset, 0) 600-})dnl
1109: __devitem(bpp, bpp*, parallel port devices)dnl
1110: __devitem(xfs, xfs*, XFS filesystem devices)dnl
1111: _mcdev(xfs, xfs*, xfs, {-major_xfs_c-}, 600)dnl
1112: __devitem(hil, hil, HIL input devices)dnl
1113: __devitem(rmidi, rmidi*, raw midi devices)dnl
1114: _mcdev(rmidi, rmidi*, rmidi, {-major_rmidi_c-}, 666)dnl
1115: __devtitle(plat, Platform-specific devices)dnl
1116: __devitem(fb, fb*, framebuffer device)dnl
1117: __devitem(bktr, bktr*, video capturing)dnl
1118: _mcdev(bktr, bktr*, bktr, {-major_bktr_c-}, 644)dnl
1119: __devitem(tuner, tuner*, tuner device)dnl
1120: _mkdev(tuner, tuner*, {-M tuner$U c major_bktr_c Add(Mult($U, 2), 16) 644-}, 644)dnl
1121: __devitem(pci, pci, PCI bus device)dnl
1.43 deraadt 1122: _mkdev(pci, pci, {-M pci c major_pci_c 0 600-}, 600)dnl
1.29 todd 1123: __devitem(adb, adb, Apple Desktop bus event interface)dnl
1124: _mkdev(adb, adb, {-M adb c major_adb_c 0-})dnl
1125: __devitem(pdc, pdc, PDC device)dnl
1126: _mkdev(local, local, {-test -s $T.local && sh $T.local-}, 666)dnl
1.49 fgsch 1127: __devitem(gpr, gpr*, gpr400 pcmcia device)dnl
1128: _mcdev(gpr, gpr*, gpr, {-major_gpr_c-})dnl
1.1 todd 1129: dnl
1130: divert(1)dnl
1131: include(etc.MACHINE/MAKEDEV.md)dnl
1132: dnl
1133: dnl
1134: divert(0)dnl
1135: #!/bin/sh -
1136: #
1137: # THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.
1138: # generated from:
1139: #
1140: show_vers()dnl <-- now that all files are included, show versions
1141: #
1142: dnl
1143: divert(2)dnl
1144: PATH=/sbin:/usr/sbin:/bin:/usr/bin
1145: T=$0
1146:
1147: # set this to echo for Echo-Only debugging
1148: [ "$eo" ] || eo=
1149:
1150: hex()
1151: {
1152: case ${--}1 in
1.26 deraadt 1153: [0-9]) echo -n {-$-}1;;
1154: 10) echo -n a;;
1155: 11) echo -n b;;
1156: 12) echo -n c;;
1157: 13) echo -n d;;
1158: 14) echo -n e;;
1159: 15) echo -n f;;
1.1 todd 1160: esac
1161: }
1.26 deraadt 1162:
1.1 todd 1163: trunc()
1164: {
1165: # XXX pdksh can't seem to deal with locally scoped variables
1166: # in ${foo#$bar} expansions
1167: arg1="{-$-}1"
1168: arg2="{-$-}2"
1169: case {-$-}3 in
1170: l) echo ${arg2#$arg1} ;;
1171: r|*) echo ${arg1#$arg2} ;;
1172: esac
1173: }
1.26 deraadt 1174:
1.1 todd 1175: unt()
1176: {
1177: # XXX pdksh can't seem to deal with locally scoped variables
1178: # in ${foo#$bar} expansions
1179: arg="{-$-}1"
1180: tmp="${arg#[a-zA-Z]*}"
1181: tmp="${tmp%*[a-zA-Z]}"
1182: while [ "$tmp" != "$arg" ]
1183: do
1184: arg=$tmp
1185: tmp="${arg#[a-zA-Z]*}"
1186: tmp="${tmp%*[a-zA-Z]}"
1187: done
1188: echo $arg
1189: }
1190: dnl
1.29 todd 1191: dnl dodisk(name, unit, blkmaj, chrmaj, unit, off[, stepping])
1.5 todd 1192: dnl arg: 1 2 3 4 5 6 7
1.1 todd 1193: dnl
1.26 deraadt 1194:
1.1 todd 1195: dodisk()
1196: {
1.27 todd 1197: [ "$DEBUG" ] && set -x
1.29 todd 1198: n=Add(Mult(${5}, ${7:-16}), ${6}) count=0
1.1 todd 1199: RMlist="$RMlist {-$-}1{-$-}2? r{-$-}1{-$-}2?"
1.13 todd 1200: [ 0$7 -ne 8 ] && l="i j k l m n o p"
1201: for d in a b c d e f g h $l
1.1 todd 1202: do
1.29 todd 1203: M {-$-}1{-$-}2$d b {-$-}3 Add($n, $count) 640
1204: M r{-$-}1{-$-}2$d c {-$-}4 Add($n, $count) 640
1.1 todd 1205: let count=count+1
1206: done
1207: MKlist="$MKlist;chown root.operator {-$-}1{-$-}2? r{-$-}1{-$-}2?"
1208: }
1209: dnl
1.29 todd 1210: dnl dodisk2(name, unit, blkmaj, chrmaj, unit, off[, stepping])
1.1 todd 1211: dnl
1212: dnl 1. name - prefix name of the device
1213: dnl 2. unit - beginning unit number for block devices
1214: dnl 3. blkmaj - block device major number
1215: dnl 4. chrmaj - character device major number
1216: dnl 5. unit - beginning unit number for character devices
1217: dnl 6. off - offset from 0 for all minor numbers (see svnd for an example)
1.5 todd 1218: dnl 7. step - optional, defaults to 16, number of partitions per device
1.1 todd 1219: dnl
1.26 deraadt 1220:
1.1 todd 1221: dodisk2()
1222: {
1.29 todd 1223: n=Add(Mult({-$-}5, ${7:-16}), {-$-}6)
1.1 todd 1224: M {-$-}1{-$-}2a b {-$-}3 $n 640 operator
1225: M r{-$-}1{-$-}2a c {-$-}4 $n 640 operator
1.29 todd 1226: n=Add($n, 2)
1.1 todd 1227: M {-$-}1{-$-}2c b {-$-}3 $n 640 operator
1228: M r{-$-}1{-$-}2c c {-$-}4 $n 640 operator
1229: }
1230:
1231: # M name b/c major minor [mode] [group]
1232: RMlist="rm -f"
1233: MKlist=":"
1.26 deraadt 1234:
1.1 todd 1235: mkl() {
1236: dnl
1237: dnl uncomment if multi mknod happens
1238: dnl
1.29 todd 1239: ifelse(1, 0,
1.1 todd 1240: [ "${mklist[{-$-}1]}" ] && mklist[{-$-}1]="${mklist[{-$-}1]} {-$-}2 {-$-}3 {-$-}4 {-$-}5" || {
1.30 todd 1241: mklist[{-$-}1]="mknod -m {-$-}1 {-$-}2 {-$-}3 {-$-}4 {-$-}5"
1242: modes="$modes {-$-}1"
1.1 todd 1243: },
1244: dnl
1245: dnl non multi mknod
1246: dnl
1.26 deraadt 1247: [ "${mklist[{-$-}1]}" ] && {
1248: mklist[{-$-}1]="${mklist[{-$-}1]};mknod -m {-$-}1 {-$-}2 {-$-}3 {-$-}4 {-$-}5"
1249: } || {
1250: mklist[{-$-}1]="mknod -m {-$-}1 {-$-}2 {-$-}3 {-$-}4 {-$-}5"
1251: modes="$modes {-$-}1"
1252: })
1.1 todd 1253: }
1.26 deraadt 1254:
1.1 todd 1255: M() {
1256: RMlist="$RMlist {-$-}1"
1257: mkl ${5-666} {-$-}1 {-$-}2 {-$-}3 {-$-}4
1258: mklist="$mklist {-$-}1"
1259: G={-$-}{6:-wheel}
1260: [ "{-$-}7" ] && {
1261: MKlist="$MKlist;chown {-$-}7.{-$-}G {-$-}1"
1262: } || {
1263: case $G in
1264: wheel)g=0;;kmem)g=2;;operator)g=5;;tty)g=4;;dialer)g=117;;
1265: esac
1266: [ "${grplist[$g]}" ] && {
1267: grplist[$g]="${grplist[$g]} {-$-}1"
1268: } || {
1269: groups="$groups $g"
1270: grplist[$g]="chgrp $G {-$-}1"
1271: }
1272: }
1273: return 0
1274: }
1275: divert(7)dnl
1276: dnl
1277: dnl there is no blank line at the end of etc.arch/MAKEDEV.md files, so add one
1278: dnl on the following line:
1279:
1280: show_devs()dnl
1281: dnl
1282: divert(9)dnl
1283: *)
1284: echo $i: unknown device
1285: ;;
1286: esac
1287: done
1288: }
1289: _recurse "$@"
1290: if [ "$os" = "SunOS" ]; then
1291: eo=transform
1292: transform() {
1293: case $mode in
1294: 600) mask=077;;
1295: 640) mask=027;;
1296: 660) mask=007;;
1297: 644) mask=022;;
1298: 666) mask=0;;
1299: 440) mask=227;;
1300: esac
1301: echo `echo "$@"|sed \
1.26 deraadt 1302: 's/mknod -m \([0-9]*\) /umask '$mask';mknod /;s/-m [0-9]* //g;\
1303: s/operator/5/g;s/root.kmem/root.2/g;s/root\./root:/g'`
1.1 todd 1304: }
1305: fi
1306: list="$RMlist"
1307: for mode in $modes; do
1308: list="$list;${mklist[$mode]}"
1309: done
1310: for group in $groups; do
1311: list="$list;${grplist[$group]}"
1312: done
1313: list="$list;$MKlist"
1314: if [ "$eo" = "echo" -o "$eo" = "transform" ]; then
1315: $eo "$list"
1316: else
1317: echo "$list" | sh
1318: fi
1.41 todd 1319: divert(3)dnl
1.1 todd 1320: dnl
1.26 deraadt 1321:
1.1 todd 1322: R() {
1.23 todd 1323: [ "$DEBUG" ] && set -x
1.1 todd 1324: for i in "$@"
1325: do
1326: U=`unt $i`
1327: [ "$U" ] || U=0
1328:
1329: case $i in
1330: dnl