Add support for cmx(4) devices.
[dragonfly.git] / etc / MAKEDEV
CommitLineData
984263bc
MD
1#!/bin/sh -
2#
3# Copyright (c) 1990 The Regents of the University of California.
4# All rights reserved.
5#
6# Written and contributed by W. Jolitz 12/90
7#
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.
21#
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 $
1038677d 24# $DragonFly: src/etc/MAKEDEV,v 1.41 2008/04/23 09:44:07 hasso Exp $
984263bc
MD
25#
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)
33#
34# Tapes:
35# ast* ATAPI tape drives
36# wt* QIC-interfaced (e.g. not SCSI) 3M cartridge tape
37# sa* SCSI Sequential Access Devices
38#
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
7dc62e37 46# ccd* CCD disks
984263bc
MD
47# cd* SCSI CD-ROM disks
48# da* SCSI Direct Access Devices
49# fd* floppy disk drives (3 1/2", 5 1/4")
984263bc 50# idad* Compaq Smart-2 RAID arrays
edc6143b
DR
51# ips* IBM ServeRAID controller
52# ipsd* IBM ServeRAID
984263bc
MD
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
984263bc 57# vn* vnode disks
e1002718 58# vkd* virtual kernel disk
984263bc
MD
59#
60# Console ports:
7e5d4a4c 61# vty* virtual console devices for syscons
984263bc
MD
62#
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
68#
984263bc
MD
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
82#
83# stlN Stallion EasyIO board N dialin and dialout
84# stliN Stallion Brumby board N dialin and dialout
85#
86# Pseudo terminals:
87# pty* set of 32 master and slave pseudo terminals
7e5d4a4c 88# vty* virtual terminals using syscons console
984263bc
MD
89#
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
95#
96# I2C and SMBus:
97# iic* I2C devices
98# smb* SMBUS devices
99#
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
110#
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
0ca0cd25 116# SAF-TE (SCSI Accessible Fault-Tolerant Enclosures) device
984263bc
MD
117#
118# PC-CARD (previously called PCMCIA) support
119# card* PC-CARD slots
120#
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)
128#
129# Special purpose devices:
967ae586 130# acpi ACPI control device
984263bc
MD
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
984263bc 157# nsmb* SMB/CIFS protocol interface
95cc27f0 158# pf PF packet filter
1038677d 159# cmx Omnikey CardMan 4040 smartcard reader
984263bc 160#
093d5d6c
MD
161##############################################################################
162#
163# To override the default ownership and/or permissions, you now have the
164# /etc/devices.conf file (create it if it's not there). Entries in this file
165# should look like:
166#
167# ad0s1c root:staff 666 # Override ad0s1c
168# ad0* root:wheel 641 # Override the entire ad0 family
169# sa0.ctl heinz:ketchup 444 # Override device control node
170# sa*.ctl heinz:ketchup 666 # Override all sa* control nodes
171# fd/4 ihate:floppies 000 # Override /dev/fd/4
172#
173# See the devices.conf(5) man page for further information.
174#
175# J.Anslik (joerg@anslik.de)
176#
177##############################################################################
178
179
180
181#-----------------------------------------------------------------------------
182# Where all device special files are built.
183#-----------------------------------------------------------------------------
184
185DEVDIR=dev
186
187
188#-----------------------------------------------------------------------------
189# File containing local ownership and permissions override entries.
190#-----------------------------------------------------------------------------
191
192DEVPERMS_LOCAL="/etc/devices.conf"
193
194
195#-----------------------------------------------------------------------------
196# Some useful programs.
197#-----------------------------------------------------------------------------
984263bc 198
093d5d6c
MD
199cut=/usr/bin/cut
200grep=/usr/bin/grep
201mknod=/sbin/mknod
202sed=/usr/bin/sed
203tr=/usr/bin/tr
204
205
206#-----------------------------------------------------------------------------
207# Set up a default search path.
208#-----------------------------------------------------------------------------
209
210if [ -n "$MAKEDEVPATH" ]
211then
984263bc
MD
212 PATH="$MAKEDEVPATH"
213else
214 PATH=/sbin:/bin
215fi
984263bc 216
093d5d6c
MD
217
218#-----------------------------------------------------------------------------
219# Print error message $2 and exit this script, returning $1.
220#-----------------------------------------------------------------------------
221
222die()
223{
984263bc 224 echo $2
093d5d6c 225
984263bc
MD
226 exit $1
227}
228
093d5d6c
MD
229
230#-----------------------------------------------------------------------------
231# Convert integer to partition name.
232#-----------------------------------------------------------------------------
233
234dkitop()
235{
984263bc
MD
236 local p
237
238 case $1 in
093d5d6c
MD
239 0) p=a;; 1) p=b;; 2) p=c;; 3) p=d;;
240 4) p=e;; 5) p=f;; 6) p=g;; 7) p=h;;
241 8) p=i;; 9) p=j;; 10) p=k;; 11) p=l;;
242 12) p=m;; 13) p=n;; 14) p=o;; 15) p=p;;
243 *) p="?";;
984263bc 244 esac
093d5d6c 245
984263bc
MD
246 echo $p
247}
248
093d5d6c
MD
249
250#-----------------------------------------------------------------------------
251# Convert integer to slice name.
252#-----------------------------------------------------------------------------
253
254dkitos()
255{
984263bc
MD
256 local s
257
258 case $1 in
291fc38f
MD
259 0) s="s0" ;;
260 1) s="" ;;
261 *) s=s$(($1-1)) ;;
984263bc 262 esac
093d5d6c 263
984263bc
MD
264 echo $s
265}
266
093d5d6c 267#-----------------------------------------------------------------------------
5350e1e9 268# Convert unit, slice, partition to minor number.
093d5d6c 269#-----------------------------------------------------------------------------
5350e1e9
MD
270#
271# ndkminor(unit, slice, partition)
093d5d6c 272
5350e1e9 273ndkminor()
984263bc 274{
5350e1e9
MD
275 echo $(( (($1 & 31) << 3) | (($1 & 480) << 16) | \
276 (($2 & 15) << 16) | (($2 & 112) << 25) | \
277 ($3 & 7) | (($3 & 8) << 17) | (($3 & 240) << 21) ))
984263bc
MD
278}
279
093d5d6c
MD
280
281#-----------------------------------------------------------------------------
282# Create the device node.
283#-----------------------------------------------------------------------------
284
984263bc 285mknod() {
093d5d6c
MD
286
287 local dev=$1
288 local unit=$2
289
290 #---------------------------------------------------------------------
291 # Remove old device node, if any.
292 #---------------------------------------------------------------------
293
294 rm -f "$dev$unit" || exit 1
295
296
297 #---------------------------------------------------------------------
298 # Supply default ownership and/or permissions according to the
299 # number of parameters passed to this function.
300 #---------------------------------------------------------------------
301
984263bc 302 case $# in
093d5d6c
MD
303 5) owner=root:wheel; perms=600;;
304 6) owner=$6; perms=600;;
305 7) owner=$6; perms=$7;;
306 *) die 2 "Bad call: mknod $@";;
984263bc 307 esac
093d5d6c
MD
308
309
310 #---------------------------------------------------------------------
311 # Get rid of first two parameters (no longer needed)
312 #---------------------------------------------------------------------
313
314 shift; shift
315
316
317 #---------------------------------------------------------------------
318 # If there's a /etc/devices.conf file, check for local overrides.
319 #---------------------------------------------------------------------
320
321 if [ -s $DEVPERMS_LOCAL ]
322 then
323 #-------------------------------------------------------------
324 # Temporarily prepend the device portion with a subdir name
325 # if we're not in $DEVDIR. We need to do this to distinguish
326 # between device nodes that live in /dev, and device nodes
327 # that live in /dev/subdir, like /dev/fd. This way, we can
328 # have "fd*" entries in the permission files, as well as
329 # "fd/*" stuff.
330 #-------------------------------------------------------------
331
332 tmpdev=$dev
333 pwd=`/usr/bin/basename $PWD`
334
335 [ "$pwd" = "$DEVDIR" ] || dev="${pwd}/$dev"
336
337
338 #-------------------------------------------------------------
339 # Check /etc/devices.conf for local overrides
340 #-------------------------------------------------------------
341
342 match=`$grep ^$dev$unit[[:space:]] $DEVPERMS_LOCAL | \
343 $sed 's/\*/\\\*/'`
344
345 [ "$match" ] ||
346 if [ `expr "$unit" : '\(.*\)\.ctl$'` ]
347 then
348 match=`$grep ^$dev\\\*\\\.ctl[[:space:]] \
349 $DEVPERMS_LOCAL | $sed 's/\*/\\\*/'`
350 else
351 match=`$grep ^$dev\\\*[[:space:]] $DEVPERMS_LOCAL | \
352 $sed 's/\*/\\\*/'`
353 fi
354
355 if [ "$match" ]
356 then
357 # Separate each field by one space character...
358 match=`echo $match | $tr -s "[:space:]" " "`
359
360 # ...and extract owenership and permissions.
361 owner=`echo $match | $cut -d' ' -f2`
362 perms=`echo $match | $cut -d' ' -f3`
363 fi
364
365 #-------------------------------------------------------------
366 # Restore "plain" device name (no prepending subdir name).
367 #-------------------------------------------------------------
368
369 dev=$tmpdev
370 fi
371
372 #---------------------------------------------------------------------
373 # Finally, set ownership and permissions.
374 #---------------------------------------------------------------------
375
376 $mknod $dev$unit $1 $2 $3 $owner
377 chmod $perms $dev$unit
984263bc
MD
378}
379
093d5d6c
MD
380
381#-----------------------------------------------------------------------------
382# Convert tape (ctrl, unit, mode, access) to device minor number.
383#-----------------------------------------------------------------------------
384
984263bc
MD
385saminor()
386{
387 echo $(($1 << 29 | ($2 / 16) << 16 | ($2 % 16) << 4 | $3 << 2 | $4))
388}
389
093d5d6c
MD
390
391#-----------------------------------------------------------------------------
392# Convert the last character of a tty name to a device minor number.
393#-----------------------------------------------------------------------------
394
984263bc
MD
395ttyminor()
396{
397 case $1 in
398 [0-9]) m=$1;;
093d5d6c
MD
399 a) m=10;; b) m=11;; c) m=12;; d) m=13;;
400 e) m=14;; f) m=15;; g) m=16;; h) m=17;;
401 i) m=18;; j) m=19;; k) m=20;; l) m=21;;
402 m) m=22;; n) m=23;; o) m=24;; p) m=25;;
403 q) m=26;; r) m=27;; s) m=28;; t) m=29;;
404 u) m=30;; v) m=31;;
984263bc
MD
405 *) m="?";;
406 esac
093d5d6c 407
984263bc
MD
408 echo $m
409}
410
093d5d6c
MD
411
412#-----------------------------------------------------------------------------
413# Convert a unit number to a device minor number.
414#-----------------------------------------------------------------------------
415
984263bc
MD
416unit2minor()
417{
093d5d6c 418 echo $(((($1 >> 8) << 16) | ($1 % 256)))
984263bc
MD
419}
420
093d5d6c
MD
421
422#-----------------------------------------------------------------------------
423# Stallion devices need some (weird) special treatment.
424#-----------------------------------------------------------------------------
425
426stallion()
427{
984263bc
MD
428 major=$1
429 letter=$2
430 card=$3
431 iscallout=$4
432
433 port=0
434 maxport=8
435 pref=tty
436 owner=
437 minorbase=0
438
093d5d6c
MD
439 if [ $iscallout -gt 0 ]
440 then
441 pref=cua
442 owner=uucp:dialer
443 minorbase=128
984263bc
MD
444 fi
445
446 case "$card" in
447 [0-7]);;
093d5d6c 448 *) die 1 "Invalid stl card number $card";;
984263bc
MD
449 esac
450
093d5d6c 451 # Make the mem interface for extracting stats & loading microcode.
984263bc 452 # 0x1000000 + card number
093d5d6c
MD
453 mknod staliomem $card c $major 0x0100000$card
454
455 while [ $port -lt $maxport ]
456 do
457 minor=$(($minorbase + $card * 1048576 + $port))
458
459 [ $port -lt 32 ] || minor=$(($minor + 65504))
460
461 unit=$(($card * 64 + $port))
984263bc 462
093d5d6c
MD
463 mknod ${pref}${letter} $unit c $major $minor $owner
464 mknod ${pref}i${letter} $unit c $major $(($minor + 32)) $owner
465 mknod ${pref}l${letter} $unit c $major $(($minor + 64)) $owner
984263bc 466
093d5d6c
MD
467 port=$(($port + 1))
468 done
469}
984263bc 470
984263bc 471
093d5d6c
MD
472#-----------------------------------------------------------------------------
473# Do it.
474#-----------------------------------------------------------------------------
984263bc
MD
475
476for i in $*; do
477case $i in
478
479all)
291fc38f 480 rm -f *.compat
984263bc
MD
481 sh MAKEDEV std # standard
482 sh MAKEDEV fd0 fd1 # bdev, floppy disk
315ce04d 483 sh MAKEDEV da0 da1 da2 da3 da4 da5 da6 da7 # bdev, SCSI disk
661ed2bb
YT
484 sh MAKEDEV da8 da9 da10 da11 da12 da13 da14 # bdev, SCSI disk
485 sh MAKEDEV da15 # bdev, SCSI disk
7dc62e37 486 sh MAKEDEV ccd0 ccd1 ccd2 ccd3 # ccd disk
984263bc 487 sh MAKEDEV ata # cdev, ATA control
315ce04d 488 sh MAKEDEV ad0 ad1 ad2 ad3 ad4 ad5 ad6 ad7 # bdev, ATA disk
984263bc
MD
489 sh MAKEDEV ar0 ar1 # bdev, ATA RAID disk
490 sh MAKEDEV acd0 afd0 ast0 # bdev, ATAPI devices
d45232a8 491 sh MAKEDEV vn0 vn1 vn2 vn3 # bdev, virtual disk
e1002718 492 sh MAKEDEV vkd0 # bdev, virtual disk
564d23ae 493 sh MAKEDEV cd0 # bdev, cdrom
984263bc
MD
494 sh MAKEDEV sa0 wt0 # bdev, tape
495 sh MAKEDEV vty12 # cdev, virtual tty
496 sh MAKEDEV cuaa0 cuaa1 cuaa2 cuaa3 # cdev, serial tty
497 sh MAKEDEV pty0 # cdev, pseudo tty
498 sh MAKEDEV ttyd0 ttyd1 ttyd2 ttyd3 # cdev, serial tty
984263bc
MD
499 sh MAKEDEV kbd0 kbd1 # cdev, keyboard
500 sh MAKEDEV mse0 psm0 jogdial sysmouse # cdev, mouse
501 sh MAKEDEV pcaudio speaker snd0 # cdev, noise
0f3fd031 502 sh MAKEDEV ipsd0 # cdev, ServeRAID disk
984263bc
MD
503 sh MAKEDEV lpt0 lpt1 lpt2 # cdev, printer
504 sh MAKEDEV ppi0 ppi1 ppi2 # cdev, parallel port
505 sh MAKEDEV iic0 iic1 # cdev, I2C device
506 sh MAKEDEV smb0 smb1 # cdev, SMBus device
507 sh MAKEDEV usb usb0 uhid0 ums0 ulpt0 ugen0 # cdev, USB devices
6383c6a5 508 sh MAKEDEV usb1 uhid1 ums1 ulpt1 ugen1 # cdev, USB devices
105db806 509 sh MAKEDEV usb2 usb3 usb4 usb5 usb6 usb7 # cdev, USB devices
984263bc 510 sh MAKEDEV urio0 uscanner0 umodem0 # cdev, USB devices too
105db806 511 sh MAKEDEV ucom0 ucom1 ucom2 ucom3 # cdev, USB serial devices
984263bc
MD
512 sh MAKEDEV bpf0 bpf1 bpf2 bpf3 # cdev, network
513 sh MAKEDEV ipl tun0 tun1 tun2 tun3 # cdev, network
514 sh MAKEDEV tap0 tap1 tap2 tap3 # cdev, network
515 sh MAKEDEV ch0 perfmon tw0 # cdev, miscellaneous
967ae586 516 sh MAKEDEV acpi # cdev, laptop
984263bc
MD
517 sh MAKEDEV apm apmctl card0 card1 card2 card3 # cdev, laptop
518 sh MAKEDEV pass4 xpt2 # cdev, CAM
519 sh MAKEDEV i4b i4bctl i4btrc0 i4btrc1 # cdev, ISDN
520 sh MAKEDEV i4btel0 i4btel1 i4bteld0 i4bteld1 # cdev, ISDN
521 sh MAKEDEV i4brbch0 i4brbch1 # cdev, ISDN
522 sh MAKEDEV agpgart # cdev, AGP
523 sh MAKEDEV nsmb0 # cdev, SMB/CIFS
31e88f68 524 sh MAKEDEV twed0 # 3ware
984263bc 525 sh MAKEDEV crypto # cdev, crypto
cbf42d05 526 sh MAKEDEV fw0 # cdev, firewire
41451722 527 sh MAKEDEV dcons # cdev, dcons
95cc27f0 528 sh MAKEDEV pf # pf
984263bc
MD
529 ;;
530
093d5d6c
MD
531
532#-----------------------------------------------------------------------------
533# A much restricted set of the above, to save precious i-nodes on the
984263bc 534# fixit floppy
093d5d6c
MD
535#-----------------------------------------------------------------------------
536
984263bc
MD
537fixit)
538 sh MAKEDEV std # standard
539 sh MAKEDEV fd0 # bdev, floppy disk
540 sh MAKEDEV da0 # bdev, SCSI disk
541 sh MAKEDEV ad0 # bdev, ATA disk
542 sh MAKEDEV acd0 afd0 ast0 # bdev, ATAPI devices
984263bc 543 sh MAKEDEV vn0 # bdev, virtual disk
e1002718 544 sh MAKEDEV vkd0 # bdev, virtual disk
984263bc
MD
545 sh MAKEDEV cd0 # bdev, cdrom
546 sh MAKEDEV sa0 # bdev, tape
547 sh MAKEDEV vty2 # cdev, virtual tty
548 sh MAKEDEV cuaa0 # cdev, serial tty
549 sh MAKEDEV pty0 # cdev, pseudo tty
550 sh MAKEDEV ttyd0 # cdev, serial tty
984263bc
MD
551 sh MAKEDEV kbd0 # cdev, keyboard
552 sh MAKEDEV mse0 psm0 sysmouse # cdev, mouse
553 sh MAKEDEV lpt0 # cdev, printer
554 sh MAKEDEV ppi0 # cdev, parallel port
555 sh MAKEDEV iic0 # cdev, I2C device
556 sh MAKEDEV smb0 # cdev, SMBus device
557 sh MAKEDEV ums0 # cdev, USB devices
558 sh MAKEDEV tun0 # cdev, network
559 sh MAKEDEV tap0 # cdev, network
560 sh MAKEDEV ch0 # cdev, miscellaneous
561 sh MAKEDEV apm apmctl card0 # cdev, laptop
562 sh MAKEDEV pass1 xpt1 # cdev, CAM
563 sh MAKEDEV i4b i4bctl i4btrc0 i4btrc1 # cdev, ISDN
564 sh MAKEDEV i4btel0 i4bteld0 # cdev, ISDN
565 sh MAKEDEV i4brbch0 # cdev, ISDN
566 rm -f fd/[1-9]?
567 ;;
568
f0c7b67f
MD
569#-----------------------------------------------------------------------------
570# Upgrade existing node set.
571#
572# 1.9 - disk devices have changed
573#-----------------------------------------------------------------------------
574upgrade)
575 echo -n "upgrading... "
36d1bf94 576 for i in aacd ad ar afd amrd ccd da fd idad ipsd md \
f0c7b67f
MD
577 mlxd pst twed vn vkd
578 do
579 for j in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
580 do
581 if [ -c $i$j ]; then
582 rm -f $i$j
583 rm -f $i${j}[a-p]
584 echo -n " $i$j $i${j}s0[a-p] $i${j}s1[a-p]"
585 sh MAKEDEV $i$j
586 # s0 and s1 handled by base
587 for k in s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 \
588 s12 s13 s14 s15
589 do
590 if [ -c $i$j${k}c ]; then
591 rm -f ${i}${j}${k}*
592 echo -n " $i$j$k"
593 sh MAKEDEV $i$j$k
594 echo -n " $i$j$k[a-p]"
595 sh MAKEDEV $i$j${k}a
596 elif [ -c $i$j$k ]; then
597 rm -f ${i}${j}${k}*
598 echo -n " $i$j$k"
599 sh MAKEDEV $i$j$k
600 fi
601 done
602 fi
603 done
604 done
605 for i in acd cd vcd
606 do
607 for j in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
608 do
609 if [ -c $i$j ]; then
610 rm -f ${i}${j}*
611 echo -n " $i$j $i${j}s0 $i${j}[a-p]"
612 sh MAKEDEV $i$j
613 elif [ -c $i${j}c ]; then
614 rm -f ${i}${j}*
615 echo -n " $i$j $i${j}s0 $i${j}[a-p]"
616 sh MAKEDEV $i$j
617 fi
618 done
619 done
620 echo ""
621 ;;
622
093d5d6c
MD
623#-----------------------------------------------------------------------------
624# Basic device node set.
625#-----------------------------------------------------------------------------
626
984263bc 627std)
093d5d6c
MD
628 mknod console "" c 0 0
629 mknod kmem "" c 2 1 root:kmem 640
630 mknod mem "" c 2 0 root:kmem 640
631 mknod null "" c 2 2 root:wheel 666
632 mknod random "" c 2 3 root:wheel 644
633 mknod urandom "" c 2 4 root:wheel 644
634 mknod zero "" c 2 12 root:wheel 666
635 mknod io "" c 2 14
636 mknod tty "" c 1 0 root:wheel 666
637 mknod klog "" c 7 0
638 mknod stdin "" c 22 0 root:wheel 666
639 mknod stdout "" c 22 1 root:wheel 666
640 mknod stderr "" c 22 2 root:wheel 666
641 mknod pci "" c 78 0 root:wheel 644
642
643
644 #---------------------------------------------------------------------
645 # Create floppy disk nodes in /dev/fd
646 #---------------------------------------------------------------------
647
984263bc 648 mkdir -p fd
093d5d6c
MD
649
650 (cd fd &&
651 i=0 &&
652 while [ $i -lt 64 ]
653 do
654 mknod $i "" c 22 $i root:wheel 666
655
656 i=$(($i + 1))
657 done)
658
984263bc 659 chmod 555 fd
984263bc
MD
660 ;;
661
093d5d6c
MD
662#-----------------------------------------------------------------------------
663
984263bc
MD
664jail)
665 sh MAKEDEV std pty0
093d5d6c
MD
666
667 rm mem kmem pci io klog console
668
669 ln -sf null mem
670 ln -sf null kmem
984263bc
MD
671 ln -sf null console
672 ;;
673
093d5d6c
MD
674#-----------------------------------------------------------------------------
675
984263bc 676mach-4)
093d5d6c
MD
677 mknod iopl "" c 22 0
678 mknod kbd "" c 23 0
679 mknod mouse "" c 24 0
680 mknod time "" c 25 0
681 mknod timezone "" c 26 0
984263bc
MD
682 ;;
683
093d5d6c
MD
684#-----------------------------------------------------------------------------
685
984263bc 686wt*)
984263bc 687 u=`expr $i : '..\(.*\)'`
093d5d6c
MD
688
689 [ "$u" ] || u=0
690
691 # Default density, 512b blocks
692 mknod rwt $u c 10 $((0 + $u)) root:operator 660
693 mknod nrwt $u c 10 $((4 + $u)) root:operator 660
694
695 # Default density, 1024b blocks
696# mknod rWt $u c 10 $((64 + $u)) root:operator 660
697# mknod nrWt $u c 10 $((68 + $u)) root:operator 660
698 mknod rwt ${u}b c 10 $((16 + $u)) root:operator 660 # 60 MB
699 mknod nrwt ${u}b c 10 $((20 + $u)) root:operator 660
700 mknod rwt ${u}c c 10 $((24 + $u)) root:operator 660 # 120 MB
701 mknod nrwt ${u}c c 10 $((28 + $u)) root:operator 660
702 mknod rwt ${u}d c 10 $((32 + $u)) root:operator 660 # 150 MB
703 mknod nrwt ${u}d c 10 $((36 + $u)) root:operator 660
704# mknod rwt ${u}e c 10 $((40 + $u)) root:operator 660 # 300 MB?
705# mknod nrwt ${u}e c 10 $((44 + $u)) root:operator 660
706# mknod rwt ${u}f c 10 $((48 + $u)) root:operator 660 # 600 MB?
707# mknod nrwt ${u}f c 10 $((52 + $u)) root:operator 660
984263bc
MD
708 ;;
709
093d5d6c
MD
710#-----------------------------------------------------------------------------
711
36d1bf94 712aacd*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*)
984263bc
MD
713 case $i in
714 aacd*s*) name=aacd; chr=151;;
5350e1e9 715 acd*s*) name=acd; chr=117;;
093d5d6c
MD
716 ad*s*) name=ad; chr=116;;
717 ar*s*) name=ar; chr=157;;
718 afd*s*) name=afd; chr=118;;
984263bc 719 amrd*s*) name=amrd; chr=133;;
7dc62e37 720 ccd*s*) name=ccd; chr=74;;
093d5d6c 721 da*s*) name=da; chr=13;;
a72d8a9f 722 fd*s*) name=fd; chr=9;;
984263bc 723 idad*s*) name=idad; chr=109;;
edc6143b 724 ipsd*s*) name=ipsd; chr=176;;
093d5d6c 725 md*s*) name=md; chr=95;;
984263bc 726 mlxd*s*) name=mlxd; chr=131;;
093d5d6c 727 pst*s*) name=pst; chr=168;;
984263bc 728 twed*s*) name=twed; chr=147;;
093d5d6c 729 vn*s*) name=vn; chr=43;;
e1002718 730 vkd*s*) name=vkd; chr=97;;
984263bc 731 esac
093d5d6c 732
984263bc 733 case $i in
edc6143b 734 aacd*s*|amrd*s*|idad*s*|ipsd*s*|mlxd*s*|twed*s*)
093d5d6c 735 unit=`expr $i : '....\([0-9]*\)s'`
984263bc 736 slice=`expr $i : '....[0-9]*s\([0-9]*\)'`
093d5d6c 737 part=`expr $i : '....[0-9]*s[0-9]*\(.*\)'`
984263bc 738 ;;
093d5d6c 739
36d1bf94 740 acd*s*|afd*s*|ccd*s*|pst*s*|wfd*s*|vkd*s*)
093d5d6c 741 unit=`expr $i : '...\([0-9]*\)s'`
984263bc 742 slice=`expr $i : '...[0-9]*s\([0-9]*\)'`
093d5d6c 743 part=`expr $i : '...[0-9]*s[0-9]*\(.*\)'`
984263bc
MD
744 ;;
745 *)
093d5d6c 746 unit=`expr $i : '..\([0-9]*\)s'`
984263bc 747 slice=`expr $i : '..[0-9]*s\([0-9]*\)'`
093d5d6c 748 part=`expr $i : '..[0-9]*s[0-9]*\(.*\)'`
984263bc
MD
749 ;;
750 esac
093d5d6c 751
984263bc
MD
752 case $unit in
753 [0-9]|[0-9][0-9]|[0-4][0-9][0-9]|50[0-9]|51[0-1])
754 case $slice in
755 [0-9]|[1-2][0-9]|30)
291fc38f
MD
756 # [no s*] == whole-disk slice (slice #1 in minor)
757 # s0 == slice #0 in minor (compatibility slice)
758 # s1 == slice #2 in minor
759 # s2 == slice #3 in minor
760 # etc..
761 #
762 # set slice to slice-in-minor-number
984263bc 763 oldslice=$slice
291fc38f
MD
764 if [ $oldslice -eq 0 ]; then
765 slice=$(($oldslice))
766 else
767 slice=$(($slice+1))
768 fi
984263bc 769 slicename=`dkitos $slice`
5350e1e9
MD
770 minor=`ndkminor $unit $slice 255`
771 mknod ${name} $unit$slicename c $chr $minor \
093d5d6c 772 root:operator 640
291fc38f
MD
773
774 # raw device names are extinct
46b3626c 775 rm -f r$name$unit$slicename
093d5d6c 776
291fc38f
MD
777 # get rid of old compatibility devices, the new
778 # ones use 's0', e.g. da0s0a
779 for i in a b c d e f g h i j k l m n o p
780 do
781 rm -f $name$unit$i
782 done
783
784 case $part in [a-p])
093d5d6c
MD
785
786 for part in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
787 do
5350e1e9 788 minor=`ndkminor $unit $slice $part`
093d5d6c
MD
789 partname=`dkitop $part`
790 mknod $name $unit$slicename$partname \
791 c $chr $minor root:operator 640
792 rm -f r$name$unit$slicename$partname
793 done
794 ;;
795
796 "") ;;
797 *) echo bad partition for disk in: $i
798 ;;
984263bc
MD
799 esac
800 ;;
801 *)
802 echo bad slice for disk in: $i
803 ;;
804 esac
805 ;;
806 *)
807 echo bad unit for disk in: $i "(unit=$unit, slice=$slice, part=$part)"
808 ;;
809 esac
984263bc
MD
810 ;;
811
093d5d6c
MD
812#-----------------------------------------------------------------------------
813
a72d8a9f
MD
814control-fd*)
815 unit=`expr $i : '..........\(.*\)'`
984263bc 816 name=fd; chr=9
093d5d6c 817
984263bc
MD
818 case $unit in
819 0|1|2|3)
a72d8a9f
MD
820 minor=`ndkminor $unit 1 129`
821 mknod $name ${unit}.1720 c $chr $minor
46b3626c 822 rm -f r${name}${unit}.1720
a72d8a9f
MD
823
824 minor=`ndkminor $unit 1 130`
825 mknod $name ${unit}.1480 c $chr $minor
826 rm -f r${name}${unit}.1480
827
828 minor=`ndkminor $unit 1 131`
829 mknod $name ${unit}.1440 c $chr $minor
830 rm -f r${name}${unit}.1440
831
832 minor=`ndkminor $unit 1 132`
833 mknod $name ${unit}.1200 c $chr $minor
834 rm -f r${name}${unit}.1200
835
836 minor=`ndkminor $unit 1 133`
837 mknod $name ${unit}.820 c $chr $minor
838 rm -f r${name}${unit}.820
839
840 minor=`ndkminor $unit 1 134`
841 mknod $name ${unit}.800 c $chr $minor
842 rm -f r${name}${unit}.800
843
844 minor=`ndkminor $unit 1 135`
845 mknod $name ${unit}.720 c $chr $minor
846 rm -f r${name}${unit}.720
847
848 minor=`ndkminor $unit 1 136`
849 mknod $name ${unit}.360 c $chr $minor
850 rm -f r${name}${unit}.360
851
852 minor=`ndkminor $unit 1 137`
853 mknod $name ${unit}.640 c $chr $minor
854 rm -f r${name}${unit}.640
855
856 minor=`ndkminor $unit 1 138`
857 mknod $name ${unit}.1232 c $chr $minor
858 rm -f r${name}${unit}.1232
984263bc
MD
859 ;;
860 *)
861 echo bad unit for disk in: $i
862 ;;
863 esac
984263bc
MD
864 ;;
865
093d5d6c
MD
866#-----------------------------------------------------------------------------
867
5350e1e9
MD
868acd*t*)
869 units=`expr $i : '...\(.*\)t'`;
870 tracks=`expr $i : '.*t\(.*\)'`;
871 name=acd;
872 chr=117;
873
874 [ "$units" ] || units=0
875 [ "$tracks" ] || tracks=100
876
877 if [ "$units" -le 31 -a "$tracks" -le 169 ]
878 then
879 i=0
880 while [ $i -le $units ]
881 do
882 dname=$name$i
883 rm -rf ${dname}t*
884
885 j=1
886 while [ $j -le $tracks ]
887 do
888 # cd unit tracks use the compatibility slice
889 # and partition numbers 129+ for tracks 1+.
890 #
f1629405 891 minor=`ndkminor $i 1 $(($j + 128))`
5350e1e9
MD
892 mknod ${dname}t $j c $chr $minor \
893 root:operator 640
894 j=$(($j + 1))
895 done
896
897 i=$(($i + 1))
898 done
899 else
900 echo "$i is invalid -- can't have more than 32 cd devices or 169 tracks"
901 fi
902 ;;
903
904#-----------------------------------------------------------------------------
905
36d1bf94 906aacd*|acd*|ad*|ar*|afd*|amrd*|cd*|ccd*|da*|fd*|idad*|ipsd*|md*|mlxd*|pst*|twed*|vcd*|vn*|vkd*)
5350e1e9 907 doslices=1
0df519f2 908 directraw=0
984263bc
MD
909 case $i in
910 aacd*) name=aacd; chr=151;;
0df519f2 911 acd*) name=acd; chr=117; doslices=0; directraw=1;;
093d5d6c
MD
912 ad*) name=ad; chr=116;;
913 ar*) name=ar; chr=157;;
914 afd*) name=afd; chr=118;;
984263bc 915 amrd*) name=amrd; chr=133;;
fe3944df 916 cd*) name=cd; chr=15; doslices=0;;
093d5d6c 917 da*) name=da; chr=13;;
a72d8a9f 918 fd*) name=fd; chr=9;;
7dc62e37 919 ccd*) name=ccd; chr=74;;
984263bc 920 idad*) name=idad; chr=109;;
edc6143b 921 ipsd*) name=ipsd; chr=176;;
093d5d6c 922 md*) name=md; chr=95;;
984263bc 923 mlxd*) name=mlxd; chr=131;;
093d5d6c 924 pst*) name=pst; chr=168;;
984263bc 925 twed*) name=twed; chr=147;;
0df519f2 926 vcd*) name=vcd; chr=98; doslices=0;;
093d5d6c 927 vn*) name=vn; chr=43;;
e1002718 928 vkd*) name=vkd; chr=97;;
984263bc 929 esac
093d5d6c 930
984263bc 931 case $i in
edc6143b 932 aacd*|amrd*|idad*|ipsd*|mlxd*|twed*)
984263bc
MD
933 unit=`expr $i : '....\(.*\)'`
934 ;;
36d1bf94 935 acd*|afd*|ccd*|pst*|wfd*|vcd*|vkd*)
984263bc
MD
936 unit=`expr $i : '...\(.*\)'`
937 ;;
938 *)
939 unit=`expr $i : '..\(.*\)'`
940 ;;
941 esac
093d5d6c 942
a72d8a9f
MD
943 case $i in
944 fd*)
945 sh MAKEDEV control-$name$unit
946 ;;
947 esac
948
984263bc
MD
949 case $unit in
950 [0-9]|[0-9][0-9]|[0-4][0-9][0-9]|50[0-9]|51[0-1])
5350e1e9 951 if [ "$doslices" -gt 0 ]; then
291fc38f
MD
952 minor=`ndkminor $unit 1 255`
953 mknod ${name} ${unit} c $chr $minor \
954 root:operator 640
5350e1e9
MD
955 for slicepartname in s0h s1h s2 s3 s4
956 do
957 sh MAKEDEV $name$unit$slicepartname
958 done
959 else
0df519f2
MD
960 if [ "$directraw" -gt 0 ]; then
961 minor=`ndkminor $unit 1 128`
962 mknod ${name} ${unit} c $chr $minor \
963 root:operator 640
964 else
965 minor=`ndkminor $unit 1 255`
966 mknod ${name} ${unit} c $chr $minor \
967 root:operator 640
968 fi
5350e1e9 969 minor=`ndkminor $unit 1 255`
0df519f2 970 mknod ${name} ${unit}s0 c $chr $minor \
5350e1e9 971 root:operator 640
8a88e0d0 972 minor=`ndkminor $unit 0 0`
5350e1e9
MD
973 mknod ${name} ${unit}a c $chr $minor \
974 root:operator 640
8a88e0d0 975 minor=`ndkminor $unit 0 2`
5350e1e9
MD
976 mknod ${name} ${unit}c c $chr $minor \
977 root:operator 640
978 fi
984263bc
MD
979 ;;
980 *)
981 echo bad unit for disk in: $i
982 ;;
983 esac
984263bc
MD
984 ;;
985
093d5d6c
MD
986#-----------------------------------------------------------------------------
987
984263bc
MD
988pt[0-9]*)
989 chr=61
990 name=pt
991 unit=`expr $i : 'pt\([0-9][0-9]*\)'`
093d5d6c
MD
992
993 [ "$unit" ] || unit=0
994
984263bc 995 unit=$(($unit + 1 - 1))
093d5d6c 996 mknod $name $unit c $chr `unit2minor $unit`
984263bc
MD
997 ;;
998
093d5d6c
MD
999#-----------------------------------------------------------------------------
1000
984263bc
MD
1001ses[0-9]*)
1002 chr=110
1003 name=ses
1004 unit=`expr $i : 'ses\([0-9][0-9]*\)'`
093d5d6c
MD
1005
1006 [ "$unit" ] || unit=0
1007
984263bc 1008 unit=$(($unit + 1 - 1))
093d5d6c 1009 mknod $name $unit c $chr `unit2minor $unit`
984263bc 1010 ;;
093d5d6c
MD
1011
1012#-----------------------------------------------------------------------------
1013
984263bc
MD
1014targ[0-9]*)
1015 chr=65
1016 name=targ
1017 unit=`expr $i : 'targ\([0-9][0-9]*\)'`
093d5d6c
MD
1018
1019 [ "$unit" ] || unit=0
1020
984263bc 1021 unit=$(($unit + 1 - 1))
093d5d6c
MD
1022
1023 mknod $name $unit c $chr `unit2minor $unit`
1024 mknod ${name}.ctl "" c $chr 0xffff00ff
984263bc
MD
1025 ;;
1026
093d5d6c
MD
1027#-----------------------------------------------------------------------------
1028
984263bc
MD
1029# CAM transport layer device
1030xpt*)
1031 # This major number is temporary
1032 chr=104
1033 name=xpt
1034 units=`expr $i : 'xpt\(.*\)'`
093d5d6c
MD
1035
1036 [ "$units" ] || units=1
1037
984263bc 1038 i=0
093d5d6c
MD
1039 while [ $i -lt $units ]
1040 do
1041 rm -rf $name$i
1042
1043 mknod $name $i c $chr `unit2minor $i` root:operator
1044
984263bc
MD
1045 i=$(($i + 1))
1046 done
1047 ;;
1048
093d5d6c
MD
1049#-----------------------------------------------------------------------------
1050
984263bc
MD
1051pass*)
1052 # This major number is temporary
1053 chr=31
1054 name=pass
1055 units=`expr $i : 'pass\(.*\)'`
093d5d6c 1056
e275134d 1057 [ "$units" ] || units=1
093d5d6c 1058
984263bc 1059 i=0
093d5d6c
MD
1060 while [ $i -lt $units ]
1061 do
1062 rm -rf $name$i
1063
1064 mknod $name $i c $chr `unit2minor $i` root:operator
1065
984263bc
MD
1066 i=$(($i + 1))
1067 done
1068 ;;
093d5d6c
MD
1069
1070#-----------------------------------------------------------------------------
1071
984263bc
MD
1072pty*)
1073 class=`expr $i : 'pty\(.*\)'`
1074 case $class in
093d5d6c
MD
1075 0) offset=0 name=p;;
1076 1) offset=32 name=q;;
1077 2) offset=64 name=r;;
1078 3) offset=96 name=s;;
1079 4) offset=128 name=P;; # Note that xterm (at least) only look at p-s.
984263bc
MD
1080 5) offset=160 name=Q;;
1081 6) offset=192 name=R;;
1082 7) offset=224 name=S;;
984263bc
MD
1083 *) echo bad unit for pty in: $i;;
1084 esac
093d5d6c 1085
984263bc
MD
1086 case $class in
1087 0|1|2|3|4|5|6|7)
1088 i=0
093d5d6c
MD
1089 while [ $i -lt 32 ]
1090 do
984263bc
MD
1091 c=$(echo 0123456789abcdefghijklmnopqrstuv |
1092 dd bs=1 skip=$i count=1 2>/dev/null)
093d5d6c
MD
1093
1094 mknod tty$name $c c 5 $(($offset + $i)) root:wheel 666
1095 mknod pty$name $c c 6 $(($offset + $i)) root:wheel 666
1096
984263bc
MD
1097 i=$(($i + 1))
1098 done
1099 ;;
1100 esac
984263bc
MD
1101 ;;
1102
093d5d6c
MD
1103#-----------------------------------------------------------------------------
1104
984263bc 1105sa*)
984263bc
MD
1106 unit=`expr $i : '..\(.*\)'`
1107 chr=14
1108
1109 case $unit in
1110 [0-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9])
093d5d6c
MD
1111 mknod sa ${unit}.ctl c $chr `saminor 1 ${unit} 0 0` \
1112 root:wheel 660
984263bc 1113 ln -f sa${unit}.ctl rsa${unit}.ctl
093d5d6c 1114
984263bc
MD
1115 for m in 0 1 2 3
1116 do
093d5d6c
MD
1117 mknod sa ${unit}.$m c $chr \
1118 `saminor 0 $unit $m 0` root:operator 660
1119 ln -f sa${unit}.$m rsa${unit}.$m
1120
1121 mknod nsa ${unit}.$m c $chr \
1122 `saminor 0 $unit $m 1` root:operator 660
1123 ln -f nsa${unit}.$m nrsa${unit}.$m
1124
1125 mknod esa ${unit}.$m c $chr \
1126 `saminor 0 $unit $m 2` root:operator 660
1127 ln -f esa${unit}.$m ersa${unit}.$m
984263bc 1128 done
093d5d6c
MD
1129
1130 ln -f sa${unit}.0 sa$unit
1131 ln -f sa${unit}.0 rsa${unit}.0
1132 ln -f sa${unit}.0 rsa$unit
1133 ln -f nsa${unit}.0 nsa$unit
984263bc 1134 ln -f nsa${unit}.0 nrsa${unit}.0
093d5d6c
MD
1135 ln -f nsa${unit}.0 nrsa$unit
1136 ln -f esa${unit}.0 esa$unit
984263bc 1137 ln -f esa${unit}.0 ersa${unit}.0
093d5d6c 1138 ln -f esa${unit}.0 ersa$unit
984263bc
MD
1139 ;;
1140 *)
1141 echo bad unit for tape in: $i
1142 ;;
1143 esac
984263bc
MD
1144 ;;
1145
093d5d6c
MD
1146#-----------------------------------------------------------------------------
1147
984263bc 1148ch*)
984263bc 1149 unit=`expr $i : '..\(.*\)'`
093d5d6c 1150
984263bc
MD
1151 case $i in
1152 ch*) name=ch; chr=17;;
1153 esac
093d5d6c 1154
984263bc
MD
1155 case $unit in
1156 0|1|2|3|4|5|6)
093d5d6c 1157 mknod $name $unit c $chr $unit root:operator 640
984263bc
MD
1158 ;;
1159 *)
1160 echo bad unit for media changer in: $i
1161 ;;
1162 esac
984263bc
MD
1163 ;;
1164
093d5d6c
MD
1165#-----------------------------------------------------------------------------
1166
984263bc 1167ata)
093d5d6c 1168 mknod ata "" c 159 0 root:operator
984263bc 1169 ;;
093d5d6c
MD
1170
1171#-----------------------------------------------------------------------------
1172
984263bc 1173ast*)
984263bc
MD
1174 unit=`expr $i : '...\(.*\)'`
1175 chr=119
093d5d6c 1176
984263bc
MD
1177 case $unit in
1178 0|1|2|3)
093d5d6c
MD
1179 mknod ast $unit c $chr $(($unit * 8 + 0)) root:operator 640
1180 mknod nast $unit c $chr $(($unit * 8 + 1)) root:operator 640
984263bc
MD
1181 ;;
1182 *)
1183 echo bad unit for tape in: $i
1184 ;;
1185 esac
984263bc
MD
1186 ;;
1187
093d5d6c
MD
1188#-----------------------------------------------------------------------------
1189
984263bc
MD
1190iic*)
1191 unit=`expr $i : 'iic\(.*\)'`
093d5d6c
MD
1192
1193 mknod iic $unit c 105 `unit2minor $unit`
984263bc
MD
1194 ;;
1195
093d5d6c
MD
1196#-----------------------------------------------------------------------------
1197
984263bc
MD
1198smb*)
1199 unit=`expr $i : 'smb\(.*\)'`
093d5d6c
MD
1200
1201 mknod smb $unit c 106 `unit2minor $unit`
984263bc
MD
1202 ;;
1203
093d5d6c
MD
1204#-----------------------------------------------------------------------------
1205
984263bc
MD
1206pcfclock*)
1207 unit=`expr $i : 'pcfclock\(.*\)'`
093d5d6c
MD
1208
1209 mknod pcfclock $unit c 140 `unit2minor $unit`
984263bc
MD
1210 ;;
1211
093d5d6c
MD
1212#-----------------------------------------------------------------------------
1213
984263bc
MD
1214ppi*)
1215 unit=`expr $i : 'ppi\(.*\)'`
093d5d6c
MD
1216
1217 mknod ppi $unit c 82 `unit2minor $unit`
984263bc
MD
1218 ;;
1219
093d5d6c
MD
1220#-----------------------------------------------------------------------------
1221
984263bc
MD
1222pps*)
1223 unit=`expr $i : 'pps\(.*\)'`
093d5d6c
MD
1224
1225 mknod pps $unit c 89 `unit2minor $unit`
984263bc
MD
1226 ;;
1227
093d5d6c
MD
1228#-----------------------------------------------------------------------------
1229
984263bc 1230usb)
093d5d6c 1231 mknod usb "" c 108 255 root:operator 0660
984263bc
MD
1232 ;;
1233
093d5d6c
MD
1234#-----------------------------------------------------------------------------
1235
984263bc 1236usb*)
984263bc 1237 unit=`expr $i : 'usb\(.*\)'`
093d5d6c
MD
1238
1239 mknod usb $unit c 108 `unit2minor $unit` root:operator 660
984263bc
MD
1240 ;;
1241
093d5d6c
MD
1242#-----------------------------------------------------------------------------
1243
984263bc 1244ucom*)
984263bc 1245 unit=`expr $i : 'ucom\(.*\)'`
093d5d6c 1246
984263bc
MD
1247 minor=$(($unit + 128))
1248 minor=`unit2minor $(($unit + 128))`
093d5d6c
MD
1249
1250 mknod ucom $unit c 138 $minor uucp:dialer 660
984263bc
MD
1251 ;;
1252
093d5d6c
MD
1253#-----------------------------------------------------------------------------
1254
984263bc 1255uhid*)
984263bc 1256 unit=`expr $i : 'uhid\(.*\)'`
093d5d6c
MD
1257
1258 mknod uhid $unit c 122 `unit2minor $unit` root:operator 660
984263bc
MD
1259 ;;
1260
093d5d6c
MD
1261#-----------------------------------------------------------------------------
1262
984263bc 1263ums*)
984263bc 1264 unit=`expr $i : 'ums\(.*\)'`
093d5d6c
MD
1265
1266 mknod ums $unit c 111 `unit2minor $unit` root:operator 660
984263bc
MD
1267 ;;
1268
093d5d6c
MD
1269#-----------------------------------------------------------------------------
1270
984263bc
MD
1271ulpt*)
1272 unit=`expr $i : 'ulpt\(.*\)'`
093d5d6c 1273
984263bc 1274 minor=`unit2minor $unit`
093d5d6c
MD
1275 mknod ulpt $unit c 113 $minor
1276
984263bc 1277 minor=`unit2minor $(($unit + 64))`
093d5d6c 1278 mknod unlpt $unit c 113 $minor # and the 'no prime' version
984263bc
MD
1279 ;;
1280
093d5d6c
MD
1281#-----------------------------------------------------------------------------
1282
984263bc 1283ugen*)
984263bc
MD
1284 unit=`expr $i : 'ugen\([0-9][0-9]*\)'`
1285 endpoint=`expr $i : 'ugen.*\.\([0-9][0-9]*\)'`
093d5d6c
MD
1286
1287 [ "$unit" ] || echo $i - Invalid unit number
1288
1289 if [ -z "${endpoint}" ] # ugen0 & ugen0.1 - ugen0.15
1290 then
1291 mknod ugen $unit c 114 `unit2minor $(($unit * 16))` \
1292 root:operator 660
984263bc 1293 i=1
093d5d6c
MD
1294 while [ $i -lt 16 ]
1295 do
1296 mknod ugen $unit.$i c 114 `unit2minor \
1297 $(($unit * 16 + $i))` root:operator 660
1298
984263bc
MD
1299 i=$(($i + 1))
1300 done
1301 else
1302 minor=`unit2minor $(($unit * 16 + $endpoint))`
093d5d6c 1303 mknod ugen $unit.$endpoint c 114 $minor root:operator 660
984263bc 1304 fi
984263bc
MD
1305 ;;
1306
093d5d6c
MD
1307#-----------------------------------------------------------------------------
1308
984263bc 1309urio*)
984263bc 1310 unit=`expr $i : 'urio\(.*\)'`
093d5d6c
MD
1311
1312 mknod urio $unit c 143 `unit2minor $unit` root:operator 660
984263bc
MD
1313 ;;
1314
093d5d6c
MD
1315#-----------------------------------------------------------------------------
1316
984263bc 1317uscanner*)
984263bc 1318 unit=`expr $i : 'uscanner\(.*\)'`
093d5d6c
MD
1319
1320 mknod uscanner $unit c 156 `unit2minor $unit` root:operator 660
984263bc
MD
1321 ;;
1322
093d5d6c
MD
1323#-----------------------------------------------------------------------------
1324
984263bc 1325umodem*)
984263bc 1326 unit=`expr $i : 'umodem\(.*\)'`
093d5d6c
MD
1327
1328 mknod umodem $unit c 124 `unit2minor $unit` uucp:dialer 660
984263bc
MD
1329 ;;
1330
093d5d6c
MD
1331#-----------------------------------------------------------------------------
1332
984263bc
MD
1333lpt*)
1334 unit=`expr $i : 'lpt\(.*\)'`
093d5d6c
MD
1335
1336 mknod lpt $unit c 16 `unit2minor $unit`
1337 mknod lpctl $unit c 16 `unit2minor $(($unit + 128))`
984263bc
MD
1338 ;;
1339
093d5d6c
MD
1340#-----------------------------------------------------------------------------
1341
984263bc
MD
1342vty*)
1343 chr=12
1344 units=`expr $i : 'vty\(.*\)'`
093d5d6c 1345
984263bc 1346 i=0
093d5d6c
MD
1347 while [ $i -lt $units ]
1348 do
1349 mknod ttyv $(printf %01x $i) c $chr `unit2minor $i`
1350
984263bc
MD
1351 i=$(($i + 1))
1352 done
093d5d6c
MD
1353
1354 ln -fs ttyv0 vga
984263bc
MD
1355 ;;
1356
093d5d6c
MD
1357#-----------------------------------------------------------------------------
1358
984263bc
MD
1359nmdm*)
1360 units=`expr $i : 'nmdm\(.*\)'`
1361 chr=18
093d5d6c 1362
984263bc 1363 i=0
093d5d6c
MD
1364 while [ $i -lt $units ]
1365 do
984263bc
MD
1366 minor=`unit2minor $i`
1367 minor=$(($minor + $minor))
093d5d6c
MD
1368 mknod nmdm ${i}A c $chr $minor
1369 mknod nmdm ${i}B c $chr $(($minor + 1))
1370
984263bc
MD
1371 i=$(($i + 1))
1372 done
1373 ;;
1374
093d5d6c
MD
1375#-----------------------------------------------------------------------------
1376
984263bc
MD
1377bpf*)
1378 nbpf=`expr $i : 'bpf\(.*\)$'`
093d5d6c 1379
984263bc 1380 unit=0
093d5d6c
MD
1381 while [ $unit -le $nbpf ]
1382 do
1383 mknod bpf $unit c 23 `unit2minor $unit`
1384
984263bc
MD
1385 unit=$(($unit + 1))
1386 done
1387 ;;
1388
093d5d6c
MD
1389#-----------------------------------------------------------------------------
1390
984263bc 1391speaker)
093d5d6c 1392 mknod speaker "" c 26 0
984263bc
MD
1393 ;;
1394
093d5d6c
MD
1395#-----------------------------------------------------------------------------
1396
984263bc 1397cua?|cuaa?|cuaa??)
984263bc 1398 unit_low=`expr $i : 'cua.*\(.\)$'`
093d5d6c 1399
984263bc
MD
1400 case $i in
1401 cua?|cuaa?)
1402 unit_high=""
1403 m_high=0
1404 ;;
1405 cuaa??)
1406 unit_high=`expr $i : 'cuaa\(.\).$'`
1407 m_high=`ttyminor $unit_high`
1408 ;;
1409 esac
093d5d6c 1410
984263bc
MD
1411 unit=$unit_high$unit_low
1412 m=$(($m_high << 16 | `ttyminor $unit_low`))
093d5d6c
MD
1413
1414 mknod cuaa $unit c 28 $(($m | 128)) uucp:dialer 660
1415 mknod cuaia $unit c 28 $(($m | 32 | 128)) uucp:dialer 660
1416 mknod cuala $unit c 28 $(($m | 64 | 128)) uucp:dialer 660
984263bc
MD
1417 ;;
1418
093d5d6c
MD
1419#-----------------------------------------------------------------------------
1420
984263bc 1421crypto)
093d5d6c 1422 mknod crypto "" c 70 0 root:operator 666
984263bc 1423 ;;
093d5d6c
MD
1424
1425#-----------------------------------------------------------------------------
1426
95cc27f0 1427pf)
093d5d6c 1428 mknod pf "" c 73 0 root:operator 600
95cc27f0 1429 ;;
093d5d6c
MD
1430
1431#-----------------------------------------------------------------------------
1432
cbf42d05
HS
1433fw?)
1434 unit=`expr $i : 'fw\(.\)$'`
093d5d6c 1435
cbf42d05
HS
1436 for sub in 0 1 2 3
1437 do
1438 minor=$(($unit << 16 | $sub))
093d5d6c
MD
1439 mknod fw $unit.$sub c 127 $minor root:operator 660
1440 mknod fwmem $unit.$sub c 127 $((1<<24 | $minor)) \
1441 root:operator 660
cbf42d05 1442 done
093d5d6c 1443
cbf42d05
HS
1444 ln -sf fw$unit.0 fw$unit
1445 ln -sf fwmem$unit.0 fwmem$unit
984263bc
MD
1446 ;;
1447
093d5d6c
MD
1448#-----------------------------------------------------------------------------
1449
41451722 1450dcons)
093d5d6c 1451 mknod dcons "" c 184 0 root:wheel 600
41451722
HS
1452 ;;
1453
093d5d6c
MD
1454#-----------------------------------------------------------------------------
1455
984263bc
MD
1456tty?|tty0?|ttyd?|ttyd??)
1457 unit_low=`expr $i : 'tty.*\(.\)$'`
093d5d6c 1458
984263bc
MD
1459 case $i in
1460 tty?|tty0?|ttyd?)
1461 unit_high=""
1462 m_high=0
1463 ;;
1464 ttyd??)
1465 unit_high=`expr $i : 'ttyd\(.\).$'`
1466 m_high=`ttyminor $unit_high`
1467 ;;
1468 esac
093d5d6c 1469
984263bc
MD
1470 unit=$unit_high$unit_low
1471 m=$(($m_high << 16 | `ttyminor $unit_low`))
093d5d6c
MD
1472
1473 mknod ttyd $unit c 28 $m
1474 mknod ttyid $unit c 28 $(($m | 32))
1475 mknod ttyld $unit c 28 $(($m | 64))
984263bc
MD
1476 ;;
1477
093d5d6c
MD
1478#-----------------------------------------------------------------------------
1479
984263bc 1480cuac?)
984263bc
MD
1481 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f
1482 g h i j k l m n o p q r s t u v"
1483 major=48
1484 card=`expr $i : 'cua.*\(.\)$'`
093d5d6c 1485
984263bc
MD
1486 for unit in $portlist
1487 do
1488 minor=`ttyminor $unit`
1489 minor=$(($card * 65536 + $minor))
1490 name=$card$unit
093d5d6c
MD
1491
1492 mknod cuac $name c $major $(($minor + 128)) uucp:dialer 660
1493 mknod cuaic $name c $major $(($minor + 32 + 128)) \
1494 uucp:dialer 660
1495 mknod cualc $name c $major $(($minor + 64 + 128)) \
1496 uucp:dialer 660
984263bc 1497 done
984263bc
MD
1498 ;;
1499
093d5d6c
MD
1500#-----------------------------------------------------------------------------
1501
984263bc
MD
1502ttyc?)
1503 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f
1504 g h i j k l m n o p q r s t u v"
1505 major=48
1506 card=`expr $i : 'tty.*\(.\)$'`
093d5d6c 1507
984263bc
MD
1508 for unit in $portlist
1509 do
1510 minor=`ttyminor $unit`
1511 minor=$(($card * 65536 + $minor))
1512 name=$card$unit
093d5d6c
MD
1513
1514 mknod ttyc $name c $major $minor
1515 mknod ttyic $name c $major $(($minor + 32))
1516 mknod ttylc $name c $major $(($minor + 64))
984263bc
MD
1517 done
1518 ;;
1519
093d5d6c 1520#-----------------------------------------------------------------------------
984263bc
MD
1521
1522cuam?)
984263bc 1523 unit=`expr $i : 'cua.*\(.\)$'`
093d5d6c 1524
984263bc 1525 m=`ttyminor $unit`
093d5d6c
MD
1526
1527 mknod cuam $unit c 63 $(($m + 128)) uucp:dialer 660
984263bc
MD
1528 ;;
1529
093d5d6c
MD
1530#-----------------------------------------------------------------------------
1531
984263bc
MD
1532ttym?)
1533 unit=`expr $i : 'tty.*\(.\)$'`
093d5d6c 1534
984263bc 1535 m=`ttyminor $unit`
093d5d6c
MD
1536
1537 mknod ttym $unit c 63 $m
984263bc
MD
1538 ;;
1539
093d5d6c
MD
1540#-----------------------------------------------------------------------------
1541
984263bc
MD
1542ttyA*)
1543 major=68
1544 nports=`expr $i : 'ttyA\(.*\)$'`
1545 port=1
093d5d6c
MD
1546
1547 while [ $port -le $nports ]
1548 do
984263bc
MD
1549 minor=$(($port - 1))
1550 name=$(printf %02d $port)
093d5d6c
MD
1551
1552 mknod ttyA $name c $major $minor
1553 mknod ttyiA $name c $major $(($minor + 65536))
1554 mknod ttylA $name c $major $(($minor + 131072))
1555
984263bc
MD
1556 port=$(($port + 1))
1557 done
093d5d6c 1558
984263bc 1559 # For the user-mode control program, 'sicontrol'
093d5d6c 1560 mknod si_control "" c 68 262144
984263bc
MD
1561 ;;
1562
093d5d6c
MD
1563#-----------------------------------------------------------------------------
1564
984263bc 1565cuaA*)
984263bc
MD
1566 major=68
1567 nports=`expr $i : 'cuaA\(.*\)$'`
1568 port=1
093d5d6c
MD
1569
1570 while [ $port -le $nports ]
1571 do
984263bc
MD
1572 minor=$(($port - 1))
1573 name=$(printf %02d $port)
093d5d6c
MD
1574
1575 mknod cuaA $name c $major $(($minor + 128)) uucp:dialer 660
1576 mknod cuaiA $name c $major $(($minor + 128 + 65536)) \
1577 uucp:dialer 660
1578 mknod cualA $name c $major $(($minor + 128 + 131072)) \
1579 uucp:dialer 660
1580
984263bc
MD
1581 port=$(($port + 1))
1582 done
984263bc
MD
1583 ;;
1584
093d5d6c
MD
1585#-----------------------------------------------------------------------------
1586
984263bc
MD
1587ttyD?)
1588 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f"
1589 major=58
1590 card=`expr $i : 'tty.*\(.\)$'`
093d5d6c 1591
984263bc
MD
1592 for unit in $portlist
1593 do
1594 minor=`ttyminor $unit`
1595 minor=$(($card * 65536 + $minor))
1596 name=$card$unit
093d5d6c
MD
1597
1598 mknod ttyD $name c $major $minor
1599 mknod ttyiD $name c $major $(($minor + 32))
1600 mknod ttylD $name c $major $(($minor + 64))
984263bc
MD
1601 done
1602 ;;
1603
093d5d6c
MD
1604#-----------------------------------------------------------------------------
1605
984263bc 1606cuaD?)
984263bc
MD
1607 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f"
1608 major=58
1609 card=`expr $i : 'cua.*\(.\)$'`
093d5d6c 1610
984263bc
MD
1611 for unit in $portlist
1612 do
1613 minor=`ttyminor $unit`
1614 minor=$(($card * 65536 + $minor))
1615 name=$card$unit
093d5d6c
MD
1616
1617 mknod cuaD $name c $major $(($minor + 128)) uucp:dialer 660
1618 mknod cuaiD $name c $major $(($minor + 32 + 128)) \
1619 uucp:dialer 660
1620 mknod cualD $name c $major $(($minor + 64 + 128)) \
1621 uucp:dialer 660
984263bc 1622 done
984263bc
MD
1623 ;;
1624
093d5d6c 1625#-----------------------------------------------------------------------------
984263bc
MD
1626
1627ttyE*)
1628 stallion 72 E `expr $i : 'tty.*\(.\)$'` 0
1629 ;;
1630cuaE*)
1631 stallion 72 E `expr $i : 'cua.*\(.\)$'` 1
1632 ;;
1633stl*)
1634 card=`expr $i : 'stl\(.\)$'`
1635 stallion 72 E $card 0
1636 stallion 72 E $card 1
1637 ;;
1638
1639ttyF*)
1640 stallion 75 F `expr $i : 'tty.*\(.\)$'` 0
1641 ;;
1642cuaF*)
1643 stallion 75 F `expr $i : 'cua.*\(.\)$'` 1
1644 ;;
1645stli*)
1646 card=`expr $i : 'stl\(.\)$'`
1647 stallion 75 F $card 0
1648 stallion 75 F $card 1
1649 ;;
1650
1651ttyM*)
1652 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f"
1653 modulelist="a b c d"
1654 major=101
1655 card=`expr $i : 'tty.*\(.\)$'`
093d5d6c 1656
984263bc
MD
1657 for unit in $modulelist
1658 do
1659 moduleminor=`ttyminor $unit`
1660 moduleminor=$(($moduleminor % 10 * 16))
1661 modulename=$unit
1662
1663 for unit in $portlist
1664 do
1665 minor=`ttyminor $unit`
1666 minor=$(($card * 65536 + $minor + $moduleminor))
1667 name=$card$modulename$unit
093d5d6c 1668
984263bc 1669 rm -f tty*M$name
093d5d6c
MD
1670
1671 mknod ttyM $name c $major $minor
1672 mknod ttyiM $name c $major $(($minor + 64))
1673 mknod ttylM $name c $major $(($minor + 128))
984263bc
MD
1674 done
1675 done
1676 ;;
1677
1678cuaM?)
984263bc
MD
1679 portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f"
1680 modulelist="a b c d"
1681 major=101
1682 card=`expr $i : 'cua.*\(.\)$'`
093d5d6c 1683
984263bc
MD
1684 for unit in $modulelist
1685 do
1686 moduleminor=`ttyminor $unit`
1687 moduleminor=$(($moduleminor % 10 * 16))
1688 modulename=$unit
1689
1690 for unit in $portlist
1691 do
1692 minor=`ttyminor $unit`
1693 minor=$(($card * 65536 + $minor + $moduleminor))
1694 name=$card$modulename$unit
093d5d6c 1695
984263bc 1696 rm -f cua*M$name
093d5d6c
MD
1697
1698 mknod cuaM $name c $major $(($minor + 262144)) \
1699 uucp:dialer 660
1700 mknod cuaiM $name c $major $(($minor + 64 + 262144)) \
1701 uucp:dialer 660
1702 mknod cualM $name c $major $(($minor + 128 + 262144)) \
1703 uucp:dialer 660
984263bc
MD
1704 done
1705 done
984263bc
MD
1706 ;;
1707
1708ttyR?)
1709 major=81
1710 BOARD=1; Rnum=0
1711 MINOR=$(($BOARD * 65536))
1712 controllers=$(
093d5d6c
MD
1713 dmesg | while read first rest
1714 do
1715 case "$first" in
1716 RocketPort[0-4]) echo "$first"
1717 ;;
1718 esac
1719 done)
1720
984263bc 1721 rm -f ttyR* ttyiR* ttylR*
093d5d6c
MD
1722
1723 for i in $controllers
1724 do
1725 ndevices=$(
1726 dmesg | while read first bar ports rest
1727 do
1728 case "$first" in
1729 $i*) echo "$ports"
984263bc 1730 ;;
093d5d6c
MD
1731 esac
1732 done)
1733
1734 echo -n "Creating $ndevices devices for $i: "
1735 dev=0
1736
1737 while [ $dev -lt $ndevices ]
1738 do
1739 mknod ttyR $Rnum c $major $MINOR
1740 mknod ttyiR $Rnum c $major $(($MINOR + 32))
1741 mknod ttylR $Rnum c $major $(($MINOR + 64))
1742
1743 Rnum=$(($Rnum + 1))
1744 MINOR=$(($MINOR + 1))
1745
1746 dev=$(($dev + 1))
984263bc 1747 done
093d5d6c 1748
984263bc
MD
1749 BOARD=$(($BOARD + 1))
1750 MINOR=$(($BOARD * 65536))
093d5d6c 1751 echo " "
984263bc
MD
1752 done
1753 ;;
1754
1755cuaR?)
1756 major=81
1757 BOARD=1; Rnum=0
1758 MINOR=$(($BOARD * 65536))
1759 controllers=$(
093d5d6c
MD
1760 dmesg | while read first rest
1761 do
1762 case "$first" in
1763 RocketPort[0-4]) echo "$first"
984263bc 1764 ;;
093d5d6c
MD
1765 esac
1766 done)
1767
984263bc 1768 rm -f cuaR* cuaiR* cualR*
093d5d6c
MD
1769
1770 for i in $controllers
1771 do
1772 ndevices=$(
1773 dmesg | while read first bar ports rest
1774 do
1775 case "$first" in
1776 $i*) echo "$ports"
984263bc 1777 ;;
093d5d6c
MD
1778 esac
1779 done)
1780
1781 echo -n "Creating $ndevices devices for $i: "
1782 dev=0
1783
1784 while [ $dev -lt $ndevices ]
1785 do
1786 mknod cuaR $Rnum c $major $(($MINOR + 128)) \
1787 uucp:dialer 660
1788 mknod cuaiR $Rnum c $major $(($MINOR + 128 + 32)) \
1789 uucp:dialer 660
1790 mknod cualR $Rnum c $major $(($MINOR + 128 + 64)) \
1791 uucp:dialer 660
1792
1793 Rnum=$(($Rnum + 1))
1794 MINOR=$(($MINOR + 1))
1795
1796 dev=$(($dev + 1))
984263bc 1797 done
093d5d6c 1798
984263bc
MD
1799 BOARD=$(($BOARD + 1))
1800 MINOR=$(($BOARD * 65536))
093d5d6c 1801 echo " "
984263bc
MD
1802 done
1803 ;;
1804
093d5d6c
MD
1805#-----------------------------------------------------------------------------
1806
984263bc
MD
1807mse*)
1808 unit=`expr $i : 'mse\(.*\)'`
1809 chr=27
093d5d6c
MD
1810
1811 # Non-blocking for X11
1812 mknod mse $unit c $chr `unit2minor $(($unit * 2 + 1))`
984263bc
MD
1813 ;;
1814
093d5d6c
MD
1815#-----------------------------------------------------------------------------
1816
984263bc
MD
1817psm*)
1818 unit=`expr $i : 'psm\(.*\)'`
1819 chr=21
093d5d6c
MD
1820
1821 # Non-blocking for X11
1822 mknod psm $unit c $chr `unit2minor $(($unit * 2 + 1))`
984263bc
MD
1823 ;;
1824
093d5d6c
MD
1825#-----------------------------------------------------------------------------
1826
984263bc
MD
1827mouse*)
1828 name=`expr $i : 'mouse\(.*\)'`
093d5d6c
MD
1829
1830 [ -c $name ] || $0 $name # Make the appropriate device
1831
984263bc
MD
1832 ln -fs $name mouse
1833 ;;
1834
093d5d6c
MD
1835#-----------------------------------------------------------------------------
1836
984263bc 1837pcaudio)
093d5d6c
MD
1838 mknod pcaudio "" c 24 0
1839 mknod pcaudioctl "" c 24 128
984263bc
MD
1840 ;;
1841
093d5d6c
MD
1842#-----------------------------------------------------------------------------
1843
984263bc 1844socksys)
093d5d6c
MD
1845 mknod socksys "" c 41 0 root:wheel 666
1846 mknod spx "" c 41 1 root:wheel 666
1847
984263bc 1848 ln -fs socksys nfsd
984263bc
MD
1849 ;;
1850
093d5d6c
MD
1851#-----------------------------------------------------------------------------
1852
984263bc 1853snd*)
984263bc
MD
1854
1855 unit=`expr $i : 'snd\(.*\)'`
1856 chr=30
1857
984263bc
MD
1858 ln -fs mixer$unit mixer
1859 ln -fs sequencer$unit sequencer
1860 ln -fs dsp$unit dsp
1861 ln -fs audio$unit audio
1862 ln -fs dspW$unit dspW
1863 ln -fs music$unit music
1864 ln -fs pss$unit pss
1865 ln -fs dsp$unit.0 dsp$unit
1866 ln -fs audio$unit.0 audio$unit
1867 ln -fs dspW$unit.0 dspW$unit
1868
093d5d6c
MD
1869 mknod mixer $unit c $chr `unit2minor $(($unit * 16 + 0))` \
1870 root:wheel 666
1871 mknod sequencer $unit c $chr `unit2minor $(($unit * 16 + 1))` \
1872 root:wheel 666
1873 mknod midi $unit c $chr `unit2minor $(($unit * 16 + 2))` \
1874 root:wheel 666
984263bc
MD
1875
1876 for chn in 0 1 2 3
1877 do
1878 minor=$(($chn * 65536 + $unit * 16))
093d5d6c
MD
1879
1880 mknod dsp $unit.$chn c $chr $(($minor + 3)) root:wheel 666
1881 mknod audio $unit.$chn c $chr $(($minor + 4)) root:wheel 666
1882 mknod dspW $unit.$chn c $chr $(($minor + 5)) root:wheel 666
984263bc
MD
1883 done
1884
093d5d6c
MD
1885 mknod sndstat "" c $chr 6 root:wheel 666
1886 mknod music $unit c $chr `unit2minor $(($unit * 16 + 8))` root:wheel 666
1887 mknod pss $unit c $chr `unit2minor $(($unit * 16 + 9))` root:wheel 666
984263bc
MD
1888 ;;
1889
093d5d6c
MD
1890#-----------------------------------------------------------------------------
1891
984263bc 1892vat)
093d5d6c 1893 mknod vatio "" c 25 128 root:wheel 660
984263bc
MD
1894 ;;
1895
093d5d6c
MD
1896#-----------------------------------------------------------------------------
1897
984263bc
MD
1898gsc*)
1899 unit=`expr $i : 'gsc\(.*\)'`
093d5d6c
MD
1900
1901 mknod gsc $unit c 47 `unit2minor $unit` root:wheel 666
1902 mknod gsc ${unit}p c 47 `unit2minor $(($unit + 8))` root:wheel 666
1903 mknod gsc ${unit}d c 47 `unit2minor $(($unit + 32))` root:wheel 666
1904 mknod gsc ${unit}pd c 47 `unit2minor $(($unit + 40))` root:wheel 666
984263bc
MD
1905 ;;
1906
093d5d6c
MD
1907#-----------------------------------------------------------------------------
1908
967ae586 1909acpi)
093d5d6c 1910 mknod acpi "" c 152 0 root:operator 664
967ae586 1911 ;;
093d5d6c
MD
1912
1913#-----------------------------------------------------------------------------
1914
984263bc 1915apm)
093d5d6c 1916 mknod apm "" c 39 0 root:operator 664
984263bc
MD
1917 ;;
1918
093d5d6c
MD
1919#-----------------------------------------------------------------------------
1920
984263bc 1921apmctl)
093d5d6c 1922 mknod apmctl "" c 39 8 root:operator 660
984263bc
MD
1923 ;;
1924
093d5d6c
MD
1925#-----------------------------------------------------------------------------
1926
984263bc
MD
1927card*)
1928 unit=`expr $i : 'card\(.*\)'`
1929 chr=50
093d5d6c
MD
1930
1931 mknod card $unit c $chr `unit2minor $unit` root:wheel 644
984263bc
MD
1932 ;;
1933
093d5d6c
MD
1934#-----------------------------------------------------------------------------
1935
984263bc
MD
1936ttyx?|ttyy?|ttyz?)
1937 case $i in
093d5d6c
MD
1938 *0) unit=0;; *1) unit=1;; *2) unit=2;; *3) unit=3;;
1939 *4) unit=4;; *5) unit=5;; *6) unit=6;; *7) unit=7;;
1940 *8) unit=8;; *9) unit=9;; *a) unit=10;; *b) unit=11;;
1941 *c) unit=12;; *d) unit=13;; *e) unit=14;; *f) unit=15;;
984263bc 1942 esac
093d5d6c 1943
984263bc 1944 case $i in
093d5d6c
MD
1945 ttyy?) unit=$(($unit + 16));;
1946 ttyz?) unit=$(($unit + 32));;
984263bc 1947 esac
093d5d6c
MD
1948
1949 mknod $i "" c 42 $unit
984263bc
MD
1950 ;;
1951
093d5d6c
MD
1952#-----------------------------------------------------------------------------
1953
984263bc 1954cronyx)
093d5d6c 1955 mknod cronyx "" c 42 63
984263bc
MD
1956 ;;
1957
093d5d6c
MD
1958#-----------------------------------------------------------------------------
1959
984263bc 1960joy)
093d5d6c
MD
1961 mknod joy 0 c 51 0 root:operator 640
1962 mknod joy 1 c 51 1 root:operator 640
984263bc
MD
1963 ;;
1964
093d5d6c
MD
1965#-----------------------------------------------------------------------------
1966
984263bc 1967spigot)
093d5d6c 1968 mknod spigot "" c 11 0 root:wheel 444
984263bc
MD
1969 ;;
1970
093d5d6c
MD
1971#-----------------------------------------------------------------------------
1972
984263bc
MD
1973ctx?)
1974 unit=`expr $i : 'ctx\(.*\)'`
093d5d6c
MD
1975
1976 mknod ctx $unit c 40 `unit2minor $unit` root:wheel 444
984263bc
MD
1977 ;;
1978
093d5d6c
MD
1979#-----------------------------------------------------------------------------
1980
984263bc
MD
1981meteor?)
1982 unit=`expr $i : 'meteor\(.*\)'`
093d5d6c
MD
1983
1984 mknod meteor $unit c 67 `unit2minor $unit` root:wheel 444
984263bc
MD
1985 ;;
1986
093d5d6c
MD
1987#-----------------------------------------------------------------------------
1988
984263bc
MD
1989bktr?)
1990 unit=`expr $i : 'bktr\(.*\)'`
093d5d6c
MD
1991
1992 mknod bktr $unit c 92 `unit2minor $unit` root:wheel 444
1993 mknod tuner $unit c 92 `unit2minor $((16 + $unit))` root:wheel 444
1994 mknod vbi $unit c 92 `unit2minor $((32 + $unit))` root:wheel 444
984263bc
MD
1995 ;;
1996
093d5d6c
MD
1997#-----------------------------------------------------------------------------
1998
984263bc
MD
1999tun*)
2000 ntun=`expr $i : 'tun\(.*\)$'`
2001 unit=0
093d5d6c
MD
2002
2003 while [ $unit -le $ntun ]
2004 do
2005 mknod tun $unit c 52 `unit2minor $unit`
2006
984263bc
MD
2007 unit=$(($unit + 1))
2008 done
2009 ;;
2010
093d5d6c
MD
2011#-----------------------------------------------------------------------------
2012
984263bc
MD
2013tap*)
2014 ntap=`expr $i : 'tap\(.*\)$'`
2015 unit=0
093d5d6c
MD
2016
2017 while [ $unit -le $ntap ]
2018 do
2019 mknod tap $unit c 149 `unit2minor $unit` root:network
2020
984263bc
MD
2021 unit=$(($unit + 1))
2022 done
2023 ;;
2024
093d5d6c
MD
2025#-----------------------------------------------------------------------------
2026
984263bc 2027sysmouse)
093d5d6c
MD
2028 mknod sysmouse "" c 12 128
2029 mknod consolectl "" c 12 255
984263bc
MD
2030 ;;
2031
093d5d6c
MD
2032#-----------------------------------------------------------------------------
2033
984263bc 2034jogdial)
093d5d6c 2035 mknod jogdial "" c 160 0
984263bc
MD
2036 ;;
2037
093d5d6c
MD
2038#-----------------------------------------------------------------------------
2039
984263bc
MD
2040snp?)
2041 unit=`expr $i : 'snp\(.*\)'`
093d5d6c
MD
2042
2043 mknod snp $unit c 53 `unit2minor $unit`
984263bc
MD
2044 ;;
2045
093d5d6c
MD
2046#-----------------------------------------------------------------------------
2047
984263bc 2048labpc*)
984263bc
MD
2049 case $i in
2050 labpcaio*)
2051 name=labpcaio
2052 unit=`expr $i : 'labpcaio\(.*\)'`
2053 all="0 1 2 3 4 5 6 7"
2054 offset=0
2055 ;;
093d5d6c 2056
984263bc
MD
2057 labpcdio*)
2058 name=labpcdio
2059 unit=`expr $i : 'labpcdio\(.*\)'`
2060 all="0 1 2 3"
2061 offset=8
2062 ;;
093d5d6c 2063
984263bc
MD
2064 *)
2065 die 3 "Don't know LabPC type $i"
2066 ;;
2067 esac
093d5d6c
MD
2068
2069 [ "${unit}" ] || unit=all
2070
984263bc
MD
2071 case $unit in
2072 0|1|2|3|4|5|6|7)
093d5d6c
MD
2073 mknod $name $unit c 66 $(($offset + $unit)) \
2074 root:wheel 660
984263bc 2075 ;;
093d5d6c 2076
984263bc
MD
2077 all)
2078 for i in $all
2079 do
093d5d6c
MD
2080 mknod $name $i c 66 $(($offset + $i)) \
2081 root:wheel 660
984263bc
MD
2082 done
2083 ;;
093d5d6c 2084
984263bc
MD
2085 *)
2086 echo "No such LabPC unit: $unit"
2087 ;;
2088 esac
984263bc
MD
2089 ;;
2090
093d5d6c
MD
2091#-----------------------------------------------------------------------------
2092
984263bc 2093perfmon)
093d5d6c 2094 mknod perfmon "" c 2 32 root:kmem 640
984263bc
MD
2095 ;;
2096
093d5d6c
MD
2097#-----------------------------------------------------------------------------
2098
984263bc 2099ipl)
093d5d6c
MD
2100 mknod ipl "" c 79 0
2101 mknod ipnat "" c 79 1
2102 mknod ipstate "" c 79 2
2103 mknod ipauth "" c 79 3
984263bc
MD
2104 ;;
2105
093d5d6c
MD
2106#-----------------------------------------------------------------------------
2107
984263bc 2108elan*)
093d5d6c 2109 mknod elan-mmcr "" c 100 0 root:wheel 600
984263bc
MD
2110 ;;
2111
093d5d6c
MD
2112#-----------------------------------------------------------------------------
2113
984263bc
MD
2114kbd*)
2115 unit=`expr $i : 'kbd\(.*\)'`
2116 chr=112
093d5d6c
MD
2117
2118 mknod kbd $unit c $chr `unit2minor $unit`
984263bc
MD
2119 ;;
2120
093d5d6c
MD
2121#-----------------------------------------------------------------------------
2122
984263bc 2123i4b)
093d5d6c 2124 mknod i4b "" c 60 0
984263bc
MD
2125 ;;
2126
2127i4bctl)
093d5d6c 2128 mknod i4bctl "" c 55 0
984263bc
MD
2129 ;;
2130
2131i4brbch*)
2132 unit=`expr $i : 'i4brbch\(.*\)'`
093d5d6c
MD
2133
2134 mknod i4brbch $unit c 57 `unit2minor $unit`
984263bc
MD
2135 ;;
2136
2137i4bteld*)
2138 offset=64
2139 unit=`expr $i : 'i4bteld\(.*\)'`
093d5d6c
MD
2140
2141 mknod i4bteld $unit c 56 `unit2minor $(($offset + $unit))`
984263bc
MD
2142 ;;
2143
2144i4btel*)
2145 unit=`expr $i : 'i4btel\(.*\)'`
093d5d6c
MD
2146
2147 mknod i4btel $unit c 56 `unit2minor $unit`
984263bc
MD
2148 ;;
2149
2150i4btrc*)
2151 unit=`expr $i : 'i4btrc\(.*\)'`
093d5d6c
MD
2152
2153 mknod i4btrc $unit c 59 `unit2minor $unit`
984263bc
MD
2154 ;;
2155
093d5d6c
MD
2156#-----------------------------------------------------------------------------
2157
984263bc
MD
2158aac*)
2159 unit=`expr $i : 'aac\(.*\)'`
093d5d6c
MD
2160
2161 mknod aac $unit c 150 `unit2minor $unit`
2162
984263bc
MD
2163 ln -fs aac$unit afa$unit
2164 ln -fs aac$unit hpn$unit
2165 ;;
2166
093d5d6c
MD
2167#-----------------------------------------------------------------------------
2168
984263bc
MD
2169mlx*)
2170 unit=`expr $i : 'mlx\(.*\)'`
093d5d6c
MD
2171
2172 mknod mlx $unit c 130 `unit2minor $unit`
984263bc
MD
2173 ;;
2174
093d5d6c
MD
2175#-----------------------------------------------------------------------------
2176
984263bc
MD
2177amr*)
2178 unit=`expr $i : 'amr\(.*\)'`
093d5d6c
MD
2179
2180 mknod amr $unit c 132 `unit2minor $unit`
984263bc
MD
2181 ;;
2182
093d5d6c
MD
2183#-----------------------------------------------------------------------------
2184
edc6143b
DR
2185ips*)
2186 unit=`expr $i : 'ips\(.*\)'`
093d5d6c
MD
2187
2188 mknod mlx $unit c 175 `unit2minor $unit`
edc6143b
DR
2189 ;;
2190
093d5d6c
MD
2191#-----------------------------------------------------------------------------
2192
984263bc
MD
2193ciss*)
2194 unit=`expr $i : 'ciss\(.*\)'`
093d5d6c
MD
2195
2196 mknod ciss $unit c 166 `unit2minor $unit`
984263bc
MD
2197 ;;
2198
093d5d6c
MD
2199#-----------------------------------------------------------------------------
2200
984263bc 2201agpgart)
093d5d6c 2202 mknod agpgart "" c 148 0
984263bc
MD
2203 ;;
2204
093d5d6c
MD
2205#-----------------------------------------------------------------------------
2206
984263bc
MD
2207twe*)
2208 unit=`expr $i : 'twe\(.*\)'`
093d5d6c
MD
2209
2210 mknod twe $unit c 146 `unit2minor $unit`
984263bc
MD
2211 ;;
2212
093d5d6c
MD
2213#-----------------------------------------------------------------------------
2214
984263bc
MD
2215tw*)
2216 unit=`expr $i : 'tw\(.*\)'`
093d5d6c
MD
2217
2218 mknod tw $unit c 19 `unit2minor $unit` root:operator
984263bc
MD
2219 ;;
2220
093d5d6c
MD
2221#-----------------------------------------------------------------------------
2222
984263bc
MD
2223nsmb*)
2224 unit=`expr $i : 'nsmb\(.*\)'`
093d5d6c
MD
2225
2226 mknod nsmb $unit c 144 $unit
984263bc
MD
2227 ;;
2228
093d5d6c
MD
2229#-----------------------------------------------------------------------------
2230
1038677d
HT
2231cmx*)
2232 unit=`expr $i : 'cmx\(.*\)'`
2233
2234 mknod cmx $unit c 185 $unit
2235 ;;
2236#-----------------------------------------------------------------------------
2237
984263bc 2238local)
093d5d6c 2239 umask 0
984263bc
MD
2240 sh MAKEDEV.local
2241 umask 77
2242 ;;
2243
093d5d6c
MD
2244#-----------------------------------------------------------------------------
2245
984263bc
MD
2246*)
2247 echo $i - no such device name
2248 ;;
2249
2250esac
2251done