/[baselayout]/trunk/sbin/MAKEDEV
Gentoo

Contents of /trunk/sbin/MAKEDEV

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1577 - (show annotations) (download)
Wed Oct 19 00:07:16 2005 UTC (8 years, 5 months ago) by vapier
File size: 51123 byte(s)
 remove dupliate call to uname
1 #! /bin/sh -
2 # $Id$
3
4 #---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#
5 # Customisation:
6 # The devices fall into various classes. This section contains the mapping
7 # from a class name into a group name and permission.
8 # You will almost certainly need to edit the group name to match your
9 # system, and you may change the permissions to suit your preference. These
10 # lines _must_ be of the format "user group perm".
11
12 public=" root root 0666"
13 private=" root root 0600"
14 system=" root root 0660"
15 kmem=" root kmem 0640"
16 tty=" root tty 0666"
17 cons=" root tty 0600"
18 dialout=" root dialout 0660"
19 dip=" root dip 0660"
20 mouse=" root root 0660"
21 printer=" root lp 0660"
22 floppy=" root floppy 0660"
23 disk=" root disk 0660"
24 scsi=" root root 0600"
25 cdrom=" root cdrom 0660"
26 tape=" root tape 0660"
27 audio=" root audio 0660"
28 video=" root video 0660"
29 ibcs2=" root root 0666"
30 scanner=" root root 0666"
31 coda=" root root 0600"
32 ipsec=" root root 0200"
33 readable=" root root 0444"
34
35 MAXVT=63
36
37 # defaults for $major_*
38 major_ide0=3
39 major_ide1=22
40 major_sd=8
41 major_lp=6
42
43 # Remark: OSS/Linux becomes major_OSSLinux
44
45 #---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#
46
47 # try to do the right things if udev is running
48 if [ "$WRITE_ON_UDEV" ]; then
49 :
50 elif [ -d /dev/.static/dev/ ] && [ "`pwd`" = /dev ] && [ -e /proc/mounts ] \
51 && grep -qE '^[^ ]+ /dev/\.static/dev' /proc/mounts; then
52 cd /dev/.static/dev/
53 elif [ -d /.dev/ ] && [ "`pwd`" = /dev ] && [ -e /proc/mounts ] \
54 && grep -qE '^[^ ]+ /\.dev' /proc/mounts; then
55 cd /.dev/
56 elif [ -d .udevdb/ ] && [ "`pwd`" = /dev ]; then
57 echo ".udevdb presence implies active udev. Aborting MAKEDEV invocation."
58 # use exit 0, not 1, so postinst scripts don't fail on this
59 exit 0
60 fi
61
62 #---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#
63
64 # don't stomp on devfs users
65 if [ -c .devfsd ]
66 then
67 echo ".devfsd presence implies active DevFS. Aborting MAKEDEV invocation."
68 # use exit 0, not 1, so postinst scripts don't fail on this
69 exit 0
70 fi
71
72 #---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#
73
74 # don't stomp on non-Linux users
75 if [ "$(uname -s)" != "Linux" ]
76 then
77 echo "Results undefined on non-Linux systems, aborting MAKEDEV invocation."
78 # use exit 0, not 1, so postinst scripts don't fail on this
79 exit 0
80 fi
81
82 #---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#
83
84 procfs=/proc
85
86 opt_v=
87 opt_d=
88 opt_n=
89
90 while [ $# -ge 1 ]
91 do
92 case $1 in
93 --) shift; break ;;
94 -v) shift; opt_v=1 ;;
95 -d) shift; opt_d=1 ;;
96 -n) shift; opt_n=1; opt_v=1 ;;
97 -V) shift; opt_V=1 ;;
98 -*) echo "$0: unknown flag \"$1\"" >&2; exit 1 ;;
99 *) break ;;
100 esac
101 done
102
103 if [ "$opt_V" ]
104 then
105 echo "This is MAKEDEV based on Debian's makedev_2.3.1-78."
106 echo "See the MAKEDEV(8) manpage for more information."
107 exit 0
108 fi
109
110 opts="${opt_n:+-n} ${opt_v:+-v} ${opt_d:+-d}"
111
112 #---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#
113
114 devicename () { # translate device names to something safe
115 echo "$*" | sed -e 's/[^A-Za-z0-9_]/_/g'
116 }
117
118 makedev () { # usage: makedev name [bcu] major minor owner group mode
119 if [ "$opt_v" ]
120 then if [ "$opt_d" ]
121 then echo "delete $1"
122 else echo "create $1 $2 $3 $4 $5:$6 $7"
123 fi
124 fi
125 # missing parameters are a bug - bail - should we do an exit 1 here?
126 case :$1:$2:$3:$4:$5:$6:$7: in
127 *::*) echo "Warning: MAKEDEV $@ is missing parameter(s)." >&2;;
128 esac
129 if [ ! "$opt_n" ]
130 then
131 if [ "$opt_d" ]
132 then
133 rm -f $1
134 else
135 rm -f $1-
136 if mknod $1- $2 $3 $4 &&
137 chown $5:$6 $1- &&
138 chmod $7 $1- &&
139 mv $1- $1
140 then
141 : # it worked
142 else
143 # Didn't work, clean up any mess...
144 echo "makedev $@: failed"
145 rm -f $1-
146 fi
147 fi
148 fi
149 }
150 symlink () { # usage: symlink name target
151 if [ "$opt_v" ]
152 then if [ "$opt_d" ]
153 then echo "delete $1"
154 else echo "create $1 -> $2"
155 fi
156 fi
157 [ ! "$opt_n" ] && rm -f $1 &&
158 [ ! "$opt_d" ] && ln -s $2 $1
159 }
160
161 #---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#
162
163 # Debian allows us to assume /bin/sh is a POSIX compliant shell, so go for it!
164
165 math () {
166 eval echo "\$(($*))"
167 }
168 index () { # index string c
169 eval "I=\${1%$2*}"
170 eval echo "\${#I}"
171 }
172 suffix () {
173 eval echo "\${1#$2}"
174 }
175 strip () {
176 eval echo "\${1% $2 *} \${1#* $2 }"
177 }
178 first () {
179 echo "${1%%?}"
180 }
181 second () {
182 echo "${1##?}"
183 }
184 substr () {
185 echo $1 | dd bs=1 count=1 skip=$(( $2 - 1 )) 2> /dev/null
186 }
187
188 #---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#---#
189
190 devices=
191 if [ ! -f $procfs/devices ]
192 then
193 echo "$0: warning: can't read $procfs/devices" >&2
194 else
195 exec 3<$procfs/devices
196 while read major device extra <&3
197 do
198 device=`echo $device | sed 's#/.*##'`
199 case "$major" in
200 Character|Block|'')
201 ;;
202 *)
203 safedevname=`devicename $device`
204 eval "major_$safedevname=$major"
205 devices="$devices $device"
206 ;;
207 esac
208 done
209 exec 3<&-
210 fi
211
212 Major () {
213 device=$2
214 devname=`devicename $1`
215 if [ "$opt_d" ]
216 then
217 echo -1 # don't care
218 else
219 eval echo \${major_$devname:-\${device:?\"unknown major number for $1\"}}
220 fi
221 }
222
223 cvt () {
224 while [ $# -ne 0 ]
225 do
226 case "$1" in
227 mem|tty|ttyp|cua|cub|cui) ;;
228 hd) (for d in a b c d e f g h ; do
229 echo -n hd$d " "
230 done) ; echo
231 ;;
232 ide0) echo hda hdb ;;
233 ide1) echo hdc hdd ;;
234 ide2) echo hde hdf ;;
235 ide3) echo hdg hdh ;;
236 ide4) echo hdi hdj ;;
237 ide5) echo hdk hdl ;;
238 ide6) echo hdm hdn ;;
239 ide7) echo hdo hdp ;;
240 ide8) echo hdq hdr ;;
241 ide9) echo hds hdt ;;
242 sd) echo sda sdb sdc sdd ;;
243 dasd) (for d in a b c d e f g h i j k l m \
244 n o p q r s t u v w x y z ; do
245 echo -n dasd$d " "
246 done) ; echo
247 ;;
248 raw) echo raw ;;
249 sg) echo sg ;;
250 sr) echo scd ;;
251 st) echo st0 ;;
252 xd) echo xda xdb ;;
253 ad) echo ada adb ;;
254 fd) echo fd0 fd1 ;;
255 lp) echo lp ;;
256 mt) echo ftape ;;
257 qft) echo ftape ;;
258 loop) echo loop ;;
259 md) echo md ;;
260 ibcs2) echo ibcs2 ;;
261 tpqic02) echo qic ;;
262 sound) echo audio ;;
263 logiscan) echo logiscan ;;
264 ac4096) echo ac4096 ;;
265 hw) echo helloworld ;;
266 sbpcd | sbpcd[123]) echo $1 ;;
267 joystick) echo js ;;
268 input) echo input ;;
269 apm_bios) echo apm ;;
270 dcf) echo dcf ;;
271 aztcd) echo aztcd ;;
272 cm206cd) echo cm206cd ;;
273 gscd) echo gscd ;;
274 pcmcia) ;; # taken care of by its own driver
275 ttyC) echo cyclades ;;
276 isdn) echo isdnmodem isdnbri dcbri ;;
277 vcs) ;;
278 pty) echo pty ;;
279 misc) echo misc ;;
280 3dfx) echo 3dfx ;;
281 agpgart) echo agpgart ;;
282 microcode) echo microcode ;;
283 ipmi|ipmikcs) echo ipmi ;;
284 fb) echo fb ;;
285 nb|drbd) echo nb0 nb1 nb2 nb3 nb4 nb5 nb6 nb7;;
286 netlink) echo netlink ;;
287 tap) echo netlink ;;
288 hamradio) echo hamradio ;;
289 snd) ;;
290 ptm) ;;
291 pts) ;;
292 ttyB) (for l in 0 1 2 3 4 5 6 7 ; do
293 echo -n ttyB$l " "
294 done) ; echo
295 ;;
296 ttyS) echo ttyS0 ttyS1 ttyS2 ttyS3 ttyS4 ;;
297 ttyI) echo ttyI0 ttyI1 ttyI2 ttyI3 ;;
298 ircomm|irlpt) irda ;;
299 ppp) echo ppp ;;
300 usb) echo usb ;;
301 dpt_i2o) echo dpti ;;
302 bluetooth) echo bluetooth ;;
303 lvm) ;; # taken care of by LVM userspace tools
304 ramdisk) echo ram ;;
305 *) echo "$0: don't know what \"$1\" is" >&2 ;;
306 esac
307 shift
308 done
309 }
310
311 get_arch() {
312 case `uname -m` in
313 arm*) echo arm;;
314 i?86) echo i386;;
315 ppc*) echo powerpc;;
316 s390*) echo s390;;
317 sh*) echo sh;;
318 x86_64) echo i386;;
319 # alpha|hppa|ia64|m68k|mips|sparc
320 *) echo $a;;
321 esac
322 }
323
324 for arg in $*
325 do
326 # case `cvt $arg` in
327 case $arg in
328 generic)
329 $0 $opts generic-`get_arch`
330 ;;
331 generic-alpha)
332 $0 $opts std
333 $0 $opts fd
334 $0 $opts fd0 fd1
335 $0 $opts hda hdb hdc hdd
336 $0 $opts xda xdb
337 $0 $opts sda sdb sdc sdd
338 $0 $opts scd0 scd1
339 $0 $opts st0 st1
340 $0 $opts sg
341 $0 $opts pty
342 $0 $opts console
343 $0 $opts ttyS0 ttyS1 ttyS2 ttyS3 ttyS4
344 $0 $opts busmice
345 $0 $opts lp
346 $0 $opts par
347 $0 $opts audio
348 $0 $opts fb
349 $0 $opts dac960
350 ;;
351 generic-arm)
352 $0 $opts std
353 $0 $opts fd
354 $0 $opts fd0 fd1
355 $0 $opts hda hdb hdc hdd
356 $0 $opts xda xdb
357 $0 $opts sda sdb sdc sdd
358 $0 $opts scd0 scd1
359 $0 $opts st0 st1
360 $0 $opts sg
361 $0 $opts pty
362 $0 $opts console
363 $0 $opts ttyS0 ttyS1 ttyS2 ttyS3 ttyS4
364 $0 $opts busmice
365 makedev sunmouse c 10 6 $mouse
366 $0 $opts lp
367 $0 $opts par
368 $0 $opts audio
369 $0 $opts fb
370 ;;
371 generic-hppa)
372 $0 $opts std
373 $0 $opts fd
374 $0 $opts fd0 fd1
375 $0 $opts hda hdb hdc hdd
376 $0 $opts sda sdb sdc sdd
377 $0 $opts scd0 scd1
378 $0 $opts st0 st1
379 $0 $opts sg
380 $0 $opts pty
381 $0 $opts console
382 $0 $opts ttyS0 ttyS1 ttyS2 ttyS3 ttyS4
383 $0 $opts ttyB0 ttyB1 ttyB2 ttyB3 ttyB4 ttyB5 ttyB6 ttyB7
384 $0 $opts busmice
385 $0 $opts lp
386 $0 $opts par
387 $0 $opts audio
388 $0 $opts fb
389 $0 $opts rtc
390 ;;
391 generic-i386)
392 $0 $opts std
393 $0 $opts fd
394 $0 $opts fd0 fd1
395 $0 $opts hda hdb hdc hdd
396 $0 $opts xda xdb
397 $0 $opts sda sdb sdc sdd
398 $0 $opts scd0 scd1
399 $0 $opts st0 st1
400 $0 $opts sg
401 $0 $opts pty
402 $0 $opts console
403 $0 $opts ttyS0 ttyS1 ttyS2 ttyS3 ttyS4
404 $0 $opts busmice
405 $0 $opts input
406 $0 $opts lp
407 $0 $opts par
408 $0 $opts audio
409 $0 $opts fb
410 $0 $opts isdn-io eda edb sonycd mcd mcdx cdu535
411 $0 $opts optcd sjcd cm206cd gscd
412 $0 $opts lmscd sbpcd aztcd bpcd dac960 dpti ida ataraid cciss
413 $0 $opts i2o.hda i2o.hdb i2o.hdc i2o.hdd
414 ;;
415 generic-ia64)
416 $0 $opts std
417 $0 $opts fd
418 $0 $opts fd0 fd1
419 $0 $opts hda hdb hdc hdd
420 $0 $opts sda sdb sdc sdd
421 $0 $opts scd0 scd1
422 $0 $opts st0 st1
423 $0 $opts sg
424 $0 $opts pty
425 $0 $opts console
426 $0 $opts ttyS0 ttyS1 ttyS2 ttyS3 ttyS4 ttyS5
427 $0 $opts busmice
428 $0 $opts input
429 $0 $opts lp
430 $0 $opts par
431 $0 $opts audio
432 $0 $opts fb
433 $0 $opts efirtc
434 ;;
435 generic-m68k)
436 $0 $opts std
437 $0 $opts fd
438 $0 $opts fd0 fd1
439 $0 $opts hda hdb hdc hdd
440 $0 $opts sda sdb sdc sdd
441 $0 $opts scd0 scd1
442 $0 $opts sg
443 $0 $opts ada adb adc add ade adf
444 $0 $opts pty
445 $0 $opts console
446 $0 $opts ttyS0 ttyS1 ttyS2 ttyS3 ttyS4 ttyS5
447 $0 $opts m68k-mice
448 $0 $opts lp
449 $0 $opts par
450 $0 $opts nvram
451 $0 $opts audio
452 $0 $opts fb
453 ;;
454 generic-mips)
455 $0 $opts std
456 $0 $opts fd
457 $0 $opts fd0 fd1
458 $0 $opts hda hdb
459 $0 $opts sda sdb sdc sdd
460 $0 $opts scd0 scd1
461 $0 $opts st0 st1
462 $0 $opts sg
463 $0 $opts pty
464 $0 $opts console
465 $0 $opts ttyS0 ttyS1 ttyS2 ttyS3 ttyS4
466 $0 $opts lp
467 $0 $opts par
468 $0 $opts audio
469 $0 $opts fb
470 $0 $opts busmice
471 ;;
472 generic-mipsel)
473 $0 $opts std
474 $0 $opts fd
475 $0 $opts fd0 fd1
476 $0 $opts hda hdb
477 $0 $opts sda sdb sdc sdd
478 $0 $opts scd0 scd1
479 $0 $opts st0 st1
480 $0 $opts sg
481 $0 $opts pty
482 $0 $opts console
483 $0 $opts ttyS0 ttyS1 ttyS2 ttyS3 ttyS4
484 $0 $opts lp
485 $0 $opts par
486 $0 $opts audio
487 $0 $opts fb
488 $0 $opts rtc
489 ;;
490 generic-powerpc)
491 $0 $opts std
492 $0 $opts fd
493 $0 $opts fd0 fd1
494 $0 $opts hda hdb hdc hdd
495 $0 $opts sda sdb sdc sdd
496 $0 $opts scd0 scd1
497 $0 $opts st0 st1
498 $0 $opts sg
499 $0 $opts pty
500 $0 $opts console
501 $0 $opts ttyS0 ttyS1 ttyS2 ttyS3 ttyS4
502 $0 $opts busmice
503 $0 $opts m68k-mice
504 $0 $opts input
505 $0 $opts lp
506 $0 $opts par
507 $0 $opts nvram
508 $0 $opts audio
509 $0 $opts adb
510 $0 $opts fb
511 $0 $opts rtc
512 $0 $opts isdn-io
513 ;;
514 generic-s390)
515 $0 $opts std
516 $0 $opts fd
517 $0 $opts dasda dasdb dasdc dasdd dasde dasdf dasdg dasdh \
518 dasdi dasdj dasdk dasdl dasdm dasdn dasdo dasdp \
519 dasdq dasdr dasds dasdt dasdu dasdv dasdw dasdx \
520 dasdy dasdz
521 $0 $opts pty
522 $0 $opts consoleonly
523 $0 $opts rtc
524 ;;
525 generic-sh)
526 $0 $opts std
527 $0 $opts fd
528 $0 $opts fd0 fd1
529 $0 $opts hda hdb
530 $0 $opts sda sdb sdc sdd
531 $0 $opts scd0 scd1
532 $0 $opts st0 st1
533 $0 $opts sg
534 $0 $opts pty
535 $0 $opts console
536 $0 $opts ttyS0 ttyS1 ttyS2 ttyS3 ttyS4
537 $0 $opts ttySC0 ttySC1 ttySC2 ttySC3
538 $0 $opts lp
539 $0 $opts par
540 $0 $opts audio
541 $0 $opts fb
542 $0 $opts rtc
543 ;;
544 generic-sparc)
545 $0 $opts std
546 $0 $opts fd
547 $0 $opts fd0 fd1
548 $0 $opts hda hdb hdc hdd
549 $0 $opts sda sdb sdc sdd
550 $0 $opts scd0 scd1
551 $0 $opts st0 st1
552 $0 $opts sg
553 $0 $opts pty
554 $0 $opts console
555 $0 $opts ttyS0 ttyS1 ttyS2 ttyS3 ttyS4
556 $0 $opts busmice
557 $0 $opts fb
558 $0 $opts rtc
559 makedev kbd c 11 0 $cons
560 makedev sunmouse c 10 6 $mouse
561 symlink mouse sunmouse
562 makedev openprom c 10 139 root root 0664
563 ;;
564 generic-*)
565 echo "$0: no support for generic on this arch" >&2
566 exit 1
567 ;;
568 local)
569 $0.local $opts
570 ;;
571 std)
572 makedev mem c 1 1 $kmem
573 makedev kmem c 1 2 $kmem
574 makedev null c 1 3 $public
575 makedev port c 1 4 $kmem
576 makedev zero c 1 5 $public
577 symlink core $procfs/kcore
578 makedev full c 1 7 $public
579 makedev random c 1 8 $public
580 makedev urandom c 1 9 $readable
581 makedev tty c 5 0 $tty
582 $0 $opts ram
583 $0 $opts loop
584 ;;
585 hamradio)
586 $0 $opts scc
587 $0 $opts bc
588 ;;
589 scc)
590 for unit in 0 1 2 3 4 5 6 7
591 do
592 makedev scc$unit c 34 $unit $system
593 done
594 ;;
595 bc)
596 for unit in 0 1 2 3
597 do
598 makedev bc$unit c 51 $unit $system
599 done
600 ;;
601 random)
602 makedev random c 1 8 $public
603 ;;
604 urandom)
605 makedev urandom c 1 9 $readable
606 ;;
607 ram)
608 for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ; do
609 makedev ram$i b 1 $i $disk
610 done
611 symlink ram ram1
612 ;;
613 ram[0-9]|ram1[0-6])
614 unit=`suffix $arg ram`
615 makedev ram$unit b 1 $unit $disk
616 ;;
617 initrd)
618 makedev initrd b 1 250 $disk
619 ;;
620 raw)
621 makedev rawctl c 162 0 $disk
622 mkdir -p raw
623 for i in 1 2 3 4 5 6 7 8; do
624 makedev raw/raw$i c 162 $i $disk
625 done
626 ;;
627 consoleonly)
628 makedev tty0 c 4 0 $cons
629 # new kernels need a device, old ones a symlink... sigh
630 kern_rev1=`uname -r | sed -e 's@^\([^.]*\)\..*@\1@'`
631 kern_rev2=`uname -r | sed -e 's@^[^.]*\.\([^.]*\)\..*@\1@'`
632 if [ $kern_rev1 -gt 2 ]
633 then
634 makedev console c 5 1 $cons
635 else
636 if [ $kern_rev1 -eq 2 ] && [ $kern_rev2 -ge 1 ]
637 then
638 makedev console c 5 1 $cons
639 else
640 symlink console tty0
641 fi
642 fi
643 ;;
644 console)
645 $0 $opts consoleonly
646 major=`Major vcs 7` # not fatal
647 [ "$major" ] && makedev vcs0 c $major 0 $cons
648 symlink vcs vcs0
649 [ "$major" ] && makedev vcsa0 c $major 128 $cons
650 symlink vcsa vcsa0
651 # individual vts
652 line=1
653 while [ $line -le $MAXVT ] && [ $line -le 63 ]
654 do
655 makedev tty$line c 4 $line $cons
656 [ "$major" ] && makedev vcs$line c $major $line $cons
657 [ "$major" ] && makedev vcsa$line c $major `math $line + 128` $cons
658 line=`math $line + 1`
659 done
660 ;;
661 adb)
662 case `get_arch` in
663 powerpc)
664 # ADB bus devices (char)
665 makedev adb c 56 0 $mouse
666 makedev adbmouse c 10 10 $mouse
667 ;;
668 m68k)
669 # ACSI disk 2, whole device (block)
670 makedev adb b 28 16 $disk
671 for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
672 do
673 minor=$(( 16 + $part ))
674 makedev adb$part b 28 $minor $disk
675 done
676 ;;
677 *)
678 echo "no support for adb on this arch" >&2
679 exit 1
680 ;;
681 esac
682 ;;
683 raw1394)
684 makedev raw1394 c 171 0 $disk
685 ;;
686 video1394)
687 rm -f video1394
688 mkdir -p video1394
689 for i in `seq 0 15`
690 do
691 makedev video1394/$i c 171 `math 16 + $i` $video
692 done
693 ;;
694 nvram)
695 makedev nvram c 10 144 $mouse
696 ;;
697 tty[1-9]|tty[1-5][0-9]|tty[6][0-3])
698 line=`suffix $arg tty`
699 makedev tty$line c 4 $line $cons
700 ;;
701 ttyS[0-9]|ttyS[1-5][0-9]|ttyS[6][0-3])
702 line=`suffix $arg ttyS`
703 minor=`math 64 + $line`
704 makedev ttyS$line c 4 $minor $dialout
705 ;;
706 ttySC[0-3])
707 line=`suffix $arg ttySC`
708 minor=`math 8 + $line`
709 makedev ttySC$line c 204 $minor $dialout
710 ;;
711 ttyB[0-7])
712 minor=`suffix $arg ttyB`
713 makedev ttyB$minor c 11 $minor $dialout
714 ;;
715 pty[a-ep-z])
716 bank=`suffix $arg pty`
717 base=`index pqrstuvwxyzabcde $bank`
718 base=`math $base \* 16`
719 for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f
720 do
721 j=`index 0123456789abcdef $i`
722 makedev pty$bank$i c 2 `math $base + $j` $tty
723 makedev tty$bank$i c 3 `math $base + $j` $tty
724 done
725 ;;
726 pty)
727 ptysufs=""
728 for i in p q r s t u v w x y z a b c d e
729 do
730 ptysufs="$ptysufs pty$i"
731 done
732 $0 $opts $ptysufs ptmx
733 ;;
734 ptmx)
735 # master pty multiplexer for 2.1 kernels
736 makedev ptmx c 5 2 $tty
737 ;;
738 cyclades|ttyC)
739 major1=`Major ttyC 19` || continue
740 #major2=`Major cub 20` || continue
741 for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 \
742 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
743 do
744 makedev ttyC$i c $major1 $i $dialout
745 #makedev cub$i c $major2 $i $dialout
746 done
747 ;;
748 stallion|ttyE)
749 major1=`Major ttyE 24` || continue
750 #major2=`Major cue 25` || continue
751 majorc=28
752 minor=0
753 until [ $minor -gt 256 ]
754 do
755 makedev ttyE$minor c $major1 $minor $dialout
756 #makedev cue$minor c $major2 $minor $dialout
757 minor=`math $minor + 1`
758 done
759 for i in 0 1 2 3
760 do
761 makedev staliomem$i c $majorc $i $private
762 done
763 ;;
764 chase|ttyH)
765 major1=`Major ttyH 17` || continue
766 #major2=`Major cuh 18` || continue
767 minor=0
768 until [ $minor -gt 16 ] # tell me if 16 is wrong
769 do
770 makedev ttyH$minor c $major1 $minor $dialout
771 #makedev cuh$minor c $major2 $minor $dialout
772 minor=`math $minor + 1`
773 done
774 ;;
775 rocketport|ttyR)
776 major1=`Major ttyR 46` || continue
777 #major2=`Major cur 47` || continue
778 minor=0
779 until [ $minor -gt 64 ] # tell me if 64 is wrong
780 do
781 makedev ttyR$minor c $major1 $minor $dialout
782 #makedev cur$minor c $major2 $minor $dialout
783 minor=`math $minor + 1`
784 done
785 ;;
786 ttyV)
787 major1=`Major ttyV 105` || continue
788 #major2=`Major cuv 106` || continue
789 minor=0
790 until [ $minor -gt 16 ] # tell me if 16 is wrong
791 do
792 makedev ttyV$minor c $major1 $minor $dialout
793 #makedev cuv$minor c $major2 $minor $dialout
794 minor=`math $minor + 1`
795 done
796 ;;
797 digi|ttyD)
798 major1=`Major ttyD 22` || continue
799 #major2=`Major cud 23` || continue
800 minor=0
801 until [ $minor -gt 16 ] # tell me if 16 is wrong
802 do
803 makedev ttyD$minor c $major1 $minor $dialout
804 #makedev cud$minor c $major2 $minor $dialout
805 minor=`math $minor + 1`
806 done
807 ;;
808 specialix|ttyX)
809 major1=`Major ttyX 32` || continue
810 #major2=`Major cux 33` || continue
811 minor=0
812 until [ $minor -gt 16 ] # tell me if 16 is wrong
813 do
814 makedev ttyX$minor c $major1 $minor $dialout
815 #makedev cux$minor c $major2 $minor $dialout
816 minor=`math $minor + 1`
817 done
818 ;;
819 specialixIO8|ttyW)
820 major1=`Major ttyW 75` || continue
821 #major2=`Major cuw 76` || continue
822 minor=0
823 until [ $minor -gt 16 ] # tell me if 16 is wrong
824 do
825 makedev ttyW$minor c $major1 $minor $dialout
826 #makedev cuw$minor c $major2 $minor $dialout
827 minor=`math $minor + 1`
828 done
829 ;;
830 PAM|ttyM)
831 major1=`Major ttyM 79` || continue
832 #major2=`Major cum 80` || continue
833 minor=0
834 until [ $minor -gt 16 ] # tell me if 16 is wrong
835 do
836 makedev ttyM$minor c $major1 $minor $dialout
837 #makedev cum$minor c $major2 $minor $dialout
838 minor=`math $minor + 1`
839 done
840 ;;
841 riscom|ttyL)
842 major=`Major ttyL 48` || continue
843 minor=0
844 until [ $minor -gt 16 ] # tell me if 16 is wrong
845 do
846 makedev ttyL$minor c $major $minor $dialout
847 minor=`math $minor + 1`
848 done
849 ;;
850 computone|ttyF)
851 major=`Major ttyF 71` || continue
852 #major2=`Major cuf 72` || continue
853 minor=0
854 until [ $minor -gt 255 ]
855 do
856 makedev ttyF$minor c $major $minor $dialout
857 #makedev cuf$minor c $major2 $minor $dialout
858 minor=`math $minor + 1`
859 done
860 major=73
861 for i in 0 4 8 12
862 do
863 makedev ip2ipl$i c $major $i $private
864 makedev ip2stat$i c $major `math $i + 1` $private
865 done
866 ;;
867 ESP|ttyP)
868 major=`Major ttyP 57` || continue
869 #major2=`Major cup 58` || continue
870 minor=0
871 until [ $minor -gt 4 ] # tell me if 4 is wrong
872 do
873 makedev ttyP$minor c $major $minor $dialout
874 #makedev cup$minor c $major2 $minor $dialout
875 minor=`math $minor + 1`
876 done
877 ;;
878 COMX|comx)
879 major=`Major comx 88` || continue
880 minor=0
881 until [ $minor -gt 4 ] # tell me if 4 is wrong
882 do
883 makedev comx$minor c $major $minor $private
884 minor=`math $minor + 1`
885 done
886 ;;
887 isdnmodem|ttyI)
888 major1=`Major ttyI 43` || continue
889 #major2=`Major cui 44` || continue
890 minor=0
891 until [ $minor -gt 63 ]
892 do
893 makedev ttyI$minor c $major1 $minor $dialout
894 #makedev cui$minor c $major2 $minor $dialout
895 minor=`math $minor + 1`
896 done
897 ;;
898 isdnbri)
899 major=45
900 minor=0
901 until [ $minor -gt 63 ]
902 do
903 makedev isdn$minor c $major $minor $dialout
904 makedev isdnctrl$minor c $major `math $minor + 64` $dialout
905 makedev ippp$minor c $major `math $minor + 128` $dialout
906 minor=`math $minor + 1`
907 done
908 makedev isdninfo c $major 255 $private
909 ;;
910 dcbri)
911 major=52
912 for i in 0 1 2 3
913 do
914 makedev dcbri$i c $major $i $dialout
915 done
916 ;;
917 capi)
918 major=68
919 makedev capi20 c $major 0 $dialout
920 for i in 0 1 2 3 4 5 6 7 8 9
921 do
922 makedev capi20.0$i c $major `math $i + 1` $dialout
923 done
924 for i in 10 11 12 13 14 15 16 17 18 19
925 do
926 makedev capi20.$i c $major `math $i + 1` $dialout
927 done
928 ;;
929 ubd)
930 major=98
931 for devicenum in 0 1 2 3 4 5 6 7
932 do
933 device=ubd`substr abcdefgh $(($devicenum + 1))`
934 baseminor=`math $devicenum \* 16`
935 makedev $device b $major $baseminor $disk
936 for partition in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
937 do
938 minor=`math $baseminor + $partition`
939 makedev $device$partition b $major $minor $disk
940 done
941 done
942 ;;
943 fb)
944 for i in 0 1 2 3 4 5 6 7
945 do
946 makedev fb$i c 29 $i $video
947 done
948 ;;
949 fb[0-7])
950 dev=`suffix $arg fb`
951 makedev fb$dev c 29 $dev $video
952 ;;
953 netlink|tap|tap[0-9]|tap1[0-5])
954 makedev route c 36 0 $coda
955 makedev skip c 36 1 $coda
956 makedev fwmonitor c 36 3 $coda
957 for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
958 do
959 makedev tap$i c 36 `math $i + 16` $coda
960 done
961 ;;
962 tun)
963 mkdir -p net
964 makedev net/tun c 10 200 $system
965 ;;
966 lp)
967 major=`Major lp 6` || continue
968 makedev ${arg}0 c $major 0 $printer
969 makedev ${arg}1 c $major 1 $printer
970 makedev ${arg}2 c $major 2 $printer
971 ;;
972 par)
973 major=`Major lp 6` || continue
974 makedev ${arg}0 c $major 0 $printer
975 makedev ${arg}1 c $major 1 $printer
976 makedev ${arg}2 c $major 2 $printer
977 ;;
978 parport)
979 major=`Major parport 99` || continue
980 makedev ${arg}0 c $major 0 $printer
981 makedev ${arg}1 c $major 1 $printer
982 makedev ${arg}2 c $major 2 $printer
983 ;;
984 slm)
985 major=`Major slm 28` || continue
986 for i in 0 1 2 3
987 do
988 makedev slm c $major $i $printer
989 done
990 ;;
991 input)
992 major=`Major pcsp 13` || continue
993 mkdir -p input
994 for i in 0 1 2 3
995 do
996 makedev input/js$i c $major $i $mouse
997 makedev input/mouse$i c $major `math $i + 32` $mouse
998 makedev input/event$i c $major `math $i + 64` $mouse
999 done
1000 makedev input/mice c $major 63 $mouse
1001 ;;
1002 busmice)
1003 major=`Major mouse 10` || continue
1004 makedev logibm c $major 0 $mouse
1005 makedev psaux c $major 1 $mouse
1006 makedev inportbm c $major 2 $mouse
1007 makedev atibm c $major 3 $mouse
1008 makedev jbm c $major 4 $mouse
1009 ;;
1010 m68k-mice)
1011 major=`Major mouse 10` || continue
1012 makedev amigamouse c $major 4 $mouse
1013 makedev atarimouse c $major 5 $mouse
1014 makedev amigamouse1 c $major 7 $mouse
1015 makedev adbmouse c $major 10 $mouse
1016 ;;
1017 3dfx)
1018 major=`Major $arg 107` || continue
1019 makedev $arg c $major 0 $video
1020 ;;
1021 agpgart)
1022 major=`Major $arg 10` || continue
1023 makedev $arg c $major 175 $video
1024 ;;
1025 hwrng)
1026 major=`Major $arg 10` || continue
1027 makedev $arg c $major 183 $private
1028 ;;
1029 cpu|microcode)
1030 mkdir -p cpu
1031 makedev cpu/microcode c 10 184 $private
1032 for i in 0 1 2 3
1033 do
1034 mkdir -p cpu/$i
1035 makedev cpu/$i/msr c 202 $i $private
1036 makedev cpu/$i/cpuid c 203 $i $private
1037 done
1038 ;;
1039 ipmi|ipmikcs)
1040 major=`Major ipmikcs 10` || continue
1041 makedev ipmikcs c $major 173 $private
1042 ;;
1043 irda)
1044 for i in 0 1
1045 do
1046 makedev ircomm$i c 161 $i $dialout
1047 makedev irlpt$i c 161 `math $i + 16` $printer
1048 done
1049 ;;
1050 irnet)
1051 makedev irnet c 10 187 $system
1052 ;;
1053 misc)
1054 major=`Major mouse 10` || continue
1055 makedev logibm c $major 0 $mouse
1056 makedev psaux c $major 1 $mouse
1057 makedev inportbm c $major 2 $mouse
1058 makedev atibm c $major 3 $mouse
1059 makedev jbm c $major 4 $mouse
1060 makedev amigamouse c $major 4 $mouse
1061 makedev atarimouse c $major 5 $mouse
1062 makedev sunmouse c $major 6 $mouse
1063 makedev amigamouse1 c $major 7 $mouse
1064 makedev smouse c $major 8 $mouse
1065 makedev pc110pad c $major 9 $mouse
1066 makedev adbmouse c $major 10 $mouse
1067 makedev beep c $major 128 $mouse
1068 makedev modreq c $major 129 $mouse
1069 makedev watchdog c $major 130 $mouse
1070 makedev temperature c $major 131 $mouse
1071 makedev hwtrap c $major 132 $mouse
1072 makedev exttrp c $major 133 $mouse
1073 makedev apm_bios c $major 134 $mouse
1074 makedev rtc c $major 135 $mouse
1075 makedev openprom c $major 139 root root 0664
1076 makedev relay8 c $major 140 $mouse
1077 makedev relay16 c $major 141 $mouse
1078 makedev msr c $major 142 $mouse
1079 makedev pciconf c $major 143 $mouse
1080 makedev nvram c $major 144 $mouse
1081 makedev hfmodem c $major 145 $mouse
1082 makedev led c $major 151 $mouse
1083 makedev mergemem c $major 153 $mouse
1084 makedev pmu c $major 154 $mouse
1085 ;;
1086 pmu)
1087 major=`Major mouse 10` || continue
1088 makedev pmu c $major 154 $mouse
1089 ;;
1090 thinkpad)
1091 major=`Major mouse 10` || continue
1092 mkdir -p thinkpad
1093 makedev thinkpad/thinkpad c $major 170 $mouse
1094 ;;
1095 rtc)
1096 major=`Major mouse 10` || continue
1097 makedev rtc c $major 135 $mouse
1098 ;;
1099 efirtc)
1100 major=`Major mouse 10` || continue
1101 makedev efirtc c $major 136 $mouse
1102 ;;
1103 mwave)
1104 makedev mwave c 10 219 $mouse
1105 ;;
1106 systrace)
1107 makedev systrace c 10 226 $private
1108 ;;
1109 uinput)
1110 makedev input/uinput c 10 223 $mouse
1111 ;;
1112 js)
1113 major=`Major Joystick 13` || continue
1114 for unit in 0 1 2 3
1115 do
1116 makedev js$unit c $major $unit $readable
1117 makedev djs$unit c $major `math $unit + 128` $readable
1118 done
1119 ;;
1120 fd[0-7])
1121 major=`Major fd 2` || continue
1122 base=`suffix $arg fd`
1123 if [ $base -ge 4 ]
1124 then
1125 base=`math $base + 124`
1126 fi
1127 makedev ${arg} b $major $base $floppy
1128 makedev ${arg}d360 b $major `math $base + 4` $floppy
1129 makedev ${arg}h1200 b $major `math $base + 8` $floppy
1130 makedev ${arg}u360 b $major `math $base + 12` $floppy
1131 makedev ${arg}u720 b $major `math $base + 16` $floppy
1132 makedev ${arg}h360 b $major `math $base + 20` $floppy
1133 makedev ${arg}h720 b $major `math $base + 24` $floppy
1134 makedev ${arg}u1440 b $major `math $base + 28` $floppy
1135 makedev ${arg}u2880 b $major `math $base + 32` $floppy
1136 makedev ${arg}CompaQ b $major `math $base + 36` $floppy
1137
1138 makedev ${arg}h1440 b $major `math $base + 40` $floppy
1139 makedev ${arg}u1680 b $major `math $base + 44` $floppy
1140 makedev ${arg}h410 b $major `math $base + 48` $floppy
1141 makedev ${arg}u820 b $major `math $base + 52` $floppy
1142 makedev ${arg}h1476 b $major `math $base + 56` $floppy
1143 makedev ${arg}u1722 b $major `math $base + 60` $floppy
1144 makedev ${arg}h420 b $major `math $base + 64` $floppy
1145 makedev ${arg}u830 b $major `math $base + 68` $floppy
1146 makedev ${arg}h1494 b $major `math $base + 72` $floppy
1147 makedev ${arg}u1743 b $major `math $base + 76` $floppy
1148 makedev ${arg}h880 b $major `math $base + 80` $floppy
1149 makedev ${arg}u1040 b $major `math $base + 84` $floppy
1150 makedev ${arg}u1120 b $major `math $base + 88` $floppy
1151 makedev ${arg}h1600 b $major `math $base + 92` $floppy
1152 makedev ${arg}u1760 b $major `math $base + 96` $floppy
1153 makedev ${arg}u1920 b $major `math $base + 100` $floppy
1154 makedev ${arg}u3200 b $major `math $base + 104` $floppy
1155 makedev ${arg}u3520 b $major `math $base + 108` $floppy
1156 makedev ${arg}u3840 b $major `math $base + 112` $floppy
1157 makedev ${arg}u1840 b $major `math $base + 116` $floppy
1158 makedev ${arg}u800 b $major `math $base + 120` $floppy
1159 makedev ${arg}u1600 b $major `math $base + 124` $floppy
1160 ;;
1161 ed[a-b])
1162 major=`Major ed 36` || continue
1163 unit=`suffix $arg ed`
1164 base=`index ab $unit`
1165 base=`math $base \* 64`
1166 makedev ed$unit b $major $base $disk
1167 for part in 1 2 3 4 5 6 7 8 # 9 10 11 12 13 14 15 16 17 18 19 20
1168 do
1169 makedev ed$unit$part b $major `math $base + $part` $disk
1170 done
1171 ;;
1172 hd[a-b])
1173 major=`Major ide0` || major=`Major hd 3` || continue
1174 unit=`suffix $arg hd`
1175 base=`index ab $unit`
1176 base=`math $base \* 64`
1177 makedev hd$unit b $major $base $disk
1178 for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
1179 do
1180 makedev hd$unit$part b $major `math $base + $part` $disk
1181 done
1182 ;;
1183 hd[c-d])
1184 major=`Major ide1 22` || continue
1185 unit=`suffix $arg hd`
1186 base=`index cd $unit`
1187 base=`math $base \* 64`
1188 makedev hd$unit b $major $base $disk
1189 for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
1190 do
1191 makedev hd$unit$part b $major $(( $base + $part )) $disk
1192 done
1193 ;;
1194 hd[e-f])
1195 major=`Major ide2 33` || continue
1196 unit=`suffix $arg hd`
1197 base=`index ef $unit`
1198 base=`math $base \* 64`
1199 makedev hd$unit b $major $base $disk
1200 for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
1201 do
1202 makedev hd$unit$part b $major $(( $base + $part )) $disk
1203 done
1204 ;;
1205 hd[g-h])
1206 major=`Major ide3 34` || continue
1207 unit=`suffix $arg hd`
1208 base=`index gh $unit`
1209 base=`math $base \* 64`
1210 makedev hd$unit b $major $base $disk
1211 for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
1212 do
1213 makedev hd$unit$part b $major $(( $base + $part )) $disk
1214 done
1215 ;;
1216 hd[i-j])
1217 major=`Major ide4 56` || continue
1218 unit=`suffix $arg hd`
1219 base=`index ij $unit`
1220 base=`math $base \* 64`
1221 makedev hd$unit b $major $base $disk
1222 for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
1223 do
1224 makedev hd$unit$part b $major $(( $base + $part )) $disk
1225 done
1226 ;;
1227 hd[k-l])
1228 major=`Major ide5 57` || continue
1229 unit=`suffix $arg hd`
1230 base=`index kl $unit`
1231 base=`math $base \* 64`
1232 makedev hd$unit b $major $base $disk
1233 for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
1234 do
1235 makedev hd$unit$part b $major $(( $base + $part )) $disk
1236 done
1237 ;;
1238 hd[m-n])
1239 major=`Major ide6 88` || continue
1240 unit=`suffix $arg hd`
1241 base=`index mn $unit`
1242 base=`math $base \* 64`
1243 makedev hd$unit b $major $base $disk
1244 for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
1245 do
1246 makedev hd$unit$part b $major $(( $base + $part )) $disk
1247 done
1248 ;;
1249 hd[o-p])
1250 major=`Major ide7 89` || continue
1251 unit=`suffix $arg hd`
1252 base=`index op $unit`
1253 base=`math $base \* 64`
1254 makedev hd$unit b $major $base $disk
1255 for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
1256 do
1257 makedev hd$unit$part b $major $(( $base + $part )) $disk
1258 done
1259 ;;
1260 hd[q-r])
1261 major=`Major ide8 90` || continue
1262 unit=`suffix $arg hd`
1263 base=`index qr $unit`
1264 base=`math $base \* 64`
1265 makedev hd$unit b $major $base $disk
1266 for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
1267 do
1268 makedev hd$unit$part b $major $(( $base + $part )) $disk
1269 done
1270 ;;
1271 hd[s-t])
1272 major=`Major ide9 91` || continue
1273 unit=`suffix $arg hd`
1274 base=`index st $unit`
1275 base=`math $base \* 64`
1276 makedev hd$unit b $major $base $disk
1277 for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
1278 do
1279 makedev hd$unit$part b $major $(( $base + $part )) $disk
1280 done
1281 ;;
1282 ub|uba)
1283 major=180
1284 makedev uba b $major 0 $disk
1285 for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1286 do
1287 makedev uba$part b $major $part $disk
1288 done
1289 ;;
1290 ht0)
1291 major=`Major ht0 37` || continue
1292 # Only one IDE tape drive is currently supported; ht0.
1293 makedev ht0 c $major 0 $tape
1294 makedev nht0 c $major 128 $tape
1295 ;;
1296 pt)
1297 major=`Major pt 96` || continue
1298 for i in 0 1 2 3
1299 do
1300 makedev pt$i c $major $i $tape
1301 makedev npt$i c $major `math $i + 128` $tape
1302 done
1303 ;;
1304 xd[a-d])
1305 major=`Major xd 13` || continue
1306 unit=`suffix $arg xd`
1307 base=`index abcd $unit`
1308 base=`math $base \* 64`
1309 makedev xd$unit b $major $base $disk
1310 for part in 1 2 3 4 5 6 7 8 # 9 10 11 12 13 14 15 16 17 18 19 20
1311 do
1312 makedev xd$unit$part b $major $(( $base + $part )) $disk
1313 done
1314 ;;
1315 sd[a-z])
1316 major=`Major sd 8` || continue
1317 unit=`suffix $arg sd`
1318 base=`index abcdefghijklmnopqrstuvwxyz $unit`
1319 base=$(( $base * 16 ))
1320 if [ $base -lt 256 ]; then
1321 major=8
1322 else
1323 major=65
1324 base=$(( $base - 256 ))
1325 fi
1326 makedev sd$unit b $major $base $disk
1327 for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1328 do
1329 minor=$(( $base + $part ))
1330 makedev sd$unit$part b $major $minor $disk
1331 done
1332 ;;
1333 sd[a-d][a-z])
1334 unit=`suffix $arg sd`
1335 unitmaj=`first $unit`
1336 unitmin=`second $unit`
1337 basemaj=`index Xabcd $unitmaj`
1338 basemin=`index abcdefghijklmnopqrstuvwxyz $unitmin`
1339 basemaj=`math $basemaj \* 416`
1340 basemin=`math $basemin \* 16`
1341 base=`math $basemaj + $basemin`
1342 basemaj=`math $base / 256`
1343 base=`math $base % 256`
1344 major=`math basemaj \+ 64`
1345 if [ $major -gt 71 ]; then
1346 echo "$0: don't know how to make device \"$arg\"" >&2
1347 exit 0
1348 fi
1349 makedev sd$unit b $major $base $disk
1350 for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1351 do
1352 minor=$(( $base + $part ))
1353 makedev sd$unit$part b $major $minor $disk
1354 done
1355 ;;
1356 i2o.hd[a-z])
1357 [ -d i2o ] || {
1358 mkdir i2o
1359 chown root:root i2o
1360 chmod 755 i2o
1361 [ -e i2o/ctl ] || makedev i2o/ctl c 10 166 $disk
1362 }
1363 unit=`suffix $arg i2o.hd`
1364 base=`index abcdefghijklmnopqrstuvwxyz $unit`
1365 base=$(( $base * 16 ))
1366 if [ $base -lt 256 ]; then
1367 major=80
1368 else
1369 major=81
1370 base=$(( $base - 256 ))
1371 fi
1372 makedev i2o/hd$unit b $major $base $disk
1373 for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1374 do
1375 minor=$(( $base + $part ))
1376 makedev i2o/hd$unit$part b $major $minor $disk
1377 done
1378 ;;
1379 i2o.hd[a-d][a-z])
1380 [ -d i2o ] || {
1381 mkdir i2o
1382 chown root:root i2o
1383 chmod 755 i2o
1384 [ -e i2o/ctl ] || makedev i2o/ctl c 10 166 $disk
1385 }
1386 unit=`suffix $arg i2o.hd`
1387 unitmaj=`first $unit`
1388 unitmin=`second $unit`
1389 basemaj=`index Xabcd $unitmaj`
1390 basemin=`index abcdefghijklmnopqrstuvwxyz $unitmin`
1391 basemaj=`math $basemaj \* 416`
1392 basemin=`math $basemin \* 16`
1393 base=`math $basemaj + $basemin`
1394 basemaj=`math $base / 256`
1395 base=`math $base % 256`
1396 major=`math basemaj \+ 80`
1397 if [ $major -gt 87 ]; then
1398 echo "$0: don't know how to make device \"$arg\"" >&2
1399 exit 0
1400 fi
1401 makedev i2o/hd$unit b $major $base $disk
1402 for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1403 do
1404 minor=$(( $base + $part ))
1405 makedev i2o/hd$unit$part b $major $minor $disk
1406 done
1407 ;;
1408 dasd[a-z])
1409 major=`Major dasd 94` || continue
1410 unit=`suffix $arg dasd`
1411 base=`index abcdefghijklmnopqrstuvwxyz $unit`
1412 base=$(( $base * 4 ))
1413 if [ $base -lt 256 ]; then
1414 major=94
1415 else
1416 major=65
1417 base=$(( $base - 256 ))
1418 fi
1419 makedev dasd$unit b $major $base $disk
1420 for part in 1 2 3
1421 do
1422 minor=$(( $base + $part ))
1423 makedev dasd$unit$part b $major $minor $disk
1424 done
1425 ;;
1426 ad[a-p])
1427 major=`Major ad 28` || continue
1428 unit=`suffix $arg ad`
1429 base=`index abcdefghijklmnop $unit`
1430 base=`math $base \* 16`
1431 makedev ad$unit b $major $base $disk
1432 for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1433 do
1434 minor=$(( $base + $part ))
1435 makedev ad$unit$part b $major $minor $disk
1436 done
1437 ;;
1438 dac960)
1439 for ctr in 0 1 2 3 4 5 6 7
1440 do
1441 $0 $opts dac960.$ctr
1442 done
1443 makedev dac960_gam c 10 252 $disk
1444 ;;
1445 dac960.[0-7])
1446 [ -d rd ] || {
1447 mkdir rd
1448 chown root:root rd
1449 chmod 755 rd
1450 }
1451 unit=`suffix $arg dac960.`
1452 major=`math 48 + $unit`
1453 minor=0
1454 for ld in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 \
1455 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
1456 do
1457 makedev rd/c${unit}d${ld} b $major $minor $disk
1458 minor=`math $minor + 1`
1459 for part in 1 2 3 4 5 6 7
1460 do
1461 makedev rd/c${unit}d${ld}p$part b $major $minor $disk
1462 minor=`math $minor + 1`
1463 done
1464 done
1465 ;;
1466 dpti)
1467 major=151
1468 for ld in 1 2 3 4 5 6 7
1469 do
1470 minor=`math $ld -1`
1471 makedev dpti${ld} c $major $minor $disk
1472 done
1473 ;;
1474 ataraid)
1475 for ctr in 0 1 2 # 3 4 5 6 7
1476 do
1477 $0 $opts ataraid.$ctr
1478 done
1479 ;;
1480 ataraid.[0-7])
1481 [ -d ataraid ] || {
1482 mkdir ataraid
1483 chown root:root ataraid
1484 chmod 755 ataraid
1485 }
1486 unit=`suffix $arg ataraid.`
1487 major=114
1488 minor=`math $unit \* 16`
1489 makedev ataraid/d${unit} b $major $minor $disk
1490 for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1491 do
1492 minor=`math $minor + 1`
1493 makedev ataraid/d${unit}p$part b $major $minor $disk
1494 done
1495 ;;
1496 ida)
1497 for ctr in 0 1 2 # 3 4 5 6 7
1498 do
1499 $0 $opts ida.$ctr
1500 done
1501 ;;
1502 ida.[0-7])
1503 [ -d ida ] || {
1504 mkdir ida
1505 chown root:root ida
1506 chmod 755 ida
1507 }
1508 unit=`suffix $arg ida.`
1509 major=`math 72 + $unit`
1510 minor=0
1511 for ld in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1512 do
1513 makedev ida/c${unit}d${ld} b $major $minor $disk
1514 minor=`math $minor + 1`
1515 for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1516 do
1517 makedev ida/c${unit}d${ld}p$part b $major $minor $disk
1518 minor=`math $minor + 1`
1519 done
1520 done
1521 ;;
1522 cciss)
1523 for ctr in 0 1 2 # 3 4 5 6 7
1524 do
1525 $0 $opts cciss.$ctr
1526 done
1527 ;;
1528 cciss.[0-7])
1529 [ -d cciss ] || {
1530 mkdir cciss
1531 chown root:root cciss
1532 chmod 755 cciss
1533 }
1534 unit=`suffix $arg cciss.`
1535 major=`math 104 + $unit`
1536 minor=0
1537 for ld in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1538 do
1539 makedev cciss/c${unit}d${ld} b $major $minor $disk
1540 minor=`math $minor + 1`
1541 for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1542 do
1543 makedev cciss/c${unit}d${ld}p$part b $major $minor $disk
1544 minor=`math $minor + 1`
1545 done
1546 done
1547 ;;
1548 rom)
1549 major=`Major rom 31`
1550 for i in 0 1 2 3 4 5 6 7
1551 do
1552 makedev rom$i b $major $i $disk
1553 makedev rrom$i b $major `math $i +8` $disk
1554 makedev flash$i b $major `math $i +16` $disk
1555 makedev rflash$i b $major `math $i +24` $disk
1556 done
1557 ;;
1558 nb[0-7])
1559 major=`Major nbd 43` || continue
1560 minor=`suffix $arg nb`
1561 makedev nb$minor b $major $minor $disk
1562 ;;
1563 loop)
1564 for part in 0 1 2 3 4 5 6 7
1565 do
1566 makedev loop$part b 7 $part $disk
1567 done
1568 ;;
1569 loop[0-9]|loop[1-9][0-9]|loop1[0-9][0-9]|loop2[0-4][0-9]|loop25[0-5])
1570 minor=`suffix $arg loop`
1571 makedev loop$minor b 7 $minor $disk
1572 ;;
1573 md)
1574 major=`Major md 9` || continue
1575 for part in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1576 do
1577 makedev md$part b $major $part $disk
1578 done
1579 ;;
1580 st[0-7])
1581 major=`Major st 9`
1582 unit=`suffix $arg st`
1583 makedev st${unit} c $major $unit $tape
1584 makedev nst${unit} c $major `math 128 + $unit` $tape
1585
1586 makedev st${unit}l c $major `math 32 + $unit` $tape
1587 makedev nst${unit}l c $major `math 160 + $unit` $tape
1588
1589 makedev st${unit}m c $major `math 64 + $unit` $tape
1590 makedev nst${unit}m c $major `math 192 + $unit` $tape
1591
1592 makedev st${unit}a c $major `math 96 + $unit` $tape
1593 makedev nst${unit}a c $major `math 224 + $unit` $tape
1594 ;;
1595 qic)
1596 major=`Major tpqic02 12`
1597 makedev ntpqic11 c $major 2 $tape
1598 makedev tpqic11 c $major 3 $tape
1599 makedev ntpqic24 c $major 4 $tape
1600 makedev tpqic24 c $major 5 $tape
1601 makedev ntpqic120 c $major 6 $tape
1602 makedev tpqic120 c $major 7 $tape
1603 makedev ntpqic150 c $major 8 $tape
1604 makedev tpqic150 c $major 9 $tape
1605 makedev rmt8 c $major 6 $tape
1606 makedev rmt16 c $major 8 $tape
1607 makedev tape-d c $major 136 $tape
1608 makedev tape-reset c $major 255 $tape
1609 $0 $opts qft
1610 ;;
1611 ftape)
1612 major=`Major qft 27` || continue
1613 for unit in 0 1 2 3
1614 do
1615 makedev qft$unit c $major $unit $tape
1616 makedev nqft$unit c $major `math $unit + 4` $tape
1617 makedev zqft$unit c $major `math $unit + 16` $tape
1618 makedev nzqft$unit c $major `math $unit + 20` $tape
1619 makedev rawqft$unit c $major `math $unit + 32` $tape
1620 makedev nrawqft$unit c $major `math $unit + 36` $tape
1621 done
1622 symlink ftape qft0
1623 symlink nftape nqft0
1624 ;;
1625 sr|scd|scd-all)
1626 major=`Major sr 11` || continue
1627 for unit in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
1628 do
1629 makedev scd$unit b $major $unit $cdrom
1630 symlink sr$unit scd$unit
1631 done
1632 ;;
1633 pktcdvd)
1634 major=97
1635 for unit in 0 1 2 3
1636 do
1637 makedev pktcdvd$unit b $major $unit $cdrom
1638 done
1639 ;;
1640 cfs0)
1641 makedev cfs0 c 67 0 $coda
1642 ;;
1643 scd[0-9]|scd[0-1][0-9])
1644 major=`Major sr 11` || continue
1645 unit=`suffix $arg scd`
1646 makedev scd$unit b $major $unit $cdrom
1647 symlink sr$unit scd$unit
1648 ;;
1649 ttyI[0-9]|ttyI[1-5][0-9]|ttyI[6][0-3])
1650 major=43
1651 unit=`suffix $arg ttyI`
1652 makedev ttyI$unit c $major $unit $dialout
1653 ;;
1654 ppp)
1655 major=108
1656 makedev ppp c $major 0 $dip
1657 ;;
1658 ippp[0-9]|ippp[1-5][0-9]|ippp[6][0-3])
1659 major=45
1660 unit=`suffix $arg ippp`
1661 minor=`math $unit + 128`
1662 makedev ippp$unit c $major $minor $dialout
1663 ;;
1664 isdn[0-9]|isdn[1-5][0-9]|isdn[6][0-3])
1665 major=45
1666 unit=`suffix $arg isdn`
1667 minor=`math $unit + 0`
1668 makedev isdn$unit c $major $minor $dialout
1669 ;;
1670 isdnctrl[0-9]|isdnctrl[1-5][0-9]|isdnctrl[6][0-3])
1671 major=45
1672 unit=`suffix $arg isdnctrl`
1673 minor=`math $unit + 64`
1674 makedev isdnctrl$unit c $major $minor $dialout
1675 ;;
1676 isdninfo)
1677 makedev isdninfo c 45 255 $private
1678 ;;
1679 isdn-tty)
1680 major=43
1681 for unit in 0 1 2 3 4 5 6 7
1682 do
1683 makedev ttyI$unit c $major $unit $dialout
1684 done
1685 ;;
1686 isdn-ippp)
1687 major=45
1688 for unit in 0 1 2 3 4 5 6 7
1689 do
1690 makedev ippp$unit c $major `math $unit + 128` $dialout
1691 done
1692 ;;
1693 isdn-io)
1694 for unit in 0 1 2 3 4 5 6 7
1695 do
1696 makedev isdn$unit c 45 $unit $dialout
1697 makedev isdnctrl$unit c 45 `math $unit + 64` $dialout
1698 makedev ippp$unit c 45 `math $unit + 128` $dialout
1699 done
1700 makedev isdninfo c 45 255 $dialout
1701 ;;
1702 sonycd)
1703 major=`Major sonycd 15` || continue
1704 makedev $arg b $major 0 $cdrom
1705 ;;
1706 mcd)
1707 major=`Major mcd 23` || continue
1708 makedev $arg b $major 0 $cdrom
1709 ;;
1710 mcdx|mcdx[0-4])
1711 major=`Major $arg 20` || continue
1712 for unit in 0 1 2 3 4
1713 do
1714 makedev mcdx$unit b $major $unit $cdrom
1715 done
1716 test -r mcdx || symlink mcdx mcdx0
1717 ;;
1718 cdu535)
1719 makedev $arg b 24 0 $cdrom
1720 ;;
1721 lmscd)
1722 makedev $arg b 24 0 $cdrom
1723 ;;
1724 sbpcd|sbpcd[123])
1725 major=`Major $arg 25` || continue
1726 base=`suffix ${arg}0 sbpcd`
1727 for minor in 0 1 2 3
1728 do
1729 # XXX
1730 unit=$(substr 0123456789abcdef $(( $base * 4 + $minor + 1 )) )
1731 makedev sbpcd$unit b $major $minor $cdrom
1732 done
1733 [ $arg = sbpcd ] && symlink $arg ${arg}0
1734 ;;
1735 aztcd)
1736 major=`Major $arg 29` || continue
1737 makedev ${arg}0 b $major 0 $cdrom
1738 ;;
1739 cm206cd)
1740 major=`Major $arg 30` || continue
1741 makedev ${arg}0 b $major 0 $cdrom
1742 ;;
1743 gscd)
1744 major=`Major $arg 16` || continue
1745 makedev ${arg}0 b $major 0 $cdrom
1746 ;;
1747 pcd)
1748 for unit in 0 1 2 3
1749 do
1750 makedev pcd$unit b 46 $unit $cdrom
1751 done
1752 ;;
1753 bpcd)
1754 makedev $arg b 41 0 $cdrom
1755 ;;
1756 optcd)
1757 makedev $arg b 17 0 $cdrom
1758 ;;
1759 sjcd)
1760 makedev $arg b 18 0 $cdrom
1761 ;;
1762 cfs|coda)
1763 makedev cfs0 c 67 0 $private
1764 ;;
1765 xfs|nnpfs|arla)
1766 makedev xfs0 c 103 0 $private
1767 makedev nnpfs0 c 103 0 $private
1768 ;;
1769 logiscan)
1770 major=`Major logiscan` || continue
1771 makedev $arg c $major 0 $scanner
1772 ;;
1773 toshiba)
1774 major=`Major $arg 10` || continue
1775 makedev $arg c $major 181 root root 0666
1776 ;;
1777 m105scan)
1778 major=`Major m105` || continue
1779 makedev $arg c $major 0 $scanner
1780 ;;
1781 ac4096)
1782 major=`Major ac4096` || continue
1783 makedev $arg c $major 0 $scanner
1784 ;;
1785 audio)
1786 major=`Major sound 14`
1787 makedev mixer c $major 0 $audio
1788 makedev mixer1 c $major 16 $audio
1789 makedev mixer2 c $major 32 $audio
1790 makedev mixer3 c $major 48 $audio
1791 makedev sequencer c $major 1 $audio
1792 makedev midi00 c $major 2 $audio
1793 makedev midi01 c $major 18 $audio
1794 makedev midi02 c $major 34 $audio
1795 makedev midi03 c $major 50 $audio
1796 makedev dsp c $major 3 $audio
1797 makedev dsp1 c $major 19 $audio
1798 makedev dsp2 c $major 35 $audio
1799 makedev dsp3 c $major 51 $audio
1800 makedev audio c $major 4 $audio
1801 makedev audio1 c $major 20 $audio
1802 makedev audio2 c $major 36 $audio
1803 makedev audio3 c $major 52 $audio
1804 makedev sndstat c $major 6 $audio
1805 makedev audioctl c $major 7 $audio
1806 major=31
1807 makedev mpu401data c $major 0 $audio
1808 makedev mpu401stat c $major 1 $audio
1809 major=35
1810 for i in 0 1 2 3
1811 do
1812 makedev midi$i c $major $i $audio
1813 makedev rmidi$i c $major `math $i + 64` $audio
1814 makedev smpte$i c $major `math $i + 128` $audio
1815 done
1816 ;;
1817 pcaudio)
1818 major=`Major pcsp 13` || continue
1819 makedev pcmixer c $major 0 $audio
1820 makedev pcsp c $major 3 $audio
1821 makedev pcaudio c $major 4 $audio
1822 ;;
1823 video|video4linux|v4l|radio)
1824 # video4linux api includes radio, teletext, etc.
1825 major=`Major video 81` || continue
1826 minor=0
1827 until [ $minor -gt 63 ]
1828 do
1829 makedev video$minor c $major $minor $video
1830 makedev radio$minor c $major `math $minor + 64` $video
1831 minor=`math $minor + 1`
1832 done
1833 symlink radio radio0
1834 minor=0
1835 until [ $minor -gt 31 ]
1836 do
1837 makedev vtx$minor c $major `math $minor + 192` $video
1838 makedev vbi$minor c $major `math $minor + 224` $video
1839 minor=`math $minor + 1`
1840 done
1841 symlink video video0
1842 symlink vbi vbi0
1843 major=82
1844 minor=0
1845 until [ $minor -gt 1 ]
1846 do
1847 makedev winradio$minor c $major $minor $video
1848 minor=`math $minor + 1`
1849 done
1850 major=83
1851 makedev vtx c $major 0 $video
1852 makedev vttuner c $major 16 $video
1853 ;;
1854 i2c)
1855 # making it possible to create an arbitrary number of i2c
1856 # devices might be good, but 8 should suffice for now
1857 major=`Major i2c 89` || continue
1858 minor=0
1859 until [ $minor -gt 7 ]
1860 do
1861 makedev i2c-$minor c $major $minor $private
1862 minor=`math $minor + 1`
1863 done
1864 ;;
1865 tlk)
1866 major=102
1867 minor=0
1868 until [ $minor -gt 3 ] # tell me if 3 is wrong...
1869 do
1870 makedev tlk$minor c $major $minor $video
1871 minor=`math $minor + 1`
1872 done
1873 ;;
1874 srnd)
1875 makedev srnd0 c 110 0 $video
1876 makedev srnd1 c 110 1 $video
1877 ;;
1878 fgrab)
1879 makedev mmetfgrab c 40 0 $video
1880 makedev wvisfgrab c 26 0 $video
1881 for i in 0 1 # more?
1882 do
1883 makedev iscc$i c 93 $i $video
1884 makedev isccctl$i c 93 `math $i + 128` $video
1885 done
1886 for i in 0 1 # more?
1887 do
1888 makedev dcxx$i c 94 $i $video
1889 done
1890 ;;
1891 sg|sg-all)
1892 major=`Major sg 21`
1893 for unit in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
1894 do
1895 makedev sg$unit c $major $unit $scsi
1896 done
1897 ;;
1898 pg)
1899 major=`Major pg 97`
1900 for unit in 0 1 2 3
1901 do
1902 makedev pg$unit c $major $unit $scsi
1903 done
1904 ;;
1905 fd)
1906 # not really devices, we use the /proc filesystem
1907 symlink fd $procfs/self/fd
1908 symlink stdin fd/0
1909 symlink stdout fd/1
1910 symlink stderr fd/2
1911 ;;
1912 ibcs2)
1913 major=`Major ibcs2 30` || continue
1914 makedev socksys c $major 0 $ibcs2
1915 symlink nfsd socksys
1916 makedev spx c $major 1 $ibcs2
1917 symlink X0R null
1918 ;;
1919 netlink)
1920 major=36
1921 makedev route c $major 0 $private
1922 makedev skip c $major 1 $private
1923 ;;
1924 enskip)
1925 major=64
1926 makedev enskip c $major 0 $private
1927 ;;
1928 ipfilt*)
1929 major=95
1930 makedev ipl c $major 0 $private
1931 makedev ipnat c $major 1 $private
1932 makedev ipstate c $major 2 $private
1933 makedev ipauth c $major 3 $private
1934 ;;
1935 qng)
1936 makedev qng c 77 0 $private
1937 ;;
1938 apm)
1939 major=`Major mouse 10` || continue
1940 makedev apm_bios c $major 134 $mouse
1941 ;;
1942 dcf)
1943 major=`Major dcf` || continue
1944 makedev $arg c $major 0 $system
1945 ;;
1946 helloworld)
1947 major=`Major hw` || continue
1948 makedev helloworld c $major 0 $public
1949 ;;
1950 ipsec)
1951 # For the Free S/WAN (http://www.xs4all.nl/~freeswan/)
1952 # implementation of IPSEC
1953 makedev ipsec c 36 10 $ipsec
1954 ;;
1955 comedi)
1956 major=98
1957 for minor in 0 1 2 3
1958 do
1959 makedev comedi$minor c $major $minor $public
1960 done
1961 ;;
1962 tilp)
1963 for i in `seq 0 7`
1964 do
1965 makedev tipar$i c 115 $i $printer
1966 makedev tiser$i c 115 `math 8 + $i` $dialout
1967 done
1968 for i in `seq 0 31`
1969 do
1970 makedev tiusb$i c 115 `math 16 + $i` $dialout
1971 done
1972 ;;
1973 dvb)
1974 # check if kernel-version is >= 2.6.8, if yes, create dvb-devices with
1975 # major-number 212, in the other case 250
1976
1977 kern_rev1=`uname -r | sed -e 's@^\([^.]*\)\..*@\1@'`
1978 kern_rev2=`uname -r | sed -e 's@^[^.]*\.\([^.]*\)\..*@\1@'`
1979 kern_rev3=`uname -r | sed -e 's@^[^.]*\.[^.]*\.\([^.][0-9]*\).*@\1@'`
1980
1981 dvb_major=250
1982
1983 if [ $kern_rev1 -gt 2 ] || ([ $kern_rev1 -eq 2 ] && [ $kern_rev2 -gt 6 ]) \
1984 || ([ $kern_rev1 -eq 2 ] && [ $kern_rev2 -eq 6 ] && [ $kern_rev3 -ge 8 ])
1985 then
1986 dvb_major=212
1987 fi
1988
1989 mkdir -p dvb
1990 for i in 0 1 2 3
1991 do
1992 mkdir -p dvb/adapter$i
1993 makedev dvb/adapter$i/video0 c $dvb_major `math 64 \* $i + 0` $video
1994 makedev dvb/adapter$i/audio0 c $dvb_major `math 64 \* $i + 1` $video
1995 makedev dvb/adapter$i/frontend0 c $dvb_major `math 64 \* $i + 3` $video
1996 makedev dvb/adapter$i/demux0 c $dvb_major `math 64 \* $i + 4` $video
1997 makedev dvb/adapter$i/dvr0 c $dvb_major `math 64 \* $i + 5` $video
1998 makedev dvb/adapter$i/ca0 c $dvb_major `math 64 \* $i + 6` $video
1999 makedev dvb/adapter$i/net0 c $dvb_major `math 64 \* $i + 7` $video
2000 makedev dvb/adapter$i/osd0 c $dvb_major `math 64 \* $i + 8` $video
2001 done
2002 ;;
2003 usb)
2004 mkdir -p usb
2005 major=180
2006 for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
2007 do
2008 makedev usb/lp$i c $major $i $printer
2009 makedev usb/mouse$i c $major `math $i + 16` $mouse
2010 makedev usb/ez$i c $major `math $i + 32` $system
2011 makedev usb/scanner$i c $major `math $i + 48` $scanner
2012 makedev usb/hiddev$i c $major `math $i + 96` $system
2013 makedev ttyACM$i c 166 $i $dialout
2014 makedev ttyUSB$i c 188 $i $dialout
2015 done
2016 makedev usb/rio500 c $major 64 $audio
2017 makedev usb/usblcd c $major 65 $audio
2018 makedev usb/cpad0 c $major 66 $audio
2019 ;;
2020 bluetooth)
2021 major=216
2022 for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 \
2023 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
2024 do
2025 makedev rfcomm$i c $major $i $dialout
2026 done
2027 makedev vhci c 10 250 $dialout
2028 for i in 0 1 2 3; do
2029 makedev ttyUB$i c 216 $i $dialout
2030 makedev ccub$i c 217 $i $dialout
2031 done
2032 ;;
2033 paride)
2034 major=45
2035 for unit in a b c d
2036 do
2037 base=`index abcd $unit`
2038 base=`math $base \* 16`
2039 makedev pd$unit b $major $base $disk
2040 for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
2041 do
2042 makedev pd$unit$part b $major $(( $base + $part )) $disk
2043 done
2044 done
2045 for i in 0 1 2 3
2046 do
2047 makedev pcd$i b 46 $i $cdrom
2048 makedev pf$i b 47 $i $floppy
2049 done
2050 ;;
2051 update)
2052 devices=
2053 if [ ! -f $procfs/devices ]
2054 then
2055 echo "$0: warning: can't read $procfs/devices" >&2
2056 else
2057 exec 3<$procfs/devices
2058 while read major device extra <&3
2059 do
2060 device=`echo $device | sed 's#/.*##'`
2061 case "$major" in
2062 Character|Block|'')
2063 ;;
2064 *)
2065 eval "major_$device=$major"
2066 devices="$devices $device"
2067 ;;
2068 esac
2069 done
2070 exec 3<&-
2071 fi
2072
2073 if [ ! "$devices" ]
2074 then
2075 echo "$0: don't appear to have any devices" >&2
2076 continue
2077 fi
2078 if [ "$opt_d" ]
2079 then
2080 echo "$0: can't delete an update" >&2
2081 continue
2082 fi
2083 create=
2084 delete=
2085 devs="$devices"
2086 if [ -f DEVICES ]
2087 then
2088 exec 3<DEVICES
2089 while read device major <&3
2090 do
2091 eval now=\$major_$device
2092 if [ "$now" = "" ]
2093 then
2094 delete="$delete `cvt $device`"
2095 continue
2096 elif [ "$now" != $major ]
2097 then
2098 create="$create "`cvt $device`
2099 fi
2100 devs=`strip " $devs " $device`
2101 done
2102 exec 3<&-
2103 fi
2104 create="$create "`cvt $devs`
2105 [ "$delete" != "" ] && $0 $opts -d $delete
2106 [ "$create" != " " ] && $0 $opts $create
2107 [ "$opt_n" ] && continue
2108 for device in $devices
2109 do
2110 if [ "`cvt $device`" ]
2111 then
2112 eval echo $device \$major_$device
2113 fi
2114 done > DEVICES
2115 ;;
2116 *)
2117 echo "$0: don't know how to make device \"$arg\"" >&2
2118 exit 1
2119 ;;
2120 esac
2121 done
2122
2123 exit 0

Properties

Name Value
svn:eol-style native
svn:executable *
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.20