3 # Copyright (c) 1990 The Regents of the University of California.
6 # Written and contributed by W. Jolitz 12/90
8 # Redistribution and use in source and binary forms are permitted provided
9 # that: (1) source distributions retain this entire copyright notice and
10 # comment, and (2) distributions including binaries display the following
11 # acknowledgement: ``This product includes software developed by the
12 # University of California, Berkeley and its contributors'' in the
13 # documentation or other materials provided with the distribution and in
14 # all advertising materials mentioning features or use of this software.
15 # Neither the name of the University nor the names of its contributors may
16 # be used to endorse or promote products derived from this software without
17 # specific prior written permission.
18 # THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
19 # WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
20 # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
22 # @(#)MAKEDEV 5.2 (Berkeley) 6/22/90
23 # $FreeBSD: src/etc/MAKEDEV,v 1.243.2.57 2003/02/10 11:35:53 simokawa Exp $
24 # $DragonFly: src/etc/MAKEDEV,v 1.14 2004/10/15 02:38:35 dillon Exp $
26 # Device "make" file. Valid arguments:
27 # all makes all known devices, standard number of units (or close)
28 # std standard devices
29 # jail suitable for a jail(8)
30 # local configuration specific devices
31 # mach-4 mach4&lites+devices for Mach's XFree86 distribution
32 # (see http://www.cs.hut.fi/lites.html for more info on LITES)
35 # ast* ATAPI tape drives
36 # wt* QIC-interfaced (e.g. not SCSI) 3M cartridge tape
37 # sa* SCSI Sequential Access Devices
40 # aac* Adaptec FSA RAID controllers
41 # aacd* Adaptec FSA RAID
42 # acd* ATAPI CD-ROM disks
44 # afd* ATAPI floppy disks
46 # cd* SCSI CD-ROM disks
47 # da* SCSI Direct Access Devices
48 # fd* floppy disk drives (3 1/2", 5 1/4")
49 # fla* M-Systems DiskOnChip
50 # idad* Compaq Smart-2 RAID arrays
51 # ips* IBM ServeRAID controller
53 # mcd* Mitsumi CD-ROM disks
54 # md* Memory (or malloc) disk
55 # mlx* Mylex DAC960 RAID controllers
56 # mlxd* Mylex DAC960 RAID disk volumes
57 # pst* Promise SuperTrak RAID disks
58 # scd* Sony CD-ROM disks
62 # vty* virtual console devices for syscons/pcvt/codrv
65 # mse* Logitech and ATI Inport bus mouse
67 # jogdial Sony VAIO Jogdial
68 # sysmouse Mousesystems mouse emulator for syscons
71 # refclock-* serial ports used by xntpd parse refclocks
74 # tty* general purpose serial ports
75 # cua* dialout serial ports
76 # ttyA* Specialix SI/XIO dialin ports ('*' = number of devices)
77 # cuaA* Specialix SI/XIO dialout ports
78 # ttyD* Digiboard - 16 dialin ports
79 # cuaD* Digiboard - 16 dialout ports
80 # ttyE* Stallion EasyIO (stl) dialin ports
81 # cuaE* Stallion EasyIO (stl) dialout ports
82 # ttyF* Stallion Brumby (stli) dialin ports
83 # cuaF* Stallion Brumby (stli) dialout ports
84 # ttyR* Rocketport dialin ports
85 # cuaR* Rocketport dialout ports
87 # stlN Stallion EasyIO board N dialin and dialout
88 # stliN Stallion Brumby board N dialin and dialout
91 # pty* set of 32 master and slave pseudo terminals
92 # vty* virtual terminals using syscons/pcvt/codrv console
96 # ppi* Parallel port i/o
97 # pps* Pulse per second timing interface
98 # pcfclock* Parallel time sync interface
105 # usb* USB bus control device
106 # ucom* USB serial devices
107 # ugen* generic USB device
108 # uhid* Human Interface Device (HID)
112 # urio* Diamond Rio 500
113 # uscanner* USB scanners
115 # SCSI devices (other than CD-ROM, tape and disk):
116 # ch* SCSI Media-Changer (juke box) driver
117 # pt* Processor Type (HP scanner, as one example)
118 # pass* CAM Passthrough device
119 # ses* SES (SCSI Environmental Services) and
120 # SAF-TE (Scsi Accessable Fault-Tolerant Enclosures) device
122 # PC-CARD (previously called PCMCIA) support
123 # card* PC-CARD slots
126 # i4b isdnd call control device
127 # i4bctl debugging control device
128 # i4btrc* trace data interface(s), one per passive card
129 # i4btel* telephony interface(s)
130 # i4bteld* telephony dialout interface(s)
131 # i4brbch* raw b channel access device(s)
133 # Special purpose devices:
134 # acpi ACPI control device
135 # apm Advanced Power Management BIOS
136 # apmctl APM BIOS control device
138 # crypto crypto interface
140 # tw* xten power controller
141 # snd* various sound cards
142 # pcaudio PCM audio driver
143 # socksys iBCS2 socket system driver
144 # vat VAT compatibility audio driver (requires snd*)
145 # gsc Genius GS-4500 hand scanner
147 # tun* Tunneling IP device
148 # tap* Ethernet Tunneling device
149 # snp* tty snoop devices
150 # spigot Video Spigot video acquisition card
151 # ctx* Cortex-I video acquisition card
152 # meteor* Matrox Meteor video acquisition card (pci)
153 # bktr* Bt848 based video acquisition card (pci)
154 # labpc* National Instrument's Lab-PC and LAB-PC+
155 # perfmon CPU performance-monitoring counters
156 # pci PCI configuration-space access from user mode
157 # ipl ipfilter control devices (ipl, ipnat, ipstate, ipauth)
158 # kbd keyboard devices
159 # elan-mmcr AMD Elan support (e.g. mmap MMCR)
160 # agpgart AGP interface
161 # cfs* Coda Distributed Filesystem
162 # nsmb* SMB/CIFS protocol interface
163 # pf PF packet filter
166 if [ -n "$MAKEDEVPATH" ]; then
173 # Usage: die exitcode msg
179 # Convert integer to partition name
184 0) p=a;; 1) p=b;; 2) p=c;; 3) p=d;; 4) p=e;; 5) p=f;; 6) p=g;; 7) p=h;;
185 8) p=i;; 9) p=j;; 10) p=k;; 11) p=l;; 12) p=m;; 13) p=n;; 14) p=o;; 15) p=p;;
191 # Convert integer to slice name
203 # Convert disk (type, unit, slice, partition) to minor number
206 echo $(($1 << 25 | ($2 / 32) << 21 | ($2 % 32) << 3 | $3 << 16 | ($4 & 7) | ($4 & 8) << 17))
209 # Override mknod(2) to add extra handling to it.
211 for i in `IFS=':'; echo $PATH`; do
212 if [ -x "${i}/mknod" ]; then
220 4) "$mknod" "$@" root:wheel || die 2 "$mknod $@ failed";;
221 5) "$mknod" "$@" || die 2 "$mknod $@ failed";;
222 *) die 2 "bad node: mknod $@";;
226 # Convert tape (ctrl, unit, mode, access) to minor number
229 echo $(($1 << 29 | ($2 / 16) << 16 | ($2 % 16) << 4 | $3 << 2 | $4))
232 # Convert the last character of a tty name to a minor number.
237 a) m=10;; b) m=11;; c) m=12;; d) m=13;; e) m=14;; f) m=15;; g) m=16;;
238 h) m=17;; i) m=18;; j) m=19;; k) m=20;; l) m=21;; m) m=22;; n) m=23;;
239 o) m=24;; p) m=25;; q) m=26;; r) m=27;; s) m=28;; t) m=29;; u) m=30;;
246 # Convert a unit number to a minor number.
249 echo $(((($1 >> 8) << 16) | ($1 % 256)))
252 # For the stallion devices tty[EF]
253 # stallion major letter card iscallout
266 if [ $iscallout -gt 0 ]; then
274 *) die 1 "Invalid stl card number $card";;
277 # make the mem interface for extracting stats & loading microcode.
278 # 0x1000000 + card number
279 mknod staliomem$card c $major 0x0100000$card
281 while [ $port -lt $maxport ]; do
282 minor=$(($minorbase + $card * 1048576 + $port))
283 if [ $port -ge 32 ]; then
284 minor=$(($minor + 65504))
286 unit=$(($card * 64 + $port))
288 mknod ${pref}${letter}$unit c $major $minor $owner
289 mknod ${pref}i${letter}$unit c $major $(($minor + 32)) $owner
290 mknod ${pref}l${letter}$unit c $major $(($minor + 64)) $owner
295 # Raw partition for disks
298 # Compatibility slice for disks
301 # Raw slice for disks
305 disk_umask=037 # allow group operator to read disks
306 tape_umask=017 # allow group operator to read/write tapes
312 sh MAKEDEV std # standard
313 sh MAKEDEV fd0 fd1 # bdev, floppy disk
314 sh MAKEDEV da0 da1 da2 da3 da4 da5 da6 da7 # bdev, SCSI disk
315 sh MAKEDEV da8 da9 da10 da11 da12 da13 da14 da15# bdev, SCSI disk
316 sh MAKEDEV ata # cdev, ATA control
317 sh MAKEDEV ad0 ad1 ad2 ad3 ad4 ad5 ad6 ad7 # bdev, ATA disk
318 sh MAKEDEV ar0 ar1 # bdev, ATA RAID disk
319 sh MAKEDEV acd0 afd0 ast0 # bdev, ATAPI devices
320 sh MAKEDEV wd0 wd1 wd2 wd3 # bdev, OLD disk
321 sh MAKEDEV wcd0 wfd0 wst0 # bdev, OLD ATAPI devs
322 sh MAKEDEV vn0 # bdev, virtual disk
323 sh MAKEDEV cd0 mcd0 scd0 # bdev, cdrom
324 sh MAKEDEV sa0 wt0 # bdev, tape
325 sh MAKEDEV vty12 # cdev, virtual tty
326 sh MAKEDEV cuaa0 cuaa1 cuaa2 cuaa3 # cdev, serial tty
327 sh MAKEDEV pty0 # cdev, pseudo tty
328 sh MAKEDEV ttyd0 ttyd1 ttyd2 ttyd3 # cdev, serial tty
329 sh MAKEDEV zs0 # big-Alpha serial tty
330 sh MAKEDEV kbd0 kbd1 # cdev, keyboard
331 sh MAKEDEV mse0 psm0 jogdial sysmouse # cdev, mouse
332 sh MAKEDEV pcaudio speaker snd0 # cdev, noise
333 sh MAKEDEV lpt0 lpt1 lpt2 # cdev, printer
334 sh MAKEDEV ppi0 ppi1 ppi2 # cdev, parallel port
335 sh MAKEDEV iic0 iic1 # cdev, I2C device
336 sh MAKEDEV smb0 smb1 # cdev, SMBus device
337 sh MAKEDEV usb usb0 uhid0 ums0 ulpt0 ugen0 # cdev, USB devices
338 sh MAKEDEV usb1 uhid1 ums1 ulpt1 ugen1 # cdev, USB devices
339 sh MAKEDEV usb2 usb3 usb4 usb5 # cdev, USB devices
340 sh MAKEDEV urio0 uscanner0 umodem0 # cdev, USB devices too
341 sh MAKEDEV bpf0 bpf1 bpf2 bpf3 # cdev, network
342 sh MAKEDEV ipl tun0 tun1 tun2 tun3 # cdev, network
343 sh MAKEDEV tap0 tap1 tap2 tap3 # cdev, network
344 sh MAKEDEV ch0 perfmon tw0 # cdev, miscellaneous
345 sh MAKEDEV acpi # cdev, laptop
346 sh MAKEDEV apm apmctl card0 card1 card2 card3 # cdev, laptop
347 sh MAKEDEV pass4 xpt2 # cdev, CAM
348 sh MAKEDEV i4b i4bctl i4btrc0 i4btrc1 # cdev, ISDN
349 sh MAKEDEV i4btel0 i4btel1 i4bteld0 i4bteld1 # cdev, ISDN
350 sh MAKEDEV i4brbch0 i4brbch1 # cdev, ISDN
351 sh MAKEDEV agpgart # cdev, AGP
352 sh MAKEDEV nsmb0 # cdev, SMB/CIFS
353 sh MAKEDEV twed0 # 3ware
354 sh MAKEDEV crypto # cdev, crypto
355 sh MAKEDEV fw0 # cdev, firewire
356 sh MAKEDEV dcons # cdev, dcons
360 # a much restricted set of the above, to save precious i-nodes on the
363 sh MAKEDEV std # standard
364 sh MAKEDEV fd0 # bdev, floppy disk
365 sh MAKEDEV da0 # bdev, SCSI disk
366 sh MAKEDEV ad0 # bdev, ATA disk
367 sh MAKEDEV acd0 afd0 ast0 # bdev, ATAPI devices
368 sh MAKEDEV wd0 # bdev, OLD disk
369 sh MAKEDEV wcd0 wfd0 wst0 # bdev, OLD ATAPI devs
370 sh MAKEDEV vn0 # bdev, virtual disk
371 sh MAKEDEV cd0 # bdev, cdrom
372 sh MAKEDEV sa0 # bdev, tape
373 sh MAKEDEV vty2 # cdev, virtual tty
374 sh MAKEDEV cuaa0 # cdev, serial tty
375 sh MAKEDEV pty0 # cdev, pseudo tty
376 sh MAKEDEV ttyd0 # cdev, serial tty
377 sh MAKEDEV zs0 # big-Alpha serial tty
378 sh MAKEDEV kbd0 # cdev, keyboard
379 sh MAKEDEV mse0 psm0 sysmouse # cdev, mouse
380 sh MAKEDEV lpt0 # cdev, printer
381 sh MAKEDEV ppi0 # cdev, parallel port
382 sh MAKEDEV iic0 # cdev, I2C device
383 sh MAKEDEV smb0 # cdev, SMBus device
384 sh MAKEDEV ums0 # cdev, USB devices
385 sh MAKEDEV tun0 # cdev, network
386 sh MAKEDEV tap0 # cdev, network
387 sh MAKEDEV ch0 # cdev, miscellaneous
388 sh MAKEDEV apm apmctl card0 # cdev, laptop
389 sh MAKEDEV pass1 xpt1 # cdev, CAM
390 sh MAKEDEV i4b i4bctl i4btrc0 i4btrc1 # cdev, ISDN
391 sh MAKEDEV i4btel0 i4bteld0 # cdev, ISDN
392 sh MAKEDEV i4brbch0 # cdev, ISDN
397 mknod console c 0 0; chmod 600 console
398 mknod kmem c 2 1 root:kmem; chmod 640 kmem
399 mknod mem c 2 0 root:kmem; chmod 640 mem
400 mknod null c 2 2; chmod 666 null
401 mknod random c 2 3; chmod 644 random
402 mknod urandom c 2 4; chmod 644 urandom
403 mknod zero c 2 12; chmod 666 zero
404 mknod io c 2 14; chmod 600 io
405 mknod tty c 1 0; chmod 666 tty
406 mknod klog c 7 0; chmod 600 klog
407 mknod stdin c 22 0; chmod 666 stdin
408 mknod stdout c 22 1; chmod 666 stdout
409 mknod stderr c 22 2; chmod 666 stderr
410 mknod pci c 78 0; chmod 644 pci
413 while [ $i -lt 64 ]; do
424 rm mem kmem pci io klog console # for security
425 ln -sf null mem # for libkvm (ab)users
426 ln -sf null kmem # --//--
435 mknod timezone c 26 0
438 # Create device files for new Archive/Wangtek QIC-02 tape driver (vak)
441 u=`expr $i : '..\(.*\)'`
442 if [ -z "${u}" ]; then u=0; fi
443 # default density, 512b blocks
444 mknod rwt${u} c 10 $(( 0 + $u)) root:operator
445 mknod nrwt${u} c 10 $(( 4 + $u)) root:operator
446 # default density, 1024b blocks
447 # mknod rWt${u} c 10 $((64 + $u)) root:operator
448 # mknod nrWt${u} c 10 $((68 + $u)) root:operator
449 mknod rwt${u}b c 10 $((16 + $u)) root:operator # 60 megabytes
450 mknod nrwt${u}b c 10 $((20 + $u)) root:operator
451 mknod rwt${u}c c 10 $((24 + $u)) root:operator # 120 megabytes
452 mknod nrwt${u}c c 10 $((28 + $u)) root:operator
453 mknod rwt${u}d c 10 $((32 + $u)) root:operator # 150 megabytes
454 mknod nrwt${u}d c 10 $((36 + $u)) root:operator
455 # mknod rwt${u}e c 10 $((40 + $u)) root:operator # 300 megabytes?
456 # mknod nrwt${u}e c 10 $((44 + $u)) root:operator
457 # mknod rwt${u}f c 10 $((48 + $u)) root:operator # 600 megabytes?
458 # mknod nrwt${u}f c 10 $((52 + $u)) root:operator
463 aacd*s*|ad*s*|ar*s*|afd*s*|amrd*s*|da*s*|fla*s*|idad*s*|ipsd*s*|md*s*|mlxd*s*|pst*s*|twed*s*|vn*s*|wd*s*|wfd*s*)
466 aacd*s*) name=aacd; chr=151;;
467 ad*s*) name=ad; chr=116;;
468 ar*s*) name=ar; chr=157;;
469 afd*s*) name=afd; chr=118;;
470 amrd*s*) name=amrd; chr=133;;
471 da*s*) name=da; chr=13;;
472 fla*s*) name=fla; chr=102;;
473 idad*s*) name=idad; chr=109;;
474 ipsd*s*) name=ipsd; chr=176;;
475 md*s*) name=md; chr=95;;
476 mlxd*s*) name=mlxd; chr=131;;
477 pst*s*) name=pst; chr=168;;
478 twed*s*) name=twed; chr=147;;
479 vn*s*) name=vn; chr=43;;
480 wd*s*) name=wd; chr=3;;
481 wfd*s*) name=wfd; chr=87;;
484 aacd*s*|amrd*s*|idad*s*|ipsd*s*|mlxd*s*|twed*s*)
485 unit=`expr $i : '....\([0-9]*\)s'`
486 slice=`expr $i : '....[0-9]*s\([0-9]*\)'`
487 part=`expr $i : '....[0-9]*s[0-9]*\(.*\)'`
489 afd*s*|fla*s*|pst*s*|wfd*s*)
490 unit=`expr $i : '...\([0-9]*\)s'`
491 slice=`expr $i : '...[0-9]*s\([0-9]*\)'`
492 part=`expr $i : '...[0-9]*s[0-9]*\(.*\)'`
495 unit=`expr $i : '..\([0-9]*\)s'`
496 slice=`expr $i : '..[0-9]*s\([0-9]*\)'`
497 part=`expr $i : '..[0-9]*s[0-9]*\(.*\)'`
501 [0-9]|[0-9][0-9]|[0-4][0-9][0-9]|50[0-9]|51[0-1])
506 slicename=`dkitos $slice`
507 minor=`dkminor 0 $unit $slice $dkrawpart`
508 mknod $name$unit$slicename c $chr $minor root:operator
509 rm -f r$name$unit$slicename
513 0) slice=$oldslice ;;
515 for part in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
517 minor=`dkminor 0 $unit $slice $part`
518 partname=`dkitop $part`
519 mknod $name$unit$slicename$partname \
520 c $chr $minor root:operator
521 rm -f r$name$unit$slicename$partname
527 echo bad partition for disk in: $i
532 echo bad slice for disk in: $i
537 echo bad unit for disk in: $i "(unit=$unit, slice=$slice, part=$part)"
545 unit=`expr $i : '..\(.*\)'`
549 mknod ${name}${unit} c $chr $(($unit * 64)) root:operator
550 rm -f r${name}${unit}
551 # Fake BSD partitions
552 for i in a b c d e f g h
554 ln -f ${name}${unit} ${name}${unit}$i
555 rm -f r${name}${unit} r${name}${unit}$i
557 # User-readable and programmer-readable name sets
559 mknod ${name}${unit}.1720 c $chr $(($unit * 64 + 1)) \
561 rm -f r${name}${unit}.1720
562 # ln -f ${name}${unit}.1720 ${name}${unit}135hs21
563 # rm -f r${name}${unit}135hs21
565 mknod ${name}${unit}.1480 c $chr $(($unit * 64 + 2)) \
567 rm -f r${name}${unit}.1480
568 # ln -f ${name}${unit}.1480 ${name}${unit}135hs18
569 # rm -f r${name}${unit}135hs18
570 # ln -f ${name}${unit}.1480 ${name}${unit}96hs18
571 # rm -f r${name}${unit}96hs18
573 mknod ${name}${unit}.1440 c $chr $(($unit * 64 + 3)) \
575 rm -f r${name}${unit}.1440
576 # ln -f ${name}${unit}.1440 ${name}${unit}135
577 # rm -f r${name}${unit}135
578 # ln -f ${name}${unit}.1440 ${name}${unit}135ds18
579 # rm -f r${name}${unit}135ds18
580 # ln -f ${name}${unit}.1440 ${name}${unit}96ds18
581 # rm -f r${name}${unit}96ds18
583 mknod ${name}${unit}.1200 c $chr $(($unit * 64 + 4)) \
585 rm -f r${name}${unit}.1200
586 # ln -f ${name}${unit}.1200 ${name}${unit}96
587 # rm -f r${name}${unit}96
588 # ln -f ${name}${unit}.1200 ${name}${unit}96ds15
589 # rm -f r${name}${unit}96ds15
590 # ln -f ${name}${unit}.1200 ${name}${unit}135ds15
591 # rm -f r${name}${unit}135ds15
593 mknod ${name}${unit}.820 c $chr $(($unit * 64 + 5)) \
595 rm -f r${name}${unit}.820
596 # ln -f ${name}${unit}.820 ${name}${unit}96hs10
597 # rm -f r${name}${unit}96hs10
598 # ln -f ${name}${unit}.820 ${name}${unit}135hs10
599 # rm -f r${name}${unit}135hs10
601 mknod ${name}${unit}.800 c $chr $(($unit * 64 + 6)) \
603 rm -f r${name}${unit}.800
604 # ln -f ${name}${unit}.800 ${name}${unit}96ds10
605 # rm -f r${name}${unit}96ds10
606 # ln -f ${name}${unit}.800 ${name}${unit}135ds10
607 # rm -f r${name}${unit}135ds10
609 mknod ${name}${unit}.720 c $chr $(($unit * 64 + 7)) \
611 rm -f r${name}${unit}.720
612 # ln -f ${name}${unit}.720 ${name}${unit}96ds9
613 # rm -f r${name}${unit}96ds9
614 # ln -f ${name}${unit}.720 ${name}${unit}135ds9
615 # rm -f r${name}${unit}135ds9
617 mknod ${name}${unit}.360 c $chr $(($unit * 64 + 8)) \
619 rm -f r${name}${unit}.360
620 # ln -f ${name}${unit}.360 ${name}${unit}48
621 # rm -f r${name}${unit}48
622 # ln -f ${name}${unit}.360 ${name}${unit}48ds9
623 # rm -f r${name}${unit}48ds9
625 mknod ${name}${unit}.640 c $chr $(($unit * 64 + 9)) \
627 rm -f r${name}${unit}.640
628 # ln -f ${name}${unit}.640 ${name}${unit}96ds8
629 # rm -f r${name}${unit}96ds8
630 # ln -f ${name}${unit}.640 ${name}${unit}135ds8
631 # rm -f r${name}${unit}135ds8
633 mknod ${name}${unit}.1232 c $chr $(($unit * 64 + 10)) \
635 rm -f r${name}${unit}.1232
636 # ln -f ${name}${unit}.1232 ${name}${unit}96ds8
637 # rm -f r${name}${unit}96ds8
638 # ln -f ${name}${unit}.1232 ${name}${unit}135ds8
639 # rm -f r${name}${unit}135ds8
642 echo bad unit for disk in: $i
648 aacd*|ad*|ar*|afd*|amrd*|da*|fla*|idad*|ipsd*|md*|mlxd*|pst*|twed*|vn*|wd*|wfd*)
651 aacd*) name=aacd; chr=151;;
652 ad*) name=ad; chr=116;;
653 ar*) name=ar; chr=157;;
654 afd*) name=afd; chr=118;;
655 amrd*) name=amrd; chr=133;;
656 da*) name=da; chr=13;;
657 fla*) name=fla; chr=102;;
658 idad*) name=idad; chr=109;;
659 ipsd*) name=ipsd; chr=176;;
660 md*) name=md; chr=95;;
661 mlxd*) name=mlxd; chr=131;;
662 pst*) name=pst; chr=168;;
663 twed*) name=twed; chr=147;;
664 vn*) name=vn; chr=43;;
665 wd*) name=wd; chr=3;;
666 wfd*) name=wfd; chr=87;;
669 aacd*|amrd*|idad*|ipsd*|mlxd*|twed*)
670 unit=`expr $i : '....\(.*\)'`
673 unit=`expr $i : '...\(.*\)'`
676 unit=`expr $i : '..\(.*\)'`
680 [0-9]|[0-9][0-9]|[0-4][0-9][0-9]|50[0-9]|51[0-1])
681 for slicepartname in s0h s1h s2 s3 s4
683 sh MAKEDEV $name$unit$slicepartname
687 echo bad unit for disk in: $i
697 unit=`expr $i : '...\(.*\)'`
699 [0-9]|[0-9][0-9]|[0-4][0-9][0-9]|50[0-9]|51[0-1])
700 for part in 0 1 2 3 4 5 6 7
702 minor=`dkminor 0 $unit 0 $part`
703 partname=`dkitop $part`
704 mknod $name$unit$partname c $chr $minor root:operator
705 rm -f r$name$unit$partname
709 echo bad unit for disk in: $i
715 # SCSI processor type driver
719 unit=`expr $i : 'pt\([0-9][0-9]*\)'`
720 if [ -z "${unit}" ]; then
723 unit=$(($unit + 1 - 1))
724 mknod ${name}${unit} c $chr `unit2minor $unit`
727 # SCSI SES/SAF-TE type driver
731 unit=`expr $i : 'ses\([0-9][0-9]*\)'`
732 if [ -z "${unit}" ]; then
735 unit=$(($unit + 1 - 1))
736 mknod ${name}${unit} c $chr `unit2minor $unit`
738 # SCSI target mode sample driver
742 unit=`expr $i : 'targ\([0-9][0-9]*\)'`
743 if [ -z "${unit}" ]; then
746 unit=$(($unit + 1 - 1))
747 mknod ${name}${unit} c $chr `unit2minor $unit`
748 mknod ${name}.ctl c $chr 0xffff00ff
751 # CAM transport layer device
753 # This major number is temporary
756 units=`expr $i : 'xpt\(.*\)'`
757 if [ -z "${units}" ]; then
761 while [ $i -lt $units ]; do
764 mknod $dname c $chr `unit2minor $i` root:operator
769 # CAM passthrough device
771 # This major number is temporary
774 units=`expr $i : 'pass\(.*\)'`
775 if [ -z "${units}" ]; then
779 while [ $i -lt $units ]; do
782 mknod $dname c $chr `unit2minor $i` root:operator
787 class=`expr $i : 'pty\(.*\)'`
790 1) offset=32 name=q;;
791 2) offset=64 name=r;;
792 3) offset=96 name=s;;
793 # Note that xterm (at least) only look at p-s.
794 4) offset=128 name=P;;
795 5) offset=160 name=Q;;
796 6) offset=192 name=R;;
797 7) offset=224 name=S;;
798 # This still leaves [tuTU].
799 *) echo bad unit for pty in: $i;;
805 while [ $i -lt 32 ]; do
806 # This was an awk substr() before.
807 c=$(echo 0123456789abcdefghijklmnopqrstuv |
808 dd bs=1 skip=$i count=1 2>/dev/null)
809 mknod tty$name$c c 5 $(($offset + $i))
810 mknod pty$name$c c 6 $(($offset + $i))
820 unit=`expr $i : '..\(.*\)'`
824 [0-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9])
825 mknod sa${unit}.ctl c $chr `saminor 1 ${unit} 0 0`
826 ln -f sa${unit}.ctl rsa${unit}.ctl
829 mknod sa${unit}.${m} c $chr \
830 `saminor 0 ${unit} ${m} 0` root:operator
831 ln -f sa${unit}.${m} rsa${unit}.${m}
832 mknod nsa${unit}.${m} c $chr \
833 `saminor 0 ${unit} ${m} 1` root:operator
834 ln -f nsa${unit}.${m} nrsa${unit}.${m}
835 mknod esa${unit}.${m} c $chr \
836 `saminor 0 ${unit} ${m} 2` root:operator
837 ln -f esa${unit}.${m} ersa${unit}.${m}
839 ln -f sa${unit}.0 sa${unit}
840 ln -f sa${unit}.0 rsa${unit}.0
841 ln -f sa${unit}.0 rsa${unit}
842 ln -f nsa${unit}.0 nsa${unit}
843 ln -f nsa${unit}.0 nrsa${unit}.0
844 ln -f nsa${unit}.0 nrsa${unit}
845 ln -f esa${unit}.0 esa${unit}
846 ln -f esa${unit}.0 ersa${unit}.0
847 ln -f esa${unit}.0 ersa${unit}
850 echo bad unit for tape in: $i
858 unit=`expr $i : '..\(.*\)'`
860 ch*) name=ch; chr=17;;
864 mknod ${name}${unit} c $chr $unit root:operator
867 echo bad unit for media changer in: $i
874 mknod ata c 159 0 root:operator
878 unit=`expr $i : '...\(.*\)'`
882 mknod ast${unit} c $chr $(($unit * 8 + 0)) root:operator
884 mknod nast${unit} c $chr $(($unit * 8 + 1)) root:operator
885 chmod 640 nast${unit}
888 echo bad unit for tape in: $i
896 units=`expr $i : '...\(.*\)t'`;
897 tracks=`expr $i : '.*t\(.*\)'`;
900 if [ -z "${units}" ]; then
903 if [ -z "${tracks}" ]; then
906 if [ "${units}" -le 31 -a "${tracks}" -le 169 ]; then
908 while [ $i -le $units ]; do
912 while [ $j -le ${tracks} ]; do
913 mknod ${dname}t$j c $chr \
914 $((($i * 8) + (65536 * $j))) \
921 echo "$i is invalid -- can't have more than 32 cd devices or 169 tracks"
929 acd*) units=`expr $i : '...\(.*\)'`; name=acd; chr=117;;
930 cd*) units=`expr $i : '..\(.*\)'`; name=cd; chr=15;;
931 mcd*) units=`expr $i : '...\(.*\)'`; name=mcd; chr=29;;
932 scd*) units=`expr $i : '...\(.*\)'`; name=scd; chr=45;;
934 if [ -z "${units}" ]; then
937 if [ "${units}" -le 31 ]; then
939 while [ $i -le $units ]; do
942 mknod ${dname}a c $chr $(($i * 8)) root:operator
945 ln -f ${dname}a ${dname}c;;
947 mknod ${dname}c c $chr $(($i * 8 + 2)) root:operator;;
954 echo "$i is invalid -- can't have more than 32 cd devices"
961 unit=`expr $i : '...\(.*\)'`
965 mknod wcd${unit}a c $chr $(($unit * 8 + 0)) root:operator
966 mknod wcd${unit}c c $chr $(($unit * 8 + 2)) root:operator
967 ln -f wcd${unit}a rwcd${unit}a
968 ln -f wcd${unit}c rwcd${unit}c
969 chmod 640 wcd${unit}[a-h] rwcd${unit}[a-h]
972 echo bad unit for disk in: $i
980 unit=`expr $i : '...\(.*\)'`
984 mknod rwst${unit} c $chr $(($unit * 8 + 0)) root:operator
985 chmod 640 rwst${unit}
992 unit=`expr $i : 'iic\(.*\)'`
993 mknod iic$unit c 105 `unit2minor $unit`
997 unit=`expr $i : 'smb\(.*\)'`
998 mknod smb$unit c 106 `unit2minor $unit`
1002 unit=`expr $i : 'pcfclock\(.*\)'`
1003 mknod pcfclock$unit c 140 `unit2minor $unit`
1007 unit=`expr $i : 'ppi\(.*\)'`
1008 mknod ppi$unit c 82 `unit2minor $unit`
1012 unit=`expr $i : 'pps\(.*\)'`
1013 mknod pps$unit c 89 `unit2minor $unit`
1017 mknod usb c 108 255 root:operator
1023 unit=`expr $i : 'usb\(.*\)'`
1024 mknod usb$unit c 108 `unit2minor $unit` root:operator
1030 unit=`expr $i : 'ucom\(.*\)'`
1031 minor=$(($unit + 128))
1032 minor=`unit2minor $(($unit + 128))`
1033 mknod ucom$unit c 138 $minor uucp:dialer
1039 unit=`expr $i : 'uhid\(.*\)'`
1040 mknod uhid$unit c 122 `unit2minor $unit` root:operator
1046 unit=`expr $i : 'ums\(.*\)'`
1047 mknod ums$unit c 111 `unit2minor $unit` root:operator
1052 unit=`expr $i : 'ulpt\(.*\)'`
1053 minor=`unit2minor $unit`
1054 mknod ulpt$unit c 113 $minor
1055 minor=`unit2minor $(($unit + 64))`
1056 mknod unlpt$unit c 113 $minor # and the 'no prime' version
1061 unit=`expr $i : 'ugen\([0-9][0-9]*\)'`
1062 endpoint=`expr $i : 'ugen.*\.\([0-9][0-9]*\)'`
1063 if [ -z "${unit}" ]; then
1064 echo $i - Invalid unit number
1066 if [ -z "${endpoint}" ]; then # ugen0 & ugen0.1 - ugen0.15
1067 mknod ugen$unit c 114 \
1068 `unit2minor $(($unit * 16))` root:operator
1070 while [ $i -lt 16 ]; do
1071 mknod ugen$unit.$i c 114 \
1072 `unit2minor $(($unit * 16 + $i))` root:operator
1076 minor=`unit2minor $(($unit * 16 + $endpoint))`
1077 mknod ugen$unit.$endpoint c 114 $minor root:operator
1084 unit=`expr $i : 'urio\(.*\)'`
1085 mknod urio$unit c 143 `unit2minor $unit` root:operator
1091 unit=`expr $i : 'uscanner\(.*\)'`
1092 mknod uscanner$unit c 156 `unit2minor $unit` root:operator
1098 unit=`expr $i : 'umodem\(.*\)'`
1099 mknod umodem$unit c 124 `unit2minor $unit` uucp:dialer
1104 unit=`expr $i : 'lpt\(.*\)'`
1105 mknod lpt$unit c 16 `unit2minor $unit`
1106 mknod lpctl$unit c 16 `unit2minor $(($unit + 128))`
1109 # Use this to create virtual consoles for syscons, pcvt or codrv
1111 # use as MAKEDEV vtyNN to create NN entries
1114 units=`expr $i : 'vty\(.*\)'`
1116 while [ $i -lt $units ]; do
1117 mknod ttyv$(printf %01x $i) c $chr `unit2minor $i`
1120 ln -fs ttyv0 vga # XXX X still needs this pccons relic
1124 units=`expr $i : 'nmdm\(.*\)'`
1127 while [ $i -lt $units ]; do
1128 minor=`unit2minor $i`
1129 minor=$(($minor + $minor))
1130 mknod nmdm${i}A c $chr $minor
1131 mknod nmdm${i}B c $chr $(($minor + 1))
1137 nbpf=`expr $i : 'bpf\(.*\)$'`
1139 while [ $unit -le $nbpf ]; do
1140 mknod bpf$unit c 23 `unit2minor $unit`
1146 mknod speaker c 26 0
1151 unit_low=`expr $i : 'cua.*\(.\)$'`
1158 unit_high=`expr $i : 'cuaa\(.\).$'`
1159 m_high=`ttyminor $unit_high`
1162 unit=$unit_high$unit_low
1163 m=$(($m_high << 16 | `ttyminor $unit_low`))
1164 mknod cuaa$unit c 28 $(($m | 128)) uucp:dialer
1165 mknod cuaia$unit c 28 $(($m | 32 | 128)) uucp:dialer
1166 mknod cuala$unit c 28 $(($m | 64 | 128)) uucp:dialer
1171 mknod crypto c 70 0 root:operator
1175 mknod pf c 73 0 root:operator
1179 unit=`expr $i : 'fw\(.\)$'`
1182 minor=$(($unit << 16 | $sub))
1183 mknod fw$unit.$sub c 127 $minor root:operator
1184 chmod 660 fw$unit.$sub
1185 mknod fwmem$unit.$sub c 127 $((1<<24 | $minor)) root:operator
1186 chmod 660 fwmem$unit.$sub
1188 ln -sf fw$unit.0 fw$unit
1189 ln -sf fwmem$unit.0 fwmem$unit
1193 mknod dcons c 184 0 root:wheel
1197 tty?|tty0?|ttyd?|ttyd??)
1198 unit_low=`expr $i : 'tty.*\(.\)$'`
1205 unit_high=`expr $i : 'ttyd\(.\).$'`
1206 m_high=`ttyminor $unit_high`
1209 unit=$unit_high$unit_low
1210 m=$(($m_high << 16 | `ttyminor $unit_low`))
1211 mknod ttyd$unit c 28 $m
1212 mknod ttyid$unit c 28 $(($m | 32))
1213 mknod ttyld$unit c 28 $(($m | 64))
1218 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f
1219 g h i j k l m n o p q r s t u v"
1221 card=`expr $i : 'cua.*\(.\)$'`
1222 for unit in $portlist
1224 minor=`ttyminor $unit`
1225 minor=$(($card * 65536 + $minor))
1227 mknod cuac$name c $major $(($minor + 128)) uucp:dialer
1228 mknod cuaic$name c $major $(($minor + 32 + 128)) uucp:dialer
1229 mknod cualc$name c $major $(($minor + 64 + 128)) uucp:dialer
1235 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f
1236 g h i j k l m n o p q r s t u v"
1238 card=`expr $i : 'tty.*\(.\)$'`
1239 for unit in $portlist
1241 minor=`ttyminor $unit`
1242 minor=$(($card * 65536 + $minor))
1244 mknod ttyc$name c $major $minor
1245 mknod ttyic$name c $major $(($minor + 32))
1246 mknod ttylc$name c $major $(($minor + 64))
1250 # RISCom8 'rc' driver entries
1254 unit=`expr $i : 'cua.*\(.\)$'`
1256 mknod cuam$unit c 63 $(($m + 128)) uucp:dialer
1261 unit=`expr $i : 'tty.*\(.\)$'`
1263 mknod ttym$unit c 63 $m
1267 # Note: these are 'base 1' to match the numbers on the panels, and to match
1268 # the manual that comes with the system.
1271 nports=`expr $i : 'ttyA\(.*\)$'`
1273 while [ $port -le $nports ]; do
1274 minor=$(($port - 1))
1275 name=$(printf %02d $port)
1276 mknod ttyA$name c $major $minor
1277 mknod ttyiA$name c $major $(($minor + 65536))
1278 mknod ttylA$name c $major $(($minor + 131072))
1281 # For the user-mode control program, 'sicontrol'
1282 mknod si_control c 68 262144
1288 nports=`expr $i : 'cuaA\(.*\)$'`
1290 while [ $port -le $nports ]; do
1291 minor=$(($port - 1))
1292 name=$(printf %02d $port)
1293 mknod cuaA$name c $major $(($minor + 128)) uucp:dialer
1294 mknod cuaiA$name c $major $(($minor + 128 + 65536)) \
1296 mknod cualA$name c $major $(($minor + 128 + 131072)) \
1303 # Alpha AS8[24]00 (TurboLaser) console.
1305 unit=`expr $i : 'zs.*\(.\)$'`
1307 mknod zs$unit c 135 $m
1310 # Digiboard PC/?? 16 port card.
1311 # The current scheme of minor numbering is:
1313 # unused{14} CARD{2} major{8} CALLOUT{1} LOCK{1} INIT{1} PORT{5}
1315 # CARD bitfield in future versions may be extended to 3 bits.
1320 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f"
1322 card=`expr $i : 'tty.*\(.\)$'`
1323 for unit in $portlist
1325 minor=`ttyminor $unit`
1326 minor=$(($card * 65536 + $minor))
1328 mknod ttyD$name c $major $minor
1329 mknod ttyiD$name c $major $(($minor + 32))
1330 mknod ttylD$name c $major $(($minor + 64))
1336 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f"
1338 card=`expr $i : 'cua.*\(.\)$'`
1339 for unit in $portlist
1341 minor=`ttyminor $unit`
1342 minor=$(($card * 65536 + $minor))
1344 mknod cuaD$name c $major $(($minor + 128)) uucp:dialer
1345 mknod cuaiD$name c $major $(($minor + 32 + 128)) uucp:dialer
1346 mknod cualD$name c $major $(($minor + 64 + 128)) uucp:dialer
1351 # Stallion multi serial cards (stl and stli drivers)
1353 # These drivers reserve 64 minor devices per board, even if the board
1354 # supports only 4 devices. We default to creating only 8 of the 64 devices
1355 # to keep /dev from getting too large (which => slow). The last part of the
1356 # arg is the board number to create ports for. So:
1357 # ttyE0 will create 8 dialin ports ttyE0-ttyE7, plus ttyiE* and ttylE*
1358 # cuaE0 will create 8 dialout ports cuaE0-cuaE7, plus cuaiE* and cualE*
1359 # ttyE1 will create 8 dialin ports ttyE64-ttyE71, plus ttyiE* and ttylE*
1361 # If you have EasyConnect 8/32 or 8/64 cards, you will need to change the
1362 # definition of "maxport" below to get nodes for the full 32 or 64
1365 # Note that the mapping of minor device numbers (with the hole between
1366 # 32-64k) is a bit odd to keep compatibility with ttyd? for
1367 # lock/initial devices.
1368 # Minor device field for the ports is
1369 # card{3} unused{4} unit-msb{1} unused{8} callout{1} lock{1} init{1} unit-lsbs{5}
1370 # for the mem device is
1372 # (For stl, there is only 1 mem device per system; for stli, one per board)
1375 stallion 72 E `expr $i : 'tty.*\(.\)$'` 0
1378 stallion 72 E `expr $i : 'cua.*\(.\)$'` 1
1381 card=`expr $i : 'stl\(.\)$'`
1382 stallion 72 E $card 0
1383 stallion 72 E $card 1
1387 stallion 75 F `expr $i : 'tty.*\(.\)$'` 0
1390 stallion 75 F `expr $i : 'cua.*\(.\)$'` 1
1393 card=`expr $i : 'stl\(.\)$'`
1394 stallion 75 F $card 0
1395 stallion 75 F $card 1
1399 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f"
1400 modulelist="a b c d"
1402 card=`expr $i : 'tty.*\(.\)$'`
1403 for unit in $modulelist
1405 moduleminor=`ttyminor $unit`
1406 moduleminor=$(($moduleminor % 10 * 16))
1409 for unit in $portlist
1411 minor=`ttyminor $unit`
1412 minor=$(($card * 65536 + $minor + $moduleminor))
1413 name=$card$modulename$unit
1415 mknod ttyM$name c $major $minor
1416 mknod ttyiM$name c $major $(($minor + 64))
1417 mknod ttylM$name c $major $(($minor + 128))
1424 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f"
1425 modulelist="a b c d"
1427 card=`expr $i : 'cua.*\(.\)$'`
1428 for unit in $modulelist
1430 moduleminor=`ttyminor $unit`
1431 moduleminor=$(($moduleminor % 10 * 16))
1434 for unit in $portlist
1436 minor=`ttyminor $unit`
1437 minor=$(($card * 65536 + $minor + $moduleminor))
1438 name=$card$modulename$unit
1440 mknod cuaM$name c $major $(($minor + 262144)) \
1442 mknod cuaiM$name c $major $(($minor + 64 + 262144)) \
1444 mknod cualM$name c $major $(($minor + 128 + 262144)) \
1454 MINOR=$(($BOARD * 65536))
1456 dmesg | while read first rest; do
1464 rm -f ttyR* ttyiR* ttylR*
1465 for i in $controllers; do
1467 dmesg | while read first bar ports rest; do
1475 echo -n "Creating $ndevices devices for $i: "
1477 while [ $dev -lt $ndevices ]; do
1478 mknod ttyR$Rnum c $major $MINOR
1479 mknod ttyiR$Rnum c $major $(($MINOR + 32))
1480 mknod ttylR$Rnum c $major $(($MINOR + 64))
1482 MINOR=$(($MINOR + 1))
1485 BOARD=$(($BOARD + 1))
1486 MINOR=$(($BOARD * 65536))
1494 MINOR=$(($BOARD * 65536))
1496 dmesg | while read first rest; do
1504 rm -f cuaR* cuaiR* cualR*
1505 for i in $controllers; do
1507 dmesg | while read first bar ports rest; do
1515 echo -n "Creating $ndevices devices for $i: "
1517 while [ $dev -lt $ndevices ]; do
1518 mknod cuaR$Rnum c $major $(($MINOR + 128)) uucp:dialer
1519 mknod cuaiR$Rnum c $major $(($MINOR + 128 + 32)) \
1521 mknod cualR$Rnum c $major $(($MINOR + 128 + 64)) \
1524 MINOR=$(($MINOR + 1))
1527 BOARD=$(($BOARD + 1))
1528 MINOR=$(($BOARD * 65536))
1534 unit=`expr $i : 'mse\(.*\)'`
1536 # non-blocking for X11
1537 mknod mse$unit c $chr `unit2minor $(($unit * 2 + 1))`
1541 unit=`expr $i : 'psm\(.*\)'`
1543 # non-blocking for X11
1544 mknod psm$unit c $chr `unit2minor $(($unit * 2 + 1))`
1548 name=`expr $i : 'mouse\(.*\)'`
1549 if [ ! -c $name ]; then
1550 $0 $name # make the appropriate device
1556 mknod pcaudio c 24 0
1557 mknod pcaudioctl c 24 128
1561 mknod socksys c 41 0
1564 chmod 666 socksys nfsd spx
1569 # changes from Linux voxware
1570 # minor Linux FreeBSD
1571 # 8 sequencer2 (aka music0) music0
1572 # 17 patmgr0 sequencer1
1573 # 33 patmgr1 sequencer2
1576 unit=`expr $i : 'snd\(.*\)'`
1579 # XXX write this less verbosely, like std
1580 snd_security_hole=0 # XXX
1581 umask $snd_security_hole
1583 ln -fs mixer$unit mixer
1584 ln -fs sequencer$unit sequencer
1586 ln -fs audio$unit audio
1587 ln -fs dspW$unit dspW
1588 ln -fs music$unit music
1590 ln -fs dsp$unit.0 dsp$unit
1591 ln -fs audio$unit.0 audio$unit
1592 ln -fs dspW$unit.0 dspW$unit
1594 mknod mixer$unit c $chr `unit2minor $(($unit * 16 + 0))`
1595 mknod sequencer$unit c $chr `unit2minor $(($unit * 16 + 1))`
1596 mknod midi$unit c $chr `unit2minor $(($unit * 16 + 2))`
1600 minor=$(($chn * 65536 + $unit * 16))
1601 mknod dsp$unit.$chn c $chr $(($minor + 3))
1602 mknod audio$unit.$chn c $chr $(($minor + 4))
1603 mknod dspW$unit.$chn c $chr $(($minor + 5))
1606 mknod sndstat c $chr 6
1607 # minor number 7 is unused
1608 mknod music$unit c $chr `unit2minor $(($unit * 16 + 8))`
1609 mknod pss$unit c $chr `unit2minor $(($unit * 16 + 9))`
1610 # minor numbers 10-15 are unused
1615 mknod vatio c 25 128
1620 unit=`expr $i : 'gsc\(.*\)'`
1621 mknod gsc${unit} c 47 `unit2minor $unit`
1622 mknod gsc${unit}p c 47 `unit2minor $(($unit + 8))`
1623 mknod gsc${unit}d c 47 `unit2minor $(($unit + 32))`
1624 mknod gsc${unit}pd c 47 `unit2minor $(($unit + 40))`
1625 chmod 666 gsc${unit}*
1629 mknod acpi c 152 0 root:operator
1633 mknod apm c 39 0 root:operator
1638 mknod apmctl c 39 8 root:operator
1643 unit=`expr $i : 'card\(.*\)'`
1645 mknod card$unit c $chr `unit2minor $unit`
1651 *0) unit=0;; *1) unit=1;; *2) unit=2;; *3) unit=3;;
1652 *4) unit=4;; *5) unit=5;; *6) unit=6;; *7) unit=7;;
1653 *8) unit=8;; *9) unit=9;; *a) unit=10;; *b) unit=11;;
1654 *c) unit=12;; *d) unit=13;; *e) unit=14;; *f) unit=15;;
1657 ttyy?) unit=$(($unit + 16));;
1658 ttyz?) unit=$(($unit + 32));;
1664 mknod cronyx c 42 63
1668 mknod joy0 c 51 0 root:operator
1669 mknod joy1 c 51 1 root:operator
1679 unit=`expr $i : 'ctx\(.*\)'`
1680 mknod ctx$unit c 40 `unit2minor $unit`
1685 unit=`expr $i : 'meteor\(.*\)'`
1686 mknod meteor$unit c 67 `unit2minor $unit`
1687 chmod 444 meteor$unit
1691 unit=`expr $i : 'bktr\(.*\)'`
1692 mknod bktr$unit c 92 `unit2minor $unit`
1693 mknod tuner$unit c 92 `unit2minor $((16 + $unit))`
1694 mknod vbi$unit c 92 `unit2minor $((32 + $unit))`
1695 chmod 444 bktr$unit tuner$unit vbi$unit
1699 ntun=`expr $i : 'tun\(.*\)$'`
1701 while [ $unit -le $ntun ]; do
1702 mknod tun$unit c 52 `unit2minor $unit`
1708 ntap=`expr $i : 'tap\(.*\)$'`
1710 while [ $unit -le $ntap ]; do
1711 mknod tap$unit c 149 `unit2minor $unit` root:network
1717 mknod sysmouse c 12 128
1718 mknod consolectl c 12 255
1722 mknod jogdial c 160 0
1726 unit=`expr $i : 'snp\(.*\)'`
1727 mknod snp$unit c 53 `unit2minor $unit`
1730 # dufault@hda.com: If I do much more work on other A-D boards
1731 # then eventually we'll have a "ad" and "dio" interface and some of these
1732 # "labpcaio" ones will be gone.
1733 # labpcaio: D-A and A-D.
1734 # labpcdio: Digital in and Digital out.
1741 unit=`expr $i : 'labpcaio\(.*\)'`
1742 all="0 1 2 3 4 5 6 7"
1747 unit=`expr $i : 'labpcdio\(.*\)'`
1752 die 3 "Don't know LabPC type $i"
1755 if [ -z "${unit}" ]; then
1760 mknod $name$unit c 66 $(($offset + $unit))
1765 mknod $name$i c 66 $(($offset + $i))
1769 echo "No such LabPC unit: $unit"
1776 mknod perfmon c 2 32 root:kmem
1783 mknod ipstate c 79 2
1788 mknod elan-mmcr c 100 0 # XXX local major
1793 unit=`expr $i : 'kbd\(.*\)'`
1795 mknod kbd$unit c $chr `unit2minor $unit`
1807 unit=`expr $i : 'i4brbch\(.*\)'`
1808 mknod i4brbch$unit c 57 `unit2minor $unit`
1813 unit=`expr $i : 'i4bteld\(.*\)'`
1814 mknod i4bteld$unit c 56 `unit2minor $(($offset + $unit))`
1818 unit=`expr $i : 'i4btel\(.*\)'`
1819 mknod i4btel$unit c 56 `unit2minor $unit`
1823 unit=`expr $i : 'i4btrc\(.*\)'`
1824 mknod i4btrc$unit c 59 `unit2minor $unit`
1828 unit=`expr $i : 'aac\(.*\)'`
1829 mknod aac$unit c 150 `unit2minor $unit`
1830 ln -fs aac$unit afa$unit
1831 ln -fs aac$unit hpn$unit
1835 unit=`expr $i : 'mlx\(.*\)'`
1836 mknod mlx$unit c 130 `unit2minor $unit`
1840 unit=`expr $i : 'amr\(.*\)'`
1841 mknod amr$unit c 132 `unit2minor $unit`
1845 unit=`expr $i : 'ips\(.*\)'`
1846 mknod mlx$unit c 175 `unit2minor $unit`
1850 unit=`expr $i : 'ciss\(.*\)'`
1851 mknod ciss$unit c 166 `unit2minor $unit`
1855 mknod agpgart c 148 0
1859 unit=`expr $i : 'twe\(.*\)'`
1860 mknod twe$unit c 146 `unit2minor $unit`
1864 unit=`expr $i : 'tw\(.*\)'`
1865 mknod tw$unit c 19 `unit2minor $unit` root:operator
1869 unit=`expr $i : 'cfs\(.*\)'`
1870 mknod cfs$unit c 93 $unit root:operator
1874 unit=`expr $i : 'nsmb\(.*\)'`
1875 mknod nsmb$unit c 144 $unit
1879 umask 0 # XXX should be elsewhere
1885 echo $i - no such device name