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 # st* "NEW type scsi tapes" (old driver uses the
34 # block devices of the disks to get access)
35 # ft* QIC-40/QIC-80 3M cartridge tape (interfaced
36 # via the floppy disk controller)
39 # wd* "Winchester" disk drives (ST506,IDE,ESDI,RLL,...)
40 # wfd* "IDE floppy" disk drives (LS-120)
41 # fd* "floppy" disk drives (3 1/2", 5 1/4")
43 # cd* "SCSI CD-ROM disks"
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
82 # uk* "unknown" device (supports ioctl calls only)
84 # pt* Processor Type (HP scanner, as one example)
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.166 1998/08/04 21:45:20 brian 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
182 # Control bit for SCSI
186 disk_umask=037 # allow group operator to read disks
187 tape_umask=017 # allow group operator to read/write tapes
193 sh MAKEDEV std # standard
194 sh MAKEDEV fd0 fd1 # bdev, floppy disk
195 sh MAKEDEV sd0 sd1 sd2 sd3 wd0 wd1 wd2 wd3 # bdev, ordinary disk
196 sh MAKEDEV od0 # bdev, optical disk
197 sh MAKEDEV wfd0 # bdev, LS-120 floppy
198 sh MAKEDEV vn0 # bdev, virtual disk
199 sh MAKEDEV cd0 matcd0 mcd0 scd0 wcd0 # bdev, cdrom
200 sh MAKEDEV ft0 st0 wt0 # bdev, tape
201 sh MAKEDEV vty4 # cdev, virtual tty
202 sh MAKEDEV cuaa0 cuaa1 cuaa2 cuaa3 # cdev, serial tty
203 sh MAKEDEV pty0 # cdev, pseudo tty
204 sh MAKEDEV ttyd0 ttyd1 ttyd2 ttyd3 # cdev, serial tty
205 sh MAKEDEV mse0 psm0 sysmouse # cdev, mouse
206 sh MAKEDEV pcaudio speaker # cdev, noise
207 sh MAKEDEV lpt0 lpt1 lpt2 # cdev, printer
208 sh MAKEDEV bpf0 ipl tun0 # cdev, network
209 sh MAKEDEV ch0 perfmon tw0 # cdev, miscellaneous
210 sh MAKEDEV apm card0 card1 # cdev, laptop
213 mknod console c 0 0; chmod 600 console
214 mknod drum c 4 0; chmod 640 drum; chgrp kmem drum
215 mknod kmem c 2 1; chmod 640 kmem; chgrp kmem kmem
216 mknod mem c 2 0; chmod 640 mem; chgrp kmem mem
217 mknod null c 2 2; chmod 666 null
218 mknod random c 2 3; chmod 644 random
219 mknod urandom c 2 4; chmod 644 urandom
220 mknod zero c 2 12; chmod 666 zero
221 mknod io c 2 14; chmod 600 io
222 mknod tty c 1 0; chmod 666 tty
223 mknod klog c 7 0; chmod 600 klog
224 mknod stdin c 22 0; chmod 666 stdin
225 mknod stdout c 22 1; chmod 666 stdout
226 mknod stderr c 22 2; chmod 666 stderr
227 mknod lkm c 32 0; chmod 644 lkm
228 mknod pci c 78 0; chmod 644 pci
230 (cd fd && eval `echo "" | awk ' BEGIN { \
231 for (i = 0; i < 64; i++) \
232 printf("mknod %d c 22 %d;", i, i)}'`)
243 mknod timezone c 26 0
246 # Create device files for new Archive/Wangtek QIC-02 tape driver (vak)
249 u=`expr $i : '..\(.*\)'`
250 if [ x$u = x ]; then u=0; fi
251 mknod rwt${u} c 10 `expr 0 + $u` # default density, 512b blocks
252 mknod nrwt${u} c 10 `expr 4 + $u`
253 # mknod rWt${u} c 10 `expr 64 + $u` # default density, 1024b blocks
254 # mknod nrWt${u} c 10 `expr 68 + $u`
255 mknod rwt${u}b c 10 `expr 16 + $u` # 60 megabytes
256 mknod nrwt${u}b c 10 `expr 20 + $u`
257 mknod rwt${u}c c 10 `expr 24 + $u` # 120 megabytes
258 mknod nrwt${u}c c 10 `expr 28 + $u`
259 mknod rwt${u}d c 10 `expr 32 + $u` # 150 megabytes
260 mknod nrwt${u}d c 10 `expr 36 + $u`
261 # mknod rwt${u}e c 10 `expr 40 + $u` # 300 megabytes?
262 # mknod nrwt${u}e c 10 `expr 44 + $u`
263 # mknod rwt${u}f c 10 `expr 48 + $u` # 600 megabytes?
264 # mknod nrwt${u}f c 10 `expr 52 + $u`
265 chgrp operator r[Ww]t$u nr[Ww]t$u r[Ww]t$u[a-f] nr[Ww]t$u[a-f]
270 od*s*|sd*s*|vn*s*|wd*s*|wfd*s*|fla*s*)
273 od*s*) name=od; blk=20; chr=70;;
274 sd*s*) name=sd; blk=4; chr=13;;
275 wd*s*) name=wd; blk=0; chr=3;;
276 vn*s*) name=vn; blk=15; chr=43;;
277 wfd*s*) name=wfd; blk=1; chr=87;;
278 fla*s*) name=fla; blk=28; chr=101;;
282 unit=`expr $i : '...\([0-9]*\)s'`
283 slice=`expr $i : '...[0-9]*s\([0-9]*\)'`
284 part=`expr $i : '...[0-9]*s[0-9]*\(.*\)'`
287 unit=`expr $i : '..\([0-9]*\)s'`
288 slice=`expr $i : '..[0-9]*s\([0-9]*\)'`
289 part=`expr $i : '..[0-9]*s[0-9]*\(.*\)'`
293 [0-9]|[0-9][0-9]|[0-4][0-9][0-9]|50[0-9]|51[0-1])
298 slicename=`dkitos $slice`
299 minor=`dkminor 0 $unit $slice $dkrawpart`
300 mknod $name$unit$slicename b $blk $minor
301 mknod r$name$unit$slicename c $chr $minor
305 0) slice=$oldslice ;;
307 for part in 0 1 2 3 4 5 6 7
309 minor=`dkminor 0 $unit $slice $part`
310 partname=`dkitop $part`
311 mknod $name$unit$slicename$partname \
313 mknod r$name$unit$slicename$partname \
320 echo bad partition for disk in: $i
323 chgrp operator $name$unit$slicename* \
324 r$name$unit$slicename*
327 echo bad slice for disk in: $i
332 echo bad unit for disk in: $i "(unit=$unit, slice=$slice, part=$part)"
340 unit=`expr $i : '..\(.*\)'`
341 name=fd; blk=2; chr=9
344 mknod ${name}${unit} b $blk `expr $unit '*' 64`
345 mknod r${name}${unit} c $chr `expr $unit '*' 64`
346 # Fake BSD partitions
347 for i in a b c d e f g h
349 ln ${name}${unit} ${name}${unit}$i
350 ln r${name}${unit} r${name}${unit}$i
352 # User-readable and programmer-readable name sets
354 mknod ${name}${unit}.1720 b $blk `expr $unit '*' 64 + 1`
355 mknod r${name}${unit}.1720 c $chr `expr $unit '*' 64 + 1`
356 # ln ${name}${unit}.1720 ${name}${unit}135hs21
357 # ln r${name}${unit}.1720 r${name}${unit}135hs21
359 mknod ${name}${unit}.1480 b $blk `expr $unit '*' 64 + 2`
360 mknod r${name}${unit}.1480 c $chr `expr $unit '*' 64 + 2`
361 # ln ${name}${unit}.1480 ${name}${unit}135hs18
362 # ln r${name}${unit}.1480 r${name}${unit}135hs18
363 # ln ${name}${unit}.1480 ${name}${unit}96hs18
364 # ln r${name}${unit}.1480 r${name}${unit}96hs18
366 mknod ${name}${unit}.1440 b $blk `expr $unit '*' 64 + 3`
367 mknod r${name}${unit}.1440 c $chr `expr $unit '*' 64 + 3`
368 # ln ${name}${unit}.1440 ${name}${unit}135
369 # ln r${name}${unit}.1440 r${name}${unit}135
370 # ln ${name}${unit}.1440 ${name}${unit}135ds18
371 # ln r${name}${unit}.1440 r${name}${unit}135ds18
372 # ln ${name}${unit}.1440 ${name}${unit}96ds18
373 # ln r${name}${unit}.1440 r${name}${unit}96ds18
375 mknod ${name}${unit}.1200 b $blk `expr $unit '*' 64 + 4`
376 mknod r${name}${unit}.1200 c $chr `expr $unit '*' 64 + 4`
377 # ln ${name}${unit}.1200 ${name}${unit}96
378 # ln r${name}${unit}.1200 r${name}${unit}96
379 # ln ${name}${unit}.1200 ${name}${unit}96ds15
380 # ln r${name}${unit}.1200 r${name}${unit}96ds15
381 # ln ${name}${unit}.1200 ${name}${unit}135ds15
382 # ln r${name}${unit}.1200 r${name}${unit}135ds15
384 mknod ${name}${unit}.820 b $blk `expr $unit '*' 64 + 5`
385 mknod r${name}${unit}.820 c $chr `expr $unit '*' 64 + 5`
386 # ln ${name}${unit}.820 ${name}${unit}96hs10
387 # ln r${name}${unit}.820 r${name}${unit}96hs10
388 # ln ${name}${unit}.820 ${name}${unit}135hs10
389 # ln r${name}${unit}.820 r${name}${unit}135hs10
391 mknod ${name}${unit}.800 b $blk `expr $unit '*' 64 + 6`
392 mknod r${name}${unit}.800 c $chr `expr $unit '*' 64 + 6`
393 # ln ${name}${unit}.800 ${name}${unit}96ds10
394 # ln r${name}${unit}.800 r${name}${unit}96ds10
395 # ln ${name}${unit}.800 ${name}${unit}135ds10
396 # ln r${name}${unit}.800 r${name}${unit}135ds10
398 mknod ${name}${unit}.720 b $blk `expr $unit '*' 64 + 7`
399 mknod r${name}${unit}.720 c $chr `expr $unit '*' 64 + 7`
400 # ln ${name}${unit}.720 ${name}${unit}96ds9
401 # ln r${name}${unit}.720 r${name}${unit}96ds9
402 # ln ${name}${unit}.720 ${name}${unit}135ds9
403 # ln r${name}${unit}.720 r${name}${unit}135ds9
405 mknod ${name}${unit}.360 b $blk `expr $unit '*' 64 + 8`
406 mknod r${name}${unit}.360 c $chr `expr $unit '*' 64 + 8`
407 # ln ${name}${unit}.360 ${name}${unit}48
408 # ln r${name}${unit}.360 r${name}${unit}48
409 # ln ${name}${unit}.360 ${name}${unit}48ds9
410 # ln r${name}${unit}.360 r${name}${unit}48ds9
412 chgrp operator ${name}${unit}* r${name}${unit}*
415 echo bad unit for disk in: $i
423 unit=`expr $i : '..\(.*\)'`
424 name=ft; blk=2; chr=9
427 mknod ${name}${unit} b $blk `expr $unit '*' 64 + 32`
428 mknod r${name}${unit} c $chr `expr $unit '*' 64 + 32`
429 ln ${name}${unit} ${name}${unit}a
430 ln r${name}${unit} r${name}${unit}a
431 chgrp operator ${name}${unit}* r${name}${unit}*
434 echo bad unit for tape in: $i
440 od*|sd*|vn*|wd*|wfd*|fla*)
443 od*) name=od; blk=20; chr=70;;
444 sd*) name=sd; blk=4; chr=13;;
445 vn*) name=vn; blk=15; chr=43;;
446 wd*) name=wd; blk=0; chr=3;;
447 wfd*) name=wfd; blk=1; chr=87;;
448 fla*) name=fla; blk=28; chr=101;;
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 minor=`dkminor 0 $unit 0 0`
467 mknod r${name}${unit}.ctl c $chr $(($minor | $scsictl))
468 chmod 600 r${name}${unit}.ctl
473 echo bad unit for disk in: $i
483 unit=`expr $i : '...\(.*\)'`
485 [0-9]|[0-9][0-9]|[0-4][0-9][0-9]|50[0-9]|51[0-1])
486 for part in 0 1 2 3 4 5 6 7
488 minor=`dkminor 0 $unit 0 $part`
489 partname=`dkitop $part`
490 mknod $name$unit$partname b $blk $minor
491 mknod r$name$unit$partname c $chr $minor
493 chgrp operator ${name}${unit}[a-h] r${name}${unit}[a-h]
496 echo bad unit for disk in: $i
507 unit=`expr $i : 'uk\(.*\)'`
508 mknod uk$unit c 31 $unit
513 unit=`expr $i : 'worm\(.*\)'`
514 if [ "X${unit}" = "X" ]; then
520 mknod ${name}${unit} b $blk ${unit}
521 mknod r${name}${unit} c $chr ${unit}
522 chgrp operator ${name}${unit} r${name}${unit}
524 mknod r${name}${unit}.ctl c $chr `expr $unit + $scsictl `
527 # SCSI processor type driver
531 unit=`expr $i : 'pt\([0-9][0-9]*\)'`
532 if [ "X${unit}" = "X" ]; then
535 unit=`expr $unit + 1 - 1`
536 mknod ${name}${unit} c $chr $unit
537 mknod ${name}${unit}.ctl c $chr `expr $unit + $scsictl `
541 class=`expr $i : 'pty\(.*\)'`
544 1) offset=32 name=q;;
545 2) offset=64 name=r;;
546 3) offset=96 name=s;;
547 # Note that xterm (at least) only look at p-s.
548 4) offset=128 name=P;;
549 5) offset=160 name=Q;;
550 6) offset=192 name=R;;
551 7) offset=224 name=S;;
552 # This still leaves [tuTU].
553 *) echo bad unit for pty in: $i;;
558 eval `echo $offset $name | awk ' { b=0+$1; n=$2 } END { \
559 for (i = 0; i < 32; i++) {
560 c = substr("0123456789abcdefghijklmnopqrstuv", i + 1, 1); \
561 printf("mknod tty%s%s c 5 %d; \
562 mknod pty%s%s c 6 %d;", \
574 unit=`expr $i : '..\(.*\)'`
581 mknod rst${unit}.${mode} c $chr `expr $unit '*' 16 + $mode '*' 4 + 0`
582 mknod nrst${unit}.${mode} c $chr `expr $unit '*' 16 + $mode '*' 4 + 1`
583 mknod erst${unit}.${mode} c $chr `expr $unit '*' 16 + $mode '*' 4 + 2`
584 mknod st${unit}ctl.${mode} c $chr `expr $unit '*' 16 + $mode '*' 4 + 3`
585 chgrp operator rst${unit}.${mode}\
586 nrst${unit}.${mode} \
587 erst${unit}.${mode} \
589 chmod 600 st${unit}ctl.${mode}
591 mknod rst${unit}.ctl c $chr `expr $unit '*' 16 + $scsictl `
592 chmod 600 rst${unit}.ctl
594 ln rst${unit}.0 rst${unit}
595 ln nrst${unit}.0 nrst${unit}
596 ln erst${unit}.0 erst${unit}
599 echo bad unit for tape in: $i
607 unit=`expr $i : '..\(.*\)'`
609 ch*) name=ch; chr=17;;
613 mknod ${name}${unit} c $chr `expr $unit '*' 16 + 0`
614 chgrp operator ${name}${unit}
615 mknod r${name}${unit}.ctl c $chr `expr $unit '*' 16 + $scsictl `
616 chmod 600 r${name}${unit}.ctl
619 echo bad unit for media changer in: $i
628 cd*) unit=`expr $i : '..\(.*\)'`; name=cd; blk=6; chr=15;;
629 mcd*) unit=`expr $i : '...\(.*\)'`; name=mcd; blk=7; chr=29;;
630 scd*) unit=`expr $i : '...\(.*\)'`; name=scd; blk=16; chr=45;;
634 mknod ${name}${unit}a b $blk `expr $unit '*' 8 + 0`
635 mknod ${name}${unit}c b $blk `expr $unit '*' 8 + 2`
636 mknod r${name}${unit}a c $chr `expr $unit '*' 8 + 0`
637 mknod r${name}${unit}c c $chr `expr $unit '*' 8 + 2`
638 chgrp operator ${name}${unit}[a-h] r${name}${unit}[a-h]
641 mknod r${name}${unit}.ctl c $chr `expr $unit '*' 8 + $scsictl `
642 chmod 600 r${name}${unit}.ctl
647 echo bad unit for disk in: $i
656 matcd*) unit=`expr $i : '.....\(.*\)'`; name=matcd; blk=17; chr=46;;
659 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15)
660 mknod ${name}${unit}a b $blk `expr $unit '*' 8 + 0`
661 mknod ${name}${unit}c b $blk `expr $unit '*' 8 + 2`
662 mknod r${name}${unit}a c $chr `expr $unit '*' 8 + 0`
663 mknod r${name}${unit}c c $chr `expr $unit '*' 8 + 2`
664 chgrp operator ${name}${unit}[a-h] r${name}${unit}[a-h]
665 chmod 640 ${name}${unit}[a-h] r${name}${unit}[a-h]
667 mknod ${name}${unit}la b $blk `expr $unit '*' 8 + 128`
668 mknod ${name}${unit}lc b $blk `expr $unit '*' 8 + 130`
669 mknod r${name}${unit}la c $chr `expr $unit '*' 8 + 128`
670 mknod r${name}${unit}lc c $chr `expr $unit '*' 8 + 130`
671 chgrp operator ${name}${unit}l[a-h] r${name}${unit}l[a-h]
672 chmod 640 ${name}${unit}l[a-h] r${name}${unit}l[a-h]
675 echo bad unit for disk in: $i
683 unit=`expr $i : '...\(.*\)'`
688 mknod wcd${unit}a b $blk `expr $unit '*' 8 + 0`
689 mknod rwcd${unit}a c $chr `expr $unit '*' 8 + 0`
690 mknod wcd${unit}c b $blk `expr $unit '*' 8 + 2`
691 mknod rwcd${unit}c c $chr `expr $unit '*' 8 + 2`
692 chgrp operator wcd${unit}[a-h] rwcd${unit}[a-h]
693 chmod 640 wcd${unit}[a-h] rwcd${unit}[a-h]
696 echo bad unit for disk in: $i
703 unit=`expr $i : 'lpt\(.*\)'`
704 mknod lpt$unit c 16 $unit
705 mknod lpctl$unit c 16 `expr $unit + 128`
709 unit=`expr $i : 'tw\(.*\)'`
710 mknod tw$unit c 19 $unit
711 chgrp operator tw$unit
714 # Use this to create virtual consoles for syscons, pcvt or codrv
716 # use as MAKEDEV vtyNN to create NN entries
719 units=`expr $i : 'vty\(.*\)'`
720 eval `echo ${chr} ${units} | awk ' { c=0+$1; n=0+$2 } END {
721 for (i = 0; i < n; i++)
722 printf("mknod ttyv%01x c %d %d;", i, c, i); }'`
723 ln -fs ttyv0 vga # XXX X still needs this pccons relic
727 unit=`expr $i : 'bpf\(.*\)'`
728 mknod bpf$unit c 23 $unit
737 unit=`expr $i : 'cua.*\(.\)$'`
739 mknod cuaa$unit c 28 `expr $m + 128`
740 mknod cuaia$unit c 28 `expr $m + 32 + 128`
741 mknod cuala$unit c 28 `expr $m + 64 + 128`
742 chown uucp.dialer cua*a$unit
747 unit=`expr $i : 'tty.*\(.\)$'`
749 mknod ttyd$unit c 28 $m
750 mknod ttyid$unit c 28 `expr $m + 32`
751 mknod ttyld$unit c 28 `expr $m + 64`
756 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f
757 g h i j k l m n o p q r s t u v"
759 card=`expr $i : 'cua.*\(.\)$'`
760 for unit in $portlist
762 minor=`ttyminor $unit`
763 minor=`expr $card \* 65536 + $minor`
765 mknod cuac$name c $major `expr $minor + 128`
766 mknod cuaic$name c $major `expr $minor + 32 + 128`
767 mknod cualc$name c $major `expr $minor + 64 + 128`
768 chown uucp.dialer cuac$name cuaic$name cualc$name
774 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f
775 g h i j k l m n o p q r s t u v"
777 card=`expr $i : 'tty.*\(.\)$'`
778 for unit in $portlist
780 minor=`ttyminor $unit`
781 minor=`expr $card \* 65536 + $minor`
783 mknod ttyc$name c $major $minor
784 mknod ttyic$name c $major `expr $minor + 32`
785 mknod ttylc$name c $major `expr $minor + 64`
789 # RISCom8 'rc' driver entries
793 unit=`expr $i : 'cua.*\(.\)$'`
795 mknod cuam$unit c 63 `expr $m + 128`
796 chown uucp.dialer cuam$unit
801 unit=`expr $i : 'tty.*\(.\)$'`
803 mknod ttym$unit c 63 $m
807 # Note: these are 'base 1' to match the numbers on the panels, and to match
808 # the manual that comes with the system.
811 nports=`expr $i : 'ttyA\(.*\)$'`
813 while [ $port -le $nports ]; do
814 minor=`expr $port - 1`
815 name=`expr $port + 1000 | cut -c 3-4`
816 mknod ttyA$name c $major $minor
817 mknod ttyiA$name c $major `expr $minor + 65536`
818 mknod ttylA$name c $major `expr $minor + 131072`
819 port=`expr $port + 1`
821 # For the user-mode control program, 'sicontrol'
822 mknod si_control c 68 262144
828 nports=`expr $i : 'cuaA\(.*\)$'`
830 while [ $port -le $nports ]; do
831 minor=`expr $port - 1`
832 name=`expr $port + 1000 | cut -c 3-4`
833 mknod cuaA$name c $major `expr $minor + 128`
834 mknod cuaiA$name c $major `expr $minor + 128 + 65536`
835 mknod cualA$name c $major `expr $minor + 128 + 131072`
836 chown uucp.dialer cuaA$name cuaiA$name cualA$name
837 port=`expr $port + 1`
842 # Digiboard PC/?? 16 port card.
843 # The current scheme of minor numbering is:
845 # unused{14} CARD{2} major{8} CALLOUT{1} LOCK{1} INIT{1} PORT{5}
847 # CARD bitfield in future versions may be extended to 3 bits.
852 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f"
854 card=`expr $i : 'tty.*\(.\)$'`
855 for unit in $portlist
857 minor=`ttyminor $unit`
858 minor=`expr $card \* 65536 + $minor`
860 mknod ttyD$name c $major $minor
861 mknod ttyiD$name c $major `expr $minor + 32`
862 mknod ttylD$name c $major `expr $minor + 64`
868 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f"
870 card=`expr $i : 'cua.*\(.\)$'`
871 for unit in $portlist
873 minor=`ttyminor $unit`
874 minor=`expr $card \* 65536 + $minor`
876 mknod cuaD$name c $major `expr $minor + 128`
877 mknod cuaiD$name c $major `expr $minor + 32 + 128`
878 mknod cualD$name c $major `expr $minor + 64 + 128`
879 chown uucp.dialer cua*D$name
885 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f"
888 card=`expr $i : 'tty.*\(.\)$'`
889 for unit in $modulelist
891 moduleminor=`ttyminor $unit`
892 moduleminor=`expr $moduleminor % 10 \* 16`
895 for unit in $portlist
897 minor=`ttyminor $unit`
898 minor=`expr $card \* 65536 + $minor + $moduleminor`
899 name=$card$modulename$unit
901 mknod ttyM$name c $major $minor
902 mknod ttyiM$name c $major `expr $minor + 64`
903 mknod ttylM$name c $major `expr $minor + 128`
904 chown root.wheel tty*M$name
911 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f"
914 card=`expr $i : 'cua.*\(.\)$'`
915 for unit in $modulelist
917 moduleminor=`ttyminor $unit`
918 moduleminor=`expr $moduleminor % 10 \* 16`
921 for unit in $portlist
923 minor=`ttyminor $unit`
924 minor=`expr $card \* 65536 + $minor + $moduleminor`
925 name=$card$modulename$unit
927 mknod cuaM$name c $major `expr $minor + 262144`
928 mknod cuaiM$name c $major `expr $minor + 64 + 262144`
929 mknod cualM$name c $major `expr $minor + 128 + 262144`
930 chown uucp.dialer cua*M$name
938 BOARD=1; MINOR=65536; Rnum=0
939 MINOR=`expr $BOARD \* 65536`
940 dmesg | grep ^RocketPort[0-4] > /tmp/rp_list
941 controllers=`awk '{print $1}' < /tmp/rp_list`
942 rm -f /dev/ttyR*; rm -f /dev/ttyiR*; rm -f /dev/ttylR*
943 for i in $controllers;do
944 ndevices=`grep ^$i /tmp/rp_list | sed -e 's/.* \([0-9]*\) ports/\1/'`
945 echo -n "Creating $ndevices devices for $i: "
946 for dev in `jot $ndevices 0`;do
947 mknod /dev/ttyR$Rnum c $major $MINOR
948 mknod /dev/ttylR$Rnum c $major `expr $MINOR + 32`
949 mknod /dev/ttyiR$Rnum c $major `expr $MINOR + 64`
950 Rnum=`expr $Rnum + 1`
951 MINOR=`expr $MINOR + 1`
953 BOARD=`expr $BOARD + 1`
954 MINOR=`expr $BOARD \* 65536`
961 BOARD=1; MINOR=65536; Rnum=0
962 MINOR=`expr $BOARD \* 65536`
963 dmesg | grep ^RocketPort[0-4] > /tmp/rp_list
964 controllers=`awk '{print $1}' < /tmp/rp_list`
965 rm -f /dev/cuaR*; rm -f /dev/cuaiR*; rm -f /dev/cualR*
966 for i in $controllers;do
967 ndevices=`grep ^$i /tmp/rp_list | sed -e 's/.* \([0-9]*\) ports/\1/'`
968 echo -n "Creating $ndevices devices for $i: "
969 for dev in `jot $ndevices 0`;do
970 mknod /dev/cuaR$Rnum c $major `expr $MINOR + 128`
971 mknod /dev/cualR$Rnum c $major `expr $MINOR + 128 + 32`
972 mknod /dev/cuaiR$Rnum c $major `expr $MINOR + 128 + 64`
973 Rnum=`expr $Rnum + 1`
974 MINOR=`expr $MINOR + 1`
976 BOARD=`expr $BOARD + 1`
977 MINOR=`expr $BOARD \* 65536`
980 chown uucp.dialer /dev/cuaR*
984 unit=`expr $i : 'mse\(.*\)'`
986 mknod mse$unit c $chr `expr $unit '*' 2 + 1` # non-blocking for X11
990 unit=`expr $i : 'psm\(.*\)'`
992 mknod psm$unit c $chr `expr $unit '*' 2 + 1` # non-blocking for X11
996 name=`expr $i : 'mouse\(.*\)'`
997 if [ ! -c $name ]; then
998 $0 $name # make the appropriate device
1004 mknod pcaudio c 24 0
1005 mknod pcaudioctl c 24 128
1009 mknod socksys c 41 0
1012 chmod 666 socksys nfsd spx
1017 # changes from Linux voxware
1018 # minor Linux FreeBSD
1019 # 8 sequencer2 (aka music0) music0
1020 # 17 patmgr0 sequencer1
1021 # 33 patmgr1 sequencer2
1024 unit=`expr $i : 'snd\(.*\)'`
1027 # XXX write this less verbosely, like std
1028 snd_security_hole=0 # XXX
1029 umask $snd_security_hole
1031 if [ $unit = "0" ] ; then
1032 ln -fs mixer$unit mixer
1033 ln -fs sequencer$unit sequencer
1035 ln -fs audio$unit audio
1036 ln -fs dspW$unit dspW
1037 ln -fs music$unit music
1041 mknod mixer$unit c $chr `expr $unit '*' 16 + 0`
1042 mknod sequencer$unit c $chr `expr $unit '*' 16 + 1`
1043 mknod midi$unit c $chr `expr $unit '*' 16 + 2`
1044 mknod dsp$unit c $chr `expr $unit '*' 16 + 3`
1045 mknod audio$unit c $chr `expr $unit '*' 16 + 4`
1046 mknod dspW$unit c $chr `expr $unit '*' 16 + 5`
1047 mknod sndstat c $chr 6
1048 # minor number 7 is unused
1049 mknod music$unit c $chr `expr $unit '*' 16 + 8`
1050 mknod pss$unit c $chr `expr $unit '*' 16 + 9`
1051 # minor numbers 10-15 are unused
1056 mknod vatio c 25 128
1061 unit=`expr $i : 'gsc\(.*\)'`
1062 mknod gsc${unit} c 47 $unit
1063 mknod gsc${unit}p c 47 $(($unit + 8))
1064 mknod gsc${unit}d c 47 $(($unit + 32))
1065 mknod gsc${unit}pd c 47 $(($unit + 40))
1066 chmod 666 gsc${unit}*
1077 unit=`expr $i : 'card\(.*\)'`
1079 mknod card$unit c $chr $unit
1085 *0) unit=0;; *1) unit=1;; *2) unit=2;; *3) unit=3;;
1086 *4) unit=4;; *5) unit=5;; *6) unit=6;; *7) unit=7;;
1087 *8) unit=8;; *9) unit=9;; *a) unit=10;; *b) unit=11;;
1088 *c) unit=12;; *d) unit=13;; *e) unit=14;; *f) unit=15;;
1091 ttyy?) unit=`expr $unit \+ 16`;;
1092 ttyz?) unit=`expr $unit \+ 32`;;
1099 mknod cronyx c 42 63
1105 chgrp operator joy0 joy1
1115 unit=`expr $i : 'ctx\(.*\)'`
1116 mknod ctx$unit c 40 $unit
1121 unit=`expr $i : 'meteor\(.*\)'`
1122 mknod meteor$unit c 67 $unit
1123 chmod 444 meteor$unit
1127 unit=`expr $i : 'bktr\(.*\)'`
1128 mknod bktr$unit c 92 $unit
1129 mknod tuner$unit c 92 $((16 + $unit ))
1130 chmod 444 bktr$unit tuner$unit
1134 ntun=`expr $i : 'tun\(.*\)$'`
1136 while [ $unit -le $ntun ]; do
1137 mknod tun$unit c 52 $unit
1138 chown uucp.dialer tun$unit
1139 unit=`expr $unit + 1`
1144 mknod sysmouse c 12 128
1145 mknod consolectl c 12 255
1149 unit=`expr $i : 'snp\(.*\)'`
1150 mknod snp$unit c 53 $unit
1153 # dufault@hda.com: If I do much more work on other A-D boards
1154 # then eventually we'll have a "ad" and "dio" interface and some of these
1155 # "labpcaio" ones will be gone.
1156 # labpcaio: D-A and A-D.
1157 # labpcdio: Digital in and Digital out.
1164 unit=`expr $i : 'labpcaio\(.*\)'`
1165 all="0 1 2 3 4 5 6 7"
1170 unit=`expr $i : 'labpcdio\(.*\)'`
1175 die 3 "Don't know LabPC type $i"
1178 if [ "X${unit}" = "X" ]; then
1183 mknod $name$unit c 66 `expr $offset + $unit `
1188 mknod $name$i c 66 `expr $offset + $i `
1192 echo "No such LabPC unit: $unit"
1199 mknod perfmon c 2 32
1207 mknod ipstate c 79 2
1212 umask 0 # XXX should be elsewhere
1218 echo $i - no such device name