Annotation of src/etc/MAKEDEV.tmpl, Revision 1.3
1.1 jdolecek 1: #!/bin/sh -
1.3 ! jdolecek 2: # $NetBSD: MAKEDEV.tmpl,v 1.2 2003/10/15 19:16:01 jdolecek Exp $
1.1 jdolecek 3: #
4: # Copyright (c) 2003 The NetBSD Foundation, Inc.
5: # All rights reserved.
6: #
7: # Redistribution and use in source and binary forms, with or without
8: # modification, are permitted provided that the following conditions
9: # are met:
10: # 1. Redistributions of source code must retain the above copyright
11: # notice, this list of conditions and the following disclaimer.
12: # 2. Redistributions in binary form must reproduce the above copyright
13: # notice, this list of conditions and the following disclaimer in the
14: # documentation and/or other materials provided with the distribution.
15: # 3. All advertising materials mentioning features or use of this software
16: # must display the following acknowledgement:
17: # This product includes software developed by the NetBSD
18: # Foundation, Inc. and its contributors.
19: # 4. Neither the name of The NetBSD Foundation nor the names of its
20: # contributors may be used to endorse or promote products derived
21: # from this software without specific prior written permission.
22: #
23: # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
24: # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
25: # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
26: # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
27: # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28: # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29: # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30: # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31: # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32: # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33: # POSSIBILITY OF SUCH DAMAGE.
34: #
35: #
36: ###########################################################################
37: #
38: # PLEASE RUN "cd ../share/man/man8 ; make makedevs"
39: # AFTER CHANGING THIS FILE, AND COMMIT THE UPDATED MANPAGE!
40: #
41: ###########################################################################
42: #
43: # Device "make" file. Valid arguments:
44: # all makes all known devices, including local devices.
45: # Tries to make the 'standard' number of each type.
46: # init A set of devices that is used for MFS /dev by init.
47: # May be equal to "all".
48: # floppy devices to be put on install floppies
49: # ramdisk devices to be put into INSTALL kernel ramdisks.
50: # std standard devices
51: # local configuration specific devices
52: # usbs make USB devices
53: # isdns make ISDN devices
54: #
55: # Tapes:
56: # st* SCSI tapes
57: # wt* QIC-interfaced (e.g. not SCSI) 3M cartridge tape
58: # ht* MASSBUS TM03 and TU??
59: # mt* MSCP tapes (e.g. TU81, TK50)
60: # tm* UNIBUS TM11 and TE10 emulations (e.g. Emulex TC-11)
61: # ts* UNIBUS TS11
62: # ut* UNIBUS TU45 emulations (e.g. si 9700)
63: # uu* TU58 cassettes on DL11 controller
64: #
65: # Disks:
66: # ccd* concatenated disk devices
67: # cd* SCSI or ATAPI CD-ROM
68: # cgd* cryptographic disk devices
69: # raid* RAIDframe disk devices
70: # sd* SCSI disks
71: # wd* "winchester" disk drives (ST506,IDE,ESDI,RLL,...)
72: # bmd* Nereid bank memory disks
73: # ed* IBM PS/2 ESDI disk devices
74: # fd* "floppy" disk drives (3 1/2", 5 1/4")
75: # gdrom* Dreamcast "gigadisc" CD-ROM drive
76: # hk* UNIBUS RK06 and RK07
77: # hp* MASSBUS RM??
78: # ld* Logical disk devices (e.g., hardware RAID)
79: # mcd* Mitsumi CD-ROM
80: # md* memory pseudo-disk devices
81: # ofdisk* OpenFirmware disk devices
82: # ra* MSCP disks (RA??, RD??)
83: # rb* 730 IDC w/ RB80 and/or RB02
84: # rd* HDC9224 RD disks on VS2000
85: # rl* UNIBUS RL02
86: # rx* MSCP floppy disk (RX33/50/...)
87: # up* other UNIBUS devices (e.g. on Emulex SC-21V controller)
88: # vnd* "file" pseudo-disks
89: # xd* Xylogic 753/7053 disks
90: # xy* Xylogic 450/451 disks
91: #
92: # Pointing devices:
93: # wsmouse* wscons mouse events
94: # lms* Logitech bus mouse
95: # mms* Microsoft bus mouse
96: # qms* "quadrature mouse"
97: # pms* PS/2 mouse
98: # mouse mouse (provides events, for X11)
99: #
100: # Keyboard devices:
101: # wskbd* wscons keyboard events
102: # kbd raw keyboard (provides events, for X11)
103: # kbdctl keyboard control
104: #
105: # Terminals/Console ports:
106: # tty[01]* standard serial ports
107: # tty0* SB1250 ("sbscn") serial ports (sbmips)
108: # ttyE* wscons - Workstation console ("wscons") glass-tty emulators
109: # ttyCZ? Cyclades-Z multiport serial boards. Each "unit"
110: # makes 64 ports.
111: # ttyCY? Cyclom-Y multiport serial boards. Each "unit" makes
112: # 32 ports.
113: # ttye* ITE bitmapped consoles
114: # ttyv0 pccons
115: # ttyC? NS16550 ("com") serial ports
116: # ttyS* SA1110 serial port (hpcarm)
117: # ttyTX? TX39 internal serial ports (hpcmips)
118: # ttyB? DEC 3000 ZS8530 ("scc") serial ports (alpha)
119: # ttyA* mfc serial ports (amiga)
120: # ttyB* msc serial ports (amiga)
121: # ttyC* com style serial ports (DraCo, HyperCom) (amiga)
122: # On the DraCo, units 0 and 1 are the built-in "modem" and
123: # "mouse" ports, if configured.
124: # ttyA0 8530 Channel A (formerly ser02) (atari)
125: # ttyA1 8530 Channel B (formerly mdm02) (atari)
126: # ttyB0 UART on first 68901 (formerly mdm01) (atari)
127: # ixpcom IXP12x0 COM ports
128: # dca* HP200/300 single port serial interface
129: # dcm* HP200/300 4 port serial mux interface
130: # apci* HP400 4 port serial mux interface
131: # ttya 'ttya' system console (luna68k)
132: # ttyb second system serial port (luna68k)
133: # tty* Onboard serial ports (mvme68k)
134: # On the mvme147 these are: ttyZ1, ttyZ2 and ttyZ3.
135: # On the mvme167, and '177: ttyC1, ttyC2 and ttyC3.
136: # Note that tty[CZ]0 is grabbed by the console device
137: # so is not created by default
138: # dc* PMAX 4 channel serial interface (kbd, mouse, modem, printer)
139: # scc* 82530 serial interface (pmax)
140: # ttyZ* Zilog 8530 ("zstty") serial ports
141: # tty[abcd] Built-in serial ports (sparc)
142: # tty* Z88530 serial controllers (sparc64)
143: # ttyh* SAB82532 serial controllers (sparc64)
144: # tty[a-j] Built-in serial ports (sun2, sun3)
145: # ttyC? pccons (arc)
146: # dz* UNIBUS DZ11 and DZ32 (vax)
147: # dh* UNIBUS DH11 and emulations (e.g. Able DMAX, Emulex CS-11) (vax)
148: # dmf* UNIBUS DMF32 (vax)
149: # dhu* UNIBUS DHU11 (vax)
150: # dmz* UNIBUS DMZ32 (vax)
151: # dl* UNIBUS DL11 (vax)
152: #
153: # Terminal multiplexors:
154: # apci* HP400 4 port serial mux interface
155: # dc* 4 channel serial interface (keyboard, mouse, modem, printer)
156: # dca* HP200/300 single port serial interface
157: # dcm* HP200/300 4 port serial mux interface
158: # dh* UNIBUS DH11 and emulations (e.g. Able DMAX, Emulex CS-11)
159: # dhu* UNIBUS DHU11
160: # dl* UNIBUS DL11
161: # dmf* UNIBUS DMF32
162: # dmz* UNIBUS DMZ32
163: # dz* UNIBUS DZ11 and DZ32
164: # scc* 82530 serial interface
165: #
166: # Call units:
167: # dn* UNIBUS DN11 and emulations (e.g. Able Quadracall)
168: #
169: # Pseudo terminals:
170: # pty* set of 62 master and slave pseudo terminals
171: # opty first 16 ptys, to save inodes on install media
172: # ipty first 2 ptys, for install media use only
173: #
174: # Printers:
175: # arcpp* Archimedes parallel port
176: # lpt* stock lp
177: # lpa* interruptless lp
178: # par* Amiga motherboard parallel port
179: #
180: # USB devices:
181: # usb* USB control devices
182: # uhid* USB generic HID devices
183: # ulpt* USB printer devices
184: # ugen* USB generic devices
185: # urio* USB Diamond Rio 500 devices
186: # uscanner* USB scanners
187: # ttyU* USB modems
188: #
189: # ISDN devices:
190: # isdn communication between userland isdnd and kernel
191: # isdnctl control device
192: # isdnbchan* raw b-channel access
193: # isdntel* telephony device
194: # isdnteld* telephony dialout device
195: # isdntrc* trace device
196: #
197: # Video devices:
198: # bwtwo* monochromatic frame buffer
199: # cgtwo* 8-bit color frame buffer
200: # cgthree* 8-bit color frame buffer
201: # cgfour* 8-bit color frame buffer
202: # cgsix* accelerated 8-bit color frame buffer
203: # cgeight* 24-bit color frame buffer
204: # etvme Tseng et-compatible cards on VME
205: # ik* UNIBUS interface to Ikonas frame buffer
206: # leo Circad Leonardo VME-bus true color
207: # ps* UNIBUS interface to Picture System 2
208: # qv* QVSS (MicroVAX) display
209: # tcx* accelerated 8/24-bit color frame buffer
210: #
211: # Maple bus devices:
212: # maple Maple bus control devices
213: # mlcd* Maple bus LCD devices
214: # mmem* Maple bus storage devices
215: #
216: # Special purpose devices:
217: # ad* UNIBUS interface to Data Translation A/D converter
218: # agp* AGP GART devices
219: # altq ALTQ control interface
220: # apm power management device
221: # audio* audio devices
222: # beep PC speaker
223: # bell* OPM bell device (x86k)
224: # bktr Brooktree 848/849/878/879 based TV cards
225: # bpf* packet filter
226: # cfs* Coda file system device
227: # ch* SCSI media changer
228: # cir* Consumer IR
229: # clockctl clock control for non root users
230: # crypto hardware crypto access driver
231: # dmoverio hardware-assisted data movers
232: # dpt* DPT/Adaptec EATA RAID management interface
233: # dpti* DPT/Adaptec I2O RAID management interface
234: # fb* generic framebuffer pseudo-device
235: # fd file descriptors
236: # grf* graphics frame buffer device
237: # hil HP300 HIL input devices
238: # icp ICP-Vortex/Intel RAID control interface
239: # iic* IIC bus device
240: # iop* I2O IOP control interface
241: # ipl IP Filter
242: # irframe* IrDA physical frame
243: # ite* terminal emulator interface to HP300 graphics devices
244: # joy* joystick device
245: # kttcp kernel ttcp helper device
246: # lkm loadable kernel modules interface
247: # magma* Magma multiport serial/parallel cards
248: # midi* MIDI
249: # mlx* Mylex DAC960 control interface
250: # mly* Mylex AcceleRAID/eXtremeRAID control interface
251: # np* UNIBUS Ethernet co-processor interface, for downloading.
252: # nsmb* SMB requester
253: # openfirm OpenFirmware accessor
254: # pci* PCI bus access devices
255: # pf PF packet filter
256: # pow* power management device (x86k)
257: # px* PixelStamp Xserver access
258: # radio* radio devices
259: # random Random number generator, see rnd(4)
260: # rtc* Atari RealTimeClock
261: # satlink* PlanetConnect satellite receiver driver
262: # scsibus* SCSI busses, see scsi(4), scsictl(8)
263: # se* SCSI Ethernet
264: # ses* SES/SAF-TE SCSI Devices
265: # speaker PC speaker (XXX - installed)
266: # sram battery backuped memory (x86k)
267: # ss* SCSI scanner
268: # stic* PixelStamp interface chip
269: # sysmon System Monitoring hardware
270: # systrace syscall tracer
271: # tun* network tunnel driver
272: # twe 3ware Escalade control interface
273: # uk* unknown SCSI device
274: # veriexec verified executable fingerprint loader
275: # vmegen* generic VME access
276: # view* generic interface to graphic displays (Amiga)
277: # wsfont* console font control
278: # wsmux* wscons event multiplexor
279:
280: dialin=0
281: dialout=524288
282: callunit=262144
283:
284: # Keep /usr/etc so SunOS can find chown
285: PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/etc
286:
287: # only allow read&write for owner by default
288: umask 077
289:
290: # Check if we have fdesc mounted
291: if [ -d fd ]; then
292: case "`df fd`" in
293: *fdesc*) nofdesc=false;;
294: *) nofdesc=true;;
295: esac
296: else
297: nofdesc=true
298: fi
299:
300: # called from makedev, with params
301: # mkdev name b/c major minor [mode] [group]
302: mkdev() {
303: rm -f $1
304: mknod $1 $2 $3 $4
305: test -n "$5" && chmod $5 $1
306: test -n "$6" && chgrp $6 $1
307: }
308:
309: makedev()
310: {
311:
312: for i
313: do
314:
315: case $i in
316:
317: %MD_DEVICES%
1.2 jdolecek 318:
319: all)
320: makedev all_md
321: makedev std fd pty0
322: makedev ccd0 ccd1 ccd2 ccd3
323: makedev cgd0 cgd1 cgd2 cgd3
324: makedev md0 md1
325: makedev raid0 raid1 raid2 raid3 raid4 raid5 raid6 raid7
326: makedev vnd0 vnd1 vnd2 vnd3
327: makedev bpf0 bpf1 bpf2 bpf3 bpf4 bpf5 bpf6 bpf7
328: makedev tun0 tun1 tun2 tun3
329: makedev ipl pf crypto random systrace
330: makedev lkm clockctl
331: makedev local
332: ;;
333:
334: init)
335: # unless overridden by MD entry, this is equal to 'all'
336: makedev all
337: ;;
1.1 jdolecek 338:
339: %MI_DEVICES_BEGIN%
340: audio)
341: makedev audio0 audio1 audio2 audio3
342: ln -fs sound0 sound
343: ln -fs audio0 audio
344: ln -fs mixer0 mixer
345: ln -fs audioctl0 audioctl
346: ;;
347:
348: radio)
349: makedev radio0 radio1
350: ln -fs radio0 radio
351: ;;
352:
353: ramdisk)
354: makedev floppy md0
355: ;;
356:
357: usbs)
358: makedev usb usb0 usb1 usb2 usb3 usb4 usb5 usb6 usb7
359: makedev uhid0 uhid1 uhid2 uhid3
360: makedev ulpt0 ulpt1
361: makedev ttyU0 ttyU1
362: makedev urio0
363: makedev uscanner0 uscanner1
364: makedev ugen0
365: ;;
366:
367: isdns)
368: makedev isdn isdnctl isdnbchan0 isdnbchan1 isdntel0 isdntel1 isdnteld0 isdnteld1 isdntrc0 isdntrc1
369: ;;
370:
371: std)
372: rm -f console constty drum mem kmem null zero io klog ksyms
373: mknod console c %cons_chr% 0
374: mknod constty c %cons_chr% 1
375: mknod drum c %swap_chr% 0 ; chmod 640 drum ; chgrp kmem drum
376: mknod kmem c %mem_chr% 1 ; chmod 640 kmem ; chgrp kmem kmem
377: mknod mem c %mem_chr% 0 ; chmod 640 mem ; chgrp kmem mem
378: mknod null c %mem_chr% 2 ; chmod 666 null
379: mknod zero c %mem_chr% 12 ; chmod 666 zero
380: mknod klog c %log_chr% 0 ; chmod 600 klog
381: mknod ksyms c %ksyms_chr% 0 ; chmod 444 ksyms
382: if $nofdesc; then
383: rm -f tty stdin stdout stderr
384: mknod tty c %ctty_chr% 0 ; chmod 666 tty
385: mknod stdin c %filedesc_chr% 0 ; chmod 666 stdin
386: mknod stdout c %filedesc_chr% 1 ; chmod 666 stdout
387: mknod stderr c %filedesc_chr% 2 ; chmod 666 stderr
388: fi
389: ;;
390:
391: usb*)
392: unit=${i#usb}
393: if [ "$unit" = "" ]; then
394: unit=255
395: usb=usb
396: else
397: usb=usb$unit
398: fi
399: major=%usb_chr%
400: rm -f $usb
401: mknod $usb c $major $unit
402: chmod 600 $usb
403: ;;
404:
405: uhid*)
406: unit=${i#uhid}
407: uhid=uhid$unit
408: major=%uhid_chr%
409: rm -f $uhid
410: mknod $uhid c $major $unit
411: chmod 666 $uhid
412: ;;
413:
414: ulpt*)
415: unit=${i#ulpt}
416: ulpt=ulpt$unit
417: ulpn=ulpn$unit
418: major=%ulpt_chr%
419: rm -f $ulpt $ulpn
420: mknod $ulpt c $major $unit
421: mknod $ulpn c $major $(($unit + 64))
422: chmod 600 $ulpt $ulpn
423: ;;
424:
425: urio*)
426: unit=${i#urio}
427: urio=urio$unit
428: major=%urio_chr%
429: rm -f $urio
430: mknod $urio c $major $unit
431: chmod 666 $urio
432: ;;
433:
434: uscanner*)
435: unit=${i#uscanner}
436: uscanner=uscanner$unit
437: major=%uscanner_chr%
438: rm -f $uscanner
439: mknod $uscanner c $major $unit
440: chmod 600 $uscanner
441: ;;
442:
443: ttyU*)
444: unit=${i#ttyU}
445: ttyU=ttyU$unit
446: dtyU=dtyU$unit
447: ctyU=ctyU$unit
448: major=%ucom_chr%
449: rm -f $ttyU $dtyU $ctyU
450: mknod $ttyU c $major $(($unit + $dialin ))
451: mknod $dtyU c $major $(($unit + $dialout ))
452: mknod $ctyU c $major $(($unit + $callunit))
453: chown uucp $ttyU $dtyU $ctyU
454: chmod 600 $ttyU $dtyU $ctyU
455: ;;
456:
457: ugen*)
458: unit=${i#ugen}
459: ugen=ugen$unit
460: major=%ugen_chr%
461: for j in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
462: do
463: ugenj=$ugen.$j
464: rm -f $ugenj
465: mknod $ugenj c $major $(($unit * 16 + ${j#0}))
466: chmod 600 $ugenj
467: done
468: ;;
469:
470: wscons)
471: makedev ttyE0 ttyE1 ttyE2 ttyE3 ttyE4 ttyE5 ttyE6 ttyE7
472: makedev wsmouse0 wsmouse1 wsmouse2 wsmouse3
473: makedev wskbd0 wskbd1 wskbd2 wskbd3
474: makedev wsmux0 wsmux1 wsmux2 wsmux3
475: makedev wsmouse wskbd
476: makedev ttyEcfg ttyEstat
477: makedev wsfont
478: ;;
479:
480: wsmouse)
481: rm -f wsmouse
482: mknod wsmouse c %wsmouse_chr% 0
483: chmod 600 wsmouse
484: ;;
485:
486: wskbd)
487: rm -f wskbd
488: mknod wskbd c %wskbd_chr% 1
489: chmod 600 wskbd
490: ;;
491:
492: wsmux*)
493: unit=${i#wsmux}
494: unitctl=$(($unit + 128))
495: wsmux=wsmux$unit
496: wsmuxctl=wsmuxctl$unit
497: major=%wsmux_chr%
498: rm -f $wsmux $wsmuxctl
499: mknod $wsmux c $major $unit
500: chmod 600 $wsmux
501: mknod $wsmuxctl c $major $unitctl
502: chmod 200 $wsmuxctl
503: ;;
504:
505: ttyEstat)
506: chr=%wsdisplay_chr%
507: rm -f ttyEstat
508: mknod ttyEstat c $chr 254
509: chmod 600 ttyEstat
510: ;;
511:
512: ttyEcfg)
513: chr=%wsdisplay_chr%
514: rm -f ttyEcfg
515: mknod ttyEcfg c $chr 255
516: chmod 600 ttyEcfg
517: ;;
518:
519: ttyE*)
520: chr=%wsdisplay_chr%; unit=${i#ttyE}
521: rm -f ttyE$unit
522: mknod ttyE$unit c $chr $unit
523: ;;
524:
525: wsmouse*)
526: unit=${i#wsmouse}
527: wsmouse=wsmouse$unit
528: major=%wsmouse_chr%
529: rm -f $wsmouse
530: mknod $wsmouse c $major $unit
531: chmod 600 $wsmouse
532: ;;
533:
534: wskbd*)
535: unit=${i#wskbd}
536: wskbd=wskbd$unit
537: major=%wskbd_chr%
538: rm -f $wskbd
539: mknod $wskbd c $major $unit
540: chmod 600 $wskbd
541: ;;
542:
543: fd)
544: if $nofdesc; then
545: rm -f fd/*
546: mkdir fd 2>/dev/null
547: n=0
548: while [ $n -lt 64 ]; do
549: mknod fd/$n c 22 $n
550: n=$(($n + 1))
551: done
552: chmod 755 fd
553: chmod 666 fd/*
554: fi
555: ;;
556:
557: wt*)
558: case $i in
559: wt*) name=wt; unit=${i#wt}; chr=%wt_chr%; blk=%wt_blk%;;
560: esac
561: for sub in $unit $(($unit+8)) $(($unit+16))
562: do
563: rm -f $name$sub n$name$sub r$name$sub nr$name$sub
564: mknod $name$sub b $blk $(($sub + 0))
565: mknod n$name$sub b $blk $(($sub + 4))
566: mknod r$name$sub c $chr $(($sub + 0))
567: mknod nr$name$sub c $chr $(($sub + 4))
568: chgrp operator $name$sub n$name$sub r$name$sub nr$name$sub
569: chmod 660 $name$sub n$name$sub r$name$sub nr$name$sub
570: done
571: ;;
572:
573: md*)
574: unit=${i#md}; blk=%md_blk%; chr=%md_chr%
575: rm -f md${unit}? rmd${unit}?
576: mknod md${unit}a b $blk $(($unit * 8 + 0))
577: mknod md${unit}d b $blk $(($unit * 8 + 3))
578: # mknod rmd${unit}a c $chr $(($unit * 8 + 0))
579: # mknod rmd${unit}d c $chr $(($unit * 8 + 3))
580: chgrp operator md${unit}? #rmd${unit}?
581: chmod 640 md${unit}? #rmd${unit}?
582: ;;
583:
584: ss*)
585: case $i in
586: ss*) name=ss; unit=${i#ss}; chr=%ss_chr%;;
587: esac
588: rm -f $name$unit n$name$unit en$name$unit
589: mknod $name$unit c $chr $(($unit * 16 + 0))
590: mknod n$name$unit c $chr $(($unit * 16 + 1))
591: mknod en$name$unit c $chr $(($unit * 16 + 3))
592: chgrp operator $name$unit n$name$unit en$name$unit
593: chmod 640 $name$unit n$name$unit en$name$unit
594: ;;
595:
596: ccd*|cgd*|raid*|sd*|vnd*)
597: case $i in
598: ccd*) name=ccd; unit=${i#ccd}; blk=%ccd_blk%; chr=%ccd_chr%;;
599: cgd*) name=cgd; unit=${i#cgd}; blk=%cgd_blk%; chr=%cgd_chr%;;
600: raid*) name=raid; unit=${i#raid}; blk=%raid_blk%; chr=%raid_chr%;;
601: sd*) name=sd; unit=${i#sd}; blk=%sd_blk%; chr=%sd_chr%;;
602: vnd*) name=vnd; unit=${i#vnd}; blk=%vnd_blk%; chr=%vnd_chr%;;
603: esac
604: %MKDISK% $name $unit $blk $chr
605: ;;
606:
607: wd*)
608: name=wd; unit=${i#wd}; blk=%wd_blk%; chr=%wd_chr%
609: %MKDISK% $name $unit $blk $chr
610: ;;
611:
612: fd*)
613: name=fd; unit=${i#fd}; blk=%fd_blk%; chr=%fd_chr%
614: %MKDISK% $name $unit $blk $chr
615: ;;
616:
617: ld*)
618: name=ld; unit=${i#ld}; blk=%ld_blk%; chr=%ld_chr%
619: %MKDISK% $name $unit $blk $chr
620: ;;
621:
622: ed*)
623: name=ed; unit=${i#ed}; blk=%ed_blk%; chr=%ed_chr%
624: %MKDISK% $name $unit $blk $chr
625: ;;
626:
627: ofdisk*)
628: name=ofdisk; unit=${i#ofdisk}; blk=%ofdisk_blk%; chr=%ofdisk_chr%
629: %MKDISK% $name $unit $blk $chr
630: ;;
631:
632: ttyCZ*)
633: unit=${i#ttyCZ}
634: major=%cz_chr%
635: minor=$(($unit * 64))
636: eminor=$(($minor + 64))
637: while [ $minor -lt $eminor ]; do
638: if [ $minor -lt 10 ]; then
639: nminor=000$minor
640: elif [ $minor -lt 100 ]; then
641: nminor=00$minor
642: elif [ $minor -lt 1000 ]; then
643: nminor=0$minor
644: else
645: nminor=$minor
646: fi
647: rm -f ttyCZ$nminor dtyCZ$nminor
648: mknod ttyCZ$nminor c $major $(($minor + $dialin ))
649: mknod dtyCZ$nminor c $major $(($minor + $dialout ))
650: chown uucp ttyCZ$nminor dtyCZ$nminor
651: chmod 600 ttyCZ$nminor dtyCZ$nminor
652: minor=$(($minor + 1))
653: done
654: ;;
655:
656: ttyCY*)
657: unit=${i#ttyCY}
658: major=%cy_chr%
659: minor=$(($unit * 32))
660: eminor=$(($minor + 32))
661: while [ $minor -lt $eminor ]; do
662: if [ $minor -lt 10 ]; then
663: nminor=00$minor
664: elif [ $minor -lt 100 ]; then
665: nminor=0$minor
666: else
667: nminor=$minor
668: fi
669: rm -f ttyCY$nminor dtyCY$nminor
670: mknod ttyCY$nminor c $major $(($minor + $dialin ))
671: mknod dtyCY$nminor c $major $(($minor + $dialout ))
672: chown uucp ttyCY$nminor dtyCY$nminor
673: chmod 600 ttyCY$nminor dtyCY$nminor
674: minor=$(($minor + 1))
675: done
676: ;;
677:
1.3 ! jdolecek 678: tty0*|tty1*|tty[0-9])
1.1 jdolecek 679: ounit=${i#tty}
680: ounit=$(($ounit + 0))
681: if [ $ounit -lt 10 ]; then
682: unit=0$ounit
683: else
684: unit=$ounit
685: fi
686: rm -f tty$unit dty$unit
687: mknod tty$unit c %com_chr% $(($ounit + $dialin ))
688: mknod dty$unit c %com_chr% $(($ounit + $dialout))
689: chown uucp tty$unit dty$unit
690: ;;
691:
692: ttyC*)
693: # some archs call it ttyC traditionally
694: unit=${i#ttyC}
695: rm -f ttyC$unit dtyC$unit
696: mknod ttyC$unit c %com_chr% $(($unit + $dialin))
697: mknod dtyC$unit c %com_chr% $(($unit + $dialout))
698: chown uucp ttyC$unit dtyC$unit
699: ;;
700:
701: ttyh*)
702: unit=${i#ttyh}
703: rm -f ttyh$unit dtyh$unit
704: mknod ttyh$unit c %sabtty_chr% $(($unit + $dialin ))
705: mknod dtyh$unit c %sabtty_chr% $(($unit + $dialout))
706: chown uucp ttyh$unit dtyh$unit
707: ;;
708:
709: ttyZ*)
710: name=ttyZ; dname=dtyZ; unit=${i#ttyZ}; chr=%zstty_chr%
711: rm -f $name$unit $dname$unit
712: mknod $name$unit c $chr $(($unit + $dialin ))
713: mknod $dname$unit c $chr $(($unit + $dialout))
714: chown uucp $name$unit $dname$unit
715: ;;
716:
717: opty)
718: rm -f ttyp[0-9a-f] ptyp[0-9a-f]
719: for j in 0 1 2 3 4 5 6 7 8 9 a b c d e f
720: do
721: case $j in
722: [0-9]) jn=$j ;;
723: a) jn=10 ;;
724: b) jn=11 ;;
725: c) jn=12 ;;
726: d) jn=13 ;;
727: e) jn=14 ;;
728: f) jn=15 ;;
729: esac
730: mknod ttyp$j c %pts_chr% $jn
731: mknod ptyp$j c %ptc_chr% $jn
732: done
733: chmod 666 ttyp[0-9a-f] ptyp[0-9a-f]
734: ;;
735:
736: pty*)
737: class=${i#pty}
738: set -- p q r s t u v w x y z P Q R S T
739: if [ "$class" -ge $# ]; then
740: echo "$MAKEDEV: $i: pty unit must be between 0 and 15"
741: continue
742: fi
743: shift $class
744: name=$1
745: if [ "$name" = v ]; then
746: echo "$MAKEDEV: $i: pty unit conflicts with console ttyv0 device."
747: continue
748: fi
749: rm -f tty$name[0-9a-zA-Z] pty$name[0-9a-zA-Z]
750: jn=0
751: unit=$(($class * 16))
752: names=
753: set -- - 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 w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
754: while
755: shift
756: j=$1
757: [ -n "$j" ]
758: do
759: if [ $j = g ]; then
760: unit=$(($unit + $class * 30 + 256 - 16))
761: fi
762: mknod tty$name$j c %pts_chr% $unit
763: mknod pty$name$j c %ptc_chr% $unit
764: names="$names tty$name$j pty$name$j"
765: unit=$(($unit + 1))
766: done
767: chmod 666 $names
768: unset names
769: ;;
770:
771: st*)
772: case $i in
773: st*) name=st; unit=${i#st}; chr=%st_chr%; blk=%st_blk%;;
774: esac
775: rm -f $name$unit n$name$unit e$name$unit en$name$unit \
776: r$name$unit nr$name$unit er$name$unit enr$name$unit
777: mknod $name$unit b $blk $(($unit * 16 + 0))
778: mknod n$name$unit b $blk $(($unit * 16 + 1))
779: mknod e$name$unit b $blk $(($unit * 16 + 2))
780: mknod en$name$unit b $blk $(($unit * 16 + 3))
781: mknod r$name$unit c $chr $(($unit * 16 + 0))
782: mknod nr$name$unit c $chr $(($unit * 16 + 1))
783: mknod er$name$unit c $chr $(($unit * 16 + 2))
784: mknod enr$name$unit c $chr $(($unit * 16 + 3))
785: chgrp operator $name$unit n$name$unit e$name$unit en$name$unit \
786: r$name$unit nr$name$unit er$name$unit enr$name$unit
787: chmod 660 $name$unit n$name$unit e$name$unit en$name$unit \
788: r$name$unit nr$name$unit er$name$unit enr$name$unit
789: ;;
790:
791: ses*|ch*|uk*)
792: case $i in
793: ch*) name=ch; unit=${i#ch}; chr=%ch_chr%;;
794: uk*) name=uk; unit=${i#uk}; chr=%uk_chr%;;
795: ses*) name=ses; unit=${i#ses}; chr=%ses_chr%;;
796: esac
797: rm -f $name$unit
798: mknod $name$unit c $chr $unit
799: chgrp operator $name$unit
800: chmod 640 $name$unit
801: ;;
802:
803: cd*|mcd*)
804: case $i in
805: cd*) name=cd; unit=${i#cd}; chr=%cd_chr%; blk=%cd_chr%;;
806: mcd*) name=mcd; unit=${i#mcd}; chr=%mcd_chr%; blk=%mcd_chr%;;
807: esac
808: rm -f $name$unit? r$name$unit?
809: mknod ${name}${unit}a b $blk $(($unit * 8 + 0))
810: mknod ${name}${unit}d b $blk $(($unit * 8 + 3))
811: mknod r${name}${unit}a c $chr $(($unit * 8 + 0))
812: mknod r${name}${unit}d c $chr $(($unit * 8 + 3))
813: chgrp operator $name$unit? r$name$unit?
814: chmod 640 $name$unit? r$name$unit?
815: ;;
816:
817: gdrom*)
818: case $i in
819: gdrom*) name=gdrom; unit=${i#gdrom}; chr=%gdrom_chr%; blk=%gdrom_blk%;;
820: esac
821: rm -f $name$unit? r$name$unit?
822: mknod ${name}${unit}a b $blk $(($unit * 16 + 0))
823: mknod ${name}${unit}c b $blk $(($unit * 16 + 2))
824: mknod r${name}${unit}a c $chr $(($unit * 16 + 0))
825: mknod r${name}${unit}c c $chr $(($unit * 16 + 2))
826: chgrp operator $name$unit? r$name$unit?
827: chmod 640 $name$unit? r$name$unit?
828: ;;
829:
830: lpt*|lpa*)
831: case $i in
832: lpt*) name=lpt; unit=${i#lpt}; chr=%lpt_chr%; flags=0;;
833: lpa*) name=lpa; unit=${i#lpa}; chr=%lpt_chr%; flags=128;;
834: esac
835: rm -f $name$unit
836: mknod $name$unit c $chr $(($unit + $flags))
837: ;;
838:
839: bpf*|tun*)
840: case $i in
841: bpf*) name=bpf; unit=${i#bpf}; chr=%bpf_chr%;;
842: tun*) name=tun; unit=${i#tun}; chr=%tun_chr%;;
843: esac
844: rm -f $name$unit
845: mknod $name$unit c $chr $unit
846: ;;
847:
848: joy*)
849: case $i in
850: joy*) name=joy; unit=${i#joy}; chr=%joy_chr%;;
851: esac
852: rm -f $name$unit
853: mknod $name$unit c $chr $unit
854: ;;
855:
856: ipl)
857: rm -f ipl ipnat ipstate ipauth
858: mknod ipl c %ipl_chr% 0
859: mknod ipnat c %ipl_chr% 1
860: mknod ipstate c %ipl_chr% 2
861: mknod ipauth c %ipl_chr% 3
862: chmod 600 ipl ipnat ipstate ipauth
863: ;;
864:
865: pf)
866: rm -f pf
867: mknod pf c %pf_chr% 0
868: chmod 600 pf
869: ;;
870:
871: crypto)
872: rm -f crypto
873: mknod crypto c %crypto_chr% 0
874: chmod 666 crypto
875: ;;
876:
877: speaker)
878: rm -f speaker
879: mknod speaker c %spkr_chr% 0
880: ;;
881:
882: lkm)
883: rm -f lkm
884: mknod lkm c %lkm_chr% 0
885: chgrp kmem lkm
886: chmod 640 lkm
887: ;;
888:
889: audio*)
890: unit=${i#audio}
891: audio=audio$unit
892: sound=sound$unit
893: mixer=mixer$unit
894: major=%audio_chr%
895: audioctl=audioctl$unit
896: if [ "$unit" = "" ]; then unit=0; fi
897: rm -f $audio $sound $mixer $audioctl
898: mknod $sound c $major $(($unit + 0))
899: mknod $audio c $major $(($unit + 128))
900: mknod $mixer c $major $(($unit + 16))
901: mknod $audioctl c $major $(($unit + 192))
902: chmod 666 $audio $sound $mixer $audioctl
903: ;;
904:
905: rmidi*)
906: unit=${i#rmidi}
907: major=%midi_chr%
908: rmidi=rmidi$unit
909: rm -f $rmidi
910: mknod $rmidi c $major $unit
911: chmod 666 $rmidi
912: ;;
913:
914: music*)
915: unit=${i#music}
916: music=music$unit
917: sequencer=sequencer$unit
918: major=%sequencer_chr%
919: if [ "$unit" = "" ]; then unit=0; fi
920: rm -f $sequencer $music
921: mknod $music c $major $(($unit + 0))
922: mknod $sequencer c $major $(($unit + 128))
923: chmod 666 $music $sequencer
924: ;;
925:
926: radio*)
927: unit=${i#radio}
928: radio=radio$unit
929: major=%radio_chr%
930: if [ "$unit" = "" ]; then unit=0; fi
931: rm -f $radio
932: mknod $radio c $major $unit
933: chmod 666 $radio
934: ;;
935:
936: apm*)
937: rm -f apm apmctl
938: mknod apm c %apm_chr% 0
939: mknod apmctl c %apm_chr% 8
940: chmod 644 apm apmctl
941: ;;
942:
943: satlink*)
944: unit=${i#satlink}
945: rm -f satlink$unit
946: mknod satlink$unit c %satlink_chr% $unit
947: chmod 444 satlink$unit
948: ;;
949:
950: random)
951: rm -f random urandom
952: mknod random c %rnd_chr% 0
953: mknod urandom c %rnd_chr% 1
954: chmod 444 random
955: chmod 644 urandom
956: ;;
957:
958: cfs*)
959: unit=${i#cfs}
960: cfs=cfs$unit
961: major=%vcoda_chr%
962: rm -f $cfs
963: mknod $cfs c $major $unit
964: chmod 600 $cfs
965: ;;
966:
967: sysmon)
968: major=%sysmon_chr%
969: rm -f sysmon
970: mknod sysmon c $major 0
971: chmod 644 sysmon
972:
973: rm -f watchdog
974: mknod watchdog c $major 1
975: chmod 644 watchdog
976:
977: rm -f power
978: mknod power c $major 2
979: chmod 640 power
980: ;;
981:
982: scsibus*)
983: unit=${i#scsibus}
984: rm -f scsibus$unit
985: mknod scsibus$unit c %scsibus_chr% $unit
986: chmod 644 scsibus$unit
987: ;;
988:
989: bktr)
990: makedev bktr0 bktr1
991: ln -fs bktr0 bktr
992: ln -fs tuner0 tuner
993: ln -fs vbi0 vbi
994: ;;
995:
996: bktr*)
997: major=%bktr_chr%
998: unit=${i#bktr}
999: rm -f bktr$unit tuner$unit vbi$unit
1000: mknod bktr$unit c $major $(($unit + 0))
1001: mknod tuner$unit c $major $(($unit + 16))
1002: mknod vbi$unit c $major $(($unit + 32))
1003: chmod 444 bktr$unit tuner$unit vbi$unit
1004: ;;
1005:
1006: iop*)
1007: unit=${i#iop}
1008: rm -f iop$unit
1009: mknod iop$unit c %iop_chr% $unit
1010: chmod 600 iop$unit
1011: ;;
1012:
1013: mlx*)
1014: unit=${i#mlx}
1015: rm -f mlx$unit
1016: mknod mlx$unit c %mlx_chr% $unit
1017: chmod 600 mlx$unit
1018: ;;
1019:
1020: mly*)
1021: unit=${i#mly}
1022: rm -f mly$unit
1023: mknod mly$unit c %mly_chr% $unit
1024: chmod 600 mly$unit
1025: ;;
1026:
1027: twe*)
1028: unit=${i#twe}
1029: rm -f twe$unit
1030: mknod twe$unit c %twe_chr% $unit
1031: chmod 600 twe$unit
1032: ;;
1033:
1034: icp*)
1035: unit=${i#icp}
1036: rm -f icp$unit
1037: mknod icp$unit c %icp_chr% $unit
1038: chmod 600 icp$unit
1039: ;;
1040:
1041: agp*)
1042: unit=${i#agp}
1043: rm -f agp$unit
1044: mknod agp$unit c %agp_chr% $unit
1045: if [ "$unit" = "0" ]; then ln -fs agp$unit agpgart; fi
1046: chmod 644 agp$unit
1047: ;;
1048:
1049: pci*)
1050: unit=${i#pci}
1051: rm -f pci$unit
1052: mknod pci$unit c %pci_chr% $unit
1053: chmod 644 pci$unit
1054: ;;
1055:
1056: dpti*)
1057: unit=${i#dpti}
1058: rm -f dpti$unit
1059: mknod dpti$unit c %dpti_chr% $unit
1060: chmod 600 dpti$unit
1061: ;;
1062:
1063: dpt*)
1064: unit=${i#dpt}
1065: rm -f dpt$unit
1066: mknod dpt$unit c %dpt_chr% $unit
1067: chmod 600 dpt$unit
1068: ;;
1069:
1070: altq)
1071: mkdir altq 2>/dev/null
1072: chmod 755 altq
1073: unit=0
1074: for dev in altq cbq wfq afm fifoq red rio localq hfsc \
1075: cdnr blue priq; do
1076: rm -f altq/$dev
1077: mknod altq/$dev c %altq_chr% $unit
1078: chmod 644 altq/$dev
1079: unit=$(($unit + 1))
1080: done
1081: ;;
1082:
1083: isdn)
1084: rm -f isdn
1085: mknod isdn c %isdn_chr% 0
1086: chmod 600 isdn
1087: ;;
1088:
1089: isdnctl)
1090: rm -f isdnctl
1091: mknod isdnctl c %isdnctl_chr% 0
1092: chmod 600 isdnctl
1093: ;;
1094:
1095: isdnbchan*)
1096: unit=${i#isdnbchan}
1097: rm -f isdnbchan$unit
1098: mknod isdnbchan$unit c %isdnbchan_chr% $unit
1099: chmod 600 isdnbchan$unit
1100: ;;
1101:
1102: isdnteld*)
1103: unit=${i#isdnteld}
1104: rm -f isdnteld$unit
1105: mknod isdnteld$unit c %isdntel_chr% $(($unit + 64))
1106: chmod 600 isdnteld$unit
1107: ;;
1108:
1109: isdntel*)
1110: unit=${i#isdntel}
1111: rm -f isdntel$unit
1112: mknod isdntel$unit c %isdntel_chr% $unit
1113: chmod 600 isdntel$unit
1114: ;;
1115:
1116: isdntrc*)
1117: unit=${i#isdntrc}
1118: rm -f isdntrc$unit
1119: mknod isdntrc$unit c %isdntrc_chr% $unit
1120: chmod 600 isdntrc$unit
1121: ;;
1122:
1123: vmegen)
1124: makedev vmegen0 vmegen1 vmegen2 vmegen3
1125: ;;
1126:
1127: vmegen*)
1128: unit=${i#vmegen}
1129: rm -f vmegen$unit
1130: mknod vmegen$unit c %vmegeneric_chr% $(($unit * 16 + 0))
1131: chmod 600 vmegen$unit
1132: ;;
1133:
1134: wsfont)
1135: rm -f wsfont
1136: mknod wsfont c %wsfont_chr% 0
1137: chmod 600 wsfont
1138: ;;
1139:
1140: cir*)
1141: unit=${i#cir}
1142: cir=cir$unit
1143: major=%cir_chr%
1144: rm -f $cir
1145: mknod $cir c $major $unit
1146: chmod 666 $cir
1147: ;;
1148:
1149: irframe*)
1150: unit=${i#irframe}
1151: irframe=irframe$unit
1152: major=%irframe_chr%
1153: rm -f $irframe
1154: mknod $irframe c $major $unit
1155: chmod 600 $irframe
1156: ;;
1157:
1158: fcom*)
1159: unit=${i#fcom}
1160: fcom=fcom$unit
1161: rm -f $fcom
1162: mknod $fcom c %fcom_chr% $unit
1163: chown uucp $fcom
1164: chmod 600 $fcom
1165: ;;
1166:
1167: beep)
1168: rm -f beep
1169: mknod beep c %beep_chr% 0
1170: ;;
1171:
1172: openfirm)
1173: rm -f openfirm
1174: mknod openfirm c %openfirm_chr% 0
1175: chmod 444 openfirm
1176: ;;
1177:
1178: nvram)
1179: rm -f nvram
1180: mknod nvram c %nvram_chr% 0
1181: chmod 644 nvram
1182: ;;
1183:
1184: rtc)
1185: mknod rtc c %rtc_chr% 3
1186: chmod 644 rtc
1187: ;;
1188:
1189: clockctl)
1190: rm -f clockctl
1191: mknod clockctl c %clockctl_chr% 0
1192: chgrp ntpd clockctl
1193: chmod 660 clockctl
1194: ;;
1195:
1196: nsmb)
1197: makedev nsmb0 nsmb1 nsmb2 nsmb3
1198: ;;
1199:
1200: nsmb*)
1201: unit=${i#nsmb}
1202: nsmb=nsmb$unit
1203: major=%nsmb_chr%
1204: rm -f $nsmb
1205: mknod $nsmb c $major $unit
1206: chmod 644 $nsmb
1207: ;;
1208:
1209: systrace)
1210: rm -f systrace
1211: mknod systrace c %systrace_chr% 0
1212: chmod 644 systrace
1213: ;;
1214:
1215: kttcp)
1216: rm -f kttcp
1217: mknod kttcp c %kttcp_chr% 0
1218: chmod 600 kttcp
1219: ;;
1220:
1221: dmoverio)
1222: rm -f dmoverio
1223: mknod dmoverio c %dmoverio_chr% 0
1224: chmod 644 dmoverio
1225: ;;
1226:
1227: veriexec)
1228: rm -f veriexec
1229: mknod veriexec c %veriexec_chr% 0
1230: chmod 644 veriexec
1231: ;;
1232:
1233: ttyv*)
1234: chr=%pc_chr%; unit=${i#ttyv}
1235: rm -f ttyv$unit
1236: mknod ttyv$unit c $chr $unit
1237: ;;
1238:
1239: arcpp*)
1240: chr=%arcpp_chr%; unit=${i#arcpp}
1241: mkdev arcpp c $chr $unit
1242: ;;
1243:
1244: par*)
1245: unit=${i#par}; chr=%par_chr%
1246: rm -f par$unit
1247: case $unit in
1248: 0)
1249: mknod par$unit c $chr $unit
1250: ;;
1251: *)
1252: echo bad unit for par in: $i
1253: ;;
1254: esac
1255: ;;
1256:
1257: ite*|ttye*)
1258: unit=${i#ttye}; chr=%ite_chr%
1259: rm -f ttye$unit
1260: rm -f ite*
1261: mknod ttye$unit c $chr $unit
1262: ;;
1263:
1264: pms*)
1265: major=%pms_chr%
1266: unit=${i#qms}
1267: rm -f $name$unit
1268: mknod $name$unit c $major $unit
1269: ;;
1270:
1271: qms*)
1272: major=%qms_chr%
1273: unit=${i#qms}
1274: rm -f $name$unit
1275: mknod $name$unit c $major $unit
1276: ;;
1277:
1278: lms*)
1279: major=%lms_chr%
1280: unit=${i#lms}
1281: rm -f $name$unit
1282: mknod $name$unit c $major $unit
1283: ;;
1284:
1285: mms*)
1286: major=%mms_chr%
1287: unit=${i#mms}
1288: rm -f $name$unit
1289: mknod $name$unit c $major $unit
1290: ;;
1291:
1292: mouse-*)
1293: case $i in
1294: mouse-pms*) name=pms; unit=${i#mouse-pms};;
1295: mouse-qms*) name=qms; unit=${i#mouse-qms};;
1296: esac
1297: ln -fs $name$unit mouse
1298: ;;
1299:
1300: kbd)
1301: rm -f kbd
1302: mknod kbd c %kbd_chr% 0
1303: ;;
1304:
1305: view*)
1306: unit=${i#view}; chr=%view_chr%
1307: rm -f view$unit
1308: mknod view$unit c $chr $unit
1309: chmod 666 view$unit
1310: ;;
1311:
1312: mouse*)
1313: unit=${i#mouse}; chr=%ms_chr%
1314: rm -f mouse$unit
1315: case $unit in
1316: 0|1)
1317: mknod mouse$unit c $chr $unit
1318: chmod 666 mouse$unit
1319: if [ $unit = 0 ]
1320: then
1321: ln -fs mouse$unit mouse
1322: fi
1323: ;;
1324: *)
1325: echo bad unit for mouse in: $i
1326: ;;
1327: esac
1328: ;;
1329:
1330: panel)
1331: rm -f panel0
1332: mknod panel0 c %panel_chr% 0
1333: chmod 660 panel0
1334: ;;
1335:
1336: ipty)
1337: rm -f ttyp0 ttyp1 ptyp0 ptyp1
1338: mknod ttyp0 c %pts_chr% 0
1339: mknod ttyp1 c %pts_chr% 1
1340: mknod ptyp0 c %ptc_chr% 0
1341: mknod ptyp1 c %ptc_chr% 1
1342: chmod 666 ttyp0 ttyp1 ptyp0 ptyp1
1343: ;;
1344:
1345: grf*)
1346: major=%grf_chr%
1347: unit=${i#grf}
1348: rm -f grf${unit}
1349: mknod grf${unit} c 11 ${unit}
1350: chmod 666 grf${unit}
1351: ;;
1352:
1353: etvme)
1354: rm -f etvme
1355: mknod etvme c %etvme_chr% 0
1356: chmod 600 etvme
1357: ;;
1358:
1359: leo*)
1360: unit=${i#leo}
1361: rm -f leo$unit
1362: mknod leo$unit c %leo_chr% $unit
1363: chmod 600 leo$unit
1364: ;;
1365:
1366: scif*)
1367: chr=%scif_chr%; unit=${i#scif}
1368: name=scif
1369: rm -f $name$unit
1370: mknod $name$unit c $chr $unit
1371: chown uucp $name$unit
1372: ;;
1373:
1374: sci*)
1375: chr=%scif_chr%; unit=${i#scif}
1376: name=sci
1377: rm -f $name$unit
1378: mknod $name$unit c $chr $unit
1379: chown uucp $name$unit
1380: ;;
1381:
1382: maple*)
1383: chr=%maple_chr%
1384: case $i in
1385: mapleA*) name="mapleA"; unit=0;;
1386: mapleB*) name="mapleB"; unit=1;;
1387: mapleC*) name="mapleC"; unit=2;;
1388: mapleD*) name="mapleD"; unit=3;;
1389: esac
1390: subunit=${i#$name}
1391: rm -f $name$subunit
1392: mknod $name$subunit c $chr $(($unit * 8 + 0$subunit))
1393: chmod 600 $name$subunit
1394: ;;
1395:
1396: mmem*)
1397: name=mmem; unit=${i#mmem}; chr=%mmem_chr%; blk=%mmem_blk%
1398: rm -f $name$unit.* r$name$unit.*
1399: for pt in 0 # 1 2 3 4 ... 255
1400: do
1401: #mknod ${name}${unit}.${pt}a b $blk $(($unit * 4096 + $pt * 16 + 0))
1402: mknod ${name}${unit}.${pt}c b $blk $(($unit * 4096 + $pt * 16 + 2))
1403: #mknod r${name}${unit}.${pt}a c $chr $(($unit * 4096 + $pt * 16 + 0))
1404: mknod r${name}${unit}.${pt}c c $chr $(($unit * 4096 + $pt * 16 + 2))
1405: done
1406: chgrp operator $name$unit.* r$name$unit.*
1407: chmod 640 $name$unit.* r$name$unit.*
1408: ;;
1409:
1410: mlcd*)
1411: name=mlcd; unit=${i#mlcd}; chr=%mlcd_chr%
1412: rm -f $name$unit.*
1413: for pt in 0 # 1 2 3 4 ... 255
1414: do
1415: mknod ${name}${unit}.${pt} c $chr $(($unit * 256 + $pt))
1416: done
1417: chgrp operator $name$unit.*
1418: chmod 640 $name$unit.*
1419: ;;
1420:
1421: ixpcom*)
1422: unit=${i#ixpcom}
1423: rm -f ixpcom$unit
1424: mknod ixpcom$unit c %ixpcom_chr% $unit
1425: chown uucp ixpcom$unit
1426: ;;
1427:
1428: ucbsnd)
1429: rm -f ucbsnd
1430: mknod ucbsnd c %ucbsnd_chr% 0
1431: chmod 666 ucbsnd
1432: ;;
1433:
1434: ttyTX*)
1435: unit=${i#ttyTX}
1436: name=ttyTX0
1437: dname=dtyTX0
1438:
1439: rm -f $name$unit $dname$unit
1440: mknod $name$unit c %txcom_chr% $(($unit + $dialin ))
1441: mknod $dname$unit c %txcom_chr% $(($unit + $dialout))
1442: chown uucp $name$unit $dname$unit
1443: ;;
1444:
1445: adb)
1446: rm -f adb
1447: mknod adb c %aed_chr% 0
1448: chmod 666 adb
1449: ;;
1450:
1451: asc*)
1452: unit=${i#asc}
1453: rm -f asc$unit
1454: mknod asc$unit c %asc_chr% $unit
1455: chmod 666 asc$unit
1456: ;;
1457:
1458: bwtwo*)
1459: unit=${i#bwtwo}
1460: rm -f bwtwo$unit
1461: mknod bwtwo$unit c %bwtwo_chr% $unit
1462: chmod 666 bwtwo$unit
1463: ;;
1464:
1465: cgtwo*)
1466: unit=${i#cgtwo}
1467: rm -f cgtwo$unit
1468: mknod cgtwo$unit c %cgtwo_chr% $unit
1469: chmod 666 cgtwo$unit
1470: ;;
1471:
1472: cgthree*)
1473: unit=${i#cgthree}
1474: rm -f cgthree$unit
1475: mknod cgthree$unit c %cgthree_chr% $unit
1476: chmod 666 cgthree$unit
1477: ;;
1478:
1479: cgfour*)
1480: unit=${i#cgfour}
1481: rm -f cgfour$unit
1482: mknod cgfour$unit c %cgfour_chr% $unit
1483: chmod 666 cgfour$unit
1484: ;;
1485:
1486: cgsix*)
1487: unit=${i#cgsix}
1488: rm -f cgsix$unit
1489: mknod cgsix$unit c %cgfix_chr% $unit
1490: chmod 666 cgsix$unit
1491: ;;
1492:
1493: cgeight*)
1494: unit=${i#cgeight}
1495: rm -f cgeight$unit
1496: mknod cgeight$unit c %cgeight_chr% $unit
1497: chmod 666 cgeight$unit
1498: ;;
1499:
1500: tcx*)
1501: unit=${i#tcx}
1502: rm -f tcx$unit
1503: mknod tcx$unit c %tcx_chr% $unit
1504: chmod 666 tcx$unit
1505: ;;
1506:
1507: xd*|xy*)
1508: case $i in
1509: xd*) name=xd; unit=${i#xd}; blk=%xd_blk%; chr=%xd_chr%;;
1510: xy*) name=xy; unit=${i#xy}; blk=%xy_blk%; chr=%xy_chr%;;
1511: esac
1512: %MKDISK% $name $unit $blk $chr
1513: ;;
1514:
1515: magma*)
1516: unit=${i#magma}
1517: if [ 0$unit -gt 3 ]
1518: then
1519: echo "bad unit for $i: $unit"
1520: break
1521: fi
1522:
1523: rm -f tty$unit[0-9a-f] bpp$unit[01]
1524: for j in 0 1 2 3 4 5 6 7 8 9 a b c d e f
1525: do
1526: case $j in
1527: [0-9]) jn=$j ;;
1528: a) jn=10 ;;
1529: b) jn=11 ;;
1530: c) jn=12 ;;
1531: d) jn=13 ;;
1532: e) jn=14 ;;
1533: f) jn=15 ;;
1534: esac
1535: mknod tty$unit$j c %mtty_chr% $(($unit * 64 + $jn))
1536: done
1537:
1538: mknod bpp${unit}0 c %mbpp_chr% $(($unit * 64 + 0))
1539: mknod bpp${unit}1 c %mbpp_chr% $(($unit * 64 + 1))
1540: ;;
1541:
1542: clcd*)
1543: unit=${i#clcd}
1544: if [ 0$unit -gt 7 ]
1545: then
1546: echo "bad unit for $i: $unit"
1547: break
1548: fi
1549:
1550: rm -f ttyA$unit[0-7] dtyA$unit[0-7]
1551: for j in 0 1 2 3 4 5 6 7
1552: do
1553: mknod ttyA$unit$j c %clcd_chr% $(($unit * 8 + $j + $dialin))
1554: mknod dtyA$unit$j c %clcd_chr% $(($unit * 8 + $j + $dialout))
1555: done
1556: chown uucp ttyA$unit[0-9a-f] dtyA$unit[0-9a-f]
1557:
1558: ;;
1559:
1560: bpp*)
1561: unit=${i#bpp}
1562: rm -f bpp$unit
1563: mknod bpp$unit c %bpp_chr% $(($unit + 0))
1564: chmod 600 bpp$unit
1565: ;;
1566:
1567: tctrl*)
1568: unit=${i#tctrl}
1569: rm -f tctrl$unit
1570: mknod tctrl$unit c %tctrl_chr% $unit
1571: chmod 666 tctrl$unit
1572: ;;
1573:
1574: bmd*)
1575: unit=${i#bmd}; blk=%bmd_blk%; chr=%bmd_chr%
1576: rm -f bmd${unit}? rbmd${unit}?
1577: mknod bmd${unit}a b $blk $(($unit * 8 + 0))
1578: mknod bmd${unit}c b $blk $(($unit * 8 + 2))
1579: mknod rbmd${unit}a c $chr $(($unit * 8 + 0))
1580: mknod rbmd${unit}c c $chr $(($unit * 8 + 2))
1581: chgrp operator bmd${unit}? rbmd${unit}?
1582: chmod 640 bmd${unit}? rbmd${unit}?
1583: ;;
1584:
1585: sram)
1586: rm -f sram
1587: mknod sram c %sram_chr% 0
1588: chmod 644 sram
1589: ;;
1590:
1591: pow*)
1592: unit=${i#pow}
1593: rm -f pow${unit}
1594: case $unit in
1595: 0|1)
1596: mknod pow${unit} c %pow_chr% ${unit}
1597: chmod 644 pow${unit}
1598: if [ $unit = 0 ]
1599: then
1600: ln -fs pow${unit} pow
1601: fi
1602: ;;
1603: *)
1604: echo bad unit for pow in: $i
1605: ;;
1606: esac
1607: ;;
1608:
1609: ttyS*)
1610: unit=${i#ttyS}
1611: rm -f ttyS$unit dtyS$unit
1612: mknod ttyS$unit c %sacom_chr% $(($unit + $dialin ))
1613: mknod dtyS$unit c %sacom_chr% $(($unit + $dialout))
1614: chown uucp ttyS$unit dtyS$unit
1615: ;;
1616:
1617: midevend)
1618: %MI_DEVICES_END%
1619: local)
1620: if [ -f "$0.local" ]; then
1621: umask 0
1622: sh $0.local all
1623: umask 077
1624: fi
1625: ;;
1626:
1627: *)
1628: echo $i: unknown device
1629: ;;
1630:
1631: esac
1632: done
1633:
1634: }
1635:
1636: # three variants of disk partitions - max 8, max 16, max 16 with highpartoffset
1.3 ! jdolecek 1637: # hack; only the one used by port is retained in final MAKEDEV script
1.1 jdolecek 1638: # routine is called as:
1639: # makedisk name unit blk chr
1640: makedisk_p8() {
1641: name="$1"; unit="$2"; blk="$3"; chr="$4"
1642:
1643: rm -f $name$unit? r$name$unit?
1644: mknod ${name}${unit}a b $blk $(($unit * 8 + 0))
1645: mknod ${name}${unit}b b $blk $(($unit * 8 + 1))
1646: mknod ${name}${unit}c b $blk $(($unit * 8 + 2))
1647: mknod ${name}${unit}d b $blk $(($unit * 8 + 3))
1648: mknod ${name}${unit}e b $blk $(($unit * 8 + 4))
1649: mknod ${name}${unit}f b $blk $(($unit * 8 + 5))
1650: mknod ${name}${unit}g b $blk $(($unit * 8 + 6))
1651: mknod ${name}${unit}h b $blk $(($unit * 8 + 7))
1652: mknod r${name}${unit}a c $chr $(($unit * 8 + 0))
1653: mknod r${name}${unit}b c $chr $(($unit * 8 + 1))
1654: mknod r${name}${unit}c c $chr $(($unit * 8 + 2))
1655: mknod r${name}${unit}d c $chr $(($unit * 8 + 3))
1656: mknod r${name}${unit}e c $chr $(($unit * 8 + 4))
1657: mknod r${name}${unit}f c $chr $(($unit * 8 + 5))
1658: mknod r${name}${unit}g c $chr $(($unit * 8 + 6))
1659: mknod r${name}${unit}h c $chr $(($unit * 8 + 7))
1660: chgrp operator $name$unit? r$name$unit?
1661: chmod 640 $name$unit? r$name$unit?
1662: }
1663: makedisk_p16() {
1664: name="$1"; unit="$2"; blk="$3"; chr="$4"
1665:
1666: rm -f $name$unit? r$name$unit?
1667: mknod ${name}${unit}a b $blk $(($unit * 16 + 0))
1668: mknod ${name}${unit}b b $blk $(($unit * 16 + 1))
1669: mknod ${name}${unit}c b $blk $(($unit * 16 + 2))
1670: mknod ${name}${unit}d b $blk $(($unit * 16 + 3))
1671: mknod ${name}${unit}e b $blk $(($unit * 16 + 4))
1672: mknod ${name}${unit}f b $blk $(($unit * 16 + 5))
1673: mknod ${name}${unit}g b $blk $(($unit * 16 + 6))
1674: mknod ${name}${unit}h b $blk $(($unit * 16 + 7))
1675: mknod ${name}${unit}i b $blk $(($unit * 16 + 8))
1676: mknod ${name}${unit}j b $blk $(($unit * 16 + 9))
1677: mknod ${name}${unit}k b $blk $(($unit * 16 + 10))
1678: mknod ${name}${unit}l b $blk $(($unit * 16 + 11))
1679: mknod ${name}${unit}m b $blk $(($unit * 16 + 12))
1680: mknod ${name}${unit}n b $blk $(($unit * 16 + 13))
1681: mknod ${name}${unit}o b $blk $(($unit * 16 + 14))
1682: mknod ${name}${unit}p b $blk $(($unit * 16 + 15))
1683: mknod r${name}${unit}a c $chr $(($unit * 16 + 0))
1684: mknod r${name}${unit}b c $chr $(($unit * 16 + 1))
1685: mknod r${name}${unit}c c $chr $(($unit * 16 + 2))
1686: mknod r${name}${unit}d c $chr $(($unit * 16 + 3))
1687: mknod r${name}${unit}e c $chr $(($unit * 16 + 4))
1688: mknod r${name}${unit}f c $chr $(($unit * 16 + 5))
1689: mknod r${name}${unit}g c $chr $(($unit * 16 + 6))
1690: mknod r${name}${unit}h c $chr $(($unit * 16 + 7))
1691: mknod r${name}${unit}i c $chr $(($unit * 16 + 8))
1692: mknod r${name}${unit}j c $chr $(($unit * 16 + 9))
1693: mknod r${name}${unit}k c $chr $(($unit * 16 + 10))
1694: mknod r${name}${unit}l c $chr $(($unit * 16 + 11))
1695: mknod r${name}${unit}m c $chr $(($unit * 16 + 12))
1696: mknod r${name}${unit}n c $chr $(($unit * 16 + 13))
1697: mknod r${name}${unit}o c $chr $(($unit * 16 + 14))
1698: mknod r${name}${unit}p c $chr $(($unit * 16 + 15))
1699: chgrp operator $name$unit? r$name$unit?
1700: chmod 640 $name$unit? r$name$unit?
1701: }
1702: makedisk_p16high() {
1703: highpartoffset=524280 # offset for partition 9 to 16
1704: name="$1"; unit="$2"; blk="$3"; chr="$4"
1705:
1706: rm -f $name$unit? r$name$unit?
1707: mknod ${name}${unit}a b $blk $(($unit * 8 + 0))
1708: mknod ${name}${unit}b b $blk $(($unit * 8 + 1))
1709: mknod ${name}${unit}c b $blk $(($unit * 8 + 2))
1710: mknod ${name}${unit}d b $blk $(($unit * 8 + 3))
1711: mknod ${name}${unit}e b $blk $(($unit * 8 + 4))
1712: mknod ${name}${unit}f b $blk $(($unit * 8 + 5))
1713: mknod ${name}${unit}g b $blk $(($unit * 8 + 6))
1714: mknod ${name}${unit}h b $blk $(($unit * 8 + 7))
1715: mknod ${name}${unit}i b $blk $(($unit * 8 + $highpartoffset + 8))
1716: mknod ${name}${unit}j b $blk $(($unit * 8 + $highpartoffset + 9))
1717: mknod ${name}${unit}k b $blk $(($unit * 8 + $highpartoffset + 10))
1718: mknod ${name}${unit}l b $blk $(($unit * 8 + $highpartoffset + 11))
1719: mknod ${name}${unit}m b $blk $(($unit * 8 + $highpartoffset + 12))
1720: mknod ${name}${unit}n b $blk $(($unit * 8 + $highpartoffset + 13))
1721: mknod ${name}${unit}o b $blk $(($unit * 8 + $highpartoffset + 14))
1722: mknod ${name}${unit}p b $blk $(($unit * 8 + $highpartoffset + 15))
1723: mknod r${name}${unit}a c $chr $(($unit * 8 + 0))
1724: mknod r${name}${unit}b c $chr $(($unit * 8 + 1))
1725: mknod r${name}${unit}c c $chr $(($unit * 8 + 2))
1726: mknod r${name}${unit}d c $chr $(($unit * 8 + 3))
1727: mknod r${name}${unit}e c $chr $(($unit * 8 + 4))
1728: mknod r${name}${unit}f c $chr $(($unit * 8 + 5))
1729: mknod r${name}${unit}g c $chr $(($unit * 8 + 6))
1730: mknod r${name}${unit}h c $chr $(($unit * 8 + 7))
1731: mknod r${name}${unit}i c $chr $(($unit * 8 + $highpartoffset + 8))
1732: mknod r${name}${unit}j c $chr $(($unit * 8 + $highpartoffset + 9))
1733: mknod r${name}${unit}k c $chr $(($unit * 8 + $highpartoffset + 10))
1734: mknod r${name}${unit}l c $chr $(($unit * 8 + $highpartoffset + 11))
1735: mknod r${name}${unit}m c $chr $(($unit * 8 + $highpartoffset + 12))
1736: mknod r${name}${unit}n c $chr $(($unit * 8 + $highpartoffset + 13))
1737: mknod r${name}${unit}o c $chr $(($unit * 8 + $highpartoffset + 14))
1738: mknod r${name}${unit}p c $chr $(($unit * 8 + $highpartoffset + 15))
1739: chgrp operator $name$unit? r$name$unit?
1740: chmod 640 $name$unit? r$name$unit?
1741: }
1742:
1743: makedev $*
CVSweb <webmaster@jp.NetBSD.org>