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
25 # Device "make" file. Valid arguments:
26 # all makes all known devices, standard number of units (or close)
27 # std standard devices
28 # jail suitable for a jail(8)
29 # local configuration specific devices
30 # mach-4 mach4&lites+devices for Mach's XFree86 distribution
31 # (see http://www.cs.hut.fi/lites.html for more info on LITES)
34 # wt* QIC-interfaced (e.g. not SCSI) 3M cartridge tape
35 # sa* SCSI Sequential Access Devices
38 # aac* Adaptec FSA RAID controllers
39 # aacd* Adaptec FSA RAID
40 # acd* ATAPI CD-ROM disks
42 # cd* SCSI CD-ROM disks
43 # da* SCSI Direct Access Devices
44 # fd* floppy disk drives (3 1/2", 5 1/4")
45 # fla* M-Systems DiskOnChip
46 # idad* Compaq Smart-2 RAID arrays
47 # matcd* Matsushita (Panasonic) CD-ROM disks
48 # mcd* Mitsumi CD-ROM disks
49 # md* Memory (or malloc) disk
50 # mlx* Mylex DAC960 RAID controllers
51 # mlxd* Mylex DAC960 RAID disk volumes
52 # mly* Mylex RAID controllers (newer models)
53 # scd* Sony CD-ROM disks
55 # wd* "Winchester" disk drives (ST506,IDE,ESDI,RLL,...)
56 # wfd* IDE floppy disk drives (LS-120)
59 # vty* virtual console devices for syscons/pcvt/codrv
62 # mse* Logitech and ATI Inport bus mouse
64 # jogdial Sony VAIO jog dial
65 # sysmouse Mousesystems mouse emulator for syscons
68 # refclock-* serial ports used by xntpd parse refclocks
71 # tty* general purpose serial ports
72 # cua* dialout serial ports
73 # ttyA* Specialix SI/XIO dialin ports ('*' = number of devices)
74 # cuaA* Specialix SI/XIO dialout ports
75 # ttyDXX Digiboard Xi - 16 dialin ports (dgb)
76 # cuaDXX Digiboard Xi - 16 dialout ports (dgb)
77 # ttyDX.X Digiboards (work in progress) - 16 dialin ports (digi)
78 # cuaDX.X Digiboards (work in progress) - 16 dialout ports (digi)
79 # ttyM* Digiboard Xem - 16 dialin ports (dgm)
80 # cuaM* Digiboard Xem - 16 dialout ports (dgm)
81 # ttyR* Rocketport dialin ports
82 # cuaR* Rocketport dialout ports
85 # pty* set of 32 master and slave pseudo terminals
86 # vty* virtual terminals using syscons/pcvt/codrv console
90 # ppi* Parallel port i/o
91 # pps* Pulse per second timing interface
92 # pcfclock* Parallel time sync interface
99 # usb* USB bus control device
100 # ugen* generic USB device
101 # uhid* Human Interface Device (HID)
105 # urio* Diamond Rio 500
106 # uscanner* USB scanners
107 # usio* USB serial devices
109 # SCSI devices (other than CD-ROM, tape and disk):
110 # ch* SCSI Media-Changer (juke box) driver
112 # pt* Processor Type (HP scanner, as one example)
113 # pass* CAM Passthrough device
114 # ses* SES (SCSI Environmental Services) and
115 # SAF-TE (Scsi Accessable Fault-Tolerant Enclosures) device
117 # PC-CARD (previously called PCMCIA) support
118 # card* PC-CARD slots
121 # i4b isdnd call control device
122 # i4bctl debugging control device
123 # i4btrc* trace data interface(s), one per passive card
124 # i4btel* telephony interface(s)
125 # i4bteld* telephony dialout interface(s)
126 # i4brbch* raw b channel access device(s)
128 # Special purpose devices:
129 # acpi Advanced Configuration and Power Interface
130 # apm Advanced Power Management BIOS
131 # apmctl APM BIOS control device
134 # tw* xten power controller
135 # snd* various sound cards
136 # pcaudio PCM audio driver
137 # socksys iBCS2 socket system driver
138 # vat VAT compatibility audio driver (requires snd*)
139 # gsc Genius GS-4500 hand scanner
141 # tun* Tunneling IP device
142 # tap* Ethernet Tunneling device
143 # snp* tty snoop devices
144 # spigot Video Spigot video acquisition card
145 # ctx* Cortex-I video acquisition card
146 # meteor* Matrox Meteor video acquisition card (pci)
147 # bktr* Bt848 based video acquisition card (pci)
148 # labpc* National Instrument's Lab-PC and LAB-PC+
149 # perfmon CPU performance-monitoring counters
150 # pci PCI configuration-space access from user mode
151 # ipl ipfilter control devices (ipl, ipnat, ipstate, ipauth)
152 # kbd keyboard devices
153 # 3dfx* 3dfx voodoo device for glide (tdfx) (/dev/3dfx,3dfxN,voodoo)
154 # agpgart AGP interface
157 if [ -n "$MAKEDEVPATH" ]; then
164 # Usage: die exitcode msg
170 # Convert integer to partition name
175 0) p=a;; 1) p=b;; 2) p=c;; 3) p=d;; 4) p=e;; 5) p=f;; 6) p=g;; 7) p=h;;
181 # Convert integer to slice name
193 # Convert disk (type, unit, slice, partition) to minor number
196 echo $(($1 << 25 | ($2 / 32) << 21 | ($2 % 32) << 3 | $3 << 16 | $4))
199 # Override mknod(2) to add extra handling to it.
201 for i in `IFS=':'; echo $PATH`; do
202 if [ -x "${i}/mknod" ]; then
210 4) "$mknod" "$@" root:wheel || die 2 "$mknod $@ failed";;
211 5) "$mknod" "$@" || die 2 "$mknod $@ failed";;
212 *) die 2 "bad node: mknod $@";;
216 # Convert tape (ctrl, unit, mode, access) to minor number
219 echo $(($1 << 29 | ($2 / 16) << 16 | ($2 % 16) << 4 | $3 << 2 | $4))
222 # Convert the last character of a tty name to a minor number.
227 a) m=10;; b) m=11;; c) m=12;; d) m=13;; e) m=14;; f) m=15;; g) m=16;;
228 h) m=17;; i) m=18;; j) m=19;; k) m=20;; l) m=21;; m) m=22;; n) m=23;;
229 o) m=24;; p) m=25;; q) m=26;; r) m=27;; s) m=28;; t) m=29;; u) m=30;;
236 # Convert a unit number to a minor number.
239 echo $(((($1 >> 8) << 16) | ($1 % 256)))
242 # Raw partition for disks
245 # Compatibility slice for disks
248 # Raw slice for disks
252 disk_umask=037 # allow group operator to read disks
253 tape_umask=017 # allow group operator to read/write tapes
260 sh $0 fd0 fd1 # bdev, floppy disk
261 sh $0 da0 da1 da2 da3 # bdev, SCSI disk
262 sh $0 ata # ATA control
263 sh $0 ad0 ad1 ad2 ad3 # bdev, ATA disk
264 sh $0 ar0 ar1 # bdev, ATA RAID disk
265 sh $0 acd0 acd0t afd0 ast0 # bdev, ATAPI devices
266 sh $0 wd0 wd1 wd2 wd3 # bdev, OLD disk
267 sh $0 wcd0 wfd0 wst0 # bdev, OLD ATAPI devs
268 sh $0 vn0 # bdev, virtual disk
269 sh $0 cd0 matcd0 mcd0 scd0 # bdev, cdrom
270 sh $0 sa0 wt0 # bdev, tape
271 sh $0 vty12 # cdev, virtual tty
272 sh $0 cuaa0 cuaa1 cuaa2 cuaa3 # cdev, serial tty
273 sh $0 pty0 # cdev, pseudo tty
274 sh $0 ttyd0 ttyd1 ttyd2 ttyd3 # cdev, serial tty
275 sh $0 kbd0 kbd1 # cdev, keyboard
276 sh $0 mse0 psm0 jogdial sysmouse # cdev, mouse
277 sh $0 pcaudio speaker # cdev, noise
278 sh $0 lpt0 lpt1 lpt2 # cdev, printer
279 sh $0 ppi0 ppi1 ppi2 # cdev, parallel port
280 sh $0 iic0 iic1 # cdev, I2C device
281 sh $0 smb0 smb1 # cdev, SMBus device
282 sh $0 usb usb0 uhid0 ums0 ulpt0 ugen0 # cdev, USB devices
283 sh $0 urio0 uscanner0 umodem0 # cdev, USB devices too
284 sh $0 bpf0 bpf1 bpf2 bpf3 # cdev, network
285 sh $0 ipl tun0 tun1 tun2 tun3 # cdev, network
286 sh $0 tap0 tap1 tap2 tap3 # cdev, network
287 sh $0 ch0 perfmon tw0 # cdev, miscellaneous
288 sh $0 acpi # cdev, ACPI
289 sh $0 apm apmctl card0 card1 card2 card3 # cdev, laptop
290 sh $0 pass4 xpt2 # cdev, CAM
291 sh $0 i4b i4bctl i4btrc0 i4btrc1 # cdev, ISDN
292 sh $0 i4btel0 i4btel1 i4bteld0 i4bteld1 # cdev, ISDN
293 sh $0 i4brbch0 i4brbch1 # cdev, ISDN
294 sh $0 agpgart # cdev, AGP
297 # a much restricted set of the above, to save precious i-nodes on the
301 sh $0 fd0 # bdev, floppy disk
302 sh $0 da0 # bdev, SCSI disk
303 sh $0 ad0 # bdev, ATA disk
304 sh $0 acd0 afd0 ast0 # bdev, ATAPI devices
305 sh $0 wd0 # bdev, OLD disk
306 sh $0 wcd0 wfd0 wst0 # bdev, OLD ATAPI devs
307 sh $0 vn0 # bdev, virtual disk
308 sh $0 cd0 # bdev, cdrom
309 sh $0 sa0 # bdev, tape
310 sh $0 vty2 # cdev, virtual tty
311 sh $0 cuaa0 # cdev, serial tty
312 sh $0 pty0 # cdev, pseudo tty
313 sh $0 ttyd0 # cdev, serial tty
314 sh $0 kbd0 # cdev, keyboard
315 sh $0 mse0 psm0 jogdial sysmouse # cdev, mouse
316 sh $0 lpt0 # cdev, printer
317 sh $0 ppi0 # cdev, parallel port
318 sh $0 iic0 # cdev, I2C device
319 sh $0 smb0 # cdev, SMBus device
320 sh $0 ums0 # cdev, USB devices
321 sh $0 tun0 # cdev, network
322 sh $0 tap0 # cdev, network
323 sh $0 ch0 # cdev, miscellaneous
324 sh $0 acpi # cdev, ACPI
325 sh $0 apm apmctl card0 # cdev, laptop
326 sh $0 pass1 xpt1 # cdev, CAM
327 sh $0 i4b i4bctl i4btrc0 i4btrc1 # cdev, ISDN
328 sh $0 i4btel0 i4bteld0 # cdev, ISDN
329 sh $0 i4brbch0 # cdev, ISDN
334 mknod console c 0 0; chmod 600 console
335 mknod kmem c 2 1 root:kmem; chmod 640 kmem
336 mknod mem c 2 0 root:kmem; chmod 640 mem
337 mknod null c 2 2; chmod 666 null
338 mknod random c 2 3; chmod 666 random
340 mknod zero c 2 12; chmod 666 zero
341 mknod io c 2 14; chmod 600 io
342 mknod tty c 1 0; chmod 666 tty
343 mknod klog c 7 0; chmod 600 klog
344 mknod pci c 78 0; chmod 644 pci
345 mknod mdctl c 95 0xffff00ff; chmod 600 mdctl
348 while [ $i -lt 64 ]; do
362 rm mem kmem pci io klog console # for security
363 ln -sf null mem # for libkvm (ab)users
364 ln -sf null kmem # --//--
373 mknod timezone c 26 0
376 # Create device files for new Archive/Wangtek QIC-02 tape driver (vak)
379 u=`expr $i : '..\(.*\)'`
380 if [ -z "${u}" ]; then u=0; fi
381 # default density, 512b blocks
382 mknod rwt${u} c 10 `expr 0 + $u` root:operator
383 mknod nrwt${u} c 10 `expr 4 + $u` root:operator
384 # default density, 1024b blocks
385 # mknod rWt${u} c 10 `expr 64 + $u` root:operator
386 # mknod nrWt${u} c 10 `expr 68 + $u` root:operator
387 mknod rwt${u}b c 10 `expr 16 + $u` root:operator # 60 megabytes
388 mknod nrwt${u}b c 10 `expr 20 + $u` root:operator
389 mknod rwt${u}c c 10 `expr 24 + $u` root:operator # 120 megabytes
390 mknod nrwt${u}c c 10 `expr 28 + $u` root:operator
391 mknod rwt${u}d c 10 `expr 32 + $u` root:operator # 150 megabytes
392 mknod nrwt${u}d c 10 `expr 36 + $u` root:operator
393 # mknod rwt${u}e c 10 `expr 40 + $u` root:operator # 300 megabytes?
394 # mknod nrwt${u}e c 10 `expr 44 + $u` root:operator
395 # mknod rwt${u}f c 10 `expr 48 + $u` root:operator # 600 megabytes?
396 # mknod nrwt${u}f c 10 `expr 52 + $u` root:operator
401 aacd*s*|ad*s*|ar*s*|afd*s*|amrd*s*|da*s*|fla*s*|idad*s*|md*s*|mlxd*s*|twed*s*|vn*s*|wd*s*|wfd*s*)
404 aacd*s*) name=aacd; chr=151;;
405 ad*s*) name=ad; chr=116;;
406 ar*s*) name=ar; chr=157;;
407 afd*s*) name=afd; chr=118;;
408 amrd*s*) name=amrd; chr=133;;
409 da*s*) name=da; chr=13;;
410 fla*s*) name=fla; chr=102;;
411 idad*s*) name=idad; chr=109;;
412 md*s*) name=md; chr=95;;
413 mlxd*s*) name=mlxd; chr=131;;
414 twed*s*) name=twed; chr=147;;
415 vn*s*) name=vn; chr=43;;
416 wd*s*) name=wd; chr=3;;
417 wfd*s*) name=wfd; chr=87;;
420 aacd*s*|amrd*s*|idad*s*|mlxd*s*|twed*s*)
421 unit=`expr $i : '....\([0-9]*\)s'`
422 slice=`expr $i : '....[0-9]*s\([0-9]*\)'`
423 part=`expr $i : '....[0-9]*s[0-9]*\(.*\)'`
425 afd*s*|fla*s*|wfd*s*)
426 unit=`expr $i : '...\([0-9]*\)s'`
427 slice=`expr $i : '...[0-9]*s\([0-9]*\)'`
428 part=`expr $i : '...[0-9]*s[0-9]*\(.*\)'`
431 unit=`expr $i : '..\([0-9]*\)s'`
432 slice=`expr $i : '..[0-9]*s\([0-9]*\)'`
433 part=`expr $i : '..[0-9]*s[0-9]*\(.*\)'`
437 [0-9]|[0-9][0-9]|[0-4][0-9][0-9]|50[0-9]|51[0-1])
442 slicename=`dkitos $slice`
443 minor=`dkminor 0 $unit $slice $dkrawpart`
444 mknod $name$unit$slicename c $chr $minor root:operator
445 ln -f $name$unit$slicename r$name$unit$slicename
449 0) slice=$oldslice ;;
451 for part in 0 1 2 3 4 5 6 7
453 minor=`dkminor 0 $unit $slice $part`
454 partname=`dkitop $part`
455 mknod $name$unit$slicename$partname \
456 c $chr $minor root:operator
457 ln -f $name$unit$slicename$partname \
458 r$name$unit$slicename$partname
464 echo bad partition for disk in: $i
469 echo bad slice for disk in: $i
474 echo bad unit for disk in: $i "(unit=$unit, slice=$slice, part=$part)"
482 unit=`expr $i : '..\(.*\)'`
486 mknod ${name}${unit} c $chr `expr $unit '*' 64` root:operator
487 ln -f ${name}${unit} r${name}${unit}
488 # Fake BSD partitions
489 for i in a b c d e f g h
491 ln -f ${name}${unit} ${name}${unit}$i
492 ln -f r${name}${unit} r${name}${unit}$i
494 # User-readable and programmer-readable name sets
496 mknod ${name}${unit}.1720 c $chr `expr $unit '*' 64 + 1` \
498 ln -f ${name}${unit}.1720 r${name}${unit}.1720
499 # ln -f ${name}${unit}.1720 ${name}${unit}135hs21
500 # ln -f r${name}${unit}.1720 r${name}${unit}135hs21
502 mknod ${name}${unit}.1480 c $chr `expr $unit '*' 64 + 2` \
504 ln -f ${name}${unit}.1480 r${name}${unit}.1480
505 # ln -f ${name}${unit}.1480 ${name}${unit}135hs18
506 # ln -f r${name}${unit}.1480 r${name}${unit}135hs18
507 # ln -f ${name}${unit}.1480 ${name}${unit}96hs18
508 # ln -f r${name}${unit}.1480 r${name}${unit}96hs18
510 mknod ${name}${unit}.1440 c $chr `expr $unit '*' 64 + 3` \
512 ln -f ${name}${unit}.1440 r${name}${unit}.1440
513 # ln -f ${name}${unit}.1440 ${name}${unit}135
514 # ln -f r${name}${unit}.1440 r${name}${unit}135
515 # ln -f ${name}${unit}.1440 ${name}${unit}135ds18
516 # ln -f r${name}${unit}.1440 r${name}${unit}135ds18
517 # ln -f ${name}${unit}.1440 ${name}${unit}96ds18
518 # ln -f r${name}${unit}.1440 r${name}${unit}96ds18
520 mknod ${name}${unit}.1200 c $chr `expr $unit '*' 64 + 4` \
522 ln -f ${name}${unit}.1200 r${name}${unit}.1200
523 # ln -f ${name}${unit}.1200 ${name}${unit}96
524 # ln -f r${name}${unit}.1200 r${name}${unit}96
525 # ln -f ${name}${unit}.1200 ${name}${unit}96ds15
526 # ln -f r${name}${unit}.1200 r${name}${unit}96ds15
527 # ln -f ${name}${unit}.1200 ${name}${unit}135ds15
528 # ln -f r${name}${unit}.1200 r${name}${unit}135ds15
530 mknod ${name}${unit}.820 c $chr `expr $unit '*' 64 + 5` \
532 ln -f ${name}${unit}.820 r${name}${unit}.820
533 # ln -f ${name}${unit}.820 ${name}${unit}96hs10
534 # ln -f r${name}${unit}.820 r${name}${unit}96hs10
535 # ln -f ${name}${unit}.820 ${name}${unit}135hs10
536 # ln -f r${name}${unit}.820 r${name}${unit}135hs10
538 mknod ${name}${unit}.800 c $chr `expr $unit '*' 64 + 6` \
540 ln -f ${name}${unit}.800 r${name}${unit}.800
541 # ln -f ${name}${unit}.800 ${name}${unit}96ds10
542 # ln -f r${name}${unit}.800 r${name}${unit}96ds10
543 # ln -f ${name}${unit}.800 ${name}${unit}135ds10
544 # ln -f r${name}${unit}.800 r${name}${unit}135ds10
546 mknod ${name}${unit}.720 c $chr `expr $unit '*' 64 + 7` \
548 ln -f ${name}${unit}.720 r${name}${unit}.720
549 # ln -f ${name}${unit}.720 ${name}${unit}96ds9
550 # ln -f r${name}${unit}.720 r${name}${unit}96ds9
551 # ln -f ${name}${unit}.720 ${name}${unit}135ds9
552 # ln -f r${name}${unit}.720 r${name}${unit}135ds9
554 mknod ${name}${unit}.360 c $chr `expr $unit '*' 64 + 8` \
556 ln -f ${name}${unit}.360 r${name}${unit}.360
557 # ln -f ${name}${unit}.360 ${name}${unit}48
558 # ln -f r${name}${unit}.360 r${name}${unit}48
559 # ln -f ${name}${unit}.360 ${name}${unit}48ds9
560 # ln -f r${name}${unit}.360 r${name}${unit}48ds9
562 mknod ${name}${unit}.640 c $chr `expr $unit '*' 64 + 9` \
564 ln -f ${name}${unit}.640 r${name}${unit}.640
565 # ln -f ${name}${unit}.640 ${name}${unit}96ds8
566 # ln -f r${name}${unit}.640 r${name}${unit}96ds8
567 # ln -f ${name}${unit}.640 ${name}${unit}135ds8
568 # ln -f r${name}${unit}.640 r${name}${unit}135ds8
570 mknod ${name}${unit}.1232 c $chr `expr $unit '*' 64 + 10` \
572 ln -f ${name}${unit}.1232 r${name}${unit}.1232
573 # ln -f ${name}${unit}.1232 ${name}${unit}96ds8
574 # ln -f r${name}${unit}.1232 r${name}${unit}96ds8
575 # ln -f ${name}${unit}.1232 ${name}${unit}135ds8
576 # ln -f r${name}${unit}.1232 r${name}${unit}135ds8
579 echo bad unit for disk in: $i
587 mknod ata c 159 0 root:operator
592 aacd*|ad*|ar*|afd*|amrd*|da*|fla*|idad*|md*|mlxd*|twed*|vn*|wd*|wfd*)
595 aacd*) name=aacd; chr=151;;
596 ad*) name=ad; chr=116;;
597 ar*) name=ar; chr=157;;
598 afd*) name=afd; chr=118;;
599 amrd*) name=amrd; chr=133;;
600 da*) name=da; chr=13;;
601 fla*) name=fla; chr=102;;
602 idad*) name=idad; chr=109;;
603 md*) name=md; chr=95;;
604 mlxd*) name=mlxd; chr=131;;
605 twed*) name=twed; chr=147;;
606 vn*) name=vn; chr=43;;
607 wd*) name=wd; chr=3;;
608 wfd*) name=wfd; chr=87;;
611 aacd*|amrd*|idad*|mlxd*|twed*)
612 unit=`expr $i : '....\(.*\)'`
615 unit=`expr $i : '...\(.*\)'`
618 unit=`expr $i : '..\(.*\)'`
622 [0-9]|[0-9][0-9]|[0-4][0-9][0-9]|50[0-9]|51[0-1])
623 for slicepartname in s0h s1 s2 s3 s4
625 sh $0 $name$unit$slicepartname
627 if [ "x$name" = "xvn" ] ; then
628 # We need to control device so we can configure
629 # the vn disks with vnconfig
630 mknod $name$unit.ctl c \
631 $chr `expr $unit '*' 8 + 33554432` root:operator
635 echo bad unit for disk in: $i
645 unit=`expr $i : '...\(.*\)'`
647 [0-9]|[0-9][0-9]|[0-4][0-9][0-9]|50[0-9]|51[0-1])
648 for part in 0 1 2 3 4 5 6 7
650 minor=`dkminor 0 $unit 0 $part`
651 partname=`dkitop $part`
652 mknod $name$unit$partname c $chr $minor root:operator
653 ln -f $name$unit$partname r$name$unit$partname
657 echo bad unit for disk in: $i
663 # SCSI processor type driver
667 unit=`expr $i : 'pt\([0-9][0-9]*\)'`
668 if [ -z "${unit}" ]; then
671 unit=`expr $unit + 1 - 1`
672 mknod ${name}${unit} c $chr `unit2minor $unit`
675 # SCSI SES/SAF-TE type driver
679 unit=`expr $i : 'ses\([0-9][0-9]*\)'`
680 if [ -z "${unit}" ]; then
683 unit=`expr $unit + 1 - 1`
684 mknod ${name}${unit} c $chr `unit2minor $unit`
686 # SCSI target mode sample driver
690 unit=`expr $i : 'targ\([0-9][0-9]*\)'`
691 if [ -z "${unit}" ]; then
694 unit=`expr $unit + 1 - 1`
695 mknod ${name}${unit} c $chr `unit2minor $unit`
696 mknod ${name}.ctl c $chr 0xffff00ff
699 # CAM transport layer device
701 # This major number is temporary
704 units=`expr $i : 'xpt\(.*\)'`
705 if [ -z "${units}" ]; then
709 while [ $i -lt $units ]; do
711 rm -rf $dname r$dname
712 mknod $dname c $chr `unit2minor $i` root:operator
717 # CAM passthrough device
719 # This major number is temporary
722 units=`expr $i : 'pass\(.*\)'`
723 if [ -z "${units}" ]; then
727 while [ $i -lt $units ]; do
729 rm -rf $dname r$dname
730 mknod $dname c $chr `unit2minor $i` root:operator
735 class=`expr $i : 'pty\(.*\)'`
738 1) offset=32 name=q;;
739 2) offset=64 name=r;;
740 3) offset=96 name=s;;
741 # Note that xterm (at least) only look at p-s.
742 4) offset=128 name=P;;
743 5) offset=160 name=Q;;
744 6) offset=192 name=R;;
745 7) offset=224 name=S;;
746 # This still leaves [tuTU].
747 *) echo bad unit for pty in: $i;;
753 while [ $i -lt 32 ]; do
754 # This was an awk substr() before.
755 c=$(echo 0123456789abcdefghijklmnopqrstuv |
756 dd bs=1 skip=$i count=1 2>/dev/null)
757 mknod tty$name$c c 5 $(($offset + $i))
758 mknod pty$name$c c 6 $(($offset + $i))
768 unit=`expr $i : '..\(.*\)'`
772 [0-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9])
773 mknod sa${unit}.ctl c $chr `saminor 1 ${unit} 0 0`
774 ln -f sa${unit}.ctl rsa${unit}.ctl
777 mknod sa${unit}.${m} c $chr \
778 `saminor 0 ${unit} ${m} 0` root:operator
779 ln -f sa${unit}.${m} rsa${unit}.${m}
780 mknod nsa${unit}.${m} c $chr \
781 `saminor 0 ${unit} ${m} 1` root:operator
782 ln -f nsa${unit}.${m} nrsa${unit}.${m}
783 mknod esa${unit}.${m} c $chr \
784 `saminor 0 ${unit} ${m} 2` root:operator
785 ln -f esa${unit}.${m} ersa${unit}.${m}
787 ln -f sa${unit}.0 sa${unit}
788 ln -f sa${unit}.0 rsa${unit}.0
789 ln -f sa${unit}.0 rsa${unit}
790 ln -f nsa${unit}.0 nsa${unit}
791 ln -f nsa${unit}.0 nrsa${unit}.0
792 ln -f nsa${unit}.0 nrsa${unit}
793 ln -f esa${unit}.0 esa${unit}
794 ln -f esa${unit}.0 ersa${unit}.0
795 ln -f esa${unit}.0 ersa${unit}
798 echo bad unit for tape in: $i
806 unit=`expr $i : '..\(.*\)'`
808 ch*) name=ch; chr=17;;
812 mknod ${name}${unit} c $chr $unit root:operator
815 echo bad unit for media changer in: $i
823 unit=`expr $i : '...\(.*\)'`
827 mknod rast${unit} c $chr `expr $unit '*' 8 + 0` root:operator
828 chmod 640 rast${unit}
829 mknod nrast${unit} c $chr `expr $unit '*' 8 + 1` root:operator
830 chmod 640 nrast${unit}
833 echo bad unit for tape in: $i
841 units=`expr $i : '...\(.*\)t'`;
842 tracks=`expr $i : '.*t\(.*\)'`;
845 if [ -z "${units}" -o "${units}" -le 0 ]; then
848 if [ -z "${tracks}" -o "${tracks}" -le 0 ]; then
851 if [ "${units}" -le 31 -a "${tracks}" -le 169 ]; then
853 while [ $i -le $units ]; do
857 while [ $j -le ${tracks} ]; do
858 mknod ${dname}t$j c $chr \
859 $((($i * 8) + (65536 * $j))) \
866 echo "$i is invalid -- can't have more than 32 cd devices or 169 tracks"
874 acd*) units=`expr $i : '...\(.*\)'`; name=acd; chr=117;;
875 cd*) units=`expr $i : '..\(.*\)'`; name=cd; chr=15;;
876 mcd*) units=`expr $i : '...\(.*\)'`; name=mcd; chr=29;;
877 scd*) units=`expr $i : '...\(.*\)'`; name=scd; chr=45;;
879 if [ -z "${units}" -o "${units}" -le 0 ]; then
882 if [ "${units}" -le 31 ]; then
884 while [ $i -le $units ]; do
886 rm -rf ${dname}[!t]* r${dname}*
887 mknod ${dname}a c $chr $(($i * 8)) root:operator
888 mknod ${dname}c c $chr $(($i * 8 + 2)) root:operator
889 ln -f ${dname}a r${dname}a
890 ln -f ${dname}c r${dname}c
894 echo "$i is invalid -- can't have more than 32 cd devices"
902 matcd*) unit=`expr $i : '.....\(.*\)'`; name=matcd; chr=46;;
905 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15)
906 mknod ${name}${unit}a c $chr `expr $unit '*' 8 + 0` \
908 mknod ${name}${unit}c c $chr `expr $unit '*' 8 + 2` \
910 ln -f ${name}${unit}a r${name}${unit}a
911 ln -f ${name}${unit}c r${name}${unit}c
912 chmod 640 ${name}${unit}[a-h] r${name}${unit}[a-h]
914 mknod ${name}${unit}la c $chr `expr $unit '*' 8 + 128` \
916 mknod ${name}${unit}lc c $chr `expr $unit '*' 8 + 130` \
918 ln -f ${name}${unit}la r${name}${unit}la
919 ln -f ${name}${unit}lc r${name}${unit}lc
920 chmod 640 ${name}${unit}l[a-h] r${name}${unit}l[a-h]
923 echo bad unit for disk in: $i
931 unit=`expr $i : '...\(.*\)'`
935 mknod wcd${unit}a c $chr `expr $unit '*' 8 + 0` root:operator
936 mknod wcd${unit}c c $chr `expr $unit '*' 8 + 2` root:operator
937 ln -f wcd${unit}a rwcd${unit}a
938 ln -f wcd${unit}c rwcd${unit}c
939 chmod 640 wcd${unit}[a-h] rwcd${unit}[a-h]
942 echo bad unit for disk in: $i
950 unit=`expr $i : '...\(.*\)'`
954 mknod rwst${unit} c $chr `expr $unit '*' 8 + 0` root:operator
955 chmod 640 rwst${unit}
962 unit=`expr $i : 'iic\(.*\)'`
963 mknod iic$unit c 105 `unit2minor $unit`
967 unit=`expr $i : 'smb\(.*\)'`
968 mknod smb$unit c 106 `unit2minor $unit`
972 unit=`expr $i : 'pcfclock\(.*\)'`
973 mknod pcfclock$unit c 140 `unit2minor $unit`
977 unit=`expr $i : 'ppi\(.*\)'`
978 mknod ppi$unit c 82 `unit2minor $unit`
982 unit=`expr $i : 'pps\(.*\)'`
983 mknod pps$unit c 89 `unit2minor $unit`
987 mknod usb$unit c 108 255 root:operator
993 unit=`expr $i : 'usb\(.*\)'`
994 mknod usb$unit c 108 `unit2minor $unit` root:operator
1000 unit=`expr $i : 'uhid\(.*\)'`
1001 mknod uhid$unit c 122 `unit2minor $unit` root:operator
1007 unit=`expr $i : 'ums\(.*\)'`
1008 mknod ums$unit c 111 `unit2minor $unit` root:operator
1013 unit=`expr $i : 'ulpt\(.*\)'`
1014 minor=`unit2minor $unit`
1015 mknod ulpt$unit c 113 $minor
1016 minor=`unit2minor \`expr $unit + 64\``
1017 mknod unlpt$unit c 113 $minor # and the 'no prime' version
1022 unit=`expr $i : 'ugen\([0-9][0-9]*\)'`
1023 endpoint=`expr $i : 'ugen.*\.\([0-9][0-9]*\)'`
1024 if [ -z "${unit}" ]; then
1025 echo $i - Invalid unit number
1027 if [ -z "${endpoint}" ]; then # ugen0 & ugen0.1 - ugen0.15
1028 mknod ugen$unit c 114 \
1029 `unit2minor $(($unit * 16))` root:operator
1031 while [ $i -lt 16 ]; do
1032 mknod ugen$unit.$i c 114 \
1033 `unit2minor $(($unit * 16 + $i))` root:operator
1037 minor=`unit2minor $(($unit * 16 + $endpoint))`
1038 mknod ugen$unit.$endpoint c 114 $minor root:operator
1045 unit=`expr $i : 'urio\(.*\)'`
1046 mknod urio$unit c 143 `unit2minor $unit` root:operator
1052 unit=`expr $i : 'usio\(.*\)'`
1053 minor=`unit2minor $(($unit + 128))`
1054 mknod usio$unit c 138 $minor uucp:dialer
1060 unit=`expr $i : 'uscanner\(.*\)'`
1061 mknod uscanner$unit c 156 `unit2minor $unit` root:operator
1067 unit=`expr $i : 'umodem\(.*\)'`
1068 mknod umodem$unit c 124 `unit2minor $unit` uucp:dialer
1073 unit=`expr $i : 'lpt\(.*\)'`
1074 mknod lpt$unit c 16 `unit2minor $unit`
1075 mknod lpctl$unit c 16 `unit2minor \`expr $unit + 128\``
1078 # Use this to create virtual consoles for syscons, pcvt or codrv
1080 # use as MAKEDEV vtyNN to create NN entries
1083 units=`expr $i : 'vty\(.*\)'`
1085 while [ $i -lt $units ]; do
1086 mknod ttyv$(printf %01x $i) c $chr `unit2minor $i`
1089 ln -fs ttyv0 vga # XXX X still needs this pccons relic
1093 units=`expr $i : 'nmdm\(.*\)'`
1096 while [ $i -lt $units ]; do
1097 minor=`unit2minor $i`
1098 minor=$(($minor + $minor))
1099 mknod nmdm${i}A c $chr $minor
1100 mknod nmdm${i}B c $chr $(($minor + 1))
1106 nbpf=`expr $i : 'bpf\(.*\)$'`
1108 while [ $unit -le $nbpf ]; do
1109 mknod bpf$unit c 23 `unit2minor $unit`
1115 mknod speaker c 26 0
1120 unit=`expr $i : 'cua.*\(.\)$'`
1122 mknod cuaa$unit c 28 `expr $m + 128` uucp:dialer
1123 mknod cuaia$unit c 28 `expr $m + 32 + 128` uucp:dialer
1124 mknod cuala$unit c 28 `expr $m + 64 + 128` uucp:dialer
1129 unit=`expr $i : 'tty.*\(.\)$'`
1131 mknod ttyd$unit c 28 $m
1132 mknod ttyid$unit c 28 `expr $m + 32`
1133 mknod ttyld$unit c 28 `expr $m + 64`
1138 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f
1139 g h i j k l m n o p q r s t u v"
1141 card=`expr $i : 'cua.*\(.\)$'`
1142 for unit in $portlist
1144 minor=`ttyminor $unit`
1145 minor=`expr $card \* 65536 + $minor`
1147 mknod cuac$name c $major `expr $minor + 128` uucp:dialer
1148 mknod cuaic$name c $major `expr $minor + 32 + 128` uucp:dialer
1149 mknod cualc$name c $major `expr $minor + 64 + 128` uucp:dialer
1155 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f
1156 g h i j k l m n o p q r s t u v"
1158 card=`expr $i : 'tty.*\(.\)$'`
1159 for unit in $portlist
1161 minor=`ttyminor $unit`
1162 minor=`expr $card \* 65536 + $minor`
1164 mknod ttyc$name c $major $minor
1165 mknod ttyic$name c $major `expr $minor + 32`
1166 mknod ttylc$name c $major `expr $minor + 64`
1170 # RISCom8 'rc' driver entries
1174 unit=`expr $i : 'cua.*\(.\)$'`
1176 mknod cuam$unit c 63 `expr $m + 128` uucp:dialer
1181 unit=`expr $i : 'tty.*\(.\)$'`
1183 mknod ttym$unit c 63 $m
1187 # Note: these are 'base 1' to match the numbers on the panels, and to match
1188 # the manual that comes with the system.
1191 nports=`expr $i : 'ttyA\(.*\)$'`
1193 while [ $port -le $nports ]; do
1194 minor=$(expr $port - 1)
1195 name=$(printf %02d $port)
1196 mknod ttyA$name c $major $minor
1197 mknod ttyiA$name c $major `expr $minor + 65536`
1198 mknod ttylA$name c $major `expr $minor + 131072`
1201 # For the user-mode control program, 'sicontrol'
1202 mknod si_control c 68 262144
1208 nports=`expr $i : 'cuaA\(.*\)$'`
1210 while [ $port -le $nports ]; do
1211 minor=$(expr $port - 1)
1212 name=$(printf %02d $port)
1213 mknod cuaA$name c $major `expr $minor + 128` uucp:dialer
1214 mknod cuaiA$name c $major `expr $minor + 128 + 65536` \
1216 mknod cualA$name c $major `expr $minor + 128 + 131072` \
1223 # Digiboard PC/?? 16 port card.
1224 # The current scheme of minor numbering is:
1226 # unused{14} CARD{2} major{8} CALLOUT{1} LOCK{1} INIT{1} PORT{5}
1228 # CARD bitfield in future versions may be extended to 3 bits.
1233 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f"
1235 card=`expr $i : 'tty.*\(.\)$'`
1236 for unit in $portlist
1238 minor=`ttyminor $unit`
1239 minor=`expr $card \* 65536 + $minor`
1241 mknod ttyD$name c $major $minor
1242 mknod ttyiD$name c $major `expr $minor + 32`
1243 mknod ttylD$name c $major `expr $minor + 64`
1246 # Also create devices for the digi driver
1249 card=`expr $i : 'tty.*\(.\)$'`
1251 mknod digi$card.ctl c $major $(($card \* 65536 + 8388608)) uucp:dialer
1253 while [ $unit -lt 16 ]
1255 base=`expr $card \* 65536 + $unit`
1258 mknod ttyD$name c $major $base
1259 mknod ttyiD$name c $major $(($base + 1048576))
1260 mknod ttylD$name c $major $(($base + 2097152))
1268 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f"
1270 card=`expr $i : 'cua.*\(.\)$'`
1271 for unit in $portlist
1273 minor=`ttyminor $unit`
1274 minor=`expr $card \* 65536 + $minor`
1276 mknod cuaD$name c $major `expr $minor + 128` uucp:dialer
1277 mknod cuaiD$name c $major `expr $minor + 32 + 128` uucp:dialer
1278 mknod cualD$name c $major `expr $minor + 64 + 128` uucp:dialer
1281 # Also create devices for the digi driver
1283 card=`expr $i : 'cua.*\(.\)$'`
1285 mknod digi$card.ctl c $major $(($card \* 65536 + 8388608)) uucp:dialer
1287 while [ $unit -lt 16 ]
1289 base=`expr $card \* 65536 + $unit`
1292 mknod cuaD$name c $major $(($base + 4194304)) uucp:dialer
1293 mknod cuaiD$name c $major $(($base + 5242880)) uucp:dialer
1294 mknod cualD$name c $major $(($base + 6291456)) uucp:dialer
1300 # Digiboard Xem - superceeded by the digi device above
1303 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f"
1304 modulelist="a b c d"
1306 card=`expr $i : 'tty.*\(.\)$'`
1307 for unit in $modulelist
1309 moduleminor=`ttyminor $unit`
1310 moduleminor=`expr $moduleminor % 10 \* 16`
1313 for unit in $portlist
1315 minor=`ttyminor $unit`
1316 minor=`expr $card \* 65536 + $minor + $moduleminor`
1317 name=$card$modulename$unit
1319 mknod ttyM$name c $major $minor
1320 mknod ttyiM$name c $major `expr $minor + 64`
1321 mknod ttylM$name c $major `expr $minor + 128`
1328 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f"
1329 modulelist="a b c d"
1331 card=`expr $i : 'cua.*\(.\)$'`
1332 for unit in $modulelist
1334 moduleminor=`ttyminor $unit`
1335 moduleminor=`expr $moduleminor % 10 \* 16`
1338 for unit in $portlist
1340 minor=`ttyminor $unit`
1341 minor=`expr $card \* 65536 + $minor + $moduleminor`
1342 name=$card$modulename$unit
1344 mknod cuaM$name c $major `expr $minor + 262144` \
1346 mknod cuaiM$name c $major `expr $minor + 64 + 262144` \
1348 mknod cualM$name c $major `expr $minor + 128 + 262144` \
1358 MINOR=$(($BOARD * 65536))
1360 dmesg | while read first rest; do
1368 rm -f /dev/ttyR* /dev/ttyiR* /dev/ttylR*
1369 for i in $controllers; do
1371 dmesg | while read first bar ports rest; do
1379 echo -n "Creating $ndevices devices for $i: "
1381 while [ $dev -lt $ndevices ]; do
1382 mknod /dev/ttyR$Rnum c $major $MINOR
1383 mknod /dev/ttyiR$Rnum c $major $(($MINOR + 32))
1384 mknod /dev/ttylR$Rnum c $major $(($MINOR + 64))
1386 MINOR=$(($MINOR + 1))
1389 BOARD=$(($BOARD + 1))
1390 MINOR=$(($BOARD * 65536))
1398 MINOR=$(($BOARD * 65536))
1400 dmesg | while read first rest; do
1408 rm -f /dev/cuaR* /dev/cuaiR* /dev/cualR*
1409 for i in $controllers; do
1411 dmesg | while read first bar ports rest; do
1419 echo -n "Creating $ndevices devices for $i: "
1421 while [ $dev -lt $ndevices ]; do
1422 mknod /dev/cuaR$Rnum c $major $(($MINOR + 128)) uucp:dialer
1423 mknod /dev/cuaiR$Rnum c $major $(($MINOR + 128 + 32)) \
1425 mknod /dev/cualR$Rnum c $major $(($MINOR + 128 + 64)) \
1428 MINOR=$(($MINOR + 1))
1431 BOARD=$(($BOARD + 1))
1432 MINOR=$(($BOARD * 65536))
1438 unit=`expr $i : 'mse\(.*\)'`
1440 # non-blocking for X11
1441 mknod mse$unit c $chr `unit2minor \`expr $unit '*' 2 + 1\``
1445 unit=`expr $i : 'psm\(.*\)'`
1447 # non-blocking for X11
1448 mknod psm$unit c $chr `unit2minor \`expr $unit '*' 2 + 1\``
1452 name=`expr $i : 'mouse\(.*\)'`
1453 if [ ! -c $name ]; then
1454 $0 $name # make the appropriate device
1460 mknod pcaudio c 24 0
1461 mknod pcaudioctl c 24 128
1465 mknod socksys c 41 0
1468 chmod 666 socksys nfsd spx
1473 # changes from Linux voxware
1474 # minor Linux FreeBSD
1475 # 8 sequencer2 (aka music0) music0
1476 # 17 patmgr0 sequencer1
1477 # 33 patmgr1 sequencer2
1480 unit=`expr $i : 'snd\(.*\)'`
1483 # XXX write this less verbosely, like std
1484 snd_security_hole=0 # XXX
1485 umask $snd_security_hole
1487 ln -fs mixer$unit mixer
1488 ln -fs sequencer$unit sequencer
1490 ln -fs audio$unit audio
1491 ln -fs dspW$unit dspW
1492 ln -fs music$unit music
1495 mknod mixer$unit c $chr `unit2minor \`expr $unit '*' 16 + 0\``
1496 mknod sequencer$unit c $chr `unit2minor \`expr $unit '*' 16 + 1\``
1497 mknod midi$unit c $chr `unit2minor \`expr $unit '*' 16 + 2\``
1498 mknod dsp$unit c $chr `unit2minor \`expr $unit '*' 16 + 3\``
1499 mknod audio$unit c $chr `unit2minor \`expr $unit '*' 16 + 4\``
1500 mknod dspW$unit c $chr `unit2minor \`expr $unit '*' 16 + 5\``
1501 mknod sndstat c $chr 6
1502 # minor number 7 is unused
1503 mknod music$unit c $chr `unit2minor \`expr $unit '*' 16 + 8\``
1504 mknod pss$unit c $chr `unit2minor \`expr $unit '*' 16 + 9\``
1505 # minor number 10 is unused
1506 mknod midistat c $chr 11
1507 # minor numbers 12-15 are unused
1512 mknod vatio c 25 128
1517 unit=`expr $i : 'gsc\(.*\)'`
1518 mknod gsc${unit} c 47 `unit2minor $unit`
1519 mknod gsc${unit}p c 47 `unit2minor $(($unit + 8))`
1520 mknod gsc${unit}d c 47 `unit2minor $(($unit + 32))`
1521 mknod gsc${unit}pd c 47 `unit2minor $(($unit + 40))`
1522 chmod 666 gsc${unit}*
1526 mknod acpi c 152 0 root:operator
1531 mknod apm c 39 0 root:operator
1536 mknod apmctl c 39 8 root:operator
1541 unit=`expr $i : 'card\(.*\)'`
1543 mknod card$unit c $chr `unit2minor $unit`
1549 *0) unit=0;; *1) unit=1;; *2) unit=2;; *3) unit=3;;
1550 *4) unit=4;; *5) unit=5;; *6) unit=6;; *7) unit=7;;
1551 *8) unit=8;; *9) unit=9;; *a) unit=10;; *b) unit=11;;
1552 *c) unit=12;; *d) unit=13;; *e) unit=14;; *f) unit=15;;
1555 ttyy?) unit=`expr $unit \+ 16`;;
1556 ttyz?) unit=`expr $unit \+ 32`;;
1562 mknod cronyx c 42 63
1566 mknod joy0 c 51 0 root:operator
1567 mknod joy1 c 51 1 root:operator
1577 unit=`expr $i : 'ctx\(.*\)'`
1578 mknod ctx$unit c 40 `unit2minor $unit`
1583 unit=`expr $i : 'meteor\(.*\)'`
1584 mknod meteor$unit c 67 `unit2minor $unit`
1585 chmod 444 meteor$unit
1589 unit=`expr $i : 'bktr\(.*\)'`
1590 mknod bktr$unit c 92 `unit2minor $unit`
1591 mknod tuner$unit c 92 `unit2minor $((16 + $unit ))`
1592 mknod vbi$unit c 92 `unit2minor $((32 + $unit ))`
1593 chmod 444 bktr$unit tuner$unit vbi$unit
1597 ntun=`expr $i : 'tun\(.*\)$'`
1599 while [ $unit -le $ntun ]; do
1600 mknod tun$unit c 52 `unit2minor $unit`
1606 ntap=`expr $i : 'tap\(.*\)$'`
1608 while [ $unit -le $ntap ]; do
1609 mknod tap$unit c 149 `unit2minor $unit` root:network
1615 mknod sysmouse c 12 128
1616 mknod consolectl c 12 255
1620 mknod jogdial c 160 0
1624 unit=`expr $i : 'snp\(.*\)'`
1625 mknod snp$unit c 53 `unit2minor $unit`
1628 # dufault@hda.com: If I do much more work on other A-D boards
1629 # then eventually we'll have a "ad" and "dio" interface and some of these
1630 # "labpcaio" ones will be gone.
1631 # labpcaio: D-A and A-D.
1632 # labpcdio: Digital in and Digital out.
1639 unit=`expr $i : 'labpcaio\(.*\)'`
1640 all="0 1 2 3 4 5 6 7"
1645 unit=`expr $i : 'labpcdio\(.*\)'`
1650 die 3 "Don't know LabPC type $i"
1653 if [ -z "${unit}" ]; then
1658 mknod $name$unit c 66 `expr $offset + $unit `
1663 mknod $name$i c 66 `expr $offset + $i `
1667 echo "No such LabPC unit: $unit"
1674 mknod perfmon c 2 32 root:kmem
1681 mknod ipstate c 79 2
1686 unit=`expr $i : 'kbd\(.*\)'`
1688 mknod kbd$unit c $chr `unit2minor $unit`
1700 unit=`expr $i : 'i4brbch\(.*\)'`
1701 mknod i4brbch$unit c 57 `unit2minor $unit`
1706 unit=`expr $i : 'i4bteld\(.*\)'`
1707 mknod i4bteld$unit c 56 `unit2minor \`expr $offset + $unit\``
1711 unit=`expr $i : 'i4btel\(.*\)'`
1712 mknod i4btel$unit c 56 `unit2minor $unit`
1716 unit=`expr $i : 'i4btrc\(.*\)'`
1717 mknod i4btrc$unit c 59 `unit2minor $unit`
1721 unit=`expr $i : 'aac\(.*\)'`
1722 mknod aac$unit c 150 `unit2minor $unit`
1723 ln -fs aac$unit afa$unit
1727 unit=`expr $i : 'mlx\(.*\)'`
1728 mknod mlx$unit c 130 `unit2minor $unit`
1732 unit=`expr $i : 'mlx\(.*\)'`
1733 mknod mlx$unit c 158 `unit2minor $unit`
1737 unit=`expr $i : 'amr\(.*\)'`
1738 mknod amr$unit c 132 `unit2minor $unit`
1742 unit=`expr $i : '3dfx\(.*\)'`
1743 mknod 3dfx$unit c 107 `unit2minor $unit`
1744 ln -sf 3dfx$unit 3dfx
1745 ln -sf 3dfx$unit voodoo
1749 mknod agpgart c 148 0
1753 unit=`expr $i : 'twe\(.*\)'`
1754 mknod twe$unit c 146 `unit2minor $unit`
1758 unit=`expr $i : 'tw\(.*\)'`
1759 mknod tw$unit c 19 `unit2minor $unit` root:operator
1763 umask 0 # XXX should be elsewhere
1769 echo $i - no such device name