xref: /openbsd/etc/etc.macppc/MAKEDEV (revision d485f761)
1#!/bin/sh -
2#	$OpenBSD: MAKEDEV,v 1.3 2001/11/06 23:46:05 drahn Exp $
3#
4# Copyright (c) 1990 The Regents of the University of California.
5# All rights reserved.
6#
7# Written and contributed by W. Jolitz 12/90
8#
9# Redistribution and use in source and binary forms are permitted provided
10# that: (1) source distributions retain this entire copyright notice and
11# comment, and (2) distributions including binaries display the following
12# acknowledgement:  ``This product includes software developed by the
13# University of California, Berkeley and its contributors'' in the
14# documentation or other materials provided with the distribution and in
15# all advertising materials mentioning features or use of this software.
16# Neither the name of the University nor the names of its contributors may
17# be used to endorse or promote products derived from this software without
18# specific prior written permission.
19# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
20# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
21# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
22#
23#	from: @(#)MAKEDEV	5.2 (Berkeley) 6/22/90
24#	$NetBSD: MAKEDEV,v 1.17 1996/02/03 15:02:42 briggs Exp $
25#
26# Device "make" file.  Valid arguments:
27#	all	makes all known devices, including local devices.
28#		Tries to make the ``standard'' number of each type.
29#	std	standard devices
30#	fd	makes fd/* for the fdescfs.
31#	local	configuration specific devices
32#	ramdisk	makes all devices for a ramdisk kernel
33#
34# Tapes:
35#	st*	SCSI tapes
36#
37# Disks:
38#	fd*	Floppy disk drives (3 1/2", 5 1/4")
39#	wd*	IDE disks
40#	sd*	SCSI disks
41#	cd*	SCSI cdrom drives
42#	vnd*	"file" pseudo-disks
43#	rd*	"ramdisk" pseudo-disks
44#	ccd*	concatenated disk devices
45#	raid*	RAIDframe disk devices
46#
47# Terminal ports:
48#	ttyC*	wscons
49#	tty*	standard built-in serial ports (2)
50#
51# Pointing devices:
52#	wsmouse* wscons mouse events
53#
54# Keyboard devices:
55#	wskbd* wscons keyboard events
56#
57# Pseudo terminals:
58#	pty*	set of 16 master and slave pseudo terminals
59#
60# Graphics devices:
61#	grf*	custom chip (grf0), Retina Z2/Z3 (grf1/grf2),
62#		Cirrus boards (grf3), A2410 (grf4) video or
63#		CyberVision 64 (grf5)
64#
65# USB devices:
66#	usb*	Bus control devices used by usbd for attach/detach
67#	uhid*	Generic HID devices
68#	ulpt*	Printer devices
69#	urio*	Diamond Multimedia Rio 500
70#	ugen*	Generic device
71#	utty*	Serial ports
72#
73# Special purpose devices:
74#	apm	power management device
75#	audio*  audio
76#	ch*	SCSI media changer
77#	bpf*	Berkeley Packet Filter
78#	tun*	network tunnel driver
79#	lkm	loadable kernel modules interface
80#	*random	inkernal random data source
81#	altq	ALTQ control interface
82#	iop	I2O controller device
83#
84
85PATH=/sbin:/bin:/usr/bin:/usr/sbin
86this=$0
87umask 77
88
89# default shell support functions
90add ()
91{
92	tmp=0
93	while [ "$1" ]
94	do
95		tmp=$(( $1 + $tmp ))
96		shift
97	done
98	echo $tmp
99}
100mult ()
101{
102	echo "$(( $1 * $2 ))"
103}
104hex ()
105{
106	case $1 in
107		[0-9]) echo -n $1;;
108		10) echo -n a;;
109		11) echo -n b;;
110		12) echo -n c;;
111		13) echo -n d;;
112		14) echo -n e;;
113		15) echo -n f;;
114	esac
115}
116trunc ()
117{
118	# XXX pdksh can't seem to deal with locally scoped variables
119	# in ${foo#$bar} expansions
120	arg1="$1"
121	arg2="$2"
122	echo ${arg1#$arg2}
123}
124unt()
125{
126	# XXX pdksh can't seem to deal with locally scoped variables
127	# in ${foo#$bar} expansions
128	arg1="$1"
129	tmp="${arg1#[a-z]*}"
130	while [ "$tmp" != "$arg1" ]
131	do
132		arg1=$tmp
133		tmp="${arg1#[a-z]*}"
134	done
135	tmp="${arg1%*[a-z]}"
136	while [ "$tmp" != "$arg1" ]
137	do
138		arg1=$tmp
139		tmp="${arg1%*[a-z]}"
140	done
141	echo $arg1
142}
143
144for i
145do
146
147unit=`unt $i`
148[ "$unit" ] || unit=0
149
150case $i in
151
152all)
153	sh $this std fd
154	sh $this wd0 wd1 wd2 wd3
155	sh $this sd0 sd1 sd2 sd3 st0 st1 cd0 cd1
156	sh $this vnd0 vnd1 vnd2 vnd3
157	sh $this ccd0 ccd1 ccd2 ccd3
158	sh $this raid0 raid1 raid2 raid3
159	sh $this rd0
160	sh $this ttyC0 ttyCcfg
161	sh $this tty00 tty01 tty02 tty03 pty0 pty1
162	sh $this bpf0 bpf1 bpf2 bpf3 bpf4 bpf5 bpf6 bpf7 bpf8 bpf9
163	sh $this pf tun0 tun1 tun2 tun3
164	sh $this audio0
165	sh $this random uk0 uk1 ss0 ss1
166	sh $this wscons
167	sh $this pci
168	sh $this lkm xfs0 altq
169	sh $this usbs
170	sh $this iop0 iop1
171	sh $this apm
172	sh $this local
173	;;
174
175ramdisk)
176	sh $this std
177	sh $this wd0 wd1 wd2 wd3
178	sh $this sd0 sd1 sd2 sd3 sd4 st0 st1 cd0 cd1
179	sh $this rd0
180	sh $this random
181	sh $this bpf0
182	sh $this tty00 tty01 pty0
183	sh $this wscons
184	;;
185
186std)
187	rm -f console drum kmem mem reload zero null tty
188	rm -f klog stdin stdout stderr ksyms
189	mknod console		c 0 0
190	mknod drum		c 3 0	; chmod 640 drum ; chgrp kmem drum
191	mknod kmem		c 2 1	; chmod 640 kmem ; chgrp kmem kmem
192	mknod mem		c 2 0	; chmod 640 mem ; chgrp kmem mem
193	mknod reload		c 2 20	; chmod 640 reload ; chgrp kmem reload
194	mknod zero		c 2 12	; chmod 666 zero
195	mknod null		c 2 2	; chmod 666 null
196	mknod tty		c 1 0	; chmod 666 tty
197	mknod klog		c 6 0	; chmod 600 klog
198	mknod stdin		c 21 0	; chmod 666 stdin
199	mknod stdout		c 21 1	; chmod 666 stdout
200	mknod stderr		c 21 2	; chmod 666 stderr
201	mknod ksyms		c 43 0  ; chmod 640 ksyms ; chown root.kmem ksyms
202	;;
203
204iop*)
205	rm -f iop$unit
206	mknod iop$unit c 73 $unit
207	chown root.wheel iop$unit
208	chmod 660 iop$unit
209	;;
210
211usbs)
212	sh $this usb0 usb1
213	sh $this uhid0 uhid1 uhid2 uhid3
214	sh $this ulpt0 ulpt1
215	sh $this urio0 uscanner0
216	sh $this utty0 utty1
217	;;
218
219fd)
220	rm -f fd/*
221	mkdir fd > /dev/null 2>&1
222	n=0
223	(cd fd && while [ $n -lt 64 ]; do mknod $n c 21 $n; n="$(( $n + 1 ))"; done)
224	chown -R root.wheel fd
225	chmod 555 fd
226	chmod 666 fd/*
227	;;
228
229sd*|wd*|ccd*|ofdisk*|raid*)
230	umask 2 ; unit=${i##*[a-z]}
231	case $i in
232	sd*) name=sd;		blk=2;	chr=8;;
233	wd*) name=wd;		blk=0;	chr=11;;
234	ofdisk*) name=ofdisk;	blk=4;	chr=13;;
235	ccd*) name=ccd; 	blk=16;	chr=18;;
236	raid*) name=raid;	blk=19;	chr=54;;
237	esac
238	rm -f $name$unit? r$name$unit?
239	case $unit in
240	0|1|2|3|4|5|6|7|8|9)
241		mknod ${name}${unit}a	b $blk $(( $unit * 16 + 0 ))
242		mknod ${name}${unit}b	b $blk $(( $unit * 16 + 1 ))
243		mknod ${name}${unit}c	b $blk $(( $unit * 16 + 2 ))
244		mknod ${name}${unit}d	b $blk $(( $unit * 16 + 3 ))
245		mknod ${name}${unit}e	b $blk $(( $unit * 16 + 4 ))
246		mknod ${name}${unit}f	b $blk $(( $unit * 16 + 5 ))
247		mknod ${name}${unit}g	b $blk $(( $unit * 16 + 6 ))
248		mknod ${name}${unit}h	b $blk $(( $unit * 16 + 7 ))
249		mknod ${name}${unit}i	b $blk $(( $unit * 16 + 8 ))
250		mknod ${name}${unit}j	b $blk $(( $unit * 16 + 9 ))
251		mknod ${name}${unit}k	b $blk $(( $unit * 16 + 10 ))
252		mknod ${name}${unit}l	b $blk $(( $unit * 16 + 11 ))
253		mknod ${name}${unit}m	b $blk $(( $unit * 16 + 12 ))
254		mknod ${name}${unit}n	b $blk $(( $unit * 16 + 13 ))
255		mknod ${name}${unit}o	b $blk $(( $unit * 16 + 14 ))
256		mknod ${name}${unit}p	b $blk $(( $unit * 16 + 15 ))
257		mknod r${name}${unit}a	c $chr $(( $unit * 16 + 0 ))
258		mknod r${name}${unit}b	c $chr $(( $unit * 16 + 1 ))
259		mknod r${name}${unit}c	c $chr $(( $unit * 16 + 2 ))
260		mknod r${name}${unit}d	c $chr $(( $unit * 16 + 3 ))
261		mknod r${name}${unit}e	c $chr $(( $unit * 16 + 4 ))
262		mknod r${name}${unit}f	c $chr $(( $unit * 16 + 5 ))
263		mknod r${name}${unit}g	c $chr $(( $unit * 16 + 6 ))
264		mknod r${name}${unit}h	c $chr $(( $unit * 16 + 7 ))
265		mknod r${name}${unit}i	c $chr $(( $unit * 16 + 8 ))
266		mknod r${name}${unit}j	c $chr $(( $unit * 16 + 9 ))
267		mknod r${name}${unit}k	c $chr $(( $unit * 16 + 10 ))
268		mknod r${name}${unit}l	c $chr $(( $unit * 16 + 11 ))
269		mknod r${name}${unit}m	c $chr $(( $unit * 16 + 12 ))
270		mknod r${name}${unit}n	c $chr $(( $unit * 16 + 13 ))
271		mknod r${name}${unit}o	c $chr $(( $unit * 16 + 14 ))
272		mknod r${name}${unit}p	c $chr $(( $unit * 16 + 15 ))
273		chgrp operator ${name}${unit}[a-p] r${name}${unit}[a-p]
274		chmod 640 ${name}${unit}[a-p] r${name}${unit}[a-p]
275		;;
276	*)
277		echo bad unit for disk in: $i
278		;;
279	esac
280	umask 77
281	;;
282
283vnd*)
284	umask 2 ; unit=${i##*[a-z]}
285	for name in vnd svnd; do
286		blk=14; chr=19;
287		case $name in
288		vnd)	off=0;;
289		svnd)	off=128;;
290		esac
291		rm -f $name$unit? r$name$unit?
292		mknod ${name}${unit}a	b $blk $(( $unit * 16 + $off + 0 ))
293		mknod ${name}${unit}b	b $blk $(( $unit * 16 + $off + 1 ))
294		mknod ${name}${unit}c	b $blk $(( $unit * 16 + $off + 2 ))
295		mknod ${name}${unit}d	b $blk $(( $unit * 16 + $off + 3 ))
296		mknod ${name}${unit}e	b $blk $(( $unit * 16 + $off + 4 ))
297		mknod ${name}${unit}f	b $blk $(( $unit * 16 + $off + 5 ))
298		mknod ${name}${unit}g	b $blk $(( $unit * 16 + $off + 6 ))
299		mknod ${name}${unit}h	b $blk $(( $unit * 16 + $off + 7 ))
300		mknod ${name}${unit}i	b $blk $(( $unit * 16 + $off + 8 ))
301		mknod ${name}${unit}j	b $blk $(( $unit * 16 + $off + 9 ))
302		mknod ${name}${unit}k	b $blk $(( $unit * 16 + $off + 10 ))
303		mknod ${name}${unit}l	b $blk $(( $unit * 16 + $off + 11 ))
304		mknod ${name}${unit}m	b $blk $(( $unit * 16 + $off + 12 ))
305		mknod ${name}${unit}n	b $blk $(( $unit * 16 + $off + 13 ))
306		mknod ${name}${unit}o	b $blk $(( $unit * 16 + $off + 14 ))
307		mknod ${name}${unit}p	b $blk $(( $unit * 16 + $off + 15 ))
308		mknod r${name}${unit}a	c $chr $(( $unit * 16 + $off + 0 ))
309		mknod r${name}${unit}b	c $chr $(( $unit * 16 + $off + 1 ))
310		mknod r${name}${unit}c	c $chr $(( $unit * 16 + $off + 2 ))
311		mknod r${name}${unit}d	c $chr $(( $unit * 16 + $off + 3 ))
312		mknod r${name}${unit}e	c $chr $(( $unit * 16 + $off + 4 ))
313		mknod r${name}${unit}f	c $chr $(( $unit * 16 + $off + 5 ))
314		mknod r${name}${unit}g	c $chr $(( $unit * 16 + $off + 6 ))
315		mknod r${name}${unit}h	c $chr $(( $unit * 16 + $off + 7 ))
316		mknod r${name}${unit}i	c $chr $(( $unit * 16 + $off + 8 ))
317		mknod r${name}${unit}j	c $chr $(( $unit * 16 + $off + 9 ))
318		mknod r${name}${unit}k	c $chr $(( $unit * 16 + $off + 10 ))
319		mknod r${name}${unit}l	c $chr $(( $unit * 16 + $off + 11 ))
320		mknod r${name}${unit}m	c $chr $(( $unit * 16 + $off + 12 ))
321		mknod r${name}${unit}n	c $chr $(( $unit * 16 + $off + 13 ))
322		mknod r${name}${unit}o	c $chr $(( $unit * 16 + $off + 14 ))
323		mknod r${name}${unit}p	c $chr $(( $unit * 16 + $off + 15 ))
324		chown root.operator ${name}${unit}[a-p] r${name}${unit}[a-p]
325		chmod 640 ${name}${unit}[a-p] r${name}${unit}[a-p]
326	done
327	umask 77
328	;;
329
330tty0*)
331	unit=${i##tty0}
332	rm -f tty0$unit cua0$unit
333	mknod tty0$unit c 7 $unit
334	mknod cua0$unit c 7 `expr $unit + 128`
335	chown uucp.dialer tty0$unit cua0$unit
336	chmod 660 tty0$unit cua0$unit
337	;;
338
339pty*)
340	class=${i##*[a-z]}
341	case $class in
342	0) offset=0 name=p;;
343	1) offset=16 name=q;;
344	2) offset=32 name=r;;
345	3) offset=48 name=s;;
346	4) offset=64 name=t;;
347	5) offset=80 name=u;;
348	6) offset=96 name=v;;
349	7) offset=112 name=w;;
350	8) offset=128 name=x;;
351	9) offset=144 name=y;;
352	10) offset=160 name=z;;
353	11) offset=176 name=P;;
354	12) offset=192 name=Q;;
355	13) offset=208 name=R;;
356	14) offset=224 name=S;;
357	15) offset=240 name=T;;
358	*) echo bad unit for pty in: $i;;
359	esac
360	case $class in
361	0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15)
362		umask 0
363		n=0
364		while [ $n -lt 16 ]
365		do
366			nam=$name`hex $n`
367			rm -f {tty,pty}$nam
368			mknod tty$nam c 4 $(( $offset + $n ))
369			mknod pty$nam c 5 $(( $offset + $n ))
370			n="$(( $n + 1 ))"
371		done
372		umask 77
373		;;
374	esac
375	;;
376
377st*)
378	umask 2 ; unit=${i##*[a-z]}
379	case $i in
380	st*) name=st;  chr=20; blk=5;;
381	esac
382	rm -f $name$unit n$name$unit e$name$unit en$name$unit \
383		r$name$unit nr$name$unit er$name$unit enr$name$unit
384	case $unit in
385	0|1|2|3|4|5|6)
386		mknod ${name}${unit}	b $blk $(( $unit * 16 + 0 ))
387		mknod n${name}${unit}	b $blk $(( $unit * 16 + 1 ))
388		mknod e${name}${unit}	b $blk $(( $unit * 16 + 2 ))
389		mknod en${name}${unit}	b $blk $(( $unit * 16 + 3 ))
390		mknod r${name}${unit}	c $chr $(( $unit * 16 + 0 ))
391		mknod nr${name}${unit}	c $chr $(( $unit * 16 + 1 ))
392		mknod er${name}${unit}	c $chr $(( $unit * 16 + 2 ))
393		mknod enr${name}${unit}	c $chr $(( $unit * 16 + 3 ))
394		chown root.operator ${name}${unit} n${name}${unit} \
395			e$name$unit en$name$unit \
396			r${name}${unit} nr${name}${unit} \
397			er${name}${unit} enr${name}${unit}
398		chmod 660 ${name}${unit} n${name}${unit} \
399			e$name$unit en$name$unit \
400			r${name}${unit} nr${name}${unit} \
401			er${name}${unit} enr${name}${unit}
402		;;
403	*)
404		echo bad unit for tape in: $i
405		;;
406	esac
407	umask 77
408	;;
409
410ch*)
411	umask 2 ; unit=${i##*[a-z]}
412	case $i in
413	ch*) name=ch;  chr=10;;
414	esac
415	rm -f $name$unit
416	case $unit in
417	0|1|2|3|4|5|6)
418		mknod ${name}${unit}	c $chr $unit
419		chown root.operator ${name}${unit}
420		chmod 660 ${name}${unit}
421		;;
422	*)
423		echo bad unit for media changer in: $i
424		;;
425	esac
426	umask 77
427	;;
428
429cd*)
430	umask 2 ; unit=${i##*[a-z]}
431	case $i in
432	cd*) name=cd; blk=3; chr=9;;
433	esac
434	rm -f $name$unit? r$name$unit?
435	case $unit in
436	0|1|2|3|4|5|6)
437		mknod ${name}${unit}a	b $blk $(( $unit * 8 + 0 ))
438		mknod ${name}${unit}c	b $blk $(( $unit * 8 + 2 ))
439		mknod r${name}${unit}a	c $chr $(( $unit * 8 + 0 ))
440		mknod r${name}${unit}c	c $chr $(( $unit * 8 + 2 ))
441		chgrp operator ${name}${unit}[a-h] r${name}${unit}[a-h]
442		chmod 640 ${name}${unit}[a-h] r${name}${unit}[a-h]
443		;;
444	*)
445		echo bad unit for disk in: $i
446		;;
447	esac
448	umask 77
449	;;
450
451audio*)
452	major=44
453	audio=audio$unit
454	sound=sound$unit
455	mixer=mixer$unit
456	audioctl=audioctl$unit
457	rm -f $sound $audio $mixer $audioctl
458	mknod $sound    c $major $unit
459	mknod $audio    c $major $(( $unit + 128 ))
460	mknod $mixer    c $major $(( $unit + 16 ))
461	mknod $audioctl c $major $(( $unit + 192 ))
462	chown root.wheel $audio $sound $mixer $audioctl
463	chmod 666 $audio $sound $mixer $audioctl
464	[ -e audio ] || ln -s $audio audio
465	[ -e mixer ] || ln -s $mixer mixer
466	[ -e sound ] || ln -s $sound sound
467	[ -e audioctl ] || ln -s $audioctl audioctl
468	;;
469
470apm*)
471	rm -f apm apmctl
472	mknod apm c 25 0
473	mknod apmctl c 25 8
474	chown root.wheel apm apmctl
475	chmod 644 apm apmctl
476	;;
477
478usb*)
479	rm -f usb$unit
480	mknod usb$unit c 61 $unit
481	chown root.wheel usb$unit
482	chmod 660 usb$unit
483	;;
484
485uhid*)
486	rm -f uhid$unit
487	mknod uhid$unit c 62 $unit
488	chown root.wheel uhid$unit
489	chmod 660 uhid$unit
490	;;
491
492ugen*)
493	for j in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
494	do
495		rm -f ugen$unit.$j
496		mknod ugen$unit.$j c 63 $(( $unit * 16 + $j ))
497		chown root.wheel ugen$unit.$j
498		chmod 660 ugen$unit.$j
499	done
500	;;
501
502ulpt*)
503	rm -f ulpt$unit
504	mknod ulpt$unit c 64 $unit
505	chown root.wheel ulpt$unit
506	chmod 660 ulpt$unit
507	;;
508
509urio*)
510	rm -f urio$unit
511	mknod urio$unit c 65 $unit
512	chown root.wheel urio$unit
513	chmod 660 urio$unit
514	;;
515
516uscanner*)
517	rm -f uscanner$unit
518	mknod uscanner$unit c 74 $unit
519	chown root.wheel uscanner$unit
520	chmod 660 uscanner$unit
521	;;
522
523utty*)
524	rm -f utty$unit
525	mknod utty$unit c 66 $unit
526	chown root.wheel utty$unit
527	chmod 660 utty$unit
528	;;
529
530
531ttyCcfg)
532	major=67
533	minor=255
534	rm -f ttyCcfg
535	mknod ttyCcfg c $major $minor
536	chown root.wheel ttyCcfg
537        ;;
538
539ttyC*)
540	type=C
541	unit=${i##ttyC}
542	major=67
543	minor=$unit
544        rm -f tty$type$unit
545        mknod tty$type$unit c $major $minor
546        chown root.wheel tty$type$unit
547        ;;
548
549bpf*)
550	unit=${i##*[a-z]}
551	rm -f bpf${unit}
552	mknod bpf${unit} c 22 ${unit}
553	chown root.wheel bpf${unit}
554	;;
555
556pf)
557	rm -f pf
558	mknod pf c 39 0
559	chown root.wheel pf
560	chmod 600 pf
561	;;
562
563tun*)
564	unit=${i##*[a-z]}
565	rm -f tun$unit
566	mknod tun$unit c 23 $unit
567	chmod 600 tun$unit
568	chown root.wheel tun$unit
569	;;
570
571rd*)
572	blk=17; chr=17;
573	umask 2 ; unit=${i##*[a-z]}
574	rm -f rd${unit}a rd${unit}c rrd${unit}a rrd${unit}c
575	mknod rd${unit}a b ${blk} $(( $unit * 16 + 0 ))
576	mknod rd${unit}c b ${blk} $(( $unit * 16 + 2 ))
577	mknod rrd${unit}a c ${chr} $(( $unit * 16 + 0 ))
578	mknod rrd${unit}c c ${chr} $(( $unit * 16 + 2 ))
579	chown root.operator rd${unit}[ac] rrd${unit}[ac]
580	chmod 640 rd${unit}[ac] rrd${unit}[ac]
581	umask 77
582	;;
583
584lkm)
585	rm -f lkm
586	mknod lkm c 24 0
587	chown root.kmem lkm
588	chmod 640 lkm
589	;;
590
591pci*)
592	rm -f pci
593	mknod pci c 71 0
594	chown root.kmem pci
595	chmod 664 pci
596	;;
597
598random|srandom|urandom|prandom|arandom)
599	rm -f random urandom srandom prandom arandom
600	mknod  random c 40 0
601	mknod srandom c 40 1
602	mknod urandom c 40 2
603	mknod prandom c 40 3
604	mknod arandom c 40 4
605	chown root.wheel random srandom urandom prandom arandom
606	chmod 644 random srandom urandom prandom arandom
607	;;
608uk*)
609	unit=${i##*[a-z]}
610	rm -f uk$unit
611	mknod uk$unit c 41 $unit
612	chown root.operator uk$unit
613	chmod 640 uk$unit
614	;;
615
616ss*)
617	unit=${i##*[a-z]}
618	rm -f ss$unit
619	mknod ss$unit c 42 $unit
620	chown root.operator ss$unit
621	chmod 440 ss$unit
622#	backwards compatibility with older PINTs
623	rm -f scan$unit
624	ln -s ss$unit scan$unit
625	;;
626wscons)
627	sh $this wskbd0 wskbd1 wskbd2 wskbd3
628	sh $this wsmouse0 wsmouse1 wsmouse2 wsmouse3
629	sh $this ttyCcfg
630	sh $this wsmux
631	;;
632wsmux|wsmouse|wskbd)
633	rm -f wsmouse wskbd
634	mknod wsmouse c 70 0
635	mknod wskbd c 70 1
636	chown root.wheel wsmouse wskbd
637	chmod 600 wsmouse wskbd
638	;;
639
640wskbd*)
641	unit=${i##*[a-z]}
642	rm -f wskbd${unit}
643	mknod wskbd${unit} c 68 ${unit}
644	# XXX
645	chmod 660 wskbd${unit}
646	chown root.wheel wskbd${unit}
647	;;
648wsmouse*)
649	unit=${i##*[a-z]}
650	rm -f wsmouse${unit}
651	mknod wsmouse${unit} c 69 ${unit}
652	# XXX
653	chmod 660 wsmouse${unit}
654	chown root.wheel wsmouse${unit}
655	;;
656
657xfs*)
658	rm -f xfs$unit
659	mknod xfs$unit c 51 $unit
660	chmod 600 xfs$unit
661	chown root.wheel xfs$unit
662	;;
663
664altq)
665	mkdir -p altq
666	chmod 755 altq
667	unit=0
668	for dev in altq cbq wfq afm fifoq red rio localq hfsc \
669	    cdnr blue priq; do
670		rm -f altq/$dev
671		mknod altq/$dev c 72 $unit
672		chmod 644 altq/$dev
673		unit=$(($unit + 1))
674	done
675	;;
676
677local)
678	umask 0
679	test -s MAKEDEV.local && sh $this.local
680	;;
681
682*)
683	echo $i: unknown device
684esac
685done
686
687