]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - etc/etc.i386/MAKEDEV
This commit was generated by cvs2svn to compensate for changes in r26986,
[FreeBSD/FreeBSD.git] / etc / etc.i386 / MAKEDEV
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 #
24 # Device "make" file.  Valid arguments:
25 #       all     makes all known devices, standard number of units (or close)
26 #       std     standard devices
27 #       local   configuration specific devices
28 #       mach-4  mach4&lites+devices for Mach's XFree86 distribution
29 #       (see http://www.cs.hut.fi/lites.html for more info on LITES)
30 #
31 # Tapes:
32 #       wt*     QIC-interfaced (e.g. not SCSI) 3M cartridge tape
33 #       st*     "NEW type scsi tapes" (old driver uses the
34 #               block devices of the disks to get access)
35 #       ft*     QIC-40/QIC-80 3M cartridge tape (interfaced
36 #               via the floppy disk controller)
37 #
38 # Disks:
39 #       wd*     "Winchester" disk drives (ST506,IDE,ESDI,RLL,...)
40 #       fd*     "floppy" disk drives (3 1/2", 5 1/4")
41 #       sd*     "SCSI disks"
42 #       cd*     "SCSI CD-ROM disks"
43 #       mcd*    "Mitsumi CD-ROM disks"
44 #       scd*    "Sony CD-ROM disks"
45 #       matcd*  "Matsushita (Panasonic) CD-ROM disks"
46 #       wcd*    "IDE CD-ROM disks"
47 #       vn*     "vnode disks"
48 #       od*     "optical disks"
49 #
50 # Console ports:
51 #       vty*    virtual console devices for syscons/pcvt/codrv
52 #
53 # Pointing devices:
54 #       mse*    Logitech and ATI Inport bus mouse
55 #       psm*    PS/2 mouse
56 #       sysmouse Mousesystems mouse emulator for syscons
57 #
58 # Time devices:
59 #       refclock-*  serial ports used by xntpd parse refclocks
60 #
61 # Terminal ports:
62 #       tty*    general purpose serial ports
63 #       cua*    dialout serial ports
64 #       ttyA*   Specialix SI/XIO dialin ports ('*' = number of devices)
65 #       cuaA*   Specialix SI/XIO dialout ports
66 #       ttyD*   Digiboard - 16 dialin ports
67 #       cuaD*   Digiboard - 16 dialout ports
68 #
69 # Pseudo terminals:
70 #       pty*    set of 32 master and slave pseudo terminals
71 #       vty*    virtual terminals using syscons/pcvt/codrv console
72 #
73 # Printers:
74 #       lpt*    stock lp
75 #
76 # SCSI devices (other than CD-ROM, tape and disk):
77 #       uk*     "unknown" device (supports ioctl calls only)
78 #       worm*   WORM driver
79 #       pt*     Processor Type (HP scanner, as one example)
80 #
81 # PC-CARD (previously called PCMCIA) support
82 #       card*   PC-CARD slots
83 #
84 # Special purpose devices:
85 #       apm     Advanced Power Management BIOS
86 #       bpf*    packet filter
87 #       speaker pc speaker
88 #       tw*     xten power controller
89 #       snd*    various sound cards
90 #       pcaudio PCM audio driver
91 #       socksys iBCS2 socket system driver
92 #       vat     VAT compatibility audio driver (requires snd*)
93 #       gsc     Genius GS-4500 hand scanner
94 #       joy     pc joystick
95 #       tun*    Tunneling IP device
96 #       snp*    tty snoop devices
97 #       spigot  Video Spigot video acquisition card
98 #       ctx*    Cortex-I video acquisition card
99 #       meteor* Matrox Meteor video acquisition card (pci)
100 #       bktr*   Bt848 based video acquisition card (pci)
101 #       qcam*   Connectix QuickCam(tm) parallel port camera
102 #       isdn*   ISDN devices
103 #       labpc*  National Instrument's Lab-PC and LAB-PC+
104 #       perfmon CPU performance-monitoring counters
105 #       pci     PCI configuration-space access from user mode
106 #
107 #       $Id: MAKEDEV,v 1.139 1997/03/10 02:10:58 danny Exp $
108 #
109
110 PATH=/sbin:/bin/:/usr/bin:/usr/sbin:$PATH
111 umask 77
112
113 # Convert integer to partition name
114 dkitop() {
115         local p
116
117         case $1 in
118         0) p=a;; 1) p=b;; 2) p=c;; 3) p=d;; 4) p=e;; 5) p=f;; 6) p=g;; 7) p=h;;
119         *) p="?";;
120         esac
121         echo $p
122 }
123
124 # Convert integer to slice name
125 dkitos() {
126         local s
127
128         case $1 in
129         0) s="";;
130         1) s="";;
131         *) s=s$(($1-1));;
132         esac
133         echo $s
134 }
135
136 # Convert disk (type, unit, slice, partition) to minor number
137 dkminor()
138 {
139         echo $(($1 << 25 | ($2 / 32) << 21 | ($2 % 32) << 3 | $3 << 16 | $4))
140 }
141
142 # Convert the last character of a tty name to a minor number.
143 ttyminor()
144 {
145         case $unit in
146         [0-9]) m=$unit;;
147         a) m=10;; b) m=11;; c) m=12;; d) m=13;; e) m=14;; f) m=15;; g) m=16;;
148         h) m=17;; i) m=18;; j) m=19;; k) m=20;; l) m=21;; m) m=22;; n) m=23;;
149         o) m=24;; p) m=25;; q) m=26;; r) m=27;; s) m=28;; t) m=29;; u) m=30;;
150         v) m=31;;
151         *) m="?";;
152         esac
153         echo $m
154 }
155
156 # Raw partition for disks
157 dkrawpart=2
158
159 # Compatibility slice for disks
160 dkcompatslice=0
161
162 # Raw slice for disks
163 dkrawslice=1
164
165 # Control bit for SCSI
166 scsictl=$((1 << 29))
167
168 # Standard umasks
169 disk_umask=037                  # allow group operator to read disks
170 tape_umask=017                  # allow group operator to read/write tapes
171
172 for i
173 do
174 case $i in
175
176 all)
177         sh MAKEDEV std                                          # standard
178         sh MAKEDEV wd0 wd1 wd2 wd3 fd0 fd1 sd0 sd1 sd2 sd3      # bdev, disk
179         sh MAKEDEV cd0 mcd0 scd0 matcd0 wcd0                    # bdev, cdrom
180         sh MAKEDEV od0                                          # bdev, ODD
181         sh MAKEDEV ft0 wt0 st0                                  # bdev, tape
182         sh MAKEDEV ttyd0 ttyd1 ttyd2 ttyd3                      # cdev, serial
183         sh MAKEDEV cuaa0 cuaa1 cuaa2 cuaa3                      # cdev, serial
184         sh MAKEDEV lpt0 lpt1 lpt2                               # cdev, printer
185         sh MAKEDEV pty0 ch0 tw0 bpf0                            # cdev
186         sh MAKEDEV perfmon speaker pcaudio psm0 mse0 sysmouse   # cdev
187         sh MAKEDEV vty4                                         # cdev
188         sh MAKEDEV tun0                                         # cdev
189         sh MAKEDEV apm card0 card1                              # cdev, laptop
190         ;;
191 std)
192         rm -f console drum mem kmem null random urandom zero io tty klog
193         rm -f stdin stdout stderr lkm pci
194         mknod console   c 0 0;  chmod 600 console;      chown root.wheel console
195         mknod drum      c 4 0;  chmod 640 drum;         chown root.kmem drum
196         mknod kmem      c 2 1;  chmod 640 kmem;         chown root.kmem kmem
197         mknod mem       c 2 0;  chmod 640 mem;          chown root.kmem mem
198         mknod null      c 2 2;  chmod 666 null;         chown root.wheel null
199         mknod random    c 2 3;  chmod 644 random;       chown root.wheel random
200         mknod urandom   c 2 4;  chmod 644 urandom;      chown root.wheel urandom
201         mknod zero      c 2 12; chmod 666 zero;         chown root.wheel zero
202         mknod io        c 2 14; chmod 600 io;           chown root.wheel io
203         mknod tty       c 1 0;  chmod 666 tty;          chown root.wheel tty
204         mknod klog      c 7 0;  chmod 600 klog;         chown root.wheel klog
205         mknod stdin     c 22 0; chmod 666 stdin;        chown root.wheel stdin
206         mknod stdout    c 22 1; chmod 666 stdout;       chown root.wheel stdout
207         mknod stderr    c 22 2; chmod 666 stderr;       chown root.wheel stderr
208         mknod lkm       c 32 0; chmod 644 lkm;          chown root.wheel lkm
209         mknod pci       c 78 0; chmod 644 pci;          chown root.wheel pci
210         rm -f fd/*
211         mkdir fd > null 2>&1
212         (cd fd && eval `echo "" | awk ' BEGIN { \
213                 for (i = 0; i < 64; i++) \
214                         printf("mknod %d c 22 %d;", i, i)}'`)
215         chown -R bin.bin fd
216         chmod 555 fd
217         chmod 666 fd/*
218         ;;
219
220 mach-4)
221         mknod iopl c 22 0
222         mknod kbd c 23 0
223         mknod mouse c 24 0
224         mknod time c 25 0
225         mknod timezone c 26 0
226         ;;
227
228 # Create device files for new Archive/Wangtek QIC-02 tape driver (vak)
229 wt*)
230         umask $tape_umask
231         u=`expr $i : '..\(.*\)'`
232         if [ x$u = x ]; then u=0; fi
233         rm -f r[Ww]t$u nr[Ww]t$u r[Ww]t$u[a-f] nr[Ww]t$u[a-f]
234         mknod rwt${u}   c 10 `expr  0 + $u`     # default density, 512b blocks
235         mknod nrwt${u}  c 10 `expr  4 + $u`
236 #       mknod rWt${u}   c 10 `expr 64 + $u`     # default density, 1024b blocks
237 #       mknod nrWt${u}  c 10 `expr 68 + $u`
238         mknod rwt${u}b  c 10 `expr 16 + $u`     # 60 megabytes
239         mknod nrwt${u}b c 10 `expr 20 + $u`
240         mknod rwt${u}c  c 10 `expr 24 + $u`     # 120 megabytes
241         mknod nrwt${u}c c 10 `expr 28 + $u`
242         mknod rwt${u}d  c 10 `expr 32 + $u`     # 150 megabytes
243         mknod nrwt${u}d c 10 `expr 36 + $u`
244 #       mknod rwt${u}e  c 10 `expr 40 + $u`     # 300 megabytes?
245 #       mknod nrwt${u}e c 10 `expr 44 + $u`
246 #       mknod rwt${u}f  c 10 `expr 48 + $u`     # 600 megabytes?
247 #       mknod nrwt${u}f c 10 `expr 52 + $u`
248         chown root.operator r[Ww]t$u nr[Ww]t$u r[Ww]t$u[a-f] nr[Ww]t$u[a-f]
249         umask 77
250         ;;
251
252 # Individual slices.
253 od*s*|sd*s*|vn*s*|wd*s*)
254         umask $disk_umask
255         case $i in
256         od*s*) name=od; blk=20; chr=70;;
257         sd*s*) name=sd; blk=4;  chr=13;;
258         wd*s*) name=wd; blk=0;  chr=3;;
259         vn*s*) name=vn; blk=15; chr=43;;
260         esac
261         unit=`expr $i : '..\([0-9]*\)s'`
262         slice=`expr $i : '..[0-9]*s\([0-9]*\)'`
263         part=`expr $i : '..[0-9]*s[0-9]*\(.*\)'`
264         case $unit in
265         [0-9]|[0-9][0-9]|[0-4][0-9][0-9]|50[0-9]|51[0-1])
266                 case $slice in
267                 [0-9]|[1-2][0-9]|30)
268                         oldslice=$slice
269                         slice=$(($slice+1))
270                         slicename=`dkitos $slice`
271                         rm -f  $name$unit$slicename* r$name$unit$slicename*
272                         minor=`dkminor 0 $unit $slice $dkrawpart`
273                         mknod  $name$unit$slicename b $blk $minor
274                         mknod r$name$unit$slicename c $chr $minor
275                         case $part in
276                         [a-h])
277                                 case $oldslice in
278                                 0) slice=$oldslice ;;
279                                 esac
280                                 for part in 0 1 2 3 4 5 6 7
281                                 do
282                                         minor=`dkminor 0 $unit $slice $part`
283                                         partname=`dkitop $part`
284                                         mknod  $name$unit$slicename$partname \
285                                               b $blk $minor
286                                         mknod r$name$unit$slicename$partname \
287                                               c $chr $minor
288                                 done
289                                 ;;
290                         "")
291                                 ;;
292                         *)
293                                 echo bad partition for disk in: $i
294                                 ;;
295                         esac
296                         chgrp operator $name$unit$slicename* \
297                                       r$name$unit$slicename*
298                         ;;
299                 *)
300                         echo bad slice for disk in: $i
301                         ;;
302                 esac
303                 ;;
304         *)
305                 echo bad unit for disk in: $i "(unit=$unit, slice=$slice, part=$part)"
306                 ;;
307         esac
308         umask 77
309         ;;
310
311 fd*)
312         umask $disk_umask
313         unit=`expr $i : '..\(.*\)'`
314         name=fd; blk=2; chr=9
315         rm -f $name$unit* r$name$unit*
316         case $unit in
317         0|1|2|3)
318                 mknod ${name}${unit}   b $blk `expr $unit '*' 64`
319                 mknod r${name}${unit}  c $chr `expr $unit '*' 64`
320                 # Fake BSD partitions
321                 for i in a b c d e f g h
322                 do
323                         ln ${name}${unit} ${name}${unit}$i
324                         ln r${name}${unit} r${name}${unit}$i
325                 done
326                 # User-readable and programmer-readable name sets
327
328                 mknod ${name}${unit}.1720  b $blk `expr $unit '*' 64 + 1`
329                 mknod r${name}${unit}.1720 c $chr `expr $unit '*' 64 + 1`
330                 # ln ${name}${unit}.1720 ${name}${unit}135hs21
331                 # ln r${name}${unit}.1720 r${name}${unit}135hs21
332
333                 mknod ${name}${unit}.1480  b $blk `expr $unit '*' 64 + 2`
334                 mknod r${name}${unit}.1480 c $chr `expr $unit '*' 64 + 2`
335                 # ln ${name}${unit}.1480 ${name}${unit}135hs18
336                 # ln r${name}${unit}.1480 r${name}${unit}135hs18
337                 # ln ${name}${unit}.1480 ${name}${unit}96hs18
338                 # ln r${name}${unit}.1480 r${name}${unit}96hs18
339
340                 mknod ${name}${unit}.1440  b $blk `expr $unit '*' 64 + 3`
341                 mknod r${name}${unit}.1440 c $chr `expr $unit '*' 64 + 3`
342                 # ln ${name}${unit}.1440 ${name}${unit}135
343                 # ln r${name}${unit}.1440 r${name}${unit}135
344                 # ln ${name}${unit}.1440 ${name}${unit}135ds18
345                 # ln r${name}${unit}.1440 r${name}${unit}135ds18
346                 # ln ${name}${unit}.1440 ${name}${unit}96ds18
347                 # ln r${name}${unit}.1440 r${name}${unit}96ds18
348
349                 mknod ${name}${unit}.1200  b $blk `expr $unit '*' 64 + 4`
350                 mknod r${name}${unit}.1200 c $chr `expr $unit '*' 64 + 4`
351                 # ln ${name}${unit}.1200 ${name}${unit}96
352                 # ln r${name}${unit}.1200 r${name}${unit}96
353                 # ln ${name}${unit}.1200 ${name}${unit}96ds15
354                 # ln r${name}${unit}.1200 r${name}${unit}96ds15
355                 # ln ${name}${unit}.1200 ${name}${unit}135ds15
356                 # ln r${name}${unit}.1200 r${name}${unit}135ds15
357
358                 mknod ${name}${unit}.820  b $blk `expr $unit '*' 64 + 5`
359                 mknod r${name}${unit}.820 c $chr `expr $unit '*' 64 + 5`
360                 # ln ${name}${unit}.820 ${name}${unit}96hs10
361                 # ln r${name}${unit}.820 r${name}${unit}96hs10
362                 # ln ${name}${unit}.820 ${name}${unit}135hs10
363                 # ln r${name}${unit}.820 r${name}${unit}135hs10
364
365                 mknod ${name}${unit}.800  b $blk `expr $unit '*' 64 + 6`
366                 mknod r${name}${unit}.800 c $chr `expr $unit '*' 64 + 6`
367                 # ln ${name}${unit}.800 ${name}${unit}96ds10
368                 # ln r${name}${unit}.800 r${name}${unit}96ds10
369                 # ln ${name}${unit}.800 ${name}${unit}135ds10
370                 # ln r${name}${unit}.800 r${name}${unit}135ds10
371
372                 mknod ${name}${unit}.720  b $blk `expr $unit '*' 64 + 7`
373                 mknod r${name}${unit}.720 c $chr `expr $unit '*' 64 + 7`
374                 # ln ${name}${unit}.720 ${name}${unit}96ds9
375                 # ln r${name}${unit}.720 r${name}${unit}96ds9
376                 # ln ${name}${unit}.720 ${name}${unit}135ds9
377                 # ln r${name}${unit}.720 r${name}${unit}135ds9
378
379                 mknod ${name}${unit}.360  b $blk `expr $unit '*' 64 + 8`
380                 mknod r${name}${unit}.360 c $chr `expr $unit '*' 64 + 8`
381                 # ln ${name}${unit}.360 ${name}${unit}48
382                 # ln r${name}${unit}.360 r${name}${unit}48
383                 # ln ${name}${unit}.360 ${name}${unit}48ds9
384                 # ln r${name}${unit}.360 r${name}${unit}48ds9
385
386                 chgrp operator ${name}${unit}* r${name}${unit}*
387                 ;;
388         *)
389                 echo bad unit for disk in: $i
390                 ;;
391         esac
392         umask 77
393         ;;
394
395 ft*)
396         umask $tape_umask
397         unit=`expr $i : '..\(.*\)'`
398         name=ft; blk=2; chr=9
399         rm -f $name$unit* r$name$unit*
400         case $unit in
401         0|1|2|3)
402                 mknod ${name}${unit}   b $blk `expr $unit '*' 64 + 32`
403                 mknod r${name}${unit}  c $chr `expr $unit '*' 64 + 32`
404                 ln ${name}${unit} ${name}${unit}a
405                 ln r${name}${unit} r${name}${unit}a
406                 chgrp operator ${name}${unit}* r${name}${unit}*
407                 ;;
408         *)
409                 echo bad unit for tape in: $i
410                 ;;
411         esac
412         umask 77
413         ;;
414
415 od*|sd*|vn*|wd*)
416         umask $disk_umask
417         case $i in
418         od*) name=od; blk=20; chr=70;;
419         sd*) name=sd; blk=4;  chr=13;;
420         vn*) name=vn; blk=15; chr=43;;
421         wd*) name=wd; blk=0;  chr=3;;
422         esac
423         unit=`expr $i : '..\(.*\)'`
424         case $unit in
425         [0-9]|[0-9][0-9]|[0-4][0-9][0-9]|50[0-9]|51[0-1])
426                 for slicepartname in s0h s1 s2 s3 s4
427                 do
428                         sh MAKEDEV $name$unit$slicepartname
429                 done
430                 case $name in
431                 od|sd)
432                         rm -f r${name}${unit}.ctl
433                         minor=`dkminor 0 $unit 0 0`
434                         mknod r${name}${unit}.ctl c $chr $(($minor | $scsictl))
435                         chmod 600 r${name}${unit}.ctl
436                         ;;
437                 esac
438                 ;;
439         *)
440                 echo bad unit for disk in: $i
441                 ;;
442         esac
443         umask 77
444         ;;
445
446 ccd*)
447         umask 37
448         name=ccd
449         blk=21; chr=74
450         unit=`expr $i : '...\(.*\)'`
451         case $unit in
452         [0-9]|[0-9][0-9]|[0-4][0-9][0-9]|50[0-9]|51[0-1])
453                 rm -f r${name}${unit}.ctl
454                 minor=`dkminor 0 $unit 0 0`
455                 mknod r${name}${unit}.ctl c $chr $(($minor | $scsictl))
456                 chmod 600 r${name}${unit}.ctl
457                 for part in 0 1 2 3 4 5 6 7
458                 do
459                         minor=`dkminor 0 $unit 0 $part` 
460                         partname=`dkitop $part`
461                         mknod  $name$unit$partname \
462                               b $blk $minor
463                         mknod r$name$unit$partname \
464                               c $chr $minor
465                 done
466                 ;;
467         *)
468                 echo bad unit for disk in: $i
469                 ;;
470         esac
471         umask 77
472         ;;
473
474 uk*)
475         unit=`expr $i : 'uk\(.*\)'`
476         rm -f uk$unit
477         mknod uk$unit c 31 $unit
478         ;;
479
480 worm*)
481         umask $disk_umask
482         unit=`expr $i : 'worm\(.*\)'`
483         if [ "X${unit}" = "X" ]; then
484                 unit=0
485         fi
486         chr=62
487         blk=23
488         name=worm
489         rm -f ${name}${unit}
490         mknod ${name}${unit} b $blk ${unit}
491         rm -f r${name}${unit}
492         mknod r${name}${unit} c $chr ${unit}
493         chgrp operator ${name}${unit} r${name}${unit}
494         umask 077
495         rm -f r${name}${unit}.ctl
496         mknod r${name}${unit}.ctl c $chr `expr $unit + $scsictl `
497         ;;
498
499 # SCSI processor type driver
500 pt[0-9]*)
501         chr=61
502         name=pt
503         unit=`expr $i : 'pt\([0-9][0-9]*\)'`
504         if [ "X${unit}" = "X" ]; then
505                 unit=0
506         fi
507         unit=`expr $unit + 1 - 1`
508         rm -f ${name}${unit}
509         mknod ${name}${unit} c $chr $unit
510         rm -f ${name}${unit}.ctl
511         mknod ${name}${unit}.ctl c $chr `expr $unit + $scsictl `
512         ;;
513
514 pty*)
515         class=`expr $i : 'pty\(.*\)'`
516         case $class in
517         0) offset=0 name=p;;
518         1) offset=32 name=q;;
519         2) offset=64 name=r;;
520         3) offset=96 name=s;;
521 # Note that xterm (at least) only look at p-s.
522         4) offset=128 name=P;;
523         5) offset=160 name=Q;;
524         6) offset=192 name=R;;
525         7) offset=224 name=S;;
526         # This still leaves [tuTU].
527         *) echo bad unit for pty in: $i;;
528         esac
529         case $class in
530         0|1|2|3|4|5|6|7)
531                 umask 0
532                 eval `echo $offset $name | awk ' { b=$1; n=$2 } END { \
533                         for (i = 0; i < 32; i++) {
534                                 c = substr("0123456789abcdefghijklmnopqrstuv", i + 1, 1); \
535                                 printf("rm -f tty%s%s pty%s%s; \
536                                         mknod tty%s%s c 5 %d; \
537                                         mknod pty%s%s c 6 %d; \
538                                         chown root.wheel tty%s%s pty%s%s;", \
539                                         n, c, n, c, \
540                                         n, c, b+i, \
541                                         n, c, b+i, \
542                                         n, c, n, c); \
543                         } \
544                 }'`
545                 umask 77
546                 ;;
547         esac
548         ;;
549
550 st*)
551         umask $tape_umask
552         unit=`expr $i : '..\(.*\)'`
553         chr=14
554
555         #remove old stype names
556         rm -f [hml]rst[0123456] [hml][en]rst[0123456] [hml]enrst[0123456]
557         #remove new style names
558         rm -f rst${unit} [en]rst${unit} enrst${unit}
559         rm -f rst${unit}.[0123] nrst${unit}.[0123]\
560                 erst${unit}.[0123] st${unit}ctl.[0123]
561         #remove control device
562
563         case $unit in
564         0|1|2|3|4|5|6)
565                 for mode in 0 1 2 3
566                 do
567                         mknod rst${unit}.${mode} c $chr `expr $unit '*' 16 + $mode '*' 4 + 0`
568                         mknod nrst${unit}.${mode} c $chr `expr $unit '*' 16 + $mode '*' 4 + 1`
569                         mknod erst${unit}.${mode} c $chr `expr $unit '*' 16 + $mode '*' 4 + 2`
570                         mknod st${unit}ctl.${mode} c $chr `expr $unit '*' 16 + $mode '*' 4 + 3`
571                         chgrp operator  rst${unit}.${mode}\
572                                         nrst${unit}.${mode} \
573                                         erst${unit}.${mode} \
574                                         st${unit}ctl.${mode}
575                         chmod 600       st${unit}ctl.${mode}
576                 done
577                 rm -f rst${unit}.ctl
578                 mknod rst${unit}.ctl c $chr `expr $unit '*' 16 + $scsictl `
579                 chmod 600 rst${unit}.ctl
580
581                 ln rst${unit}.0 rst${unit}
582                 ln nrst${unit}.0 nrst${unit}
583                 ln erst${unit}.0 erst${unit}
584                 ;;
585         *)
586                 echo bad unit for tape in: $i
587                 ;;
588         esac
589         umask 77
590         ;;
591
592 ch*)
593         umask 37
594         unit=`expr $i : '..\(.*\)'`
595         case $i in
596         ch*) name=ch;  chr=17;;
597         esac
598         rm -f $name$unit
599         case $unit in
600         0|1|2|3|4|5|6)
601                 mknod ${name}${unit}    c $chr `expr $unit '*' 16 + 0`
602                 chgrp operator ${name}${unit}
603                 rm -f r${name}${unit}.ctl
604                 mknod r${name}${unit}.ctl c $chr `expr $unit '*' 16 + $scsictl `
605                 chmod 600 r${name}${unit}.ctl
606                 ;;
607         *)
608                 echo bad unit for media changer in: $i
609                 ;;
610         esac
611         umask 77
612         ;;
613
614 cd*|mcd*|scd*)
615         umask $disk_umask
616         case $i in
617         cd*) unit=`expr $i : '..\(.*\)'`; name=cd; blk=6; chr=15;;
618         mcd*) unit=`expr $i : '...\(.*\)'`; name=mcd; blk=7; chr=29;;
619         scd*) unit=`expr $i : '...\(.*\)'`; name=scd; blk=16; chr=45;;
620         esac
621         rm -f $name$unit? r$name$unit?
622         case $unit in
623         0|1|2|3|4|5|6)
624                 mknod ${name}${unit}a   b $blk `expr $unit '*' 8 + 0`
625                 mknod ${name}${unit}c   b $blk `expr $unit '*' 8 + 2`
626                 mknod r${name}${unit}a  c $chr `expr $unit '*' 8 + 0`
627                 mknod r${name}${unit}c  c $chr `expr $unit '*' 8 + 2`
628                 chgrp operator ${name}${unit}[a-h] r${name}${unit}[a-h]
629                 case $name in
630                 cd)
631                         rm -f r${name}${unit}.ctl
632                         mknod r${name}${unit}.ctl c $chr `expr $unit '*' 8 + $scsictl `
633                         chmod 600 r${name}${unit}.ctl
634                         ;;
635                 esac
636                 ;;
637         *)
638                 echo bad unit for disk in: $i
639                 ;;
640         esac
641         umask 77
642         ;;
643
644 matcd*)
645         umask 2
646         case $i in
647         matcd*) unit=`expr $i : '.....\(.*\)'`; name=matcd; blk=17; chr=46;;
648         esac
649         rm -f $name$unit? r$name$unit? $name$unit?? r$name$unit??
650         case $unit in
651         0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15)
652                 mknod ${name}${unit}a   b $blk `expr $unit '*' 8 + 0`
653                 mknod ${name}${unit}c   b $blk `expr $unit '*' 8 + 2`
654                 mknod r${name}${unit}a  c $chr `expr $unit '*' 8 + 0`
655                 mknod r${name}${unit}c  c $chr `expr $unit '*' 8 + 2`
656                 chgrp operator ${name}${unit}[a-h] r${name}${unit}[a-h]
657                 chmod 640 ${name}${unit}[a-h] r${name}${unit}[a-h]
658
659                 mknod ${name}${unit}la  b $blk `expr $unit '*' 8 + 128`
660                 mknod ${name}${unit}lc  b $blk `expr $unit '*' 8 + 130`
661                 mknod r${name}${unit}la c $chr `expr $unit '*' 8 + 128`
662                 mknod r${name}${unit}lc c $chr `expr $unit '*' 8 + 130`
663                 chgrp operator ${name}${unit}l[a-h] r${name}${unit}l[a-h]
664                 chmod 640 ${name}${unit}l[a-h] r${name}${unit}l[a-h]
665                 ;;
666         *)
667                 echo bad unit for disk in: $i
668                 ;;
669         esac
670         umask 77
671         ;;
672
673 wcd*)
674         umask 2 ;
675         unit=`expr $i : '...\(.*\)'`
676         blk=19
677         chr=69
678         rm -f wcd$unit? rwcd$unit?
679         case $unit in
680         0|1|2|3)
681                 mknod wcd${unit}a  b $blk `expr $unit '*' 8 + 0`
682                 mknod rwcd${unit}a c $chr `expr $unit '*' 8 + 0`
683                 mknod wcd${unit}c  b $blk `expr $unit '*' 8 + 2`
684                 mknod rwcd${unit}c c $chr `expr $unit '*' 8 + 2`
685                 chgrp operator wcd${unit}[a-h] rwcd${unit}[a-h]
686                 chmod 640 wcd${unit}[a-h] rwcd${unit}[a-h]
687                 ;;
688         *)
689                 echo bad unit for disk in: $i
690                 ;;
691         esac
692         umask 77
693         ;;
694
695 lpt*)
696         unit=`expr $i : 'lpt\(.*\)'`
697         rm -f lpt$unit
698         rm -f lpctl$unit
699         mknod lpt$unit c 16 $unit
700         mknod lpctl$unit c 16 `expr $unit + 128`
701         chown root.wheel lpt$unit
702         chown root.wheel lpctl$unit
703         ;;
704
705 tw*)
706         unit=`expr $i : 'tw\(.*\)'`
707         rm -f tw$unit
708         mknod tw$unit c 19 $unit
709         chown root.operator tw$unit
710         ;;
711
712 # Use this to create virtual consoles for syscons, pcvt or codrv
713 # ttyv0-b
714 # use as MAKEDEV vtyNN to create NN entries
715 vty*)
716         chr=12
717         units=`expr $i : 'vty\(.*\)'`
718         eval `echo ${chr} ${units} | awk ' { c=$1; n=$2 } END {
719                 for (i = 0; i < n; i++)
720                         printf("rm -f ttyv%01x; mknod ttyv%01x c %d %d; \
721                                 chown root.wheel ttyv%01x;", \
722                                 i, i, c, i, i); }'`
723         ln -fs ttyv0 vga        # XXX X still needs this pccons relic
724         ;;
725
726 bpf*)
727         unit=`expr $i : 'bpf\(.*\)'`
728         rm -f bpf$unit
729         mknod bpf$unit c 23 $unit
730         chown root.wheel bpf$unit
731         ;;
732
733 speaker)
734         rm -f speaker
735         mknod speaker c 26 0
736         chown root.wheel speaker
737         ;;
738
739 cuaa?|cua?)
740         umask 7
741         unit=`expr $i : 'cua.*\(.\)$'`
742         rm -f cua*a$unit
743         m=`ttyminor $unit`
744         mknod cuaa$unit c 28 `expr $m + 128`
745         mknod cuaia$unit c 28 `expr $m + 32 + 128`
746         mknod cuala$unit c 28 `expr $m + 64 + 128`
747         chown uucp.dialer cua*a$unit
748         umask 77
749         ;;
750
751 tty0?|ttyd?|tty?)
752         unit=`expr $i : 'tty.*\(.\)$'`
753         rm -f tty*d$unit
754         m=`ttyminor $unit`
755         mknod ttyd$unit c 28 $m
756         mknod ttyid$unit c 28 `expr $m + 32`
757         mknod ttyld$unit c 28 `expr $m + 64`
758         chown root.wheel tty*d$unit
759         ;;
760
761 cuac?)
762         umask 7
763         portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f
764                   g h i j k l m n o p q r s t u v"
765         major=48
766         card=`expr $i : 'cua.*\(.\)$'`
767         for unit in $portlist
768         do
769                 minor=`ttyminor $unit`
770                 minor=`expr $card \* 65536 + $minor`
771                 name=$card$unit
772                 rm -f cuac$name cuaic$name cualc$name
773                 mknod cuac$name c $major `expr $minor + 128`
774                 mknod cuaic$name c $major `expr $minor + 32 + 128`
775                 mknod cualc$name c $major `expr $minor + 64 + 128`
776                 chown uucp.dialer cuac$name cuaic$name cualc$name
777         done
778         umask 77
779         ;;
780
781 ttyc?)
782         portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f
783                   g h i j k l m n o p q r s t u v"
784         major=48
785         card=`expr $i : 'tty.*\(.\)$'`
786         for unit in $portlist
787         do
788                 minor=`ttyminor $unit`
789                 minor=`expr $card \* 65536 + $minor`
790                 name=$card$unit
791                 rm -f ttyc$name ttyic$name ttylc$name
792                 mknod ttyc$name c $major $minor
793                 mknod ttyic$name c $major `expr $minor + 32`
794                 mknod ttylc$name c $major `expr $minor + 64`
795                 chown root.wheel ttyc$name ttyic$name ttylc$name
796         done
797         ;;
798
799 # RISCom8 'rc' driver entries
800
801 cuam?)
802         umask 7
803         unit=`expr $i : 'cua.*\(.\)$'`
804         rm -f cuam$unit
805         m=`ttyminor $unit`
806         mknod cuam$unit c 63 `expr $m + 128`
807         chown uucp.dialer cuam$unit
808         umask 77
809         ;;
810
811 ttym?)
812         unit=`expr $i : 'tty.*\(.\)$'`
813         rm -f ttym$unit
814         m=`ttyminor $unit`
815         mknod ttym$unit c 63 $m
816         chown root.wheel ttym$unit
817         ;;
818
819 # Specialix SI/XIO.
820 # Note: these are 'base 1' to match the numbers on the panels, and to match
821 #       the manual that comes with the system.
822 ttyA*)
823         major=68
824         nports=`expr $i : 'ttyA\(.*\)$'`
825         port=1
826         while [ $port -le $nports ]; do
827                 minor=`expr $port - 1`
828                 name=`expr $port + 1000 | cut -c 3-4` 
829                 rm -f tty*A$name
830                 mknod ttyA$name c $major $minor
831                 chown root.wheel ttyA$name
832                 mknod ttyiA$name c $major `expr $minor + 65536`
833                 chown root.wheel ttyiA$name
834                 mknod ttylA$name c $major `expr $minor + 131072`
835                 chown root.wheel ttylA$name
836                 port=`expr $port + 1`
837         done
838         # For the user-mode control program, 'sicontrol'
839         rm -f si_control
840         mknod si_control c 68 262144
841         chmod 600 si_control
842         chown root.wheel si_control
843         ;;
844
845 cuaA*)
846         umask 7
847         major=68
848         nports=`expr $i : 'cuaA\(.*\)$'`
849         port=1
850         while [ $port -le $nports ]; do
851                 minor=`expr $port - 1`
852                 name=`expr $port + 1000 | cut -c 3-4` 
853                 rm -f cuaA$name
854                 mknod cuaA$name c $major `expr $minor + 128`
855                 chown uucp.dialer cuaA$name
856                 port=`expr $port + 1`
857         done
858         umask 77
859         ;;
860
861 # Digiboard PC/?? 16 port card.
862 # The current scheme of minor numbering is:
863 #
864 #       unused{14} CARD{2} major{8} CALLOUT{1} LOCK{1} INIT{1} PORT{5}
865 #
866 #   CARD bitfield in future versions may be extended to 3 bits.
867 #
868 # See dgb(4)
869 #
870 ttyD?)
871         portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f"
872         major=58
873         card=`expr $i : 'tty.*\(.\)$'`
874         for unit in $portlist
875         do
876                 minor=`ttyminor $unit`
877                 minor=`expr $card \* 65536 + $minor`
878                 name=$card$unit
879                 rm -f tty*D$name
880                 mknod ttyD$name c $major $minor
881                 mknod ttyiD$name c $major `expr $minor + 32`
882                 mknod ttylD$name c $major `expr $minor + 64`
883                 chown root.wheel tty*D$name
884         done
885         ;;
886
887 cuaD?)
888         umask 7
889         portlist="0 1 2 3 4 5 6 7 8 9 a b c d e f"
890         major=58
891         card=`expr $i : 'cua.*\(.\)$'`
892         for unit in $portlist
893         do
894                 minor=`ttyminor $unit`
895                 minor=`expr $card \* 65536 + $minor`
896                 name=$card$unit
897                 rm -f cua*D$name
898                 mknod cuaD$name c $major `expr $minor + 128`
899                 mknod cuaiD$name c $major `expr $minor + 32 + 128`
900                 mknod cualD$name c $major `expr $minor + 64 + 128`
901                 chown uucp.dialer cua*D$name
902         done
903         umask 77
904         ;;
905
906 mse*)
907         unit=`expr $i : 'mse\(.*\)'`
908         chr=27
909         rm -f mse$unit
910         mknod mse$unit c $chr `expr $unit '*' 2 + 1`    # non-blocking for X11
911         chown root.wheel mse$unit
912         ;;
913
914 psm*)
915         unit=`expr $i : 'psm\(.*\)'`
916         chr=21
917         rm -f psm$unit
918         mknod psm$unit c $chr `expr $unit '*' 2 + 1`    # non-blocking for X11
919         chown root.wheel psm$unit
920         ;;
921
922 mouse*)
923         name=`expr $i : 'mouse\(.*\)'`
924         if [ ! -c $name ]; then
925                 $0 $name                        # make the appropriate device
926         fi
927         rm -f mouse
928         ln -s $name mouse
929         ;;
930
931 pcaudio)
932         rm -f pcaudio pcaudioctl
933         mknod pcaudio c 24 0
934         mknod pcaudioctl c 24 128
935         chown root.wheel pcaudio pcaudioctl
936         ;;
937
938 socksys)
939         rm -f socksys nfsd spx
940         mknod socksys c 41 0
941         mknod spx c 41 1
942         ln -s socksys nfsd
943         chown root.wheel socksys nfsd spx
944         chmod 666 socksys nfsd spx
945         ;;
946
947 snd*)
948 #
949 # changes from Linux voxware
950 # minor         Linux                   FreeBSD
951 # 8             sequencer2 (aka music0) music0
952 # 17            patmgr0                 sequencer1
953 # 33            patmgr1                 sequencer2
954 #
955
956         unit=`expr $i : 'snd\(.*\)'`
957         chr=30
958
959         # XXX write this less verbosely, like std
960         snd_security_hole=0     # XXX
961         umask $snd_security_hole
962
963         if [ $unit = "0" ] ; then
964                 rm -f mixer     ; ln -s mixer$unit mixer
965                 rm -f sequencer ; ln -s sequencer$unit sequencer
966                 rm -f dsp       ; ln -s dsp$unit dsp
967                 rm -f audio     ; ln -s audio$unit audio
968                 rm -f dspW      ; ln -s dspW$unit dspW
969                 rm -f music     ; ln -s music$unit music
970                 rm -f pss       ; ln -s pss$unit pss
971         fi
972
973         rm -f mixer$unit        # Mixer [ Control ]
974         mknod mixer$unit        c $chr `expr $unit '*' 16 + 0`
975
976         rm -f sequencer$unit    # Sequencer [ FM Synth and MIDI output ]
977         mknod sequencer$unit    c $chr `expr $unit '*' 16 + 1`
978
979         rm -f midi midi$unit    # Midi 0
980         mknod midi$unit         c $chr `expr $unit '*' 16 + 2`
981
982         rm -f dsp$unit          # DSP [ Digitized voice ]
983         mknod dsp$unit          c $chr `expr $unit '*' 16 + 3`
984
985         rm -f audio$unit        # SPARC audio [ Not fully implemented ]
986         mknod audio$unit        c $chr `expr $unit '*' 16 + 4`
987
988         rm -f dspW$unit         # Wide DSP (each sample is 16 bits)
989         mknod dspW$unit         c $chr `expr $unit '*' 16 + 5`
990
991         rm -f sndstat           # Status Device [ Debugging interface, only 1 ]
992         mknod sndstat           c $chr 6
993
994                                 # minor number 7 is unused
995
996         rm -f music$unit        # Sequencer level 2
997         mknod music$unit        c $chr `expr $unit '*' 16 + 8`
998
999         rm -f pss$unit          # PSS and programmable devices
1000         mknod pss$unit          c $chr `expr $unit '*' 16 + 9`
1001
1002                                 # minor numbers 10-15 are unused
1003         umask 77
1004         ;;
1005
1006 vat)
1007         rm -f vatio
1008         mknod vatio c 25 128
1009         chown root.wheel vatio
1010         chmod 660 vatio
1011         ;;
1012
1013 gsc*)
1014         unit=`expr $i : 'gsc\(.*\)'`
1015         rm -f gsc${unit}*
1016         mknod gsc${unit} c 47 $unit
1017         mknod gsc${unit}p c 47 $(($unit + 8))
1018         mknod gsc${unit}d c 47 $(($unit + 32))
1019         mknod gsc${unit}pd c 47 $(($unit + 40))
1020         chmod 666 gsc${unit}*
1021         chown root.wheel gsc${unit}*
1022         ;;
1023
1024 apm*)
1025         rm -f apm
1026         chr=39
1027         mknod apm c $chr 0
1028         chown root.operator apm
1029         chmod 660 apm
1030         ;;
1031
1032 card*)
1033         unit=`expr $i : 'card\(.*\)'`
1034         chr=50
1035         rm -f card$unit
1036         mknod card$unit c $chr $unit
1037         chmod 644 card$unit
1038         chown root.wheel card$unit
1039         ;;
1040
1041 ttyx?|ttyy?|ttyz?)
1042         case $i in
1043         *0) unit=0;;    *1) unit=1;;    *2) unit=2;;    *3) unit=3;;
1044         *4) unit=4;;    *5) unit=5;;    *6) unit=6;;    *7) unit=7;;
1045         *8) unit=8;;    *9) unit=9;;    *a) unit=10;;   *b) unit=11;;
1046         *c) unit=12;;   *d) unit=13;;   *e) unit=14;;   *f) unit=15;;
1047         esac
1048         case $i in
1049         ttyy?)  unit=`expr $unit \+ 16`;;
1050         ttyz?)  unit=`expr $unit \+ 32`;;
1051         esac
1052         rm -f $i
1053         mknod $i c 42 $unit
1054         chown uucp.wheel $i
1055         ;;
1056
1057 cronyx)
1058         rm -f cronyx
1059         mknod cronyx c 42 63
1060         chown root.wheel cronyx
1061         ;;
1062
1063 joy)
1064         rm -f joy0 joy1
1065         mknod joy0 c 51 0
1066         mknod joy1 c 51 1
1067         chown root.operator joy0 joy1
1068         chmod 640  joy0 joy1
1069         ;;
1070
1071 spigot)
1072         rm -f spigot
1073         mknod spigot c 11 0
1074         chmod 444 spigot
1075         ;;
1076
1077 ctx?)
1078         unit=`expr $i : 'ctx\(.*\)'`
1079         rm -f ctx$unit
1080         mknod ctx$unit c 40 $unit
1081         chmod 444 ctx$unit
1082         ;;
1083
1084 qcam?)
1085         unit=`expr $i : 'qcam\(.*\)'`
1086         rm -f qcam$unit
1087         mknod qcam$unit c 73 $unit
1088         chmod 444 qcam$unit
1089         ;;
1090
1091 meteor?)
1092         unit=`expr $i : 'meteor\(.*\)'`
1093         rm -f meteor$unit
1094         mknod meteor$unit c 67 $unit
1095         chown root.wheel meteor$unit
1096         chmod 444 meteor$unit
1097         ;;
1098
1099 bktr?)
1100         unit=`expr $i : 'bktr\(.*\)'`
1101         rm -f bktr$unit tuner$unit
1102         mknod bktr$unit c 79 $unit
1103         mknod tuner$unit c 79 $((16 + $unit ))
1104         chown root.wheel bktr$unit tuner$unit
1105         chmod 444 bktr$unit tuner$unit
1106         ;;
1107
1108 tun*)
1109         ntun=`expr $i : 'tun\(.*\)$'`
1110         unit=0
1111         while [ $unit -le $ntun ]; do
1112                 rm -f tun$unit
1113                 mknod tun$unit c 52 $unit
1114                 chown uucp.dialer tun$unit
1115                 unit=`expr $unit + 1`
1116         done
1117         ;;
1118
1119 sysmouse)
1120         rm -f sysmouse consolectl
1121         mknod sysmouse c 12 128
1122         mknod consolectl c 12 255
1123         chown root.wheel sysmouse consolectl
1124         ;;
1125
1126 snp?)
1127         unit=`expr $i : 'snp\(.*\)'`
1128         rm -f snp$unit
1129         mknod snp$unit c 53 $unit
1130         chown root.wheel snp$unit
1131         ;;
1132
1133 # Valid arguments to isdn:
1134 #       none    makes all the node but nic0
1135 #       5000    makes nic0 for Niccy 5000
1136 #       3008    makes nic0 for Niccy 3008
1137 #       3009    makes nic0 for Niccy 3009
1138 #       1000    makes nodes for Niccy 1000
1139 #       tel*    makes nodes for TELES S0
1140 #
1141 isdn*)
1142         type=`expr $i : 'isdn\(.*\)'`
1143         if [ "X${type}" = "X" ]; then
1144                 type=none
1145         fi
1146         unit=54
1147         rm -f nic0 snic0 n?ic0 isdn isdn? ity?? itel?? ispy
1148         mknod n8ic0 c $unit 0
1149         mknod snic0 c `expr $unit + 4` 0
1150         mknod n9ic0 c `expr $unit + 6` 0
1151         mknod isdn c `expr $unit + 1` 0
1152         mknod isdn1 c `expr $unit + 1` 1
1153         mknod isdn2 c `expr $unit + 1` 2
1154         mknod ity00 c `expr $unit + 2` 0
1155         mknod ity01 c `expr $unit + 2` 1
1156         mknod ityo0 c `expr $unit + 2` 130
1157         mknod ityo1 c `expr $unit + 2` 131
1158         mknod itel00 c `expr $unit + 3` 0
1159         mknod itel01 c `expr $unit + 3` 1
1160         mknod ispy c `expr $unit + 5` 0
1161         chown root.wheel n8ic0 n9ic0 snic0 isdn isdn? ity?? itel?? ispy
1162         chown uucp.wheel ityo[01]
1163         case $type in
1164         5000)
1165                 ln snic0 nic0
1166                 chown root.wheel nic0
1167                 ;;
1168         3008)
1169                 ln n8ic0 nic0
1170                 chown root.wheel nic0
1171                 ;;
1172         3009)
1173                 ln n9ic0 nic0
1174                 chown root.wheel nic0
1175                 ;;
1176         1000|tel*|TEL*|none)
1177                 ;;
1178         *)
1179                 echo "No such ISDN device subtype: $type"
1180                 ;;
1181         esac
1182         ;;
1183
1184 # dufault@hda.com: If I do much more work on other A-D boards
1185 # then eventually we'll have a "ad" and "dio" interface and some of these
1186 # "labpcaio" ones will be gone.
1187 # labpcaio: D-A and A-D.
1188 # labpcdio: Digital in and Digital out.
1189 #
1190 labpc*)
1191         umask 7
1192         case $i in
1193         labpcaio*)
1194                 name=labpcaio
1195                 unit=`expr $i : 'labpcaio\(.*\)'`
1196                 all="0 1 2 3 4 5 6 7"
1197                 offset=0
1198                 ;;
1199         labpcdio*)
1200                 name=labpcdio
1201                 unit=`expr $i : 'labpcdio\(.*\)'`
1202                 all="0 1 2 3"
1203                 offset=8
1204                 ;;
1205         *)
1206                 echo "Don't understand that labpc name"
1207                 exit
1208                 ;;
1209         esac
1210         if [ "X${unit}" = "X" ]; then
1211                 unit=all
1212         fi
1213         case $unit in
1214                 0|1|2|3|4|5|6|7)
1215                                 rm -f $name$unit
1216                                 mknod $name$unit c 66 `expr $offset + $unit `
1217                 ;;
1218                 all)
1219                         for i in $all
1220                         do
1221                                 rm -f $name$i
1222                                 mknod $name$i c 66 `expr $offset + $i `
1223                         done
1224                         ;;
1225                 *)
1226                         echo "No such LabPC unit: $unit"
1227                         ;;
1228         esac
1229         umask 77
1230         ;;
1231
1232 perfmon)
1233         rm -f perfmon
1234         mknod perfmon c 2 32
1235         chown root.kmem perfmon
1236         chmod 640 perfmon
1237         ;;
1238
1239 local)
1240         umask 0                 # XXX should be elsewhere
1241         sh MAKEDEV.local
1242         umask 77
1243         ;;
1244
1245 *)
1246         echo $i - no such device name
1247         ;;
1248
1249 esac
1250 done