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 # fd* "floppy" disk drives (3 1/2", 5 1/4")
42 # cd* "SCSI CD-ROM disks"
43 # mcd* "Mitsumi CD-ROM disks"
44 # scd* "Sony CD-ROM disks"
45 # matcd* "Matsushita (Panasonic) CD-ROM disks"
46 # wcd* "IDE CD-ROM disks"
51 # vty* virtual console devices for syscons/pcvt/codrv
54 # mse* Logitech and ATI Inport bus mouse
56 # sysmouse Mousesystems mouse emulator for syscons
59 # refclock-* serial ports used by xntpd parse refclocks
62 # tty* general purpose serial ports
63 # cua* dialout serial ports
64 # ttyA* Specialix SI/XIO dialin ports ('*' = number of devices)
65 # cuaA* Specialix SI/XIO dialout ports
66 # ttyD* Digiboard - 16 dialin ports
67 # cuaD* Digiboard - 16 dialout ports
70 # pty* set of 32 master and slave pseudo terminals
71 # vty* virtual terminals using syscons/pcvt/codrv console
76 # SCSI devices (other than CD-ROM, tape and disk):
77 # uk* "unknown" device (supports ioctl calls only)
79 # pt* Processor Type (HP scanner, as one example)
81 # PC-CARD (previously called PCMCIA) support
84 # Special purpose devices:
85 # apm Advanced Power Management BIOS
88 # tw* xten power controller
89 # snd* various sound cards
90 # pcaudio PCM audio driver
91 # socksys iBCS2 socket system driver
92 # vat VAT compatibility audio driver (requires snd*)
93 # gsc Genius GS-4500 hand scanner
95 # tun* Tunneling IP device
96 # snp* tty snoop devices
97 # spigot Video Spigot video acquisition card
98 # ctx* Cortex-I video acquisition card
99 # meteor* Matrox Meteor video acquisition card (pci)
100 # bktr* Bt848 based video acquisition card (pci)
101 # qcam* Connectix QuickCam(tm) parallel port camera
103 # labpc* National Instrument's Lab-PC and LAB-PC+
104 # perfmon CPU performance-monitoring counters
105 # pci PCI configuration-space access from user mode
107 # $Id: MAKEDEV,v 1.139 1997/03/10 02:10:58 danny Exp $
110 PATH=/sbin:/bin/:/usr/bin:/usr/sbin:$PATH
113 # Convert integer to partition name
118 0) p=a;; 1) p=b;; 2) p=c;; 3) p=d;; 4) p=e;; 5) p=f;; 6) p=g;; 7) p=h;;
124 # Convert integer to slice name
136 # Convert disk (type, unit, slice, partition) to minor number
139 echo $(($1 << 25 | ($2 / 32) << 21 | ($2 % 32) << 3 | $3 << 16 | $4))
142 # Convert the last character of a tty name to a minor number.
147 a) m=10;; b) m=11;; c) m=12;; d) m=13;; e) m=14;; f) m=15;; g) m=16;;
148 h) m=17;; i) m=18;; j) m=19;; k) m=20;; l) m=21;; m) m=22;; n) m=23;;
149 o) m=24;; p) m=25;; q) m=26;; r) m=27;; s) m=28;; t) m=29;; u) m=30;;
156 # Raw partition for disks
159 # Compatibility slice for disks
162 # Raw slice for disks
165 # Control bit for SCSI
169 disk_umask=037 # allow group operator to read disks
170 tape_umask=017 # allow group operator to read/write tapes
177 sh MAKEDEV std # standard
178 sh MAKEDEV wd0 wd1 wd2 wd3 fd0 fd1 sd0 sd1 sd2 sd3 # bdev, disk
179 sh MAKEDEV cd0 mcd0 scd0 matcd0 wcd0 # bdev, cdrom
180 sh MAKEDEV od0 # bdev, ODD
181 sh MAKEDEV ft0 wt0 st0 # bdev, tape
182 sh MAKEDEV ttyd0 ttyd1 ttyd2 ttyd3 # cdev, serial
183 sh MAKEDEV cuaa0 cuaa1 cuaa2 cuaa3 # cdev, serial
184 sh MAKEDEV lpt0 lpt1 lpt2 # cdev, printer
185 sh MAKEDEV pty0 ch0 tw0 bpf0 # cdev
186 sh MAKEDEV perfmon speaker pcaudio psm0 mse0 sysmouse # cdev
187 sh MAKEDEV vty4 # cdev
188 sh MAKEDEV tun0 # cdev
189 sh MAKEDEV apm card0 card1 # cdev, laptop
192 rm -f console drum mem kmem null random urandom zero io tty klog
193 rm -f stdin stdout stderr lkm pci
194 mknod console c 0 0; chmod 600 console; chown root.wheel console
195 mknod drum c 4 0; chmod 640 drum; chown root.kmem drum
196 mknod kmem c 2 1; chmod 640 kmem; chown root.kmem kmem
197 mknod mem c 2 0; chmod 640 mem; chown root.kmem mem
198 mknod null c 2 2; chmod 666 null; chown root.wheel null
199 mknod random c 2 3; chmod 644 random; chown root.wheel random
200 mknod urandom c 2 4; chmod 644 urandom; chown root.wheel urandom
201 mknod zero c 2 12; chmod 666 zero; chown root.wheel zero
202 mknod io c 2 14; chmod 600 io; chown root.wheel io
203 mknod tty c 1 0; chmod 666 tty; chown root.wheel tty
204 mknod klog c 7 0; chmod 600 klog; chown root.wheel klog
205 mknod stdin c 22 0; chmod 666 stdin; chown root.wheel stdin
206 mknod stdout c 22 1; chmod 666 stdout; chown root.wheel stdout
207 mknod stderr c 22 2; chmod 666 stderr; chown root.wheel stderr
208 mknod lkm c 32 0; chmod 644 lkm; chown root.wheel lkm
209 mknod pci c 78 0; chmod 644 pci; chown root.wheel pci
212 (cd fd && eval `echo "" | awk ' BEGIN { \
213 for (i = 0; i < 64; i++) \
214 printf("mknod %d c 22 %d;", i, i)}'`)
225 mknod timezone c 26 0
228 # Create device files for new Archive/Wangtek QIC-02 tape driver (vak)
231 u=`expr $i : '..\(.*\)'`
232 if [ x$u = x ]; then u=0; fi
233 rm -f r[Ww]t$u nr[Ww]t$u r[Ww]t$u[a-f] nr[Ww]t$u[a-f]
234 mknod rwt${u} c 10 `expr 0 + $u` # default density, 512b blocks
235 mknod nrwt${u} c 10 `expr 4 + $u`
236 # mknod rWt${u} c 10 `expr 64 + $u` # default density, 1024b blocks
237 # mknod nrWt${u} c 10 `expr 68 + $u`
238 mknod rwt${u}b c 10 `expr 16 + $u` # 60 megabytes
239 mknod nrwt${u}b c 10 `expr 20 + $u`
240 mknod rwt${u}c c 10 `expr 24 + $u` # 120 megabytes
241 mknod nrwt${u}c c 10 `expr 28 + $u`
242 mknod rwt${u}d c 10 `expr 32 + $u` # 150 megabytes
243 mknod nrwt${u}d c 10 `expr 36 + $u`
244 # mknod rwt${u}e c 10 `expr 40 + $u` # 300 megabytes?
245 # mknod nrwt${u}e c 10 `expr 44 + $u`
246 # mknod rwt${u}f c 10 `expr 48 + $u` # 600 megabytes?
247 # mknod nrwt${u}f c 10 `expr 52 + $u`
248 chown root.operator r[Ww]t$u nr[Ww]t$u r[Ww]t$u[a-f] nr[Ww]t$u[a-f]
253 od*s*|sd*s*|vn*s*|wd*s*)
256 od*s*) name=od; blk=20; chr=70;;
257 sd*s*) name=sd; blk=4; chr=13;;
258 wd*s*) name=wd; blk=0; chr=3;;
259 vn*s*) name=vn; blk=15; chr=43;;
261 unit=`expr $i : '..\([0-9]*\)s'`
262 slice=`expr $i : '..[0-9]*s\([0-9]*\)'`
263 part=`expr $i : '..[0-9]*s[0-9]*\(.*\)'`
265 [0-9]|[0-9][0-9]|[0-4][0-9][0-9]|50[0-9]|51[0-1])
270 slicename=`dkitos $slice`
271 rm -f $name$unit$slicename* r$name$unit$slicename*
272 minor=`dkminor 0 $unit $slice $dkrawpart`
273 mknod $name$unit$slicename b $blk $minor
274 mknod r$name$unit$slicename c $chr $minor
278 0) slice=$oldslice ;;
280 for part in 0 1 2 3 4 5 6 7
282 minor=`dkminor 0 $unit $slice $part`
283 partname=`dkitop $part`
284 mknod $name$unit$slicename$partname \
286 mknod r$name$unit$slicename$partname \
293 echo bad partition for disk in: $i
296 chgrp operator $name$unit$slicename* \
297 r$name$unit$slicename*
300 echo bad slice for disk in: $i
305 echo bad unit for disk in: $i "(unit=$unit, slice=$slice, part=$part)"
313 unit=`expr $i : '..\(.*\)'`
314 name=fd; blk=2; chr=9
315 rm -f $name$unit* r$name$unit*
318 mknod ${name}${unit} b $blk `expr $unit '*' 64`
319 mknod r${name}${unit} c $chr `expr $unit '*' 64`
320 # Fake BSD partitions
321 for i in a b c d e f g h
323 ln ${name}${unit} ${name}${unit}$i
324 ln r${name}${unit} r${name}${unit}$i
326 # User-readable and programmer-readable name sets
328 mknod ${name}${unit}.1720 b $blk `expr $unit '*' 64 + 1`
329 mknod r${name}${unit}.1720 c $chr `expr $unit '*' 64 + 1`
330 # ln ${name}${unit}.1720 ${name}${unit}135hs21
331 # ln r${name}${unit}.1720 r${name}${unit}135hs21
333 mknod ${name}${unit}.1480 b $blk `expr $unit '*' 64 + 2`
334 mknod r${name}${unit}.1480 c $chr `expr $unit '*' 64 + 2`
335 # ln ${name}${unit}.1480 ${name}${unit}135hs18
336 # ln r${name}${unit}.1480 r${name}${unit}135hs18
337 # ln ${name}${unit}.1480 ${name}${unit}96hs18
338 # ln r${name}${unit}.1480 r${name}${unit}96hs18
340 mknod ${name}${unit}.1440 b $blk `expr $unit '*' 64 + 3`
341 mknod r${name}${unit}.1440 c $chr `expr $unit '*' 64 + 3`
342 # ln ${name}${unit}.1440 ${name}${unit}135
343 # ln r${name}${unit}.1440 r${name}${unit}135
344 # ln ${name}${unit}.1440 ${name}${unit}135ds18
345 # ln r${name}${unit}.1440 r${name}${unit}135ds18
346 # ln ${name}${unit}.1440 ${name}${unit}96ds18
347 # ln r${name}${unit}.1440 r${name}${unit}96ds18
349 mknod ${name}${unit}.1200 b $blk `expr $unit '*' 64 + 4`
350 mknod r${name}${unit}.1200 c $chr `expr $unit '*' 64 + 4`
351 # ln ${name}${unit}.1200 ${name}${unit}96
352 # ln r${name}${unit}.1200 r${name}${unit}96
353 # ln ${name}${unit}.1200 ${name}${unit}96ds15
354 # ln r${name}${unit}.1200 r${name}${unit}96ds15
355 # ln ${name}${unit}.1200 ${name}${unit}135ds15
356 # ln r${name}${unit}.1200 r${name}${unit}135ds15
358 mknod ${name}${unit}.820 b $blk `expr $unit '*' 64 + 5`
359 mknod r${name}${unit}.820 c $chr `expr $unit '*' 64 + 5`
360 # ln ${name}${unit}.820 ${name}${unit}96hs10
361 # ln r${name}${unit}.820 r${name}${unit}96hs10
362 # ln ${name}${unit}.820 ${name}${unit}135hs10
363 # ln r${name}${unit}.820 r${name}${unit}135hs10
365 mknod ${name}${unit}.800 b $blk `expr $unit '*' 64 + 6`
366 mknod r${name}${unit}.800 c $chr `expr $unit '*' 64 + 6`
367 # ln ${name}${unit}.800 ${name}${unit}96ds10
368 # ln r${name}${unit}.800 r${name}${unit}96ds10
369 # ln ${name}${unit}.800 ${name}${unit}135ds10
370 # ln r${name}${unit}.800 r${name}${unit}135ds10
372 mknod ${name}${unit}.720 b $blk `expr $unit '*' 64 + 7`
373 mknod r${name}${unit}.720 c $chr `expr $unit '*' 64 + 7`
374 # ln ${name}${unit}.720 ${name}${unit}96ds9
375 # ln r${name}${unit}.720 r${name}${unit}96ds9
376 # ln ${name}${unit}.720 ${name}${unit}135ds9
377 # ln r${name}${unit}.720 r${name}${unit}135ds9
379 mknod ${name}${unit}.360 b $blk `expr $unit '*' 64 + 8`
380 mknod r${name}${unit}.360 c $chr `expr $unit '*' 64 + 8`
381 # ln ${name}${unit}.360 ${name}${unit}48
382 # ln r${name}${unit}.360 r${name}${unit}48
383 # ln ${name}${unit}.360 ${name}${unit}48ds9
384 # ln r${name}${unit}.360 r${name}${unit}48ds9
386 chgrp operator ${name}${unit}* r${name}${unit}*
389 echo bad unit for disk in: $i
397 unit=`expr $i : '..\(.*\)'`
398 name=ft; blk=2; chr=9
399 rm -f $name$unit* r$name$unit*
402 mknod ${name}${unit} b $blk `expr $unit '*' 64 + 32`
403 mknod r${name}${unit} c $chr `expr $unit '*' 64 + 32`
404 ln ${name}${unit} ${name}${unit}a
405 ln r${name}${unit} r${name}${unit}a
406 chgrp operator ${name}${unit}* r${name}${unit}*
409 echo bad unit for tape in: $i
418 od*) name=od; blk=20; chr=70;;
419 sd*) name=sd; blk=4; chr=13;;
420 vn*) name=vn; blk=15; chr=43;;
421 wd*) name=wd; blk=0; chr=3;;
423 unit=`expr $i : '..\(.*\)'`
425 [0-9]|[0-9][0-9]|[0-4][0-9][0-9]|50[0-9]|51[0-1])
426 for slicepartname in s0h s1 s2 s3 s4
428 sh MAKEDEV $name$unit$slicepartname
432 rm -f r${name}${unit}.ctl
433 minor=`dkminor 0 $unit 0 0`
434 mknod r${name}${unit}.ctl c $chr $(($minor | $scsictl))
435 chmod 600 r${name}${unit}.ctl
440 echo bad unit for disk in: $i
450 unit=`expr $i : '...\(.*\)'`
452 [0-9]|[0-9][0-9]|[0-4][0-9][0-9]|50[0-9]|51[0-1])
453 rm -f r${name}${unit}.ctl
454 minor=`dkminor 0 $unit 0 0`
455 mknod r${name}${unit}.ctl c $chr $(($minor | $scsictl))
456 chmod 600 r${name}${unit}.ctl
457 for part in 0 1 2 3 4 5 6 7
459 minor=`dkminor 0 $unit 0 $part`
460 partname=`dkitop $part`
461 mknod $name$unit$partname \
463 mknod r$name$unit$partname \
468 echo bad unit for disk in: $i
475 unit=`expr $i : 'uk\(.*\)'`
477 mknod uk$unit c 31 $unit
482 unit=`expr $i : 'worm\(.*\)'`
483 if [ "X${unit}" = "X" ]; then
490 mknod ${name}${unit} b $blk ${unit}
491 rm -f r${name}${unit}
492 mknod r${name}${unit} c $chr ${unit}
493 chgrp operator ${name}${unit} r${name}${unit}
495 rm -f r${name}${unit}.ctl
496 mknod r${name}${unit}.ctl c $chr `expr $unit + $scsictl `
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`
509 mknod ${name}${unit} c $chr $unit
510 rm -f ${name}${unit}.ctl
511 mknod ${name}${unit}.ctl c $chr `expr $unit + $scsictl `
515 class=`expr $i : 'pty\(.*\)'`
518 1) offset=32 name=q;;
519 2) offset=64 name=r;;
520 3) offset=96 name=s;;
521 # Note that xterm (at least) only look at p-s.
522 4) offset=128 name=P;;
523 5) offset=160 name=Q;;
524 6) offset=192 name=R;;
525 7) offset=224 name=S;;
526 # This still leaves [tuTU].
527 *) echo bad unit for pty in: $i;;
532 eval `echo $offset $name | awk ' { b=$1; n=$2 } END { \
533 for (i = 0; i < 32; i++) {
534 c = substr("0123456789abcdefghijklmnopqrstuv", i + 1, 1); \
535 printf("rm -f tty%s%s pty%s%s; \
536 mknod tty%s%s c 5 %d; \
537 mknod pty%s%s c 6 %d; \
538 chown root.wheel tty%s%s pty%s%s;", \
552 unit=`expr $i : '..\(.*\)'`
555 #remove old stype names
556 rm -f [hml]rst[0123456] [hml][en]rst[0123456] [hml]enrst[0123456]
557 #remove new style names
558 rm -f rst${unit} [en]rst${unit} enrst${unit}
559 rm -f rst${unit}.[0123] nrst${unit}.[0123]\
560 erst${unit}.[0123] st${unit}ctl.[0123]
561 #remove control device
567 mknod rst${unit}.${mode} c $chr `expr $unit '*' 16 + $mode '*' 4 + 0`
568 mknod nrst${unit}.${mode} c $chr `expr $unit '*' 16 + $mode '*' 4 + 1`
569 mknod erst${unit}.${mode} c $chr `expr $unit '*' 16 + $mode '*' 4 + 2`
570 mknod st${unit}ctl.${mode} c $chr `expr $unit '*' 16 + $mode '*' 4 + 3`
571 chgrp operator rst${unit}.${mode}\
572 nrst${unit}.${mode} \
573 erst${unit}.${mode} \
575 chmod 600 st${unit}ctl.${mode}
578 mknod rst${unit}.ctl c $chr `expr $unit '*' 16 + $scsictl `
579 chmod 600 rst${unit}.ctl
581 ln rst${unit}.0 rst${unit}
582 ln nrst${unit}.0 nrst${unit}
583 ln erst${unit}.0 erst${unit}
586 echo bad unit for tape in: $i
594 unit=`expr $i : '..\(.*\)'`
596 ch*) name=ch; chr=17;;
601 mknod ${name}${unit} c $chr `expr $unit '*' 16 + 0`
602 chgrp operator ${name}${unit}
603 rm -f r${name}${unit}.ctl
604 mknod r${name}${unit}.ctl c $chr `expr $unit '*' 16 + $scsictl `
605 chmod 600 r${name}${unit}.ctl
608 echo bad unit for media changer in: $i
617 cd*) unit=`expr $i : '..\(.*\)'`; name=cd; blk=6; chr=15;;
618 mcd*) unit=`expr $i : '...\(.*\)'`; name=mcd; blk=7; chr=29;;
619 scd*) unit=`expr $i : '...\(.*\)'`; name=scd; blk=16; chr=45;;
621 rm -f $name$unit? r$name$unit?
624 mknod ${name}${unit}a b $blk `expr $unit '*' 8 + 0`
625 mknod ${name}${unit}c b $blk `expr $unit '*' 8 + 2`
626 mknod r${name}${unit}a c $chr `expr $unit '*' 8 + 0`
627 mknod r${name}${unit}c c $chr `expr $unit '*' 8 + 2`
628 chgrp operator ${name}${unit}[a-h] r${name}${unit}[a-h]
631 rm -f r${name}${unit}.ctl
632 mknod r${name}${unit}.ctl c $chr `expr $unit '*' 8 + $scsictl `
633 chmod 600 r${name}${unit}.ctl
638 echo bad unit for disk in: $i
647 matcd*) unit=`expr $i : '.....\(.*\)'`; name=matcd; blk=17; chr=46;;
649 rm -f $name$unit? r$name$unit? $name$unit?? r$name$unit??
651 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15)
652 mknod ${name}${unit}a b $blk `expr $unit '*' 8 + 0`
653 mknod ${name}${unit}c b $blk `expr $unit '*' 8 + 2`
654 mknod r${name}${unit}a c $chr `expr $unit '*' 8 + 0`
655 mknod r${name}${unit}c c $chr `expr $unit '*' 8 + 2`
656 chgrp operator ${name}${unit}[a-h] r${name}${unit}[a-h]
657 chmod 640 ${name}${unit}[a-h] r${name}${unit}[a-h]
659 mknod ${name}${unit}la b $blk `expr $unit '*' 8 + 128`
660 mknod ${name}${unit}lc b $blk `expr $unit '*' 8 + 130`
661 mknod r${name}${unit}la c $chr `expr $unit '*' 8 + 128`
662 mknod r${name}${unit}lc c $chr `expr $unit '*' 8 + 130`
663 chgrp operator ${name}${unit}l[a-h] r${name}${unit}l[a-h]
664 chmod 640 ${name}${unit}l[a-h] r${name}${unit}l[a-h]
667 echo bad unit for disk in: $i
675 unit=`expr $i : '...\(.*\)'`
678 rm -f wcd$unit? rwcd$unit?
681 mknod wcd${unit}a b $blk `expr $unit '*' 8 + 0`
682 mknod rwcd${unit}a c $chr `expr $unit '*' 8 + 0`
683 mknod wcd${unit}c b $blk `expr $unit '*' 8 + 2`
684 mknod rwcd${unit}c c $chr `expr $unit '*' 8 + 2`
685 chgrp operator wcd${unit}[a-h] rwcd${unit}[a-h]
686 chmod 640 wcd${unit}[a-h] rwcd${unit}[a-h]
689 echo bad unit for disk in: $i
696 unit=`expr $i : 'lpt\(.*\)'`
699 mknod lpt$unit c 16 $unit
700 mknod lpctl$unit c 16 `expr $unit + 128`
701 chown root.wheel lpt$unit
702 chown root.wheel lpctl$unit
706 unit=`expr $i : 'tw\(.*\)'`
708 mknod tw$unit c 19 $unit
709 chown root.operator tw$unit
712 # Use this to create virtual consoles for syscons, pcvt or codrv
714 # use as MAKEDEV vtyNN to create NN entries
717 units=`expr $i : 'vty\(.*\)'`
718 eval `echo ${chr} ${units} | awk ' { c=$1; n=$2 } END {
719 for (i = 0; i < n; i++)
720 printf("rm -f ttyv%01x; mknod ttyv%01x c %d %d; \
721 chown root.wheel ttyv%01x;", \
723 ln -fs ttyv0 vga # XXX X still needs this pccons relic
727 unit=`expr $i : 'bpf\(.*\)'`
729 mknod bpf$unit c 23 $unit
730 chown root.wheel bpf$unit
736 chown root.wheel speaker
741 unit=`expr $i : 'cua.*\(.\)$'`
744 mknod cuaa$unit c 28 `expr $m + 128`
745 mknod cuaia$unit c 28 `expr $m + 32 + 128`
746 mknod cuala$unit c 28 `expr $m + 64 + 128`
747 chown uucp.dialer cua*a$unit
752 unit=`expr $i : 'tty.*\(.\)$'`
755 mknod ttyd$unit c 28 $m
756 mknod ttyid$unit c 28 `expr $m + 32`
757 mknod ttyld$unit c 28 `expr $m + 64`
758 chown root.wheel tty*d$unit
763 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f
764 g h i j k l m n o p q r s t u v"
766 card=`expr $i : 'cua.*\(.\)$'`
767 for unit in $portlist
769 minor=`ttyminor $unit`
770 minor=`expr $card \* 65536 + $minor`
772 rm -f cuac$name cuaic$name cualc$name
773 mknod cuac$name c $major `expr $minor + 128`
774 mknod cuaic$name c $major `expr $minor + 32 + 128`
775 mknod cualc$name c $major `expr $minor + 64 + 128`
776 chown uucp.dialer cuac$name cuaic$name cualc$name
782 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f
783 g h i j k l m n o p q r s t u v"
785 card=`expr $i : 'tty.*\(.\)$'`
786 for unit in $portlist
788 minor=`ttyminor $unit`
789 minor=`expr $card \* 65536 + $minor`
791 rm -f ttyc$name ttyic$name ttylc$name
792 mknod ttyc$name c $major $minor
793 mknod ttyic$name c $major `expr $minor + 32`
794 mknod ttylc$name c $major `expr $minor + 64`
795 chown root.wheel ttyc$name ttyic$name ttylc$name
799 # RISCom8 'rc' driver entries
803 unit=`expr $i : 'cua.*\(.\)$'`
806 mknod cuam$unit c 63 `expr $m + 128`
807 chown uucp.dialer cuam$unit
812 unit=`expr $i : 'tty.*\(.\)$'`
815 mknod ttym$unit c 63 $m
816 chown root.wheel ttym$unit
820 # Note: these are 'base 1' to match the numbers on the panels, and to match
821 # the manual that comes with the system.
824 nports=`expr $i : 'ttyA\(.*\)$'`
826 while [ $port -le $nports ]; do
827 minor=`expr $port - 1`
828 name=`expr $port + 1000 | cut -c 3-4`
830 mknod ttyA$name c $major $minor
831 chown root.wheel ttyA$name
832 mknod ttyiA$name c $major `expr $minor + 65536`
833 chown root.wheel ttyiA$name
834 mknod ttylA$name c $major `expr $minor + 131072`
835 chown root.wheel ttylA$name
836 port=`expr $port + 1`
838 # For the user-mode control program, 'sicontrol'
840 mknod si_control c 68 262144
842 chown root.wheel si_control
848 nports=`expr $i : 'cuaA\(.*\)$'`
850 while [ $port -le $nports ]; do
851 minor=`expr $port - 1`
852 name=`expr $port + 1000 | cut -c 3-4`
854 mknod cuaA$name c $major `expr $minor + 128`
855 chown uucp.dialer cuaA$name
856 port=`expr $port + 1`
861 # Digiboard PC/?? 16 port card.
862 # The current scheme of minor numbering is:
864 # unused{14} CARD{2} major{8} CALLOUT{1} LOCK{1} INIT{1} PORT{5}
866 # CARD bitfield in future versions may be extended to 3 bits.
871 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f"
873 card=`expr $i : 'tty.*\(.\)$'`
874 for unit in $portlist
876 minor=`ttyminor $unit`
877 minor=`expr $card \* 65536 + $minor`
880 mknod ttyD$name c $major $minor
881 mknod ttyiD$name c $major `expr $minor + 32`
882 mknod ttylD$name c $major `expr $minor + 64`
883 chown root.wheel tty*D$name
889 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f"
891 card=`expr $i : 'cua.*\(.\)$'`
892 for unit in $portlist
894 minor=`ttyminor $unit`
895 minor=`expr $card \* 65536 + $minor`
898 mknod cuaD$name c $major `expr $minor + 128`
899 mknod cuaiD$name c $major `expr $minor + 32 + 128`
900 mknod cualD$name c $major `expr $minor + 64 + 128`
901 chown uucp.dialer cua*D$name
907 unit=`expr $i : 'mse\(.*\)'`
910 mknod mse$unit c $chr `expr $unit '*' 2 + 1` # non-blocking for X11
911 chown root.wheel mse$unit
915 unit=`expr $i : 'psm\(.*\)'`
918 mknod psm$unit c $chr `expr $unit '*' 2 + 1` # non-blocking for X11
919 chown root.wheel psm$unit
923 name=`expr $i : 'mouse\(.*\)'`
924 if [ ! -c $name ]; then
925 $0 $name # make the appropriate device
932 rm -f pcaudio pcaudioctl
934 mknod pcaudioctl c 24 128
935 chown root.wheel pcaudio pcaudioctl
939 rm -f socksys nfsd spx
943 chown root.wheel socksys nfsd spx
944 chmod 666 socksys nfsd spx
949 # changes from Linux voxware
950 # minor Linux FreeBSD
951 # 8 sequencer2 (aka music0) music0
952 # 17 patmgr0 sequencer1
953 # 33 patmgr1 sequencer2
956 unit=`expr $i : 'snd\(.*\)'`
959 # XXX write this less verbosely, like std
960 snd_security_hole=0 # XXX
961 umask $snd_security_hole
963 if [ $unit = "0" ] ; then
964 rm -f mixer ; ln -s mixer$unit mixer
965 rm -f sequencer ; ln -s sequencer$unit sequencer
966 rm -f dsp ; ln -s dsp$unit dsp
967 rm -f audio ; ln -s audio$unit audio
968 rm -f dspW ; ln -s dspW$unit dspW
969 rm -f music ; ln -s music$unit music
970 rm -f pss ; ln -s pss$unit pss
973 rm -f mixer$unit # Mixer [ Control ]
974 mknod mixer$unit c $chr `expr $unit '*' 16 + 0`
976 rm -f sequencer$unit # Sequencer [ FM Synth and MIDI output ]
977 mknod sequencer$unit c $chr `expr $unit '*' 16 + 1`
979 rm -f midi midi$unit # Midi 0
980 mknod midi$unit c $chr `expr $unit '*' 16 + 2`
982 rm -f dsp$unit # DSP [ Digitized voice ]
983 mknod dsp$unit c $chr `expr $unit '*' 16 + 3`
985 rm -f audio$unit # SPARC audio [ Not fully implemented ]
986 mknod audio$unit c $chr `expr $unit '*' 16 + 4`
988 rm -f dspW$unit # Wide DSP (each sample is 16 bits)
989 mknod dspW$unit c $chr `expr $unit '*' 16 + 5`
991 rm -f sndstat # Status Device [ Debugging interface, only 1 ]
992 mknod sndstat c $chr 6
994 # minor number 7 is unused
996 rm -f music$unit # Sequencer level 2
997 mknod music$unit c $chr `expr $unit '*' 16 + 8`
999 rm -f pss$unit # PSS and programmable devices
1000 mknod pss$unit c $chr `expr $unit '*' 16 + 9`
1002 # minor numbers 10-15 are unused
1008 mknod vatio c 25 128
1009 chown root.wheel vatio
1014 unit=`expr $i : 'gsc\(.*\)'`
1016 mknod gsc${unit} c 47 $unit
1017 mknod gsc${unit}p c 47 $(($unit + 8))
1018 mknod gsc${unit}d c 47 $(($unit + 32))
1019 mknod gsc${unit}pd c 47 $(($unit + 40))
1020 chmod 666 gsc${unit}*
1021 chown root.wheel gsc${unit}*
1028 chown root.operator apm
1033 unit=`expr $i : 'card\(.*\)'`
1036 mknod card$unit c $chr $unit
1038 chown root.wheel card$unit
1043 *0) unit=0;; *1) unit=1;; *2) unit=2;; *3) unit=3;;
1044 *4) unit=4;; *5) unit=5;; *6) unit=6;; *7) unit=7;;
1045 *8) unit=8;; *9) unit=9;; *a) unit=10;; *b) unit=11;;
1046 *c) unit=12;; *d) unit=13;; *e) unit=14;; *f) unit=15;;
1049 ttyy?) unit=`expr $unit \+ 16`;;
1050 ttyz?) unit=`expr $unit \+ 32`;;
1059 mknod cronyx c 42 63
1060 chown root.wheel cronyx
1067 chown root.operator joy0 joy1
1078 unit=`expr $i : 'ctx\(.*\)'`
1080 mknod ctx$unit c 40 $unit
1085 unit=`expr $i : 'qcam\(.*\)'`
1087 mknod qcam$unit c 73 $unit
1092 unit=`expr $i : 'meteor\(.*\)'`
1094 mknod meteor$unit c 67 $unit
1095 chown root.wheel meteor$unit
1096 chmod 444 meteor$unit
1100 unit=`expr $i : 'bktr\(.*\)'`
1101 rm -f bktr$unit tuner$unit
1102 mknod bktr$unit c 79 $unit
1103 mknod tuner$unit c 79 $((16 + $unit ))
1104 chown root.wheel bktr$unit tuner$unit
1105 chmod 444 bktr$unit tuner$unit
1109 ntun=`expr $i : 'tun\(.*\)$'`
1111 while [ $unit -le $ntun ]; do
1113 mknod tun$unit c 52 $unit
1114 chown uucp.dialer tun$unit
1115 unit=`expr $unit + 1`
1120 rm -f sysmouse consolectl
1121 mknod sysmouse c 12 128
1122 mknod consolectl c 12 255
1123 chown root.wheel sysmouse consolectl
1127 unit=`expr $i : 'snp\(.*\)'`
1129 mknod snp$unit c 53 $unit
1130 chown root.wheel snp$unit
1133 # Valid arguments to isdn:
1134 # none makes all the node but nic0
1135 # 5000 makes nic0 for Niccy 5000
1136 # 3008 makes nic0 for Niccy 3008
1137 # 3009 makes nic0 for Niccy 3009
1138 # 1000 makes nodes for Niccy 1000
1139 # tel* makes nodes for TELES S0
1142 type=`expr $i : 'isdn\(.*\)'`
1143 if [ "X${type}" = "X" ]; then
1147 rm -f nic0 snic0 n?ic0 isdn isdn? ity?? itel?? ispy
1148 mknod n8ic0 c $unit 0
1149 mknod snic0 c `expr $unit + 4` 0
1150 mknod n9ic0 c `expr $unit + 6` 0
1151 mknod isdn c `expr $unit + 1` 0
1152 mknod isdn1 c `expr $unit + 1` 1
1153 mknod isdn2 c `expr $unit + 1` 2
1154 mknod ity00 c `expr $unit + 2` 0
1155 mknod ity01 c `expr $unit + 2` 1
1156 mknod ityo0 c `expr $unit + 2` 130
1157 mknod ityo1 c `expr $unit + 2` 131
1158 mknod itel00 c `expr $unit + 3` 0
1159 mknod itel01 c `expr $unit + 3` 1
1160 mknod ispy c `expr $unit + 5` 0
1161 chown root.wheel n8ic0 n9ic0 snic0 isdn isdn? ity?? itel?? ispy
1162 chown uucp.wheel ityo[01]
1166 chown root.wheel nic0
1170 chown root.wheel nic0
1174 chown root.wheel nic0
1176 1000|tel*|TEL*|none)
1179 echo "No such ISDN device subtype: $type"
1184 # dufault@hda.com: If I do much more work on other A-D boards
1185 # then eventually we'll have a "ad" and "dio" interface and some of these
1186 # "labpcaio" ones will be gone.
1187 # labpcaio: D-A and A-D.
1188 # labpcdio: Digital in and Digital out.
1195 unit=`expr $i : 'labpcaio\(.*\)'`
1196 all="0 1 2 3 4 5 6 7"
1201 unit=`expr $i : 'labpcdio\(.*\)'`
1206 echo "Don't understand that labpc name"
1210 if [ "X${unit}" = "X" ]; then
1216 mknod $name$unit c 66 `expr $offset + $unit `
1222 mknod $name$i c 66 `expr $offset + $i `
1226 echo "No such LabPC unit: $unit"
1234 mknod perfmon c 2 32
1235 chown root.kmem perfmon
1240 umask 0 # XXX should be elsewhere
1246 echo $i - no such device name