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
24 # Device "make" file. Valid arguments:
25 # all makes all known devices, standard number of units (or close)
26 # std standard devices
27 # local configuration specific devices
28 # mach-4 mach4&lites+devices for Mach's XFree86 distribution
29 # (see http://www.cs.hut.fi/lites.html for more info on LITES)
32 # wt* QIC-interfaced (e.g. not SCSI) 3M cartridge tape
33 # sa* SCSI Sequential Access Devices
34 # ft* QIC-40/QIC-80 3M cartridge tape (interfaced
35 # via the floppy disk controller)
38 # wd* "Winchester" disk drives (ST506,IDE,ESDI,RLL,...)
39 # wfd* "IDE floppy" disk drives (LS-120)
40 # fd* "floppy" disk drives (3 1/2", 5 1/4")
41 # da* "SCSI Direct Access Devices"
42 # cd* "SCSI CD-ROM disks"
43 # sd* "SCSI disk", antiquated, use da* instead
44 # mcd* "Mitsumi CD-ROM disks"
45 # scd* "Sony CD-ROM disks"
46 # matcd* "Matsushita (Panasonic) CD-ROM disks"
47 # wcd* "IDE CD-ROM disks"
50 # fla* "M-Systems DiskOnChip"
53 # vty* virtual console devices for syscons/pcvt/codrv
56 # mse* Logitech and ATI Inport bus mouse
58 # sysmouse Mousesystems mouse emulator for syscons
61 # refclock-* serial ports used by xntpd parse refclocks
64 # tty* general purpose serial ports
65 # cua* dialout serial ports
66 # ttyA* Specialix SI/XIO dialin ports ('*' = number of devices)
67 # cuaA* Specialix SI/XIO dialout ports
68 # ttyD* Digiboard - 16 dialin ports
69 # cuaD* Digiboard - 16 dialout ports
70 # ttyR* Rocketport dialin ports
71 # cuaR* Rocketport dialout ports
74 # pty* set of 32 master and slave pseudo terminals
75 # vty* virtual terminals using syscons/pcvt/codrv console
80 # SCSI devices (other than CD-ROM, tape and disk):
81 # ssc The ``super scsi'' device
83 # pt* Processor Type (HP scanner, as one example)
84 # pass* CAM Passthrough device
86 # PC-CARD (previously called PCMCIA) support
89 # Special purpose devices:
90 # apm Advanced Power Management BIOS
93 # tw* xten power controller
94 # snd* various sound cards
95 # pcaudio PCM audio driver
96 # socksys iBCS2 socket system driver
97 # vat VAT compatibility audio driver (requires snd*)
98 # gsc Genius GS-4500 hand scanner
100 # tun* Tunneling IP device
101 # snp* tty snoop devices
102 # spigot Video Spigot video acquisition card
103 # ctx* Cortex-I video acquisition card
104 # meteor* Matrox Meteor video acquisition card (pci)
105 # bktr* Bt848 based video acquisition card (pci)
106 # labpc* National Instrument's Lab-PC and LAB-PC+
107 # perfmon CPU performance-monitoring counters
108 # pci PCI configuration-space access from user mode
109 # ipl ipfilter control devices (ipl, ipnat, ipstate, ipauth)
111 # $Id: MAKEDEV,v 1.173 1998/10/02 22:33:52 obrien Exp $
114 PATH=/sbin:/bin/:/usr/bin:/usr/sbin:$PATH
117 # Usage: die exitcode msg
123 # Convert integer to partition name
128 0) p=a;; 1) p=b;; 2) p=c;; 3) p=d;; 4) p=e;; 5) p=f;; 6) p=g;; 7) p=h;;
134 # Convert integer to slice name
146 # Convert disk (type, unit, slice, partition) to minor number
149 echo $(($1 << 25 | ($2 / 32) << 21 | ($2 % 32) << 3 | $3 << 16 | $4))
152 # Override mknod(2) to add extra handling to it.
155 /sbin/mknod "$@" || die 2 "/sbin/mknod $@ failed"
156 chown root.wheel "$1" || exit 1
159 # Convert the last character of a tty name to a minor number.
164 a) m=10;; b) m=11;; c) m=12;; d) m=13;; e) m=14;; f) m=15;; g) m=16;;
165 h) m=17;; i) m=18;; j) m=19;; k) m=20;; l) m=21;; m) m=22;; n) m=23;;
166 o) m=24;; p) m=25;; q) m=26;; r) m=27;; s) m=28;; t) m=29;; u) m=30;;
173 # Raw partition for disks
176 # Compatibility slice for disks
179 # Raw slice for disks
183 disk_umask=037 # allow group operator to read disks
184 tape_umask=017 # allow group operator to read/write tapes
190 sh MAKEDEV std # standard
191 sh MAKEDEV fd0 fd1 # bdev, floppy disk
192 sh MAKEDEV da0 da1 da2 da3 wd0 wd1 wd2 wd3 # bdev, ordinary disk
193 sh MAKEDEV od0 # bdev, optical disk
194 sh MAKEDEV wfd0 # bdev, LS-120 floppy
195 sh MAKEDEV vn0 # bdev, virtual disk
196 sh MAKEDEV cd0 matcd0 mcd0 scd0 wcd0 # bdev, cdrom
197 sh MAKEDEV ft0 sa0 wt0 wst0 # bdev, tape
198 sh MAKEDEV vty4 # cdev, virtual tty
199 sh MAKEDEV cuaa0 cuaa1 cuaa2 cuaa3 # cdev, serial tty
200 sh MAKEDEV pty0 # cdev, pseudo tty
201 sh MAKEDEV ttyd0 ttyd1 ttyd2 ttyd3 # cdev, serial tty
202 sh MAKEDEV mse0 psm0 sysmouse # cdev, mouse
203 sh MAKEDEV pcaudio speaker # cdev, noise
204 sh MAKEDEV lpt0 lpt1 lpt2 # cdev, printer
205 sh MAKEDEV bpf0 ipl tun0 # cdev, network
206 sh MAKEDEV ch0 perfmon tw0 # cdev, miscellaneous
207 sh MAKEDEV apm card0 card1 # cdev, laptop
208 sh MAKEDEV pass4 xpt2 # cdev, CAM
211 mknod console c 0 0; chmod 600 console
212 mknod drum c 4 0; chmod 640 drum; chgrp kmem drum
213 mknod kmem c 2 1; chmod 640 kmem; chgrp kmem kmem
214 mknod mem c 2 0; chmod 640 mem; chgrp kmem mem
215 mknod null c 2 2; chmod 666 null
216 mknod random c 2 3; chmod 644 random
217 mknod urandom c 2 4; chmod 644 urandom
218 mknod zero c 2 12; chmod 666 zero
219 mknod io c 2 14; chmod 600 io
220 mknod tty c 1 0; chmod 666 tty
221 mknod klog c 7 0; chmod 600 klog
222 mknod stdin c 22 0; chmod 666 stdin
223 mknod stdout c 22 1; chmod 666 stdout
224 mknod stderr c 22 2; chmod 666 stderr
225 mknod lkm c 32 0; chmod 644 lkm
226 mknod pci c 78 0; chmod 644 pci
228 (cd fd && eval `echo "" | awk ' BEGIN { \
229 for (i = 0; i < 64; i++) \
230 printf("mknod %d c 22 %d;", i, i)}'`)
241 mknod timezone c 26 0
244 # Create device files for new Archive/Wangtek QIC-02 tape driver (vak)
247 u=`expr $i : '..\(.*\)'`
248 if [ x$u = x ]; then u=0; fi
249 mknod rwt${u} c 10 `expr 0 + $u` # default density, 512b blocks
250 mknod nrwt${u} c 10 `expr 4 + $u`
251 # mknod rWt${u} c 10 `expr 64 + $u` # default density, 1024b blocks
252 # mknod nrWt${u} c 10 `expr 68 + $u`
253 mknod rwt${u}b c 10 `expr 16 + $u` # 60 megabytes
254 mknod nrwt${u}b c 10 `expr 20 + $u`
255 mknod rwt${u}c c 10 `expr 24 + $u` # 120 megabytes
256 mknod nrwt${u}c c 10 `expr 28 + $u`
257 mknod rwt${u}d c 10 `expr 32 + $u` # 150 megabytes
258 mknod nrwt${u}d c 10 `expr 36 + $u`
259 # mknod rwt${u}e c 10 `expr 40 + $u` # 300 megabytes?
260 # mknod nrwt${u}e c 10 `expr 44 + $u`
261 # mknod rwt${u}f c 10 `expr 48 + $u` # 600 megabytes?
262 # mknod nrwt${u}f c 10 `expr 52 + $u`
263 chgrp operator r[Ww]t$u nr[Ww]t$u r[Ww]t$u[a-f] nr[Ww]t$u[a-f]
268 od*s*|sd*s*|da*s*|vn*s*|wd*s*|wfd*s*|fla*s*)
271 fla*s*) name=fla; blk=28; chr=101;;
272 od*s*) name=od; blk=4; chr=13;;
273 sd*s*) name=sd; blk=4; chr=13;;
274 da*s*) name=da; blk=4; chr=13;;
275 vn*s*) name=vn; blk=15; chr=43;;
276 wd*s*) name=wd; blk=0; chr=3;;
277 wfd*s*) name=wfd; blk=1; chr=87;;
281 unit=`expr $i : '...\([0-9]*\)s'`
282 slice=`expr $i : '...[0-9]*s\([0-9]*\)'`
283 part=`expr $i : '...[0-9]*s[0-9]*\(.*\)'`
286 unit=`expr $i : '..\([0-9]*\)s'`
287 slice=`expr $i : '..[0-9]*s\([0-9]*\)'`
288 part=`expr $i : '..[0-9]*s[0-9]*\(.*\)'`
292 [0-9]|[0-9][0-9]|[0-4][0-9][0-9]|50[0-9]|51[0-1])
297 slicename=`dkitos $slice`
298 minor=`dkminor 0 $unit $slice $dkrawpart`
299 mknod $name$unit$slicename b $blk $minor
300 mknod r$name$unit$slicename c $chr $minor
304 0) slice=$oldslice ;;
306 for part in 0 1 2 3 4 5 6 7
308 minor=`dkminor 0 $unit $slice $part`
309 partname=`dkitop $part`
310 mknod $name$unit$slicename$partname \
312 mknod r$name$unit$slicename$partname \
319 echo bad partition for disk in: $i
322 chgrp operator $name$unit$slicename* \
323 r$name$unit$slicename*
326 echo bad slice for disk in: $i
331 echo bad unit for disk in: $i "(unit=$unit, slice=$slice, part=$part)"
339 unit=`expr $i : '..\(.*\)'`
340 name=fd; blk=2; chr=9
343 mknod ${name}${unit} b $blk `expr $unit '*' 64`
344 mknod r${name}${unit} c $chr `expr $unit '*' 64`
345 # Fake BSD partitions
346 for i in a b c d e f g h
348 ln ${name}${unit} ${name}${unit}$i
349 ln r${name}${unit} r${name}${unit}$i
351 # User-readable and programmer-readable name sets
353 mknod ${name}${unit}.1720 b $blk `expr $unit '*' 64 + 1`
354 mknod r${name}${unit}.1720 c $chr `expr $unit '*' 64 + 1`
355 # ln ${name}${unit}.1720 ${name}${unit}135hs21
356 # ln r${name}${unit}.1720 r${name}${unit}135hs21
358 mknod ${name}${unit}.1480 b $blk `expr $unit '*' 64 + 2`
359 mknod r${name}${unit}.1480 c $chr `expr $unit '*' 64 + 2`
360 # ln ${name}${unit}.1480 ${name}${unit}135hs18
361 # ln r${name}${unit}.1480 r${name}${unit}135hs18
362 # ln ${name}${unit}.1480 ${name}${unit}96hs18
363 # ln r${name}${unit}.1480 r${name}${unit}96hs18
365 mknod ${name}${unit}.1440 b $blk `expr $unit '*' 64 + 3`
366 mknod r${name}${unit}.1440 c $chr `expr $unit '*' 64 + 3`
367 # ln ${name}${unit}.1440 ${name}${unit}135
368 # ln r${name}${unit}.1440 r${name}${unit}135
369 # ln ${name}${unit}.1440 ${name}${unit}135ds18
370 # ln r${name}${unit}.1440 r${name}${unit}135ds18
371 # ln ${name}${unit}.1440 ${name}${unit}96ds18
372 # ln r${name}${unit}.1440 r${name}${unit}96ds18
374 mknod ${name}${unit}.1200 b $blk `expr $unit '*' 64 + 4`
375 mknod r${name}${unit}.1200 c $chr `expr $unit '*' 64 + 4`
376 # ln ${name}${unit}.1200 ${name}${unit}96
377 # ln r${name}${unit}.1200 r${name}${unit}96
378 # ln ${name}${unit}.1200 ${name}${unit}96ds15
379 # ln r${name}${unit}.1200 r${name}${unit}96ds15
380 # ln ${name}${unit}.1200 ${name}${unit}135ds15
381 # ln r${name}${unit}.1200 r${name}${unit}135ds15
383 mknod ${name}${unit}.820 b $blk `expr $unit '*' 64 + 5`
384 mknod r${name}${unit}.820 c $chr `expr $unit '*' 64 + 5`
385 # ln ${name}${unit}.820 ${name}${unit}96hs10
386 # ln r${name}${unit}.820 r${name}${unit}96hs10
387 # ln ${name}${unit}.820 ${name}${unit}135hs10
388 # ln r${name}${unit}.820 r${name}${unit}135hs10
390 mknod ${name}${unit}.800 b $blk `expr $unit '*' 64 + 6`
391 mknod r${name}${unit}.800 c $chr `expr $unit '*' 64 + 6`
392 # ln ${name}${unit}.800 ${name}${unit}96ds10
393 # ln r${name}${unit}.800 r${name}${unit}96ds10
394 # ln ${name}${unit}.800 ${name}${unit}135ds10
395 # ln r${name}${unit}.800 r${name}${unit}135ds10
397 mknod ${name}${unit}.720 b $blk `expr $unit '*' 64 + 7`
398 mknod r${name}${unit}.720 c $chr `expr $unit '*' 64 + 7`
399 # ln ${name}${unit}.720 ${name}${unit}96ds9
400 # ln r${name}${unit}.720 r${name}${unit}96ds9
401 # ln ${name}${unit}.720 ${name}${unit}135ds9
402 # ln r${name}${unit}.720 r${name}${unit}135ds9
404 mknod ${name}${unit}.360 b $blk `expr $unit '*' 64 + 8`
405 mknod r${name}${unit}.360 c $chr `expr $unit '*' 64 + 8`
406 # ln ${name}${unit}.360 ${name}${unit}48
407 # ln r${name}${unit}.360 r${name}${unit}48
408 # ln ${name}${unit}.360 ${name}${unit}48ds9
409 # ln r${name}${unit}.360 r${name}${unit}48ds9
411 chgrp operator ${name}${unit}* r${name}${unit}*
414 echo bad unit for disk in: $i
422 unit=`expr $i : '..\(.*\)'`
423 name=ft; blk=2; chr=9
426 mknod ${name}${unit} b $blk `expr $unit '*' 64 + 32`
427 mknod r${name}${unit} c $chr `expr $unit '*' 64 + 32`
428 ln ${name}${unit} ${name}${unit}a
429 ln r${name}${unit} r${name}${unit}a
430 chgrp operator ${name}${unit}* r${name}${unit}*
433 echo bad unit for tape in: $i
439 sd*|od*|da*|vn*|wd*|wfd*|fla*)
442 fla*) name=fla; blk=28; chr=101;;
443 sd*) name=sd; blk=4; chr=13;;
444 od*) name=od; blk=4; chr=13;;
445 da*) name=da; blk=4; chr=13;;
446 vn*) name=vn; blk=15; chr=43;;
447 wd*) name=wd; blk=0; chr=3;;
448 wfd*) name=wfd; blk=1; chr=87;;
452 unit=`expr $i : '...\(.*\)'`
455 unit=`expr $i : '..\(.*\)'`
459 [0-9]|[0-9][0-9]|[0-4][0-9][0-9]|50[0-9]|51[0-1])
460 for slicepartname in s0h s1 s2 s3 s4
462 sh MAKEDEV $name$unit$slicepartname
466 echo bad unit for disk in: $i
476 unit=`expr $i : '...\(.*\)'`
478 [0-9]|[0-9][0-9]|[0-4][0-9][0-9]|50[0-9]|51[0-1])
479 for part in 0 1 2 3 4 5 6 7
481 minor=`dkminor 0 $unit 0 $part`
482 partname=`dkitop $part`
483 mknod $name$unit$partname b $blk $minor
484 mknod r$name$unit$partname c $chr $minor
486 chgrp operator ${name}${unit}[a-h] r${name}${unit}[a-h]
489 echo bad unit for disk in: $i
499 # SCSI processor type driver
503 unit=`expr $i : 'pt\([0-9][0-9]*\)'`
504 if [ "X${unit}" = "X" ]; then
507 unit=`expr $unit + 1 - 1`
508 mknod ${name}${unit} c $chr $unit
511 # SCSI target mode sample driver
515 unit=`expr $i : 'targ\([0-9][0-9]*\)'`
516 if [ "X${unit}" = "X" ]; then
519 unit=`expr $unit + 1 - 1`
520 mknod ${name}${unit} c $chr $unit
523 # CAM transport layer device
526 # This major number is temporary
529 units=`expr $i : 'xpt\(.*\)'`
530 if [ "X${units}" = "X" ]; then
533 eval `echo ${chr} ${units} ${name} |awk \
534 '{ c=$1; n=$2; name=$3;} END {
535 for (i = 0; i < n; i++)
536 printf("rm -f %s%d r%s%d; mknod %s%d c %d %d; \
537 chgrp operator %s%d;", \
538 name, i, name, i, name, i, c, i, \
541 # CAM passthrough device
544 # This major number is temporary
547 units=`expr $i : 'pass\(.*\)'`
548 if [ "X${units}" = "X" ]; then
551 eval `echo ${chr} ${units} ${name} |awk \
552 '{ c=$1; n=$2; name=$3;} END {
553 for (i = 0; i < n; i++)
554 printf("rm -f %s%d r%s%d; mknod %s%d c %d %d; \
555 chgrp operator %s%d;", \
556 name, i, name, i, name, i, c, i, \
560 class=`expr $i : 'pty\(.*\)'`
563 1) offset=32 name=q;;
564 2) offset=64 name=r;;
565 3) offset=96 name=s;;
566 # Note that xterm (at least) only look at p-s.
567 4) offset=128 name=P;;
568 5) offset=160 name=Q;;
569 6) offset=192 name=R;;
570 7) offset=224 name=S;;
571 # This still leaves [tuTU].
572 *) echo bad unit for pty in: $i;;
577 eval `echo $offset $name | awk ' { b=0+$1; n=$2 } END { \
578 for (i = 0; i < 32; i++) {
579 c = substr("0123456789abcdefghijklmnopqrstuv", i + 1, 1); \
580 printf("mknod tty%s%s c 5 %d; \
581 mknod pty%s%s c 6 %d;", \
593 unit=`expr $i : '..\(.*\)'`
600 mknod rsa${unit}.${mode} c $chr `expr $unit '*' 16 + $mode '*' 4 + 0`
601 mknod nrsa${unit}.${mode} c $chr `expr $unit '*' 16 + $mode '*' 4 + 1`
602 mknod ersa${unit}.${mode} c $chr `expr $unit '*' 16 + $mode '*' 4 + 2`
603 chgrp operator rsa${unit}.${mode}\
604 nrsa${unit}.${mode} \
608 ln rsa${unit}.0 rsa${unit}
609 ln nrsa${unit}.0 nrsa${unit}
610 ln ersa${unit}.0 ersa${unit}
613 echo bad unit for tape in: $i
621 unit=`expr $i : '..\(.*\)'`
623 ch*) name=ch; chr=17;;
627 mknod ${name}${unit} c $chr $unit
628 chgrp operator ${name}${unit}
631 echo bad unit for media changer in: $i
640 cd*) units=`expr $i : '..\(.*\)'`; name=cd; blk=6; chr=15;;
641 mcd*) units=`expr $i : '...\(.*\)'`; name=mcd; blk=7; chr=29;;
642 scd*) units=`expr $i : '...\(.*\)'`; name=scd; blk=16; chr=45;;
644 if [ "X${units}" = "X" -o ${units} -le 0 ]; then
647 if [ "${units}" -le 31 ]; then
648 eval `echo ${chr} ${blk} ${units} ${name} |awk \
649 '{ c=$1; b=$2; n=$3; name=$4;} END{
650 for (i = 0; i < n; i++){
651 printf("rm -f %s%d* r%s%d*; \
652 mknod %s%da b %d %d; \
653 mknod %s%dc b %d %d; \
654 mknod r%s%da c %d %d; \
655 mknod r%s%dc c %d %d; \
656 chgrp operator %s%d* r%s%d*;",
659 name, i, b, (i * 8) + 2,
661 name, i, c, (i * 8) + 2,
662 name, i, name, i); }}'`
665 echo "$i is invalid -- can't have more than 32 cd devices"
673 matcd*) unit=`expr $i : '.....\(.*\)'`; name=matcd; blk=17; chr=46;;
676 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15)
677 mknod ${name}${unit}a b $blk `expr $unit '*' 8 + 0`
678 mknod ${name}${unit}c b $blk `expr $unit '*' 8 + 2`
679 mknod r${name}${unit}a c $chr `expr $unit '*' 8 + 0`
680 mknod r${name}${unit}c c $chr `expr $unit '*' 8 + 2`
681 chgrp operator ${name}${unit}[a-h] r${name}${unit}[a-h]
682 chmod 640 ${name}${unit}[a-h] r${name}${unit}[a-h]
684 mknod ${name}${unit}la b $blk `expr $unit '*' 8 + 128`
685 mknod ${name}${unit}lc b $blk `expr $unit '*' 8 + 130`
686 mknod r${name}${unit}la c $chr `expr $unit '*' 8 + 128`
687 mknod r${name}${unit}lc c $chr `expr $unit '*' 8 + 130`
688 chgrp operator ${name}${unit}l[a-h] r${name}${unit}l[a-h]
689 chmod 640 ${name}${unit}l[a-h] r${name}${unit}l[a-h]
692 echo bad unit for disk in: $i
700 unit=`expr $i : '...\(.*\)'`
705 mknod wcd${unit}a b $blk `expr $unit '*' 8 + 0`
706 mknod rwcd${unit}a c $chr `expr $unit '*' 8 + 0`
707 mknod wcd${unit}c b $blk `expr $unit '*' 8 + 2`
708 mknod rwcd${unit}c c $chr `expr $unit '*' 8 + 2`
709 chgrp operator wcd${unit}[a-h] rwcd${unit}[a-h]
710 chmod 640 wcd${unit}[a-h] rwcd${unit}[a-h]
713 echo bad unit for disk in: $i
721 unit=`expr $i : '...\(.*\)'`
725 mknod rwst${unit} c $chr `expr $unit '*' 8 + 0`
726 chgrp operator rwst${unit}
727 chmod 640 rwst${unit}
734 unit=`expr $i : 'lpt\(.*\)'`
735 mknod lpt$unit c 16 $unit
736 mknod lpctl$unit c 16 `expr $unit + 128`
740 unit=`expr $i : 'tw\(.*\)'`
741 mknod tw$unit c 19 $unit
742 chgrp operator tw$unit
745 # Use this to create virtual consoles for syscons, pcvt or codrv
747 # use as MAKEDEV vtyNN to create NN entries
750 units=`expr $i : 'vty\(.*\)'`
751 eval `echo ${chr} ${units} | awk ' { c=0+$1; n=0+$2 } END {
752 for (i = 0; i < n; i++)
753 printf("mknod ttyv%01x c %d %d;", i, c, i); }'`
754 ln -fs ttyv0 vga # XXX X still needs this pccons relic
758 nbpf=`expr $i : 'bpf\(.*\)$'`
760 while [ $unit -le $nbpf ]; do
761 mknod bpf$unit c 23 $unit
762 unit=`expr $unit + 1`
772 unit=`expr $i : 'cua.*\(.\)$'`
774 mknod cuaa$unit c 28 `expr $m + 128`
775 mknod cuaia$unit c 28 `expr $m + 32 + 128`
776 mknod cuala$unit c 28 `expr $m + 64 + 128`
777 chown uucp.dialer cua*a$unit
782 unit=`expr $i : 'tty.*\(.\)$'`
784 mknod ttyd$unit c 28 $m
785 mknod ttyid$unit c 28 `expr $m + 32`
786 mknod ttyld$unit c 28 `expr $m + 64`
791 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f
792 g h i j k l m n o p q r s t u v"
794 card=`expr $i : 'cua.*\(.\)$'`
795 for unit in $portlist
797 minor=`ttyminor $unit`
798 minor=`expr $card \* 65536 + $minor`
800 mknod cuac$name c $major `expr $minor + 128`
801 mknod cuaic$name c $major `expr $minor + 32 + 128`
802 mknod cualc$name c $major `expr $minor + 64 + 128`
803 chown uucp.dialer cuac$name cuaic$name cualc$name
809 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f
810 g h i j k l m n o p q r s t u v"
812 card=`expr $i : 'tty.*\(.\)$'`
813 for unit in $portlist
815 minor=`ttyminor $unit`
816 minor=`expr $card \* 65536 + $minor`
818 mknod ttyc$name c $major $minor
819 mknod ttyic$name c $major `expr $minor + 32`
820 mknod ttylc$name c $major `expr $minor + 64`
824 # RISCom8 'rc' driver entries
828 unit=`expr $i : 'cua.*\(.\)$'`
830 mknod cuam$unit c 63 `expr $m + 128`
831 chown uucp.dialer cuam$unit
836 unit=`expr $i : 'tty.*\(.\)$'`
838 mknod ttym$unit c 63 $m
842 # Note: these are 'base 1' to match the numbers on the panels, and to match
843 # the manual that comes with the system.
846 nports=`expr $i : 'ttyA\(.*\)$'`
848 while [ $port -le $nports ]; do
849 minor=`expr $port - 1`
850 name=`expr $port + 1000 | cut -c 3-4`
851 mknod ttyA$name c $major $minor
852 mknod ttyiA$name c $major `expr $minor + 65536`
853 mknod ttylA$name c $major `expr $minor + 131072`
854 port=`expr $port + 1`
856 # For the user-mode control program, 'sicontrol'
857 mknod si_control c 68 262144
863 nports=`expr $i : 'cuaA\(.*\)$'`
865 while [ $port -le $nports ]; do
866 minor=`expr $port - 1`
867 name=`expr $port + 1000 | cut -c 3-4`
868 mknod cuaA$name c $major `expr $minor + 128`
869 mknod cuaiA$name c $major `expr $minor + 128 + 65536`
870 mknod cualA$name c $major `expr $minor + 128 + 131072`
871 chown uucp.dialer cuaA$name cuaiA$name cualA$name
872 port=`expr $port + 1`
877 # Digiboard PC/?? 16 port card.
878 # The current scheme of minor numbering is:
880 # unused{14} CARD{2} major{8} CALLOUT{1} LOCK{1} INIT{1} PORT{5}
882 # CARD bitfield in future versions may be extended to 3 bits.
887 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f"
889 card=`expr $i : 'tty.*\(.\)$'`
890 for unit in $portlist
892 minor=`ttyminor $unit`
893 minor=`expr $card \* 65536 + $minor`
895 mknod ttyD$name c $major $minor
896 mknod ttyiD$name c $major `expr $minor + 32`
897 mknod ttylD$name c $major `expr $minor + 64`
903 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f"
905 card=`expr $i : 'cua.*\(.\)$'`
906 for unit in $portlist
908 minor=`ttyminor $unit`
909 minor=`expr $card \* 65536 + $minor`
911 mknod cuaD$name c $major `expr $minor + 128`
912 mknod cuaiD$name c $major `expr $minor + 32 + 128`
913 mknod cualD$name c $major `expr $minor + 64 + 128`
914 chown uucp.dialer cua*D$name
920 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f"
923 card=`expr $i : 'tty.*\(.\)$'`
924 for unit in $modulelist
926 moduleminor=`ttyminor $unit`
927 moduleminor=`expr $moduleminor % 10 \* 16`
930 for unit in $portlist
932 minor=`ttyminor $unit`
933 minor=`expr $card \* 65536 + $minor + $moduleminor`
934 name=$card$modulename$unit
936 mknod ttyM$name c $major $minor
937 mknod ttyiM$name c $major `expr $minor + 64`
938 mknod ttylM$name c $major `expr $minor + 128`
939 chown root.wheel tty*M$name
946 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f"
949 card=`expr $i : 'cua.*\(.\)$'`
950 for unit in $modulelist
952 moduleminor=`ttyminor $unit`
953 moduleminor=`expr $moduleminor % 10 \* 16`
956 for unit in $portlist
958 minor=`ttyminor $unit`
959 minor=`expr $card \* 65536 + $minor + $moduleminor`
960 name=$card$modulename$unit
962 mknod cuaM$name c $major `expr $minor + 262144`
963 mknod cuaiM$name c $major `expr $minor + 64 + 262144`
964 mknod cualM$name c $major `expr $minor + 128 + 262144`
965 chown uucp.dialer cua*M$name
973 BOARD=1; MINOR=65536; Rnum=0
974 MINOR=`expr $BOARD \* 65536`
975 dmesg | grep ^RocketPort[0-4] > /tmp/rp_list
976 controllers=`awk '{print $1}' < /tmp/rp_list`
977 rm -f /dev/ttyR*; rm -f /dev/ttyiR*; rm -f /dev/ttylR*
978 for i in $controllers;do
979 ndevices=`grep ^$i /tmp/rp_list | sed -e 's/.* \([0-9]*\) ports/\1/'`
980 echo -n "Creating $ndevices devices for $i: "
981 for dev in `jot $ndevices 0`;do
982 mknod /dev/ttyR$Rnum c $major $MINOR
983 mknod /dev/ttylR$Rnum c $major `expr $MINOR + 32`
984 mknod /dev/ttyiR$Rnum c $major `expr $MINOR + 64`
985 Rnum=`expr $Rnum + 1`
986 MINOR=`expr $MINOR + 1`
988 BOARD=`expr $BOARD + 1`
989 MINOR=`expr $BOARD \* 65536`
996 BOARD=1; MINOR=65536; Rnum=0
997 MINOR=`expr $BOARD \* 65536`
998 dmesg | grep ^RocketPort[0-4] > /tmp/rp_list
999 controllers=`awk '{print $1}' < /tmp/rp_list`
1000 rm -f /dev/cuaR*; rm -f /dev/cuaiR*; rm -f /dev/cualR*
1001 for i in $controllers;do
1002 ndevices=`grep ^$i /tmp/rp_list | sed -e 's/.* \([0-9]*\) ports/\1/'`
1003 echo -n "Creating $ndevices devices for $i: "
1004 for dev in `jot $ndevices 0`;do
1005 mknod /dev/cuaR$Rnum c $major `expr $MINOR + 128`
1006 mknod /dev/cualR$Rnum c $major `expr $MINOR + 128 + 32`
1007 mknod /dev/cuaiR$Rnum c $major `expr $MINOR + 128 + 64`
1008 Rnum=`expr $Rnum + 1`
1009 MINOR=`expr $MINOR + 1`
1011 BOARD=`expr $BOARD + 1`
1012 MINOR=`expr $BOARD \* 65536`
1015 chown uucp.dialer /dev/cuaR*
1019 unit=`expr $i : 'mse\(.*\)'`
1021 mknod mse$unit c $chr `expr $unit '*' 2 + 1` # non-blocking for X11
1025 unit=`expr $i : 'psm\(.*\)'`
1027 mknod psm$unit c $chr `expr $unit '*' 2 + 1` # non-blocking for X11
1031 name=`expr $i : 'mouse\(.*\)'`
1032 if [ ! -c $name ]; then
1033 $0 $name # make the appropriate device
1039 mknod pcaudio c 24 0
1040 mknod pcaudioctl c 24 128
1044 mknod socksys c 41 0
1047 chmod 666 socksys nfsd spx
1052 # changes from Linux voxware
1053 # minor Linux FreeBSD
1054 # 8 sequencer2 (aka music0) music0
1055 # 17 patmgr0 sequencer1
1056 # 33 patmgr1 sequencer2
1059 unit=`expr $i : 'snd\(.*\)'`
1062 # XXX write this less verbosely, like std
1063 snd_security_hole=0 # XXX
1064 umask $snd_security_hole
1066 ln -fs mixer$unit mixer
1067 ln -fs sequencer$unit sequencer
1069 ln -fs audio$unit audio
1070 ln -fs dspW$unit dspW
1071 ln -fs music$unit music
1074 mknod mixer$unit c $chr `expr $unit '*' 16 + 0`
1075 mknod sequencer$unit c $chr `expr $unit '*' 16 + 1`
1076 mknod midi$unit c $chr `expr $unit '*' 16 + 2`
1077 mknod dsp$unit c $chr `expr $unit '*' 16 + 3`
1078 mknod audio$unit c $chr `expr $unit '*' 16 + 4`
1079 mknod dspW$unit c $chr `expr $unit '*' 16 + 5`
1080 mknod sndstat c $chr 6
1081 # minor number 7 is unused
1082 mknod music$unit c $chr `expr $unit '*' 16 + 8`
1083 mknod pss$unit c $chr `expr $unit '*' 16 + 9`
1084 # minor numbers 10-15 are unused
1089 mknod vatio c 25 128
1094 unit=`expr $i : 'gsc\(.*\)'`
1095 mknod gsc${unit} c 47 $unit
1096 mknod gsc${unit}p c 47 $(($unit + 8))
1097 mknod gsc${unit}d c 47 $(($unit + 32))
1098 mknod gsc${unit}pd c 47 $(($unit + 40))
1099 chmod 666 gsc${unit}*
1110 unit=`expr $i : 'card\(.*\)'`
1112 mknod card$unit c $chr $unit
1118 *0) unit=0;; *1) unit=1;; *2) unit=2;; *3) unit=3;;
1119 *4) unit=4;; *5) unit=5;; *6) unit=6;; *7) unit=7;;
1120 *8) unit=8;; *9) unit=9;; *a) unit=10;; *b) unit=11;;
1121 *c) unit=12;; *d) unit=13;; *e) unit=14;; *f) unit=15;;
1124 ttyy?) unit=`expr $unit \+ 16`;;
1125 ttyz?) unit=`expr $unit \+ 32`;;
1132 mknod cronyx c 42 63
1138 chgrp operator joy0 joy1
1148 unit=`expr $i : 'ctx\(.*\)'`
1149 mknod ctx$unit c 40 $unit
1154 unit=`expr $i : 'meteor\(.*\)'`
1155 mknod meteor$unit c 67 $unit
1156 chmod 444 meteor$unit
1160 unit=`expr $i : 'bktr\(.*\)'`
1161 mknod bktr$unit c 92 $unit
1162 mknod tuner$unit c 92 $((16 + $unit ))
1163 chmod 444 bktr$unit tuner$unit
1167 ntun=`expr $i : 'tun\(.*\)$'`
1169 while [ $unit -le $ntun ]; do
1170 mknod tun$unit c 52 $unit
1171 chown uucp.dialer tun$unit
1172 unit=`expr $unit + 1`
1177 mknod sysmouse c 12 128
1178 mknod consolectl c 12 255
1182 unit=`expr $i : 'snp\(.*\)'`
1183 mknod snp$unit c 53 $unit
1186 # dufault@hda.com: If I do much more work on other A-D boards
1187 # then eventually we'll have a "ad" and "dio" interface and some of these
1188 # "labpcaio" ones will be gone.
1189 # labpcaio: D-A and A-D.
1190 # labpcdio: Digital in and Digital out.
1197 unit=`expr $i : 'labpcaio\(.*\)'`
1198 all="0 1 2 3 4 5 6 7"
1203 unit=`expr $i : 'labpcdio\(.*\)'`
1208 die 3 "Don't know LabPC type $i"
1211 if [ "X${unit}" = "X" ]; then
1216 mknod $name$unit c 66 `expr $offset + $unit `
1221 mknod $name$i c 66 `expr $offset + $i `
1225 echo "No such LabPC unit: $unit"
1232 mknod perfmon c 2 32
1240 mknod ipstate c 79 2
1245 umask 0 # XXX should be elsewhere
1251 echo $i - no such device name