- Add an entry for iwl(4)
[dragonfly.git] / etc / MAKEDEV
blob32e160f9c398219a3eac988dfc8d7777564d079f
1 #!/bin/sh -
3 # Copyright (c) 1990 The Regents of the University of California.
4 # All rights reserved.
6 # Written and contributed by W. Jolitz 12/90
8 # Redistribution and use in source and binary forms are permitted provided
9 # that: (1) source distributions retain this entire copyright notice and
10 # comment, and (2) distributions including binaries display the following
11 # acknowledgement: ``This product includes software developed by the
12 # University of California, Berkeley and its contributors'' in the
13 # documentation or other materials provided with the distribution and in
14 # all advertising materials mentioning features or use of this software.
15 # Neither the name of the University nor the names of its contributors may
16 # be used to endorse or promote products derived from this software without
17 # specific prior written permission.
18 # THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
19 # WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
20 # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
22 # @(#)MAKEDEV 5.2 (Berkeley) 6/22/90
23 # $FreeBSD: src/etc/MAKEDEV,v 1.243.2.57 2003/02/10 11:35:53 simokawa Exp $
24 # $DragonFly: src/etc/MAKEDEV,v 1.39 2008/02/17 19:51:53 swildner Exp $
26 # Device "make" file. Valid arguments:
27 # all makes all known devices, standard number of units (or close)
28 # std standard devices
29 # jail suitable for a jail(8)
30 # local configuration specific devices
31 # mach-4 mach4&lites+devices for Mach's XFree86 distribution
32 # (see http://www.cs.hut.fi/lites.html for more info on LITES)
34 # Tapes:
35 # ast* ATAPI tape drives
36 # wt* QIC-interfaced (e.g. not SCSI) 3M cartridge tape
37 # sa* SCSI Sequential Access Devices
39 # Disks:
40 # aac* Adaptec FSA RAID controllers
41 # aacd* Adaptec FSA RAID
42 # acd* ATAPI CD-ROM disks
43 # ad* ATA disks
44 # afd* ATAPI floppy disks
45 # amrd* AMI MegaRAID
46 # ccd* CCD disks
47 # cd* SCSI CD-ROM disks
48 # da* SCSI Direct Access Devices
49 # fd* floppy disk drives (3 1/2", 5 1/4")
50 # idad* Compaq Smart-2 RAID arrays
51 # ips* IBM ServeRAID controller
52 # ipsd* IBM ServeRAID
53 # md* Memory (or malloc) disk
54 # mlx* Mylex DAC960 RAID controllers
55 # mlxd* Mylex DAC960 RAID disk volumes
56 # pst* Promise SuperTrak RAID disks
57 # vn* vnode disks
58 # vkd* virtual kernel disk
60 # Console ports:
61 # vty* virtual console devices for syscons
63 # Pointing devices:
64 # mse* Logitech and ATI Inport bus mouse
65 # psm* PS/2 mouse
66 # jogdial Sony VAIO Jogdial
67 # sysmouse Mousesystems mouse emulator for syscons
69 # Terminal ports:
70 # tty* general purpose serial ports
71 # cua* dialout serial ports
72 # ttyA* Specialix SI/XIO dialin ports ('*' = number of devices)
73 # cuaA* Specialix SI/XIO dialout ports
74 # ttyD* Digiboard - 16 dialin ports
75 # cuaD* Digiboard - 16 dialout ports
76 # ttyE* Stallion EasyIO (stl) dialin ports
77 # cuaE* Stallion EasyIO (stl) dialout ports
78 # ttyF* Stallion Brumby (stli) dialin ports
79 # cuaF* Stallion Brumby (stli) dialout ports
80 # ttyR* Rocketport dialin ports
81 # cuaR* Rocketport dialout ports
83 # stlN Stallion EasyIO board N dialin and dialout
84 # stliN Stallion Brumby board N dialin and dialout
86 # Pseudo terminals:
87 # pty* set of 32 master and slave pseudo terminals
88 # vty* virtual terminals using syscons console
90 # Parallel port:
91 # lpt* Printer
92 # ppi* Parallel port i/o
93 # pps* Pulse per second timing interface
94 # pcfclock* Parallel time sync interface
96 # I2C and SMBus:
97 # iic* I2C devices
98 # smb* SMBUS devices
100 # USB devices:
101 # usb* USB bus control device
102 # ucom* USB serial devices
103 # ugen* generic USB device
104 # uhid* Human Interface Device (HID)
105 # ulpt* printer
106 # umodem* modems
107 # ums* mouse
108 # urio* Diamond Rio 500
109 # uscanner* USB scanners
111 # SCSI devices (other than CD-ROM, tape and disk):
112 # ch* SCSI Media-Changer (juke box) driver
113 # pt* Processor Type (HP scanner, as one example)
114 # pass* CAM Passthrough device
115 # ses* SES (SCSI Environmental Services) and
116 # SAF-TE (Scsi Accessable Fault-Tolerant Enclosures) device
118 # PC-CARD (previously called PCMCIA) support
119 # card* PC-CARD slots
121 # ISDN devices:
122 # i4b isdnd call control device
123 # i4bctl debugging control device
124 # i4btrc* trace data interface(s), one per passive card
125 # i4btel* telephony interface(s)
126 # i4bteld* telephony dialout interface(s)
127 # i4brbch* raw b channel access device(s)
129 # Special purpose devices:
130 # acpi ACPI control device
131 # apm Advanced Power Management BIOS
132 # apmctl APM BIOS control device
133 # bpf* packet filter
134 # crypto crypto interface
135 # speaker pc speaker
136 # tw* xten power controller
137 # snd* various sound cards
138 # pcaudio PCM audio driver
139 # socksys iBCS2 socket system driver
140 # vat VAT compatibility audio driver (requires snd*)
141 # gsc Genius GS-4500 hand scanner
142 # joy pc joystick
143 # tun* Tunneling IP device
144 # tap* Ethernet Tunneling device
145 # snp* tty snoop devices
146 # spigot Video Spigot video acquisition card
147 # ctx* Cortex-I video acquisition card
148 # meteor* Matrox Meteor video acquisition card (pci)
149 # bktr* Bt848 based video acquisition card (pci)
150 # labpc* National Instrument's Lab-PC and LAB-PC+
151 # perfmon CPU performance-monitoring counters
152 # pci PCI configuration-space access from user mode
153 # ipl ipfilter control devices (ipl, ipnat, ipstate, ipauth)
154 # kbd keyboard devices
155 # elan-mmcr AMD Elan support (e.g. mmap MMCR)
156 # agpgart AGP interface
157 # nsmb* SMB/CIFS protocol interface
158 # pf PF packet filter
160 ##############################################################################
162 # To override the default ownership and/or permissions, you now have the
163 # /etc/devices.conf file (create it if it's not there). Entries in this file
164 # should look like:
166 # ad0s1c root:staff 666 # Override ad0s1c
167 # ad0* root:wheel 641 # Override the entire ad0 family
168 # sa0.ctl heinz:ketchup 444 # Override device control node
169 # sa*.ctl heinz:ketchup 666 # Override all sa* control nodes
170 # fd/4 ihate:floppies 000 # Override /dev/fd/4
172 # See the devices.conf(5) man page for further information.
174 # J.Anslik (joerg@anslik.de)
176 ##############################################################################
180 #-----------------------------------------------------------------------------
181 # Where all device special files are built.
182 #-----------------------------------------------------------------------------
184 DEVDIR=dev
187 #-----------------------------------------------------------------------------
188 # File containing local ownership and permissions override entries.
189 #-----------------------------------------------------------------------------
191 DEVPERMS_LOCAL="/etc/devices.conf"
194 #-----------------------------------------------------------------------------
195 # Some useful programs.
196 #-----------------------------------------------------------------------------
198 cut=/usr/bin/cut
199 grep=/usr/bin/grep
200 mknod=/sbin/mknod
201 sed=/usr/bin/sed
202 tr=/usr/bin/tr
205 #-----------------------------------------------------------------------------
206 # Set up a default search path.
207 #-----------------------------------------------------------------------------
209 if [ -n "$MAKEDEVPATH" ]
210 then
211 PATH="$MAKEDEVPATH"
212 else
213 PATH=/sbin:/bin
217 #-----------------------------------------------------------------------------
218 # Print error message $2 and exit this script, returning $1.
219 #-----------------------------------------------------------------------------
221 die()
223 echo $2
225 exit $1
229 #-----------------------------------------------------------------------------
230 # Convert integer to partition name.
231 #-----------------------------------------------------------------------------
233 dkitop()
235 local p
237 case $1 in
238 0) p=a;; 1) p=b;; 2) p=c;; 3) p=d;;
239 4) p=e;; 5) p=f;; 6) p=g;; 7) p=h;;
240 8) p=i;; 9) p=j;; 10) p=k;; 11) p=l;;
241 12) p=m;; 13) p=n;; 14) p=o;; 15) p=p;;
242 *) p="?";;
243 esac
245 echo $p
249 #-----------------------------------------------------------------------------
250 # Convert integer to slice name.
251 #-----------------------------------------------------------------------------
253 dkitos()
255 local s
257 case $1 in
258 0) s="s0" ;;
259 1) s="" ;;
260 *) s=s$(($1-1)) ;;
261 esac
263 echo $s
266 #-----------------------------------------------------------------------------
267 # Convert unit, slice, partition to minor number.
268 #-----------------------------------------------------------------------------
270 # ndkminor(unit, slice, partition)
272 ndkminor()
274 echo $(( (($1 & 31) << 3) | (($1 & 480) << 16) | \
275 (($2 & 15) << 16) | (($2 & 112) << 25) | \
276 ($3 & 7) | (($3 & 8) << 17) | (($3 & 240) << 21) ))
280 #-----------------------------------------------------------------------------
281 # Create the device node.
282 #-----------------------------------------------------------------------------
284 mknod() {
286 local dev=$1
287 local unit=$2
289 #---------------------------------------------------------------------
290 # Remove old device node, if any.
291 #---------------------------------------------------------------------
293 rm -f "$dev$unit" || exit 1
296 #---------------------------------------------------------------------
297 # Supply default ownership and/or permissions according to the
298 # number of parameters passed to this function.
299 #---------------------------------------------------------------------
301 case $# in
302 5) owner=root:wheel; perms=600;;
303 6) owner=$6; perms=600;;
304 7) owner=$6; perms=$7;;
305 *) die 2 "Bad call: mknod $@";;
306 esac
309 #---------------------------------------------------------------------
310 # Get rid of first two parameters (no longer needed)
311 #---------------------------------------------------------------------
313 shift; shift
316 #---------------------------------------------------------------------
317 # If there's a /etc/devices.conf file, check for local overrides.
318 #---------------------------------------------------------------------
320 if [ -s $DEVPERMS_LOCAL ]
321 then
322 #-------------------------------------------------------------
323 # Temporarily prepend the device portion with a subdir name
324 # if we're not in $DEVDIR. We need to do this to distinguish
325 # between device nodes that live in /dev, and device nodes
326 # that live in /dev/subdir, like /dev/fd. This way, we can
327 # have "fd*" entries in the permission files, as well as
328 # "fd/*" stuff.
329 #-------------------------------------------------------------
331 tmpdev=$dev
332 pwd=`/usr/bin/basename $PWD`
334 [ "$pwd" = "$DEVDIR" ] || dev="${pwd}/$dev"
337 #-------------------------------------------------------------
338 # Check /etc/devices.conf for local overrides
339 #-------------------------------------------------------------
341 match=`$grep ^$dev$unit[[:space:]] $DEVPERMS_LOCAL | \
342 $sed 's/\*/\\\*/'`
344 [ "$match" ] ||
345 if [ `expr "$unit" : '\(.*\)\.ctl$'` ]
346 then
347 match=`$grep ^$dev\\\*\\\.ctl[[:space:]] \
348 $DEVPERMS_LOCAL | $sed 's/\*/\\\*/'`
349 else
350 match=`$grep ^$dev\\\*[[:space:]] $DEVPERMS_LOCAL | \
351 $sed 's/\*/\\\*/'`
354 if [ "$match" ]
355 then
356 # Separate each field by one space character...
357 match=`echo $match | $tr -s "[:space:]" " "`
359 # ...and extract owenership and permissions.
360 owner=`echo $match | $cut -d' ' -f2`
361 perms=`echo $match | $cut -d' ' -f3`
364 #-------------------------------------------------------------
365 # Restore "plain" device name (no prepending subdir name).
366 #-------------------------------------------------------------
368 dev=$tmpdev
371 #---------------------------------------------------------------------
372 # Finally, set ownership and permissions.
373 #---------------------------------------------------------------------
375 $mknod $dev$unit $1 $2 $3 $owner
376 chmod $perms $dev$unit
380 #-----------------------------------------------------------------------------
381 # Convert tape (ctrl, unit, mode, access) to device minor number.
382 #-----------------------------------------------------------------------------
384 saminor()
386 echo $(($1 << 29 | ($2 / 16) << 16 | ($2 % 16) << 4 | $3 << 2 | $4))
390 #-----------------------------------------------------------------------------
391 # Convert the last character of a tty name to a device minor number.
392 #-----------------------------------------------------------------------------
394 ttyminor()
396 case $1 in
397 [0-9]) m=$1;;
398 a) m=10;; b) m=11;; c) m=12;; d) m=13;;
399 e) m=14;; f) m=15;; g) m=16;; h) m=17;;
400 i) m=18;; j) m=19;; k) m=20;; l) m=21;;
401 m) m=22;; n) m=23;; o) m=24;; p) m=25;;
402 q) m=26;; r) m=27;; s) m=28;; t) m=29;;
403 u) m=30;; v) m=31;;
404 *) m="?";;
405 esac
407 echo $m
411 #-----------------------------------------------------------------------------
412 # Convert a unit number to a device minor number.
413 #-----------------------------------------------------------------------------
415 unit2minor()
417 echo $(((($1 >> 8) << 16) | ($1 % 256)))
421 #-----------------------------------------------------------------------------
422 # Stallion devices need some (weird) special treatment.
423 #-----------------------------------------------------------------------------
425 stallion()
427 major=$1
428 letter=$2
429 card=$3
430 iscallout=$4
432 port=0
433 maxport=8
434 pref=tty
435 owner=
436 minorbase=0
438 if [ $iscallout -gt 0 ]
439 then
440 pref=cua
441 owner=uucp:dialer
442 minorbase=128
445 case "$card" in
446 [0-7]);;
447 *) die 1 "Invalid stl card number $card";;
448 esac
450 # Make the mem interface for extracting stats & loading microcode.
451 # 0x1000000 + card number
452 mknod staliomem $card c $major 0x0100000$card
454 while [ $port -lt $maxport ]
456 minor=$(($minorbase + $card * 1048576 + $port))
458 [ $port -lt 32 ] || minor=$(($minor + 65504))
460 unit=$(($card * 64 + $port))
462 mknod ${pref}${letter} $unit c $major $minor $owner
463 mknod ${pref}i${letter} $unit c $major $(($minor + 32)) $owner
464 mknod ${pref}l${letter} $unit c $major $(($minor + 64)) $owner
466 port=$(($port + 1))
467 done
471 #-----------------------------------------------------------------------------
472 # Do it.
473 #-----------------------------------------------------------------------------
475 for i in $*; do
476 case $i in
478 all)
479 rm -f *.compat
480 sh MAKEDEV std # standard
481 sh MAKEDEV fd0 fd1 # bdev, floppy disk
482 sh MAKEDEV da0 da1 da2 da3 da4 da5 da6 da7 # bdev, SCSI disk
483 sh MAKEDEV da8 da9 da10 da11 da12 da13 da14 # bdev, SCSI disk
484 sh MAKEDEV da15 # bdev, SCSI disk
485 sh MAKEDEV ccd0 ccd1 ccd2 ccd3 # ccd disk
486 sh MAKEDEV ata # cdev, ATA control
487 sh MAKEDEV ad0 ad1 ad2 ad3 ad4 ad5 ad6 ad7 # bdev, ATA disk
488 sh MAKEDEV ar0 ar1 # bdev, ATA RAID disk
489 sh MAKEDEV acd0 afd0 ast0 # bdev, ATAPI devices
490 sh MAKEDEV vn0 vn1 vn2 vn3 # bdev, virtual disk
491 sh MAKEDEV vkd0 # bdev, virtual disk
492 sh MAKEDEV cd0 # bdev, cdrom
493 sh MAKEDEV sa0 wt0 # bdev, tape
494 sh MAKEDEV vty12 # cdev, virtual tty
495 sh MAKEDEV cuaa0 cuaa1 cuaa2 cuaa3 # cdev, serial tty
496 sh MAKEDEV pty0 # cdev, pseudo tty
497 sh MAKEDEV ttyd0 ttyd1 ttyd2 ttyd3 # cdev, serial tty
498 sh MAKEDEV kbd0 kbd1 # cdev, keyboard
499 sh MAKEDEV mse0 psm0 jogdial sysmouse # cdev, mouse
500 sh MAKEDEV pcaudio speaker snd0 # cdev, noise
501 sh MAKEDEV ipsd0 # cdev, ServeRAID disk
502 sh MAKEDEV lpt0 lpt1 lpt2 # cdev, printer
503 sh MAKEDEV ppi0 ppi1 ppi2 # cdev, parallel port
504 sh MAKEDEV iic0 iic1 # cdev, I2C device
505 sh MAKEDEV smb0 smb1 # cdev, SMBus device
506 sh MAKEDEV usb usb0 uhid0 ums0 ulpt0 ugen0 # cdev, USB devices
507 sh MAKEDEV usb1 uhid1 ums1 ulpt1 ugen1 # cdev, USB devices
508 sh MAKEDEV usb2 usb3 usb4 usb5 usb6 usb7 # cdev, USB devices
509 sh MAKEDEV urio0 uscanner0 umodem0 # cdev, USB devices too
510 sh MAKEDEV ucom0 ucom1 ucom2 ucom3 # cdev, USB serial devices
511 sh MAKEDEV bpf0 bpf1 bpf2 bpf3 # cdev, network
512 sh MAKEDEV ipl tun0 tun1 tun2 tun3 # cdev, network
513 sh MAKEDEV tap0 tap1 tap2 tap3 # cdev, network
514 sh MAKEDEV ch0 perfmon tw0 # cdev, miscellaneous
515 sh MAKEDEV acpi # cdev, laptop
516 sh MAKEDEV apm apmctl card0 card1 card2 card3 # cdev, laptop
517 sh MAKEDEV pass4 xpt2 # cdev, CAM
518 sh MAKEDEV i4b i4bctl i4btrc0 i4btrc1 # cdev, ISDN
519 sh MAKEDEV i4btel0 i4btel1 i4bteld0 i4bteld1 # cdev, ISDN
520 sh MAKEDEV i4brbch0 i4brbch1 # cdev, ISDN
521 sh MAKEDEV agpgart # cdev, AGP
522 sh MAKEDEV nsmb0 # cdev, SMB/CIFS
523 sh MAKEDEV twed0 # 3ware
524 sh MAKEDEV crypto # cdev, crypto
525 sh MAKEDEV fw0 # cdev, firewire
526 sh MAKEDEV dcons # cdev, dcons
527 sh MAKEDEV pf # pf
531 #-----------------------------------------------------------------------------
532 # A much restricted set of the above, to save precious i-nodes on the
533 # fixit floppy
534 #-----------------------------------------------------------------------------
536 fixit)
537 sh MAKEDEV std # standard
538 sh MAKEDEV fd0 # bdev, floppy disk
539 sh MAKEDEV da0 # bdev, SCSI disk
540 sh MAKEDEV ad0 # bdev, ATA disk
541 sh MAKEDEV acd0 afd0 ast0 # bdev, ATAPI devices
542 sh MAKEDEV vn0 # bdev, virtual disk
543 sh MAKEDEV vkd0 # bdev, virtual disk
544 sh MAKEDEV cd0 # bdev, cdrom
545 sh MAKEDEV sa0 # bdev, tape
546 sh MAKEDEV vty2 # cdev, virtual tty
547 sh MAKEDEV cuaa0 # cdev, serial tty
548 sh MAKEDEV pty0 # cdev, pseudo tty
549 sh MAKEDEV ttyd0 # cdev, serial tty
550 sh MAKEDEV kbd0 # cdev, keyboard
551 sh MAKEDEV mse0 psm0 sysmouse # cdev, mouse
552 sh MAKEDEV lpt0 # cdev, printer
553 sh MAKEDEV ppi0 # cdev, parallel port
554 sh MAKEDEV iic0 # cdev, I2C device
555 sh MAKEDEV smb0 # cdev, SMBus device
556 sh MAKEDEV ums0 # cdev, USB devices
557 sh MAKEDEV tun0 # cdev, network
558 sh MAKEDEV tap0 # cdev, network
559 sh MAKEDEV ch0 # cdev, miscellaneous
560 sh MAKEDEV apm apmctl card0 # cdev, laptop
561 sh MAKEDEV pass1 xpt1 # cdev, CAM
562 sh MAKEDEV i4b i4bctl i4btrc0 i4btrc1 # cdev, ISDN
563 sh MAKEDEV i4btel0 i4bteld0 # cdev, ISDN
564 sh MAKEDEV i4brbch0 # cdev, ISDN
565 rm -f fd/[1-9]?
568 #-----------------------------------------------------------------------------
569 # Upgrade existing node set.
571 # 1.9 - disk devices have changed
572 #-----------------------------------------------------------------------------
573 upgrade)
574 echo -n "upgrading... "
575 for i in aacd ad ar afd amrd ccd da fd idad ipsd md \
576 mlxd pst twed vn vkd
578 for j in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
580 if [ -c $i$j ]; then
581 rm -f $i$j
582 rm -f $i${j}[a-p]
583 echo -n " $i$j $i${j}s0[a-p] $i${j}s1[a-p]"
584 sh MAKEDEV $i$j
585 # s0 and s1 handled by base
586 for k in s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 \
587 s12 s13 s14 s15
589 if [ -c $i$j${k}c ]; then
590 rm -f ${i}${j}${k}*
591 echo -n " $i$j$k"
592 sh MAKEDEV $i$j$k
593 echo -n " $i$j$k[a-p]"
594 sh MAKEDEV $i$j${k}a
595 elif [ -c $i$j$k ]; then
596 rm -f ${i}${j}${k}*
597 echo -n " $i$j$k"
598 sh MAKEDEV $i$j$k
600 done
602 done
603 done
604 for i in acd cd vcd
606 for j in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
608 if [ -c $i$j ]; then
609 rm -f ${i}${j}*
610 echo -n " $i$j $i${j}s0 $i${j}[a-p]"
611 sh MAKEDEV $i$j
612 elif [ -c $i${j}c ]; then
613 rm -f ${i}${j}*
614 echo -n " $i$j $i${j}s0 $i${j}[a-p]"
615 sh MAKEDEV $i$j
617 done
618 done
619 echo ""
622 #-----------------------------------------------------------------------------
623 # Basic device node set.
624 #-----------------------------------------------------------------------------
626 std)
627 mknod console "" c 0 0
628 mknod kmem "" c 2 1 root:kmem 640
629 mknod mem "" c 2 0 root:kmem 640
630 mknod null "" c 2 2 root:wheel 666
631 mknod random "" c 2 3 root:wheel 644
632 mknod urandom "" c 2 4 root:wheel 644
633 mknod zero "" c 2 12 root:wheel 666
634 mknod io "" c 2 14
635 mknod tty "" c 1 0 root:wheel 666
636 mknod klog "" c 7 0
637 mknod stdin "" c 22 0 root:wheel 666
638 mknod stdout "" c 22 1 root:wheel 666
639 mknod stderr "" c 22 2 root:wheel 666
640 mknod pci "" c 78 0 root:wheel 644
643 #---------------------------------------------------------------------
644 # Create floppy disk nodes in /dev/fd
645 #---------------------------------------------------------------------
647 mkdir -p fd
649 (cd fd &&
650 i=0 &&
651 while [ $i -lt 64 ]
653 mknod $i "" c 22 $i root:wheel 666
655 i=$(($i + 1))
656 done)
658 chmod 555 fd
661 #-----------------------------------------------------------------------------
663 jail)
664 sh MAKEDEV std pty0
666 rm mem kmem pci io klog console
668 ln -sf null mem
669 ln -sf null kmem
670 ln -sf null console
673 #-----------------------------------------------------------------------------
675 mach-4)
676 mknod iopl "" c 22 0
677 mknod kbd "" c 23 0
678 mknod mouse "" c 24 0
679 mknod time "" c 25 0
680 mknod timezone "" c 26 0
683 #-----------------------------------------------------------------------------
685 wt*)
686 u=`expr $i : '..\(.*\)'`
688 [ "$u" ] || u=0
690 # Default density, 512b blocks
691 mknod rwt $u c 10 $((0 + $u)) root:operator 660
692 mknod nrwt $u c 10 $((4 + $u)) root:operator 660
694 # Default density, 1024b blocks
695 # mknod rWt $u c 10 $((64 + $u)) root:operator 660
696 # mknod nrWt $u c 10 $((68 + $u)) root:operator 660
697 mknod rwt ${u}b c 10 $((16 + $u)) root:operator 660 # 60 MB
698 mknod nrwt ${u}b c 10 $((20 + $u)) root:operator 660
699 mknod rwt ${u}c c 10 $((24 + $u)) root:operator 660 # 120 MB
700 mknod nrwt ${u}c c 10 $((28 + $u)) root:operator 660
701 mknod rwt ${u}d c 10 $((32 + $u)) root:operator 660 # 150 MB
702 mknod nrwt ${u}d c 10 $((36 + $u)) root:operator 660
703 # mknod rwt ${u}e c 10 $((40 + $u)) root:operator 660 # 300 MB?
704 # mknod nrwt ${u}e c 10 $((44 + $u)) root:operator 660
705 # mknod rwt ${u}f c 10 $((48 + $u)) root:operator 660 # 600 MB?
706 # mknod nrwt ${u}f c 10 $((52 + $u)) root:operator 660
709 #-----------------------------------------------------------------------------
711 aacd*s*|acd*s*|ad*s*|ar*s*|afd*s*|amrd*s*|ccd*s*|da*s*|fd*s*|idad*s*|ipsd*s*|md*s*|mlxd*s*|pst*s*|twed*s*|vn*s*|vkd*s*)
712 case $i in
713 aacd*s*) name=aacd; chr=151;;
714 acd*s*) name=acd; chr=117;;
715 ad*s*) name=ad; chr=116;;
716 ar*s*) name=ar; chr=157;;
717 afd*s*) name=afd; chr=118;;
718 amrd*s*) name=amrd; chr=133;;
719 ccd*s*) name=ccd; chr=74;;
720 da*s*) name=da; chr=13;;
721 fd*s*) name=fd; chr=9;;
722 idad*s*) name=idad; chr=109;;
723 ipsd*s*) name=ipsd; chr=176;;
724 md*s*) name=md; chr=95;;
725 mlxd*s*) name=mlxd; chr=131;;
726 pst*s*) name=pst; chr=168;;
727 twed*s*) name=twed; chr=147;;
728 vn*s*) name=vn; chr=43;;
729 vkd*s*) name=vkd; chr=97;;
730 esac
732 case $i in
733 aacd*s*|amrd*s*|idad*s*|ipsd*s*|mlxd*s*|twed*s*)
734 unit=`expr $i : '....\([0-9]*\)s'`
735 slice=`expr $i : '....[0-9]*s\([0-9]*\)'`
736 part=`expr $i : '....[0-9]*s[0-9]*\(.*\)'`
739 acd*s*|afd*s*|ccd*s*|pst*s*|wfd*s*|vkd*s*)
740 unit=`expr $i : '...\([0-9]*\)s'`
741 slice=`expr $i : '...[0-9]*s\([0-9]*\)'`
742 part=`expr $i : '...[0-9]*s[0-9]*\(.*\)'`
745 unit=`expr $i : '..\([0-9]*\)s'`
746 slice=`expr $i : '..[0-9]*s\([0-9]*\)'`
747 part=`expr $i : '..[0-9]*s[0-9]*\(.*\)'`
749 esac
751 case $unit in
752 [0-9]|[0-9][0-9]|[0-4][0-9][0-9]|50[0-9]|51[0-1])
753 case $slice in
754 [0-9]|[1-2][0-9]|30)
755 # [no s*] == whole-disk slice (slice #1 in minor)
756 # s0 == slice #0 in minor (compatibility slice)
757 # s1 == slice #2 in minor
758 # s2 == slice #3 in minor
759 # etc..
761 # set slice to slice-in-minor-number
762 oldslice=$slice
763 if [ $oldslice -eq 0 ]; then
764 slice=$(($oldslice))
765 else
766 slice=$(($slice+1))
768 slicename=`dkitos $slice`
769 minor=`ndkminor $unit $slice 255`
770 mknod ${name} $unit$slicename c $chr $minor \
771 root:operator 640
773 # raw device names are extinct
774 rm -f r$name$unit$slicename
776 # get rid of old compatibility devices, the new
777 # ones use 's0', e.g. da0s0a
778 for i in a b c d e f g h i j k l m n o p
780 rm -f $name$unit$i
781 done
783 case $part in [a-p])
785 for part in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
787 minor=`ndkminor $unit $slice $part`
788 partname=`dkitop $part`
789 mknod $name $unit$slicename$partname \
790 c $chr $minor root:operator 640
791 rm -f r$name$unit$slicename$partname
792 done
795 "") ;;
796 *) echo bad partition for disk in: $i
798 esac
801 echo bad slice for disk in: $i
803 esac
806 echo bad unit for disk in: $i "(unit=$unit, slice=$slice, part=$part)"
808 esac
811 #-----------------------------------------------------------------------------
813 control-fd*)
814 unit=`expr $i : '..........\(.*\)'`
815 name=fd; chr=9
817 case $unit in
818 0|1|2|3)
819 minor=`ndkminor $unit 1 129`
820 mknod $name ${unit}.1720 c $chr $minor
821 rm -f r${name}${unit}.1720
823 minor=`ndkminor $unit 1 130`
824 mknod $name ${unit}.1480 c $chr $minor
825 rm -f r${name}${unit}.1480
827 minor=`ndkminor $unit 1 131`
828 mknod $name ${unit}.1440 c $chr $minor
829 rm -f r${name}${unit}.1440
831 minor=`ndkminor $unit 1 132`
832 mknod $name ${unit}.1200 c $chr $minor
833 rm -f r${name}${unit}.1200
835 minor=`ndkminor $unit 1 133`
836 mknod $name ${unit}.820 c $chr $minor
837 rm -f r${name}${unit}.820
839 minor=`ndkminor $unit 1 134`
840 mknod $name ${unit}.800 c $chr $minor
841 rm -f r${name}${unit}.800
843 minor=`ndkminor $unit 1 135`
844 mknod $name ${unit}.720 c $chr $minor
845 rm -f r${name}${unit}.720
847 minor=`ndkminor $unit 1 136`
848 mknod $name ${unit}.360 c $chr $minor
849 rm -f r${name}${unit}.360
851 minor=`ndkminor $unit 1 137`
852 mknod $name ${unit}.640 c $chr $minor
853 rm -f r${name}${unit}.640
855 minor=`ndkminor $unit 1 138`
856 mknod $name ${unit}.1232 c $chr $minor
857 rm -f r${name}${unit}.1232
860 echo bad unit for disk in: $i
862 esac
865 #-----------------------------------------------------------------------------
867 acd*t*)
868 units=`expr $i : '...\(.*\)t'`;
869 tracks=`expr $i : '.*t\(.*\)'`;
870 name=acd;
871 chr=117;
873 [ "$units" ] || units=0
874 [ "$tracks" ] || tracks=100
876 if [ "$units" -le 31 -a "$tracks" -le 169 ]
877 then
879 while [ $i -le $units ]
881 dname=$name$i
882 rm -rf ${dname}t*
885 while [ $j -le $tracks ]
887 # cd unit tracks use the compatibility slice
888 # and partition numbers 129+ for tracks 1+.
890 minor=`ndkminor $i 1 $(($j + 128))`
891 mknod ${dname}t $j c $chr $minor \
892 root:operator 640
893 j=$(($j + 1))
894 done
896 i=$(($i + 1))
897 done
898 else
899 echo "$i is invalid -- can't have more than 32 cd devices or 169 tracks"
903 #-----------------------------------------------------------------------------
905 aacd*|acd*|ad*|ar*|afd*|amrd*|cd*|ccd*|da*|fd*|idad*|ipsd*|md*|mlxd*|pst*|twed*|vcd*|vn*|vkd*)
906 doslices=1
907 directraw=0
908 case $i in
909 aacd*) name=aacd; chr=151;;
910 acd*) name=acd; chr=117; doslices=0; directraw=1;;
911 ad*) name=ad; chr=116;;
912 ar*) name=ar; chr=157;;
913 afd*) name=afd; chr=118;;
914 amrd*) name=amrd; chr=133;;
915 cd*) name=cd; chr=15; doslices=0;;
916 da*) name=da; chr=13;;
917 fd*) name=fd; chr=9;;
918 ccd*) name=ccd; chr=74;;
919 idad*) name=idad; chr=109;;
920 ipsd*) name=ipsd; chr=176;;
921 md*) name=md; chr=95;;
922 mlxd*) name=mlxd; chr=131;;
923 pst*) name=pst; chr=168;;
924 twed*) name=twed; chr=147;;
925 vcd*) name=vcd; chr=98; doslices=0;;
926 vn*) name=vn; chr=43;;
927 vkd*) name=vkd; chr=97;;
928 esac
930 case $i in
931 aacd*|amrd*|idad*|ipsd*|mlxd*|twed*)
932 unit=`expr $i : '....\(.*\)'`
934 acd*|afd*|ccd*|pst*|wfd*|vcd*|vkd*)
935 unit=`expr $i : '...\(.*\)'`
938 unit=`expr $i : '..\(.*\)'`
940 esac
942 case $i in
943 fd*)
944 sh MAKEDEV control-$name$unit
946 esac
948 case $unit in
949 [0-9]|[0-9][0-9]|[0-4][0-9][0-9]|50[0-9]|51[0-1])
950 if [ "$doslices" -gt 0 ]; then
951 minor=`ndkminor $unit 1 255`
952 mknod ${name} ${unit} c $chr $minor \
953 root:operator 640
954 for slicepartname in s0h s1h s2 s3 s4
956 sh MAKEDEV $name$unit$slicepartname
957 done
958 else
959 if [ "$directraw" -gt 0 ]; then
960 minor=`ndkminor $unit 1 128`
961 mknod ${name} ${unit} c $chr $minor \
962 root:operator 640
963 else
964 minor=`ndkminor $unit 1 255`
965 mknod ${name} ${unit} c $chr $minor \
966 root:operator 640
968 minor=`ndkminor $unit 1 255`
969 mknod ${name} ${unit}s0 c $chr $minor \
970 root:operator 640
971 minor=`ndkminor $unit 0 0`
972 mknod ${name} ${unit}a c $chr $minor \
973 root:operator 640
974 minor=`ndkminor $unit 0 2`
975 mknod ${name} ${unit}c c $chr $minor \
976 root:operator 640
980 echo bad unit for disk in: $i
982 esac
985 #-----------------------------------------------------------------------------
987 pt[0-9]*)
988 chr=61
989 name=pt
990 unit=`expr $i : 'pt\([0-9][0-9]*\)'`
992 [ "$unit" ] || unit=0
994 unit=$(($unit + 1 - 1))
995 mknod $name $unit c $chr `unit2minor $unit`
998 #-----------------------------------------------------------------------------
1000 ses[0-9]*)
1001 chr=110
1002 name=ses
1003 unit=`expr $i : 'ses\([0-9][0-9]*\)'`
1005 [ "$unit" ] || unit=0
1007 unit=$(($unit + 1 - 1))
1008 mknod $name $unit c $chr `unit2minor $unit`
1011 #-----------------------------------------------------------------------------
1013 targ[0-9]*)
1014 chr=65
1015 name=targ
1016 unit=`expr $i : 'targ\([0-9][0-9]*\)'`
1018 [ "$unit" ] || unit=0
1020 unit=$(($unit + 1 - 1))
1022 mknod $name $unit c $chr `unit2minor $unit`
1023 mknod ${name}.ctl "" c $chr 0xffff00ff
1026 #-----------------------------------------------------------------------------
1028 # CAM transport layer device
1029 xpt*)
1030 # This major number is temporary
1031 chr=104
1032 name=xpt
1033 units=`expr $i : 'xpt\(.*\)'`
1035 [ "$units" ] || units=1
1038 while [ $i -lt $units ]
1040 rm -rf $name$i
1042 mknod $name $i c $chr `unit2minor $i` root:operator
1044 i=$(($i + 1))
1045 done
1048 #-----------------------------------------------------------------------------
1050 pass*)
1051 # This major number is temporary
1052 chr=31
1053 name=pass
1054 units=`expr $i : 'pass\(.*\)'`
1056 [ "$units" ] || units=1
1059 while [ $i -lt $units ]
1061 rm -rf $name$i
1063 mknod $name $i c $chr `unit2minor $i` root:operator
1065 i=$(($i + 1))
1066 done
1069 #-----------------------------------------------------------------------------
1071 pty*)
1072 class=`expr $i : 'pty\(.*\)'`
1073 case $class in
1074 0) offset=0 name=p;;
1075 1) offset=32 name=q;;
1076 2) offset=64 name=r;;
1077 3) offset=96 name=s;;
1078 4) offset=128 name=P;; # Note that xterm (at least) only look at p-s.
1079 5) offset=160 name=Q;;
1080 6) offset=192 name=R;;
1081 7) offset=224 name=S;;
1082 *) echo bad unit for pty in: $i;;
1083 esac
1085 case $class in
1086 0|1|2|3|4|5|6|7)
1088 while [ $i -lt 32 ]
1090 c=$(echo 0123456789abcdefghijklmnopqrstuv |
1091 dd bs=1 skip=$i count=1 2>/dev/null)
1093 mknod tty$name $c c 5 $(($offset + $i)) root:wheel 666
1094 mknod pty$name $c c 6 $(($offset + $i)) root:wheel 666
1096 i=$(($i + 1))
1097 done
1099 esac
1102 #-----------------------------------------------------------------------------
1104 sa*)
1105 unit=`expr $i : '..\(.*\)'`
1106 chr=14
1108 case $unit in
1109 [0-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9])
1110 mknod sa ${unit}.ctl c $chr `saminor 1 ${unit} 0 0` \
1111 root:wheel 660
1112 ln -f sa${unit}.ctl rsa${unit}.ctl
1114 for m in 0 1 2 3
1116 mknod sa ${unit}.$m c $chr \
1117 `saminor 0 $unit $m 0` root:operator 660
1118 ln -f sa${unit}.$m rsa${unit}.$m
1120 mknod nsa ${unit}.$m c $chr \
1121 `saminor 0 $unit $m 1` root:operator 660
1122 ln -f nsa${unit}.$m nrsa${unit}.$m
1124 mknod esa ${unit}.$m c $chr \
1125 `saminor 0 $unit $m 2` root:operator 660
1126 ln -f esa${unit}.$m ersa${unit}.$m
1127 done
1129 ln -f sa${unit}.0 sa$unit
1130 ln -f sa${unit}.0 rsa${unit}.0
1131 ln -f sa${unit}.0 rsa$unit
1132 ln -f nsa${unit}.0 nsa$unit
1133 ln -f nsa${unit}.0 nrsa${unit}.0
1134 ln -f nsa${unit}.0 nrsa$unit
1135 ln -f esa${unit}.0 esa$unit
1136 ln -f esa${unit}.0 ersa${unit}.0
1137 ln -f esa${unit}.0 ersa$unit
1140 echo bad unit for tape in: $i
1142 esac
1145 #-----------------------------------------------------------------------------
1147 ch*)
1148 unit=`expr $i : '..\(.*\)'`
1150 case $i in
1151 ch*) name=ch; chr=17;;
1152 esac
1154 case $unit in
1155 0|1|2|3|4|5|6)
1156 mknod $name $unit c $chr $unit root:operator 640
1159 echo bad unit for media changer in: $i
1161 esac
1164 #-----------------------------------------------------------------------------
1166 ata)
1167 mknod ata "" c 159 0 root:operator
1170 #-----------------------------------------------------------------------------
1172 ast*)
1173 unit=`expr $i : '...\(.*\)'`
1174 chr=119
1176 case $unit in
1177 0|1|2|3)
1178 mknod ast $unit c $chr $(($unit * 8 + 0)) root:operator 640
1179 mknod nast $unit c $chr $(($unit * 8 + 1)) root:operator 640
1182 echo bad unit for tape in: $i
1184 esac
1187 #-----------------------------------------------------------------------------
1189 iic*)
1190 unit=`expr $i : 'iic\(.*\)'`
1192 mknod iic $unit c 105 `unit2minor $unit`
1195 #-----------------------------------------------------------------------------
1197 smb*)
1198 unit=`expr $i : 'smb\(.*\)'`
1200 mknod smb $unit c 106 `unit2minor $unit`
1203 #-----------------------------------------------------------------------------
1205 pcfclock*)
1206 unit=`expr $i : 'pcfclock\(.*\)'`
1208 mknod pcfclock $unit c 140 `unit2minor $unit`
1211 #-----------------------------------------------------------------------------
1213 ppi*)
1214 unit=`expr $i : 'ppi\(.*\)'`
1216 mknod ppi $unit c 82 `unit2minor $unit`
1219 #-----------------------------------------------------------------------------
1221 pps*)
1222 unit=`expr $i : 'pps\(.*\)'`
1224 mknod pps $unit c 89 `unit2minor $unit`
1227 #-----------------------------------------------------------------------------
1229 usb)
1230 mknod usb "" c 108 255 root:operator 0660
1233 #-----------------------------------------------------------------------------
1235 usb*)
1236 unit=`expr $i : 'usb\(.*\)'`
1238 mknod usb $unit c 108 `unit2minor $unit` root:operator 660
1241 #-----------------------------------------------------------------------------
1243 ucom*)
1244 unit=`expr $i : 'ucom\(.*\)'`
1246 minor=$(($unit + 128))
1247 minor=`unit2minor $(($unit + 128))`
1249 mknod ucom $unit c 138 $minor uucp:dialer 660
1252 #-----------------------------------------------------------------------------
1254 uhid*)
1255 unit=`expr $i : 'uhid\(.*\)'`
1257 mknod uhid $unit c 122 `unit2minor $unit` root:operator 660
1260 #-----------------------------------------------------------------------------
1262 ums*)
1263 unit=`expr $i : 'ums\(.*\)'`
1265 mknod ums $unit c 111 `unit2minor $unit` root:operator 660
1268 #-----------------------------------------------------------------------------
1270 ulpt*)
1271 unit=`expr $i : 'ulpt\(.*\)'`
1273 minor=`unit2minor $unit`
1274 mknod ulpt $unit c 113 $minor
1276 minor=`unit2minor $(($unit + 64))`
1277 mknod unlpt $unit c 113 $minor # and the 'no prime' version
1280 #-----------------------------------------------------------------------------
1282 ugen*)
1283 unit=`expr $i : 'ugen\([0-9][0-9]*\)'`
1284 endpoint=`expr $i : 'ugen.*\.\([0-9][0-9]*\)'`
1286 [ "$unit" ] || echo $i - Invalid unit number
1288 if [ -z "${endpoint}" ] # ugen0 & ugen0.1 - ugen0.15
1289 then
1290 mknod ugen $unit c 114 `unit2minor $(($unit * 16))` \
1291 root:operator 660
1293 while [ $i -lt 16 ]
1295 mknod ugen $unit.$i c 114 `unit2minor \
1296 $(($unit * 16 + $i))` root:operator 660
1298 i=$(($i + 1))
1299 done
1300 else
1301 minor=`unit2minor $(($unit * 16 + $endpoint))`
1302 mknod ugen $unit.$endpoint c 114 $minor root:operator 660
1306 #-----------------------------------------------------------------------------
1308 urio*)
1309 unit=`expr $i : 'urio\(.*\)'`
1311 mknod urio $unit c 143 `unit2minor $unit` root:operator 660
1314 #-----------------------------------------------------------------------------
1316 uscanner*)
1317 unit=`expr $i : 'uscanner\(.*\)'`
1319 mknod uscanner $unit c 156 `unit2minor $unit` root:operator 660
1322 #-----------------------------------------------------------------------------
1324 umodem*)
1325 unit=`expr $i : 'umodem\(.*\)'`
1327 mknod umodem $unit c 124 `unit2minor $unit` uucp:dialer 660
1330 #-----------------------------------------------------------------------------
1332 lpt*)
1333 unit=`expr $i : 'lpt\(.*\)'`
1335 mknod lpt $unit c 16 `unit2minor $unit`
1336 mknod lpctl $unit c 16 `unit2minor $(($unit + 128))`
1339 #-----------------------------------------------------------------------------
1341 vty*)
1342 chr=12
1343 units=`expr $i : 'vty\(.*\)'`
1346 while [ $i -lt $units ]
1348 mknod ttyv $(printf %01x $i) c $chr `unit2minor $i`
1350 i=$(($i + 1))
1351 done
1353 ln -fs ttyv0 vga
1356 #-----------------------------------------------------------------------------
1358 nmdm*)
1359 units=`expr $i : 'nmdm\(.*\)'`
1360 chr=18
1363 while [ $i -lt $units ]
1365 minor=`unit2minor $i`
1366 minor=$(($minor + $minor))
1367 mknod nmdm ${i}A c $chr $minor
1368 mknod nmdm ${i}B c $chr $(($minor + 1))
1370 i=$(($i + 1))
1371 done
1374 #-----------------------------------------------------------------------------
1376 bpf*)
1377 nbpf=`expr $i : 'bpf\(.*\)$'`
1379 unit=0
1380 while [ $unit -le $nbpf ]
1382 mknod bpf $unit c 23 `unit2minor $unit`
1384 unit=$(($unit + 1))
1385 done
1388 #-----------------------------------------------------------------------------
1390 speaker)
1391 mknod speaker "" c 26 0
1394 #-----------------------------------------------------------------------------
1396 cua?|cuaa?|cuaa??)
1397 unit_low=`expr $i : 'cua.*\(.\)$'`
1399 case $i in
1400 cua?|cuaa?)
1401 unit_high=""
1402 m_high=0
1404 cuaa??)
1405 unit_high=`expr $i : 'cuaa\(.\).$'`
1406 m_high=`ttyminor $unit_high`
1408 esac
1410 unit=$unit_high$unit_low
1411 m=$(($m_high << 16 | `ttyminor $unit_low`))
1413 mknod cuaa $unit c 28 $(($m | 128)) uucp:dialer 660
1414 mknod cuaia $unit c 28 $(($m | 32 | 128)) uucp:dialer 660
1415 mknod cuala $unit c 28 $(($m | 64 | 128)) uucp:dialer 660
1418 #-----------------------------------------------------------------------------
1420 crypto)
1421 mknod crypto "" c 70 0 root:operator 666
1424 #-----------------------------------------------------------------------------
1427 mknod pf "" c 73 0 root:operator 600
1430 #-----------------------------------------------------------------------------
1432 fw?)
1433 unit=`expr $i : 'fw\(.\)$'`
1435 for sub in 0 1 2 3
1437 minor=$(($unit << 16 | $sub))
1438 mknod fw $unit.$sub c 127 $minor root:operator 660
1439 mknod fwmem $unit.$sub c 127 $((1<<24 | $minor)) \
1440 root:operator 660
1441 done
1443 ln -sf fw$unit.0 fw$unit
1444 ln -sf fwmem$unit.0 fwmem$unit
1447 #-----------------------------------------------------------------------------
1449 dcons)
1450 mknod dcons "" c 184 0 root:wheel 600
1453 #-----------------------------------------------------------------------------
1455 tty?|tty0?|ttyd?|ttyd??)
1456 unit_low=`expr $i : 'tty.*\(.\)$'`
1458 case $i in
1459 tty?|tty0?|ttyd?)
1460 unit_high=""
1461 m_high=0
1463 ttyd??)
1464 unit_high=`expr $i : 'ttyd\(.\).$'`
1465 m_high=`ttyminor $unit_high`
1467 esac
1469 unit=$unit_high$unit_low
1470 m=$(($m_high << 16 | `ttyminor $unit_low`))
1472 mknod ttyd $unit c 28 $m
1473 mknod ttyid $unit c 28 $(($m | 32))
1474 mknod ttyld $unit c 28 $(($m | 64))
1477 #-----------------------------------------------------------------------------
1479 cuac?)
1480 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f
1481 g h i j k l m n o p q r s t u v"
1482 major=48
1483 card=`expr $i : 'cua.*\(.\)$'`
1485 for unit in $portlist
1487 minor=`ttyminor $unit`
1488 minor=$(($card * 65536 + $minor))
1489 name=$card$unit
1491 mknod cuac $name c $major $(($minor + 128)) uucp:dialer 660
1492 mknod cuaic $name c $major $(($minor + 32 + 128)) \
1493 uucp:dialer 660
1494 mknod cualc $name c $major $(($minor + 64 + 128)) \
1495 uucp:dialer 660
1496 done
1499 #-----------------------------------------------------------------------------
1501 ttyc?)
1502 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f
1503 g h i j k l m n o p q r s t u v"
1504 major=48
1505 card=`expr $i : 'tty.*\(.\)$'`
1507 for unit in $portlist
1509 minor=`ttyminor $unit`
1510 minor=$(($card * 65536 + $minor))
1511 name=$card$unit
1513 mknod ttyc $name c $major $minor
1514 mknod ttyic $name c $major $(($minor + 32))
1515 mknod ttylc $name c $major $(($minor + 64))
1516 done
1519 #-----------------------------------------------------------------------------
1521 cuam?)
1522 unit=`expr $i : 'cua.*\(.\)$'`
1524 m=`ttyminor $unit`
1526 mknod cuam $unit c 63 $(($m + 128)) uucp:dialer 660
1529 #-----------------------------------------------------------------------------
1531 ttym?)
1532 unit=`expr $i : 'tty.*\(.\)$'`
1534 m=`ttyminor $unit`
1536 mknod ttym $unit c 63 $m
1539 #-----------------------------------------------------------------------------
1541 ttyA*)
1542 major=68
1543 nports=`expr $i : 'ttyA\(.*\)$'`
1544 port=1
1546 while [ $port -le $nports ]
1548 minor=$(($port - 1))
1549 name=$(printf %02d $port)
1551 mknod ttyA $name c $major $minor
1552 mknod ttyiA $name c $major $(($minor + 65536))
1553 mknod ttylA $name c $major $(($minor + 131072))
1555 port=$(($port + 1))
1556 done
1558 # For the user-mode control program, 'sicontrol'
1559 mknod si_control "" c 68 262144
1562 #-----------------------------------------------------------------------------
1564 cuaA*)
1565 major=68
1566 nports=`expr $i : 'cuaA\(.*\)$'`
1567 port=1
1569 while [ $port -le $nports ]
1571 minor=$(($port - 1))
1572 name=$(printf %02d $port)
1574 mknod cuaA $name c $major $(($minor + 128)) uucp:dialer 660
1575 mknod cuaiA $name c $major $(($minor + 128 + 65536)) \
1576 uucp:dialer 660
1577 mknod cualA $name c $major $(($minor + 128 + 131072)) \
1578 uucp:dialer 660
1580 port=$(($port + 1))
1581 done
1584 #-----------------------------------------------------------------------------
1586 ttyD?)
1587 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f"
1588 major=58
1589 card=`expr $i : 'tty.*\(.\)$'`
1591 for unit in $portlist
1593 minor=`ttyminor $unit`
1594 minor=$(($card * 65536 + $minor))
1595 name=$card$unit
1597 mknod ttyD $name c $major $minor
1598 mknod ttyiD $name c $major $(($minor + 32))
1599 mknod ttylD $name c $major $(($minor + 64))
1600 done
1603 #-----------------------------------------------------------------------------
1605 cuaD?)
1606 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f"
1607 major=58
1608 card=`expr $i : 'cua.*\(.\)$'`
1610 for unit in $portlist
1612 minor=`ttyminor $unit`
1613 minor=$(($card * 65536 + $minor))
1614 name=$card$unit
1616 mknod cuaD $name c $major $(($minor + 128)) uucp:dialer 660
1617 mknod cuaiD $name c $major $(($minor + 32 + 128)) \
1618 uucp:dialer 660
1619 mknod cualD $name c $major $(($minor + 64 + 128)) \
1620 uucp:dialer 660
1621 done
1624 #-----------------------------------------------------------------------------
1626 ttyE*)
1627 stallion 72 E `expr $i : 'tty.*\(.\)$'` 0
1629 cuaE*)
1630 stallion 72 E `expr $i : 'cua.*\(.\)$'` 1
1632 stl*)
1633 card=`expr $i : 'stl\(.\)$'`
1634 stallion 72 E $card 0
1635 stallion 72 E $card 1
1638 ttyF*)
1639 stallion 75 F `expr $i : 'tty.*\(.\)$'` 0
1641 cuaF*)
1642 stallion 75 F `expr $i : 'cua.*\(.\)$'` 1
1644 stli*)
1645 card=`expr $i : 'stl\(.\)$'`
1646 stallion 75 F $card 0
1647 stallion 75 F $card 1
1650 ttyM*)
1651 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f"
1652 modulelist="a b c d"
1653 major=101
1654 card=`expr $i : 'tty.*\(.\)$'`
1656 for unit in $modulelist
1658 moduleminor=`ttyminor $unit`
1659 moduleminor=$(($moduleminor % 10 * 16))
1660 modulename=$unit
1662 for unit in $portlist
1664 minor=`ttyminor $unit`
1665 minor=$(($card * 65536 + $minor + $moduleminor))
1666 name=$card$modulename$unit
1668 rm -f tty*M$name
1670 mknod ttyM $name c $major $minor
1671 mknod ttyiM $name c $major $(($minor + 64))
1672 mknod ttylM $name c $major $(($minor + 128))
1673 done
1674 done
1677 cuaM?)
1678 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f"
1679 modulelist="a b c d"
1680 major=101
1681 card=`expr $i : 'cua.*\(.\)$'`
1683 for unit in $modulelist
1685 moduleminor=`ttyminor $unit`
1686 moduleminor=$(($moduleminor % 10 * 16))
1687 modulename=$unit
1689 for unit in $portlist
1691 minor=`ttyminor $unit`
1692 minor=$(($card * 65536 + $minor + $moduleminor))
1693 name=$card$modulename$unit
1695 rm -f cua*M$name
1697 mknod cuaM $name c $major $(($minor + 262144)) \
1698 uucp:dialer 660
1699 mknod cuaiM $name c $major $(($minor + 64 + 262144)) \
1700 uucp:dialer 660
1701 mknod cualM $name c $major $(($minor + 128 + 262144)) \
1702 uucp:dialer 660
1703 done
1704 done
1707 ttyR?)
1708 major=81
1709 BOARD=1; Rnum=0
1710 MINOR=$(($BOARD * 65536))
1711 controllers=$(
1712 dmesg | while read first rest
1714 case "$first" in
1715 RocketPort[0-4]) echo "$first"
1717 esac
1718 done)
1720 rm -f ttyR* ttyiR* ttylR*
1722 for i in $controllers
1724 ndevices=$(
1725 dmesg | while read first bar ports rest
1727 case "$first" in
1728 $i*) echo "$ports"
1730 esac
1731 done)
1733 echo -n "Creating $ndevices devices for $i: "
1734 dev=0
1736 while [ $dev -lt $ndevices ]
1738 mknod ttyR $Rnum c $major $MINOR
1739 mknod ttyiR $Rnum c $major $(($MINOR + 32))
1740 mknod ttylR $Rnum c $major $(($MINOR + 64))
1742 Rnum=$(($Rnum + 1))
1743 MINOR=$(($MINOR + 1))
1745 dev=$(($dev + 1))
1746 done
1748 BOARD=$(($BOARD + 1))
1749 MINOR=$(($BOARD * 65536))
1750 echo " "
1751 done
1754 cuaR?)
1755 major=81
1756 BOARD=1; Rnum=0
1757 MINOR=$(($BOARD * 65536))
1758 controllers=$(
1759 dmesg | while read first rest
1761 case "$first" in
1762 RocketPort[0-4]) echo "$first"
1764 esac
1765 done)
1767 rm -f cuaR* cuaiR* cualR*
1769 for i in $controllers
1771 ndevices=$(
1772 dmesg | while read first bar ports rest
1774 case "$first" in
1775 $i*) echo "$ports"
1777 esac
1778 done)
1780 echo -n "Creating $ndevices devices for $i: "
1781 dev=0
1783 while [ $dev -lt $ndevices ]
1785 mknod cuaR $Rnum c $major $(($MINOR + 128)) \
1786 uucp:dialer 660
1787 mknod cuaiR $Rnum c $major $(($MINOR + 128 + 32)) \
1788 uucp:dialer 660
1789 mknod cualR $Rnum c $major $(($MINOR + 128 + 64)) \
1790 uucp:dialer 660
1792 Rnum=$(($Rnum + 1))
1793 MINOR=$(($MINOR + 1))
1795 dev=$(($dev + 1))
1796 done
1798 BOARD=$(($BOARD + 1))
1799 MINOR=$(($BOARD * 65536))
1800 echo " "
1801 done
1804 #-----------------------------------------------------------------------------
1806 mse*)
1807 unit=`expr $i : 'mse\(.*\)'`
1808 chr=27
1810 # Non-blocking for X11
1811 mknod mse $unit c $chr `unit2minor $(($unit * 2 + 1))`
1814 #-----------------------------------------------------------------------------
1816 psm*)
1817 unit=`expr $i : 'psm\(.*\)'`
1818 chr=21
1820 # Non-blocking for X11
1821 mknod psm $unit c $chr `unit2minor $(($unit * 2 + 1))`
1824 #-----------------------------------------------------------------------------
1826 mouse*)
1827 name=`expr $i : 'mouse\(.*\)'`
1829 [ -c $name ] || $0 $name # Make the appropriate device
1831 ln -fs $name mouse
1834 #-----------------------------------------------------------------------------
1836 pcaudio)
1837 mknod pcaudio "" c 24 0
1838 mknod pcaudioctl "" c 24 128
1841 #-----------------------------------------------------------------------------
1843 socksys)
1844 mknod socksys "" c 41 0 root:wheel 666
1845 mknod spx "" c 41 1 root:wheel 666
1847 ln -fs socksys nfsd
1850 #-----------------------------------------------------------------------------
1852 snd*)
1854 unit=`expr $i : 'snd\(.*\)'`
1855 chr=30
1857 ln -fs mixer$unit mixer
1858 ln -fs sequencer$unit sequencer
1859 ln -fs dsp$unit dsp
1860 ln -fs audio$unit audio
1861 ln -fs dspW$unit dspW
1862 ln -fs music$unit music
1863 ln -fs pss$unit pss
1864 ln -fs dsp$unit.0 dsp$unit
1865 ln -fs audio$unit.0 audio$unit
1866 ln -fs dspW$unit.0 dspW$unit
1868 mknod mixer $unit c $chr `unit2minor $(($unit * 16 + 0))` \
1869 root:wheel 666
1870 mknod sequencer $unit c $chr `unit2minor $(($unit * 16 + 1))` \
1871 root:wheel 666
1872 mknod midi $unit c $chr `unit2minor $(($unit * 16 + 2))` \
1873 root:wheel 666
1875 for chn in 0 1 2 3
1877 minor=$(($chn * 65536 + $unit * 16))
1879 mknod dsp $unit.$chn c $chr $(($minor + 3)) root:wheel 666
1880 mknod audio $unit.$chn c $chr $(($minor + 4)) root:wheel 666
1881 mknod dspW $unit.$chn c $chr $(($minor + 5)) root:wheel 666
1882 done
1884 mknod sndstat "" c $chr 6 root:wheel 666
1885 mknod music $unit c $chr `unit2minor $(($unit * 16 + 8))` root:wheel 666
1886 mknod pss $unit c $chr `unit2minor $(($unit * 16 + 9))` root:wheel 666
1889 #-----------------------------------------------------------------------------
1891 vat)
1892 mknod vatio "" c 25 128 root:wheel 660
1895 #-----------------------------------------------------------------------------
1897 gsc*)
1898 unit=`expr $i : 'gsc\(.*\)'`
1900 mknod gsc $unit c 47 `unit2minor $unit` root:wheel 666
1901 mknod gsc ${unit}p c 47 `unit2minor $(($unit + 8))` root:wheel 666
1902 mknod gsc ${unit}d c 47 `unit2minor $(($unit + 32))` root:wheel 666
1903 mknod gsc ${unit}pd c 47 `unit2minor $(($unit + 40))` root:wheel 666
1906 #-----------------------------------------------------------------------------
1908 acpi)
1909 mknod acpi "" c 152 0 root:operator 664
1912 #-----------------------------------------------------------------------------
1914 apm)
1915 mknod apm "" c 39 0 root:operator 664
1918 #-----------------------------------------------------------------------------
1920 apmctl)
1921 mknod apmctl "" c 39 8 root:operator 660
1924 #-----------------------------------------------------------------------------
1926 card*)
1927 unit=`expr $i : 'card\(.*\)'`
1928 chr=50
1930 mknod card $unit c $chr `unit2minor $unit` root:wheel 644
1933 #-----------------------------------------------------------------------------
1935 ttyx?|ttyy?|ttyz?)
1936 case $i in
1937 *0) unit=0;; *1) unit=1;; *2) unit=2;; *3) unit=3;;
1938 *4) unit=4;; *5) unit=5;; *6) unit=6;; *7) unit=7;;
1939 *8) unit=8;; *9) unit=9;; *a) unit=10;; *b) unit=11;;
1940 *c) unit=12;; *d) unit=13;; *e) unit=14;; *f) unit=15;;
1941 esac
1943 case $i in
1944 ttyy?) unit=$(($unit + 16));;
1945 ttyz?) unit=$(($unit + 32));;
1946 esac
1948 mknod $i "" c 42 $unit
1951 #-----------------------------------------------------------------------------
1953 cronyx)
1954 mknod cronyx "" c 42 63
1957 #-----------------------------------------------------------------------------
1959 joy)
1960 mknod joy 0 c 51 0 root:operator 640
1961 mknod joy 1 c 51 1 root:operator 640
1964 #-----------------------------------------------------------------------------
1966 spigot)
1967 mknod spigot "" c 11 0 root:wheel 444
1970 #-----------------------------------------------------------------------------
1972 ctx?)
1973 unit=`expr $i : 'ctx\(.*\)'`
1975 mknod ctx $unit c 40 `unit2minor $unit` root:wheel 444
1978 #-----------------------------------------------------------------------------
1980 meteor?)
1981 unit=`expr $i : 'meteor\(.*\)'`
1983 mknod meteor $unit c 67 `unit2minor $unit` root:wheel 444
1986 #-----------------------------------------------------------------------------
1988 bktr?)
1989 unit=`expr $i : 'bktr\(.*\)'`
1991 mknod bktr $unit c 92 `unit2minor $unit` root:wheel 444
1992 mknod tuner $unit c 92 `unit2minor $((16 + $unit))` root:wheel 444
1993 mknod vbi $unit c 92 `unit2minor $((32 + $unit))` root:wheel 444
1996 #-----------------------------------------------------------------------------
1998 tun*)
1999 ntun=`expr $i : 'tun\(.*\)$'`
2000 unit=0
2002 while [ $unit -le $ntun ]
2004 mknod tun $unit c 52 `unit2minor $unit`
2006 unit=$(($unit + 1))
2007 done
2010 #-----------------------------------------------------------------------------
2012 tap*)
2013 ntap=`expr $i : 'tap\(.*\)$'`
2014 unit=0
2016 while [ $unit -le $ntap ]
2018 mknod tap $unit c 149 `unit2minor $unit` root:network
2020 unit=$(($unit + 1))
2021 done
2024 #-----------------------------------------------------------------------------
2026 sysmouse)
2027 mknod sysmouse "" c 12 128
2028 mknod consolectl "" c 12 255
2031 #-----------------------------------------------------------------------------
2033 jogdial)
2034 mknod jogdial "" c 160 0
2037 #-----------------------------------------------------------------------------
2039 snp?)
2040 unit=`expr $i : 'snp\(.*\)'`
2042 mknod snp $unit c 53 `unit2minor $unit`
2045 #-----------------------------------------------------------------------------
2047 labpc*)
2048 case $i in
2049 labpcaio*)
2050 name=labpcaio
2051 unit=`expr $i : 'labpcaio\(.*\)'`
2052 all="0 1 2 3 4 5 6 7"
2053 offset=0
2056 labpcdio*)
2057 name=labpcdio
2058 unit=`expr $i : 'labpcdio\(.*\)'`
2059 all="0 1 2 3"
2060 offset=8
2064 die 3 "Don't know LabPC type $i"
2066 esac
2068 [ "${unit}" ] || unit=all
2070 case $unit in
2071 0|1|2|3|4|5|6|7)
2072 mknod $name $unit c 66 $(($offset + $unit)) \
2073 root:wheel 660
2076 all)
2077 for i in $all
2079 mknod $name $i c 66 $(($offset + $i)) \
2080 root:wheel 660
2081 done
2085 echo "No such LabPC unit: $unit"
2087 esac
2090 #-----------------------------------------------------------------------------
2092 perfmon)
2093 mknod perfmon "" c 2 32 root:kmem 640
2096 #-----------------------------------------------------------------------------
2098 ipl)
2099 mknod ipl "" c 79 0
2100 mknod ipnat "" c 79 1
2101 mknod ipstate "" c 79 2
2102 mknod ipauth "" c 79 3
2105 #-----------------------------------------------------------------------------
2107 elan*)
2108 mknod elan-mmcr "" c 100 0 root:wheel 600
2111 #-----------------------------------------------------------------------------
2113 kbd*)
2114 unit=`expr $i : 'kbd\(.*\)'`
2115 chr=112
2117 mknod kbd $unit c $chr `unit2minor $unit`
2120 #-----------------------------------------------------------------------------
2122 i4b)
2123 mknod i4b "" c 60 0
2126 i4bctl)
2127 mknod i4bctl "" c 55 0
2130 i4brbch*)
2131 unit=`expr $i : 'i4brbch\(.*\)'`
2133 mknod i4brbch $unit c 57 `unit2minor $unit`
2136 i4bteld*)
2137 offset=64
2138 unit=`expr $i : 'i4bteld\(.*\)'`
2140 mknod i4bteld $unit c 56 `unit2minor $(($offset + $unit))`
2143 i4btel*)
2144 unit=`expr $i : 'i4btel\(.*\)'`
2146 mknod i4btel $unit c 56 `unit2minor $unit`
2149 i4btrc*)
2150 unit=`expr $i : 'i4btrc\(.*\)'`
2152 mknod i4btrc $unit c 59 `unit2minor $unit`
2155 #-----------------------------------------------------------------------------
2157 aac*)
2158 unit=`expr $i : 'aac\(.*\)'`
2160 mknod aac $unit c 150 `unit2minor $unit`
2162 ln -fs aac$unit afa$unit
2163 ln -fs aac$unit hpn$unit
2166 #-----------------------------------------------------------------------------
2168 mlx*)
2169 unit=`expr $i : 'mlx\(.*\)'`
2171 mknod mlx $unit c 130 `unit2minor $unit`
2174 #-----------------------------------------------------------------------------
2176 amr*)
2177 unit=`expr $i : 'amr\(.*\)'`
2179 mknod amr $unit c 132 `unit2minor $unit`
2182 #-----------------------------------------------------------------------------
2184 ips*)
2185 unit=`expr $i : 'ips\(.*\)'`
2187 mknod mlx $unit c 175 `unit2minor $unit`
2190 #-----------------------------------------------------------------------------
2192 ciss*)
2193 unit=`expr $i : 'ciss\(.*\)'`
2195 mknod ciss $unit c 166 `unit2minor $unit`
2198 #-----------------------------------------------------------------------------
2200 agpgart)
2201 mknod agpgart "" c 148 0
2204 #-----------------------------------------------------------------------------
2206 twe*)
2207 unit=`expr $i : 'twe\(.*\)'`
2209 mknod twe $unit c 146 `unit2minor $unit`
2212 #-----------------------------------------------------------------------------
2214 tw*)
2215 unit=`expr $i : 'tw\(.*\)'`
2217 mknod tw $unit c 19 `unit2minor $unit` root:operator
2220 #-----------------------------------------------------------------------------
2222 nsmb*)
2223 unit=`expr $i : 'nsmb\(.*\)'`
2225 mknod nsmb $unit c 144 $unit
2228 #-----------------------------------------------------------------------------
2230 local)
2231 umask 0
2232 sh MAKEDEV.local
2233 umask 77
2236 #-----------------------------------------------------------------------------
2239 echo $i - no such device name
2242 esac
2243 done