head	1.34;
access;
symbols
	perseant-exfatfs-base-20250801:1.34
	perseant-exfatfs-base-20240630:1.34
	perseant-exfatfs:1.34.0.48
	perseant-exfatfs-base:1.34
	cjep_sun2x:1.34.0.46
	cjep_sun2x-base:1.34
	cjep_staticlib_x-base1:1.34
	cjep_staticlib_x:1.34.0.44
	cjep_staticlib_x-base:1.34
	phil-wifi-20200421:1.34
	phil-wifi-20200411:1.34
	phil-wifi-20200406:1.34
	pgoyette-compat-merge-20190127:1.34
	pgoyette-compat-20190127:1.34
	pgoyette-compat-20190118:1.34
	pgoyette-compat-1226:1.34
	pgoyette-compat-1126:1.34
	pgoyette-compat-1020:1.34
	pgoyette-compat-0930:1.34
	pgoyette-compat-0906:1.34
	pgoyette-compat-0728:1.34
	pgoyette-compat-0625:1.34
	pgoyette-compat-0521:1.34
	pgoyette-compat-0502:1.34
	pgoyette-compat-0422:1.34
	pgoyette-compat-0415:1.34
	pgoyette-compat-0407:1.34
	pgoyette-compat-0330:1.34
	pgoyette-compat-0322:1.34
	pgoyette-compat-0315:1.34
	pgoyette-compat:1.34.0.42
	pgoyette-compat-base:1.34
	perseant-stdc-iso10646:1.34.0.40
	perseant-stdc-iso10646-base:1.34
	prg-localcount2-base3:1.34
	prg-localcount2-base2:1.34
	prg-localcount2-base1:1.34
	prg-localcount2:1.34.0.38
	prg-localcount2-base:1.34
	pgoyette-localcount-20170426:1.34
	bouyer-socketcan-base1:1.34
	pgoyette-localcount-20170320:1.34
	bouyer-socketcan:1.34.0.36
	bouyer-socketcan-base:1.34
	pgoyette-localcount-20170107:1.34
	pgoyette-localcount-20161104:1.34
	localcount-20160914:1.34
	pgoyette-localcount-20160806:1.34
	pgoyette-localcount-20160726:1.34
	pgoyette-localcount:1.34.0.34
	pgoyette-localcount-base:1.34
	netbsd-5-2-3-RELEASE:1.34
	netbsd-5-1-5-RELEASE:1.34
	yamt-pagecache-base9:1.34
	yamt-pagecache-tag8:1.34
	tls-earlyentropy:1.34.0.30
	tls-earlyentropy-base:1.34
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.34
	riastradh-drm2-base3:1.34
	netbsd-5-2-2-RELEASE:1.34
	netbsd-5-1-4-RELEASE:1.34
	netbsd-5-2-1-RELEASE:1.34
	netbsd-5-1-3-RELEASE:1.34
	agc-symver:1.34.0.32
	agc-symver-base:1.34
	tls-maxphys-base:1.34
	yamt-pagecache-base8:1.34
	netbsd-5-2:1.34.0.28
	yamt-pagecache-base7:1.34
	netbsd-5-2-RELEASE:1.34
	netbsd-5-2-RC1:1.34
	yamt-pagecache-base6:1.34
	yamt-pagecache-base5:1.34
	yamt-pagecache-base4:1.34
	netbsd-5-1-2-RELEASE:1.34
	netbsd-5-1-1-RELEASE:1.34
	yamt-pagecache-base3:1.34
	yamt-pagecache-base2:1.34
	yamt-pagecache:1.34.0.26
	yamt-pagecache-base:1.34
	bouyer-quota2-nbase:1.34
	bouyer-quota2:1.34.0.24
	bouyer-quota2-base:1.34
	matt-nb5-pq3:1.34.0.22
	matt-nb5-pq3-base:1.34
	netbsd-5-1:1.34.0.20
	netbsd-5-1-RELEASE:1.34
	netbsd-5-1-RC4:1.34
	netbsd-5-1-RC3:1.34
	netbsd-5-1-RC2:1.34
	netbsd-5-1-RC1:1.34
	netbsd-5-0-2-RELEASE:1.34
	netbsd-5-0-1-RELEASE:1.34
	jym-xensuspend-nbase:1.34
	netbsd-5-0:1.34.0.18
	netbsd-5-0-RELEASE:1.34
	netbsd-5-0-RC4:1.34
	netbsd-5-0-RC3:1.34
	netbsd-5-0-RC2:1.34
	jym-xensuspend:1.34.0.16
	jym-xensuspend-base:1.34
	netbsd-5-0-RC1:1.34
	mjf-devfs2-base2:1.34
	netbsd-5:1.34.0.14
	netbsd-5-base:1.34
	yamt-pf42-base4:1.34
	yamt-pf42-base3:1.34
	hpcarm-cleanup-nbase:1.34
	yamt-pf42-base2:1.34
	yamt-pf42:1.34.0.12
	yamt-pf42-base:1.34
	mjf-devfs2:1.34.0.10
	mjf-devfs2-base:1.34
	keiichi-mipv6:1.34.0.8
	keiichi-mipv6-base:1.34
	mjf-devfs:1.34.0.6
	mjf-devfs-base:1.34
	cube-autoconf:1.34.0.4
	cube-autoconf-base:1.34
	hpcarm-cleanup:1.34.0.2
	hpcarm-cleanup-base:1.34
	netbsd-1-6-PATCH002-RELEASE:1.15.2.1
	netbsd-1-6-PATCH002:1.15.2.1
	netbsd-1-6-PATCH002-RC4:1.15.2.1
	netbsd-1-6-PATCH002-RC3:1.15.2.1
	netbsd-1-6-PATCH002-RC2:1.15.2.1
	netbsd-1-6-PATCH002-RC1:1.15.2.1
	unifiedMKDEV-pre:1.33
	netbsd-1-6-PATCH001:1.15.2.1
	netbsd-1-6-PATCH001-RELEASE:1.15.2.1
	netbsd-1-6-PATCH001-RC3:1.15.2.1
	netbsd-1-6-PATCH001-RC2:1.15.2.1
	netbsd-1-6-PATCH001-RC1:1.15.2.1
	fvdl_fs64_base:1.23
	netbsd-1-6-RELEASE:1.15.2.1
	netbsd-1-6-RC3:1.15.2.1
	netbsd-1-6-RC2:1.15.2.1
	netbsd-1-6-RC1:1.15.2.1
	netbsd-1-6:1.15.0.2
	netbsd-1-6-base:1.15;
locks; strict;
comment	@# @;


1.34
date	2003.10.24.20.12.05;	author jdolecek;	state dead;
branches;
next	1.33;

1.33
date	2003.10.10.22.47.11;	author jdolecek;	state Exp;
branches;
next	1.32;

1.32
date	2003.10.03.14.35.37;	author dsl;	state Exp;
branches;
next	1.31;

1.31
date	2003.09.05.17.02.59;	author dsl;	state Exp;
branches;
next	1.30;

1.30
date	2003.08.30.11.00.29;	author dsl;	state Exp;
branches;
next	1.29;

1.29
date	2003.08.22.05.06.32;	author itojun;	state Exp;
branches;
next	1.28;

1.28
date	2003.07.27.14.18.04;	author itojun;	state Exp;
branches;
next	1.27;

1.27
date	2003.04.27.13.15.37;	author ragge;	state Exp;
branches;
next	1.26;

1.26
date	2003.04.17.18.03.15;	author fvdl;	state Exp;
branches;
next	1.25;

1.25
date	2003.03.31.03.59.03;	author perry;	state Exp;
branches;
next	1.24;

1.24
date	2003.03.30.17.41.54;	author wiz;	state Exp;
branches;
next	1.23;

1.23
date	2002.10.21.04.14.54;	author lukem;	state Exp;
branches;
next	1.22;

1.22
date	2002.10.04.18.53.31;	author elric;	state Exp;
branches;
next	1.21;

1.21
date	2002.08.09.02.39.24;	author lukem;	state Exp;
branches;
next	1.20;

1.20
date	2002.07.18.15.07.49;	author tsutsui;	state Exp;
branches;
next	1.19;

1.19
date	2002.06.18.13.40.20;	author wiz;	state Exp;
branches;
next	1.18;

1.18
date	2002.06.17.16.21.08;	author christos;	state Exp;
branches;
next	1.17;

1.17
date	2002.05.25.16.31.10;	author uch;	state Exp;
branches;
next	1.16;

1.16
date	2002.05.22.15.02.25;	author uch;	state Exp;
branches;
next	1.15;

1.15
date	2002.03.13.01.26.57;	author simonb;	state Exp;
branches
	1.15.2.1;
next	1.14;

1.14
date	2002.03.04.14.02.33;	author lukem;	state Exp;
branches;
next	1.13;

1.13
date	2002.03.03.14.16.03;	author toshii;	state Exp;
branches;
next	1.12;

1.12
date	2002.02.25.07.35.04;	author atatat;	state Exp;
branches;
next	1.11;

1.11
date	2002.02.02.20.58.47;	author tls;	state Exp;
branches;
next	1.10;

1.10
date	2002.02.02.07.04.49;	author tls;	state Exp;
branches;
next	1.9;

1.9
date	2002.01.21.16.19.21;	author abs;	state Exp;
branches;
next	1.8;

1.8
date	2002.01.13.14.18.16;	author manu;	state Exp;
branches;
next	1.7;

1.7
date	2001.12.19.18.30.02;	author wiz;	state Exp;
branches;
next	1.6;

1.6
date	2001.12.19.17.58.07;	author wiz;	state Exp;
branches;
next	1.5;

1.5
date	2001.10.29.22.50.42;	author augustss;	state Exp;
branches;
next	1.4;

1.4
date	2001.10.13.20.20.56;	author augustss;	state Exp;
branches;
next	1.3;

1.3
date	2001.05.10.01.03.03;	author lukem;	state Exp;
branches;
next	1.2;

1.2
date	2001.01.21.18.35.55;	author uch;	state Exp;
branches;
next	1.1;

1.1
date	2001.01.17.05.27.15;	author itojun;	state Exp;
branches;
next	;

1.15.2.1
date	2002.08.10.00.08.38;	author lukem;	state Exp;
branches;
next	;


desc
@@


1.34
log
@switch over to unified MAKEDEV
@
text
@#!/bin/sh -
#
#	$NetBSD: MAKEDEV,v 1.33 2003/10/10 22:47:11 jdolecek Exp $
#
# Copyright (c) 1990 The Regents of the University of California.
# All rights reserved.
#
# Redistribution and use in source and binary forms are permitted provided
# that: (1) source distributions retain this entire copyright notice and
# comment, and (2) distributions including binaries display the following
# acknowledgement:  ``This product includes software developed by the
# University of California, Berkeley and its contributors'' in the
# documentation or other materials provided with the distribution and in
# all advertising materials mentioning features or use of this software.
# Neither the name of the University nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
#	@@(#)MAKEDEV	5.2 (Berkeley) 6/22/90
#
###########################################################################
#
#   PLEASE RUN "cd ../share/man/man8 ; make makedevs"
#   AFTER CHANGING THIS FILE, AND COMMIT THE UPDATED MANPAGE!
#
###########################################################################
#
# Device "make" file.  Valid arguments:
#	all	makes all known devices, including local devices.
#		Tries to make the 'standard' number of each type.
#	init	A set of devices that is used for MFS /dev by init.
#		May be equal to "all".
#	std	standard devices
#	local	configuration specific devices
#
# Tapes:
#	st*	SCSI tapes
#
# Disks:
#	wd*	"winchester" disk drives (ST506,IDE,ESDI,RLL,...)
#	sd*	SCSI disks
#	cd*	SCSI CD-ROM
#	vnd*	"file" pseudo-disks
#	md*	memory pseudo-disk devices
#	ccd*	concatenated disk devices
#	cgd*	cryptographic disk devices
#	raid*	RAIDframe disk devices
#
# Console ports:
#	ttyE*	wscons
#
# Pointing devices:
#	wsmouse* wscons mouse events
#
# Keyboard devices:
#	wskbd*	wscons keyboard events
#
# Terminal ports:
#	scif*	serial communication interface with FIFO
#	sci*	serial communication interface
#	com*	standard PC COM ports			(XXX)
#	tty*	alias for PC COM ports, this is what the system really wants
#
# Pseudo terminals:
#	pty*	set of 62 master and slave pseudo terminals
#	opty	first 16 ptys, to save inodes on install media
#
# Special purpose devices:
#	clockctl clock control for non root users
#	fd	file descriptors
#	bpf*	packet filter
#	ipl	IP Filter
#	pf	PF packet filter
#	crypto	hardware crypto access driver
#	random	Random number generator
#	tun*	network tunnel driver
#	scsibus* SCSI busses, see scsi(4), scsictl(8)
#	ss*	SCSI scanner
#	uk*	unknown SCSI device
#	ch*	SCSI media changer
#	systrace syscall tracer
#

dialin=0
dialout=524288		# high bit of the minor number
callunit=262144

PATH=/sbin:/usr/sbin:/bin:/usr/bin
umask 77

# Check if we have fdesc mounted
if [ -d fd ]; then
	case "`df fd`" in
	*fdesc*) nofdesc=false;;
	*) nofdesc=true;;
	esac
else
	nofdesc=true
fi

makedev()
{

for i
do
case $i in

init|all)
	makedev std wscons fd wd0 wd1 sd0 sd1
	makedev scif0 sci0
	makedev tty0 tty1 tty2 pty0
	makedev bpf0
	makedev md0 random
	makedev scsibus0
#	makedev local
	makedev clockctl
	makedev systrace
	;;

ramdisk)
	makedev std md0
	makedev scif0 sci0
	;;

std)
	rm -f console constty drum mem kmem null zero io klog ksyms
	mknod console		c 2 0
	mknod constty		c 2 1
	mknod drum		c 1 0	; chmod 640 drum ; chgrp kmem drum
	mknod kmem		c 0 1	; chmod 640 kmem ; chgrp kmem kmem
	mknod mem		c 0 0	; chmod 640 mem	; chgrp kmem mem
	mknod null		c 0 2	; chmod 666 null
	mknod zero		c 0 12	; chmod 666 zero
	mknod io		c 0 14	; chmod 640 io ; chgrp kmem io
	mknod klog		c 5 0	; chmod 600 klog
	mknod ksyms		c 37 0	; chmod 444 ksyms
	if $nofdesc; then
		rm -f tty stdin stdout stderr
		mknod tty	c 3 0	; chmod 666 tty
		mknod stdin	c 4 0	; chmod 666 stdin
		mknod stdout	c 4 1	; chmod 666 stdout
		mknod stderr	c 4 2	; chmod 666 stderr
	fi
	;;

wscons)
	makedev ttyE0 ttyE1 ttyE2 ttyE3 ttyE4 ttyE5 ttyE6 ttyE7
	makedev wsmouse0 wsmouse1 wsmouse2 wsmouse3
	makedev wskbd0 wskbd1 wskbd2 wskbd3
	makedev wsmux0 wsmux1 wsmux2 wsmux3
	makedev wsmouse wskbd
	makedev ttyEcfg
	;;

wsmouse)
	rm -f wsmouse
	mknod wsmouse c 29 0
	chmod 600 wsmouse
	;;

wskbd)
	rm -f wskbd
	mknod wskbd c 29 1
	chmod 600 wskbd
	;;

wsmux*)
	unit=${i#wsmux}
	unitctl=$(($unit + 128))
	wsmux=wsmux$unit
	wsmuxctl=wsmuxctl$unit
	major=29
	rm -f $wsmux $wsmuxctl
	mknod $wsmux c $major $unit
	chmod 600 $wsmux
	mknod $wsmuxctl c $major $unitctl
	chmod 200 $wsmuxctl
	;;

ttyEcfg)
	chr=26
	rm -f ttyEcfg
	mknod ttyEcfg c $chr 255
	chmod 600 ttyEcfg
	;;

ttyE*)
	chr=26; unit=${i#ttyE}
	rm -f ttyE$unit
	mknod ttyE$unit c $chr $unit
	;;

wsmouse*)
	unit=${i#wsmouse}
	wsmouse=wsmouse$unit
	major=28
	rm -f $wsmouse
	mknod $wsmouse c $major $unit
	chmod 600 $wsmouse
	;;

wskbd*)
	unit=${i#wskbd}
	wskbd=wskbd$unit
	major=27
	rm -f $wskbd
	mknod $wskbd c $major $unit
	chmod 600 $wskbd
	;;

fd)
	if $nofdesc; then
		rm -f fd/*
		mkdir fd 2>/dev/null
		n=0
		while [ $n -lt 64 ]; do
			mknod fd/$n c 4 $n
			n=$(($n + 1))
		done
		chmod 755 fd
		chmod 666 fd/*
	fi
	;;

md*)
	unit=${i#md}; blk=6; chr=12
	rm -f md${unit}? rmd${unit}?
	mknod md${unit}a  b $blk $(($unit * 8 + 0))
	mknod md${unit}c  b $blk $(($unit * 8 + 2))
#	mknod rmd${unit}a c $chr $(($unit * 8 + 0))
#	mknod rmd${unit}c c $chr $(($unit * 8 + 2))
	chgrp operator md${unit}? #rmd${unit}?
	chmod 640 md${unit}? #rmd${unit}?
	;;

ss*)
	case $i in
	ss*) name=ss;	unit=${i#ss};	chr=22;;
	esac
	rm -f $name$unit n$name$unit en$name$unit
	mknod $name$unit	c $chr $(($unit * 16 + 0))
	mknod n$name$unit	c $chr $(($unit * 16 + 1))
	mknod en$name$unit	c $chr $(($unit * 16 + 3))
	chgrp operator $name$unit n$name$unit en$name$unit
	chmod 640 $name$unit n$name$unit en$name$unit
	;;

ccd*|cgd*|fd*|sd*|vnd*|wd*|raid*)
	case $i in
	ccd*) name=ccd;	unit=${i#ccd};	blk=7;	chr=13;;
	cgd*) name=cgd;	unit=${i#cgd};	blk=10;	chr=36;;
	raid*) name=raid; unit=${i#raid}; blk=9; chr=15;;
	sd*) name=sd;	unit=${i#sd};	blk=3;	chr=17;;
	vnd*) name=vnd;	unit=${i#vnd};	blk=8;	chr=14;;
	wd*) name=wd;	unit=${i#wd};	blk=1;	chr=10;;
	esac
	rm -f $name$unit? r$name$unit?
	mknod ${name}${unit}a	b $blk $(($unit * 16 + 0))
	mknod ${name}${unit}b	b $blk $(($unit * 16 + 1))
	mknod ${name}${unit}c	b $blk $(($unit * 16 + 2))
	mknod ${name}${unit}d	b $blk $(($unit * 16 + 3))
	mknod ${name}${unit}e	b $blk $(($unit * 16 + 4))
	mknod ${name}${unit}f	b $blk $(($unit * 16 + 5))
	mknod ${name}${unit}g	b $blk $(($unit * 16 + 6))
	mknod ${name}${unit}h	b $blk $(($unit * 16 + 7))
	mknod ${name}${unit}i	b $blk $(($unit * 16 + 8))
	mknod ${name}${unit}j	b $blk $(($unit * 16 + 9))
	mknod ${name}${unit}k	b $blk $(($unit * 16 + 10))
	mknod ${name}${unit}l	b $blk $(($unit * 16 + 11))
	mknod ${name}${unit}m	b $blk $(($unit * 16 + 12))
	mknod ${name}${unit}n	b $blk $(($unit * 16 + 13))
	mknod ${name}${unit}o	b $blk $(($unit * 16 + 14))
	mknod ${name}${unit}p	b $blk $(($unit * 16 + 15))
	mknod r${name}${unit}a	c $chr $(($unit * 16 + 0))
	mknod r${name}${unit}b	c $chr $(($unit * 16 + 1))
	mknod r${name}${unit}c	c $chr $(($unit * 16 + 2))
	mknod r${name}${unit}d	c $chr $(($unit * 16 + 3))
	mknod r${name}${unit}e	c $chr $(($unit * 16 + 4))
	mknod r${name}${unit}f	c $chr $(($unit * 16 + 5))
	mknod r${name}${unit}g	c $chr $(($unit * 16 + 6))
	mknod r${name}${unit}h	c $chr $(($unit * 16 + 7))
	mknod r${name}${unit}i	c $chr $(($unit * 16 + 8))
	mknod r${name}${unit}j	c $chr $(($unit * 16 + 9))
	mknod r${name}${unit}k	c $chr $(($unit * 16 + 10))
	mknod r${name}${unit}l	c $chr $(($unit * 16 + 11))
	mknod r${name}${unit}m	c $chr $(($unit * 16 + 12))
	mknod r${name}${unit}n	c $chr $(($unit * 16 + 13))
	mknod r${name}${unit}o	c $chr $(($unit * 16 + 14))
	mknod r${name}${unit}p	c $chr $(($unit * 16 + 15))
	chgrp operator $name$unit? r$name$unit?
	chmod 640 $name$unit? r$name$unit?
	;;

scif*|sci*)
	case $i in
	scif*) name=scif; unit=${i#scif}; chr=31;;
	sci*) name=sci; unit=${i#sci}; chr=32;;
	esac
	rm -f $name$unit
	mknod $name$unit c $chr $unit
	chown uucp $name$unit
	;;

com*|tty*)					# (XXX -- com should die)
	unit=${i#???}
	rm -f com$unit tty0$unit dty0$unit
	mknod tty0$unit c 8 $(($unit + $dialin ))
	mknod dty0$unit c 8 $(($unit + $dialout))
	chown uucp tty0$unit dty0$unit
	;;

opty)
	rm -f ttyp[0-9a-f] ptyp[0-9a-f]
	for j in 0 1 2 3 4 5 6 7 8 9 a b c d e f
	do
		case $j in
		[0-9])	jn=$j ;;
		a)	jn=10 ;;
		b)	jn=11 ;;
		c)	jn=12 ;;
		d)	jn=13 ;;
		e)	jn=14 ;;
		f)	jn=15 ;;
		esac
		mknod ttyp$j c 7 $jn
		mknod ptyp$j c 6 $jn
	done
	chmod 666 ttyp[0-9a-f] ptyp[0-9a-f]
	;;

pty*)
	class=${i#pty}
	set -- p q r s t u v w x y z P Q R S T
	if [ "$class" -ge $# ]; then
		echo "$MAKEDEV: $i: pty unit must be between 0 and 15"
		continue
	fi
	shift $class
	name=$1
	if [ "$name" = v ]; then
		echo "$MAKEDEV: $i: pty unit conflicts with console ttyv0 device."
		continue
	fi
	rm -f tty$name[0-9a-zA-Z] pty$name[0-9a-zA-Z]
	jn=0
	unit=$(($class * 16))
	names=
	set -- - 0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
	while
		shift
		j=$1
		[ -n "$j" ]
	do
		if [ $j = g ]; then
			unit=$(($unit + $class * 30 + 256 - 16))
		fi
		mknod tty$name$j c 7 $unit
		mknod pty$name$j c 6 $unit
		names="$names tty$name$j pty$name$j"
		unit=$(($unit + 1))
	done
	chmod 666 $names
	unset names
	;;

st*)
	case $i in
	st*) name=st;	unit=${i#st};	chr=18;	blk=4;;
	esac
	rm -f $name$unit n$name$unit e$name$unit en$name$unit \
		r$name$unit nr$name$unit er$name$unit enr$name$unit
	mknod $name$unit	b $blk $(($unit * 16 + 0))
	mknod n$name$unit	b $blk $(($unit * 16 + 1))
	mknod e$name$unit	b $blk $(($unit * 16 + 2))
	mknod en$name$unit	b $blk $(($unit * 16 + 3))
	mknod r$name$unit	c $chr $(($unit * 16 + 0))
	mknod nr$name$unit	c $chr $(($unit * 16 + 1))
	mknod er$name$unit	c $chr $(($unit * 16 + 2))
	mknod enr$name$unit	c $chr $(($unit * 16 + 3))
	chgrp operator $name$unit n$name$unit e$name$unit en$name$unit \
		r$name$unit nr$name$unit er$name$unit enr$name$unit
	chmod 660 $name$unit n$name$unit e$name$unit en$name$unit \
		r$name$unit nr$name$unit er$name$unit enr$name$unit
	;;

ch*|uk*)
	case $i in
	ch*) name=ch;	unit=${i#ch};	chr=20;;
	uk*) name=uk;	unit=${i#uk};	chr=21;;
	esac
	rm -f $name$unit
	mknod $name$unit	c $chr $unit
	chgrp operator $name$unit
	chmod 640 $name$unit
	;;

cd*)
	case $i in
	cd*) name=cd;	unit=${i#cd};	chr=19;	blk=5;;
	esac
	rm -f $name$unit? r$name$unit?
	mknod ${name}${unit}a	b $blk $(($unit * 8 + 0))
	mknod ${name}${unit}c	b $blk $(($unit * 8 + 2))
	mknod r${name}${unit}a	c $chr $(($unit * 8 + 0))
	mknod r${name}${unit}c	c $chr $(($unit * 8 + 2))
	chgrp operator $name$unit? r$name$unit?
	chmod 640 $name$unit? r$name$unit?
	;;

bpf*|tun*)
	case $i in
	bpf*) name=bpf;	unit=${i#bpf};	chr=25;;
	tun*) name=tun;	unit=${i#tun};	chr=24;;
	esac
	rm -f $name$unit
	mknod $name$unit	c $chr $unit
	;;

ipl)
	rm -f ipl ipnat ipstate ipauth
	mknod ipl c 23 0
	mknod ipnat c 23 1
	mknod ipstate c 23 2
	mknod ipauth c 23 3
	chmod 600 ipl ipnat ipstate ipauth
	;;

pf)
	rm -f pf
	mknod pf c 161 0
	chmod 600 pf
	;;

crypto)
	rm -f crypto
	mknod crypto c 160 0
	chmod 666 crypto
	;;

random)
	rm -f random urandom
	mknod random c 30 0
	mknod urandom c 30 1
	chmod 444 random
	chmod 644 urandom
	;;


scsibus*)
	unit=${i#scsibus}
	rm -f scsibus$unit
	mknod scsibus$unit c 16 $unit
	chmod 644 scsibus$unit
	;;

clockctl)
	rm -f clockctl
	mknod clockctl c 34 0
	chgrp ntpd clockctl
	chmod 660 clockctl
	;;

systrace)
	rm -f systrace
	mknod systrace c 35 0
	chmod 644 systrace
	;;

local)
	if [ -f "$0.local" ]; then
		umask 0
		sh $0.local all
		umask 77
	fi
	;;

*)
	echo $i: unknown device
	;;

esac
done

}

makedev $*
@


1.33
log
@reassing majors for crypto and pf to use the newly defined MI major range
@
text
@d3 1
a3 1
#	$NetBSD: MAKEDEV,v 1.32 2003/10/03 14:35:37 dsl Exp $
@


1.32
log
@Add a /dev/constty == /dev/console but with minor 1.
Use for tty sessions on 'console' so that output doesn't pinched by anyone
using TIOCCONS to get kernel and system messages.
@
text
@d3 1
a3 1
#	$NetBSD: MAKEDEV,v 1.31 2003/09/05 17:02:59 dsl Exp $
d433 1
a433 1
	mknod pf c 38 0
d439 1
a439 1
	mknod crypto c 39 0
@


1.31
log
@Put back port specific majors for ptys
@
text
@d3 1
a3 1
#	$NetBSD: MAKEDEV,v 1.30 2003/08/30 11:00:29 dsl Exp $
d129 1
a129 1
	rm -f console drum mem kmem null zero io klog ksyms
d131 1
@


1.30
log
@Change the way pseudo tty devices are generated in order to avoid
any pipes and running other commands (eg dd).
Measurable speeds up creating pseudo ttys.
(there has to be a better way than editing 51 files! - tedious at only
6 key presses per file)
@
text
@d3 1
a3 1
#	$NetBSD: MAKEDEV,v 1.29 2003/08/22 05:06:32 itojun Exp $
d359 1
a359 1
		mknod tty$name$j c 5 $unit
@


1.29
log
@create /dev/crypto
@
text
@d3 1
a3 1
#	$NetBSD: MAKEDEV,v 1.28 2003/07/27 14:18:04 itojun Exp $
d335 11
a345 8
	name=`echo pqrstuvwxyzPQRST | dd bs=1 count=1 skip=$class 2>/dev/null`
	case $name in
	v)	echo "$0: $i: pty unit conflicts with console ttyv0 device."
		continue ;;
	?)	;;
	*)	echo "$0: $i: pty unit must be between 0 and 15"
		continue ;;
	esac
d348 7
a354 1
	while [ $jn -lt 62 ]
d356 2
a357 4
		j=`echo 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ | dd bs=1 count=1 skip=$jn 2>/dev/null`
		skip=0
		if [ $jn -ge 16 ]; then
			skip=$(($class * 30 + 256 - 16))
d359 1
a359 2
		unit=$(($class * 16 + $jn + $skip))
		mknod tty$name$j c 7 $unit
d361 2
a362 1
		jn=$(($jn + 1))
d364 2
a365 1
	chmod 666 tty$name[0-9a-zA-Z] pty$name[0-9a-zA-Z]
@


1.28
log
@reserve cdev major # for PF.  ok'ed by technical-exec
@
text
@d3 1
a3 1
#	$NetBSD: MAKEDEV,v 1.27 2003/04/27 13:15:37 ragge Exp $
d77 1
d426 6
@


1.27
log
@Add ksyms to "std" devices.
@
text
@d3 1
a3 1
#	$NetBSD: MAKEDEV,v 1.26 2003/04/17 18:03:15 fvdl Exp $
d76 1
d419 6
@


1.26
log
@Add an 'init' target, that creates the device nodes in the case where
MAKEDEV is being called from init(8) to create an MFS /dev. For most
ports, this is the same as 'all'. The only exceptions are i386 and
x86_64.
@
text
@d3 1
a3 1
#	$NetBSD: MAKEDEV,v 1.25 2003/03/31 03:59:03 perry Exp $
d127 1
a127 1
	rm -f console drum mem kmem null zero io klog
d136 1
@


1.25
log
@make ipl consistently "IP Filter"
@
text
@d3 1
a3 1
#	$NetBSD: MAKEDEV,v 1.24 2003/03/30 17:41:54 wiz Exp $
d34 2
d109 1
a109 1
all)
@


1.24
log
@Miscellaneous fixes from Igor Sobrado, in PRs 20943-20959.
@
text
@d3 1
a3 1
#	$NetBSD: MAKEDEV,v 1.23 2002/10/21 04:14:54 lukem Exp $
d73 1
a73 1
#	ipl	IP filter
@


1.23
log
@whitespace consistency cleanup
@
text
@d3 1
a3 1
#	$NetBSD: MAKEDEV,v 1.22 2002/10/04 18:53:31 elric Exp $
d46 1
a46 1
#	ccd*	contatenated disk devices
d60 2
a61 2
#	scif*	serial communcation interface with FIFO
#	sci*	serial communcation interface
d73 1
a73 1
#	ipl	ip filter
@


1.22
log
@Include cgd on the list of things to be mknod(8)ed on all arches.
@
text
@d3 1
a3 1
#	$NetBSD: MAKEDEV,v 1.21 2002/08/09 02:39:24 lukem Exp $
a327 1
		
d333 4
a336 4
		continue;;
	?)      ;;
	*)      echo "$0: $i: pty unit must be between 0 and 15"
	        continue ;;
@


1.21
log
@- in local), only run $0.local if it is an existing file
  (prevents spurious warning for mfs /dev, amongst other things)
- for mipsco, news68k, newsmips: ensure that "umask 77" is run after $0.local
- for playstation2: add local) target, and use in all)  (for consistency)
@
text
@d3 1
a3 1
#	$NetBSD: MAKEDEV,v 1.20 2002/07/18 15:07:49 tsutsui Exp $
d47 1
d245 1
a245 1
ccd*|fd*|sd*|vnd*|wd*|raid*)
d248 1
@


1.20
log
@Fix cd and md entries since RAW_PART is 2 on sh3 ports.
@
text
@d3 1
a3 1
#	$NetBSD: MAKEDEV,v 1.19 2002/06/18 13:40:20 wiz Exp $
d446 5
a450 3
	umask 0
	sh $0.local all
	umask 77
@


1.19
log
@Update comment on how to regenerate MAKEDEV(8) after changing the
MAKEDEV script. Not that anybody acts on it, but it's nicer if it's correct.
@
text
@d3 1
a3 1
#	$NetBSD: MAKEDEV,v 1.18 2002/06/17 16:21:08 christos Exp $
d225 1
a225 1
	mknod md${unit}d  b $blk $(($unit * 8 + 3))
d227 1
a227 1
#	mknod rmd${unit}d c $chr $(($unit * 8 + 3))
d391 1
a391 1
	mknod ${name}${unit}d	b $blk $(($unit * 8 + 3))
d393 1
a393 1
	mknod r${name}${unit}d	c $chr $(($unit * 8 + 3))
@


1.18
log
@Add device creation support for systrace.
@
text
@d3 1
a3 1
#	$NetBSD: MAKEDEV,v 1.17 2002/05/25 16:31:10 uch Exp $
d26 1
a26 1
#   PLEASE RUN "cd ../share/man/man8 ; perl5 MAKEDEV2manpage.pl"
@


1.17
log
@type miss of i partition: 9->8
@
text
@d3 1
a3 1
#	$NetBSD: MAKEDEV,v 1.16 2002/05/22 15:02:25 uch Exp $
d79 1
d115 1
d437 6
@


1.16
log
@increase partition to 16.
@
text
@d3 1
a3 1
#	$NetBSD: MAKEDEV,v 1.15 2002/03/13 01:26:57 simonb Exp $
d259 1
a259 1
	mknod ${name}${unit}i	b $blk $(($unit * 16 + 9))
@


1.15
log
@Remove trailing semicolons from lines that don't need them.
TABify many lines.
@
text
@d3 1
a3 1
#	$NetBSD: MAKEDEV,v 1.14 2002/03/04 14:02:33 lukem Exp $
d59 2
d107 1
d117 2
a118 1
	makedev floppy md0
d251 32
a282 16
	mknod ${name}${unit}a	b $blk $(($unit * 8 + 0))
	mknod ${name}${unit}b	b $blk $(($unit * 8 + 1))
	mknod ${name}${unit}c	b $blk $(($unit * 8 + 2))
	mknod ${name}${unit}d	b $blk $(($unit * 8 + 3))
	mknod ${name}${unit}e	b $blk $(($unit * 8 + 4))
	mknod ${name}${unit}f	b $blk $(($unit * 8 + 5))
	mknod ${name}${unit}g	b $blk $(($unit * 8 + 6))
	mknod ${name}${unit}h	b $blk $(($unit * 8 + 7))
	mknod r${name}${unit}a	c $chr $(($unit * 8 + 0))
	mknod r${name}${unit}b	c $chr $(($unit * 8 + 1))
	mknod r${name}${unit}c	c $chr $(($unit * 8 + 2))
	mknod r${name}${unit}d	c $chr $(($unit * 8 + 3))
	mknod r${name}${unit}e	c $chr $(($unit * 8 + 4))
	mknod r${name}${unit}f	c $chr $(($unit * 8 + 5))
	mknod r${name}${unit}g	c $chr $(($unit * 8 + 6))
	mknod r${name}${unit}h	c $chr $(($unit * 8 + 7))
d285 10
@


1.15.2.1
log
@Pull up revision 1.21 (requested by lukem):
- in local), only run $0.local if it is an existing file
  (prevents spurious warning for mfs /dev, amongst other things)
- for mipsco, news68k, newsmips: ensure that "umask 77" is run after $0.local
- for playstation2: add local) target, and use in all)  (for consistency)
@
text
@d3 1
a3 1
#	$NetBSD$
d408 3
a410 5
	if [ -f "$0.local" ]; then
		umask 0
		sh $0.local all
		umask 77
	fi
@


1.14
log
@various cleanups inspired by etc.i386/MAKEDEV:

* use "ln -fs foo bar" instead of "rm -f bar; ln -s foo bar"

* remove unnecessary chown root or chgrp wheel directives; older code here
  didn't bother doing this, so why be inconsistent

* when making directories, don't use -p and don't redirect stdout to /dev/null

* clean up whitespace

* wrap the main parser code in a function makedev(), and call makedev
  instead of "sh $0". (this is a bit faster)

* don't barf when we have fdesc mounted; just skip the devices fdesc provides


(these files should really be automagically generated...)
@
text
@d3 1
a3 1
#	$NetBSD: MAKEDEV,v 1.13 2002/03/03 14:16:03 toshii Exp $
d57 1
a57 1
# 
d216 1
a216 1
	unit=${i#md}; blk=6; chr=12;
d224 1
a224 1
	;;      
d291 1
a291 1
	chmod 666 ttyp[0-9a-f] ptyp[0-9a-f] 
d327 1
a327 1
		r$name$unit nr$name$unit er$name$unit enr$name$unit 
d337 1
a337 1
		r$name$unit nr$name$unit er$name$unit enr$name$unit 
d339 1
a339 1
		r$name$unit nr$name$unit er$name$unit enr$name$unit 
d394 1
a394 1
	unit=${i#scsibus}; 
@


1.13
log
@Use a tab instead of 7 spaces.
@
text
@d3 1
a3 1
#	$NetBSD: MAKEDEV,v 1.12 2002/02/25 07:35:04 atatat Exp $
d86 13
a100 1

d104 7
a110 7
	sh $0 std wscons fd wd0 wd1 sd0 sd1
	sh $0 tty0 tty1 tty2 pty0
	sh $0 bpf0
	sh $0 md0 random
	sh $0 scsibus0
#	sh $0 local
	sh $0 clockctl
d114 1
a114 1
	sh $0 floppy md0
d118 1
a118 1
	rm -f console drum mem kmem null zero io tty klog stdin stdout stderr
a125 1
	mknod tty		c 3 0	; chmod 666 tty
d127 7
a133 3
	mknod stdin		c 4 0	; chmod 666 stdin
	mknod stdout		c 4 1	; chmod 666 stdout
	mknod stderr		c 4 2	; chmod 666 stderr
d137 6
a142 6
	sh $0 ttyE0 ttyE1 ttyE2 ttyE3 ttyE4 ttyE5 ttyE6 ttyE7
	sh $0 wsmouse0 wsmouse1 wsmouse2 wsmouse3
	sh $0 wskbd0 wskbd1 wskbd2 wskbd3
	sh $0 wsmux0 wsmux1 wsmux2 wsmux3
	sh $0 wsmouse wskbd
	sh $0 ttyEcfg
a147 1
	chown root.wheel wsmouse
a153 1
	chown root.wheel wskbd
a164 1
	chown root.wheel $wsmux
a166 1
	chown root.wheel $wsmuxctl
a173 1
	chown root.wheel ttyEcfg
a180 1
	chown root.wheel ttyE$unit
a188 1
	chown root.wheel $wsmouse
a197 1
	chown root.wheel $wskbd
d202 11
a212 10
	rm -f fd/*
	mkdir fd > /dev/null 2>&1
	n=0
	while [ $n -lt 64 ]; do
		mknod fd/$n c 4 $n
		n=$(($n + 1))
	done
	chown -R root.wheel fd
	chmod 755 fd
	chmod 666 fd/*
d272 1
a272 1
	chown uucp.wheel tty0$unit dty0$unit
a290 1
	chgrp wheel ttyp[0-9a-f] ptyp[0-9a-f]
d319 1
a319 2
        chgrp wheel tty$name[0-9a-zA-Z] pty$name[0-9a-zA-Z]
        chmod 666 tty$name[0-9a-zA-Z] pty$name[0-9a-zA-Z]
a372 1
	chown root.wheel $name$unit
a380 1
	chown root.wheel ipl ipnat ipstate ipauth
a387 1
	chown root.wheel random urandom
a396 1
	chown root:wheel scsibus$unit
d403 1
a403 1
	chown root.ntpd clockctl
d419 4
@


1.12
log
@Change a 62 to a 16, so that the proper number of slots is skipped.
Fixes PR 15650.
@
text
@d3 1
a3 1
#	$NetBSD: MAKEDEV,v 1.11 2002/02/02 20:58:47 tls Exp $
d67 1
a67 1
#       clockctl clock control for non root users
@


1.11
log
@Fix minor mistake made while increasing number of pty devices: where we had
"pty0 pty1 pty2 pty3" before, for a total of 64 device nodes, we now want
just "pty0" for a total of 62 -- the original commit had "pty0 pty1" for a
total of 124, which ate too many inodes and made "ls /dev" a bit messy.
@
text
@d3 1
a3 1
#	$NetBSD: MAKEDEV,v 1.10 2002/02/02 07:04:49 tls Exp $
d307 1
a307 1
		unit=$(($class * 62 + $jn + $skip))
@


1.10
log
@Add support for many more (930 or 992) ptys than the current 256.

Changes taken from the i386 MAKEDEV.  Note that the unusual use of 'dd'
to index an array was chosen because 'dd' is on all ports' install media.

This form of this change comes from Andrew Brown; the original idea to
bump the number of ptys this way comes from Brian Marcotte at Panix.
@
text
@d3 1
a3 1
#	$NetBSD: MAKEDEV,v 1.9 2002/01/21 16:19:21 abs Exp $
d93 1
a93 1
	sh $0 tty0 tty1 tty2 pty0 pty1
@


1.9
log
@Move 'wscons' to directly after 'std'. Various MAKEDEVs had it pretty much
at the end, and as wscons (actually ttyE0) is required to login on the console,
it is probably better that an out of space MAKEDEV fail on some other device.
@
text
@d3 1
a3 1
#	$NetBSD: MAKEDEV,v 1.8 2002/01/13 14:18:16 manu Exp $
d63 2
a64 1
#	pty*	set of 16 master and slave pseudo terminals
d93 1
a93 1
	sh $0 tty0 tty1 tty2 pty0 pty1 pty2 pty3
d267 21
d290 5
a294 17
	case $class in
	0)      name=p;;
	1)      name=q;;
	2)      name=r;;
	3)      name=s;;
	4)      name=t;;
	5)      name=u;;
	6)      name=v;;
	7)      name=w;;
	8)      name=x;;
	9)      name=y;;
	10)     name=z;;
	11)     name=P;;
	12)     name=Q;;
	13)     name=R;;
	14)     name=S;;
	15)     name=T;;
d298 3
a300 2
	rm -f tty$name[0-9a-f] pty$name[0-9a-f]
	for j in 0 1 2 3 4 5 6 7 8 9 a b c d e f
d302 6
a307 10
		case $j in
		[0-9])  jn=$j ;;
		a)      jn=10 ;;
		b)      jn=11 ;;
		c)      jn=12 ;;
		d)      jn=13 ;;
		e)      jn=14 ;;
		f)      jn=15 ;;
		esac
		unit=$(($class * 16 + $jn))
d310 1
d312 2
a313 2
        chgrp wheel tty$name? pty$name?
        chmod 666 tty$name? pty$name?
@


1.8
log
@Added clockctl
@
text
@d3 1
a3 1
#	$NetBSD: MAKEDEV,v 1.7 2001/12/19 18:30:02 wiz Exp $
d91 1
a91 1
	sh $0 std fd wd0 wd1 sd0 sd1
a95 1
	sh $0 wscons
@


1.7
log
@Standardize ch* and uk* descriptions.
@
text
@d3 1
a3 1
#	$NetBSD: MAKEDEV,v 1.6 2001/12/19 17:58:07 wiz Exp $
d66 1
d98 1
d389 7
@


1.6
log
@Standardize scsibus* description.
@
text
@d3 1
a3 1
#	$NetBSD: MAKEDEV,v 1.5 2001/10/29 22:50:42 augustss Exp $
d73 2
a74 2
#	uk*	SCSI unknown
#	ch*	SCSI changer
@


1.5
log
@Create wsmuxN and wsmuxctlN together.
Use separate nodes for wsmouse and wskbd.
@
text
@d3 1
a3 1
#	$NetBSD: MAKEDEV,v 1.4 2001/10/13 20:20:56 augustss Exp $
d71 1
a71 1
#	scsibus* SCSI busses
@


1.4
log
@Allow creation of wsmuxctl devices.
@
text
@d3 1
a3 1
#	$NetBSD: MAKEDEV,v 1.3 2001/05/10 01:03:03 lukem Exp $
d123 2
d126 29
a154 1
	sh $0 wsmux0 wsmux1
a189 21
	;;

wsmuxctl*)
	unit=${i#wsmuxctl}
	minor=$(($unit + 128))
	wsmuxctl=wsmuxctl$unit
	major=29
	rm -f $wsmuxctl
	mknod $wsmuxctl c $major $minor
	chown root.wheel $wsmuxctl
	chmod 200 $wsmuxctl
	;;

wsmux*)
	unit=${i#wsmux}
	wsmux=wsmux$unit
	major=29
	rm -f $wsmux
	mknod $wsmux c $major $unit
	chown root.wheel $wsmux
	chmod 600 $wsmux
@


1.3
log
@don't prevent pty6 from creating ttyv*, since there's no custom console on ttyv
@
text
@d3 1
a3 1
#	$NetBSD: MAKEDEV,v 1.2 2001/01/21 18:35:55 uch Exp $
d160 11
@


1.2
log
@hpcsh original device file
@
text
@d3 1
a3 1
#	$NetBSD$
d254 1
a254 3
	6)      name=v
		echo "$0: $i: pty unit conflicts with console ttyv* devices."
		continue;;
@


1.1
log
@for MACHINE=hpcsh. straight copy of evbsh3.
@
text
@a7 2
# Written and contributed by W. Jolitz 12/90
#
d24 7
a33 1
#	floppy	devices to be put on install floppies
a37 1
#	wt*	QIC-interfaced (e.g. not SCSI) 3M cartridge tape
a41 1
#	fd*	"floppy" disk drives (3 1/2", 5 1/4")
a43 1
#	mcd*	Mitsumi CD-ROM
d45 1
a45 1
#	md*	memory pseudo-disks
d47 1
d50 4
a53 2
#	ttyv0	pccons or pcvt screen 0
#	ttyv*	pcvt
d55 3
a64 2
# Call units:
#
a68 1
#	cbq	Alternate Queueing (ALTQ)
a69 4
#	speaker	pc speaker				(XXX - installed)
#	lkm	loadable kernel modules interface
#	audio	audio device
#	apm	power management device
d71 1
a71 1
#	joy*	joystick device
d77 4
d83 1
d86 1
d90 7
a96 7
	sh $0 std fd fd0
	sh $0 tty0 tty1 pty0 pty1
	sh $0 vnd0 vnd1
	sh $0 ttyv0 bpf0 bpf1 bpf2 bpf3 tun0 tun1 ipl
	sh $0 ccd0 ccd1 ccd2 ccd3 md0 random
	sh $0 lkm audio local
	sh $0 ttyv0 ttyv1 ttyv2 ttyv3 ttyv4 ttyv5 ttyv6 ttyv7 ttyv8
d100 1
a100 3
	sh $0 std md0
	sh $0 tty0 tty1 pty0 pty1
	sh $0 ttyv0 bpf0 bpf1 bpf2 bpf3 tun0 tun1 ipl
d105 65
a169 25
	mknod console		c 0 0
	mknod drum		c 4 0	; chmod 640 drum ; chgrp kmem drum
	mknod kmem		c 2 1	; chmod 640 kmem ; chgrp kmem kmem
	mknod mem		c 2 0	; chmod 640 mem	; chgrp kmem mem
	mknod null		c 2 2	; chmod 666 null
	mknod zero		c 2 12	; chmod 666 zero
	mknod io		c 2 14	; chmod 640 io ; chgrp kmem io
	mknod tty		c 1 0	; chmod 666 tty
	mknod klog		c 7 0	; chmod 600 klog
	mknod stdin		c 22 0	; chmod 666 stdin
	mknod stdout		c 22 1	; chmod 666 stdout
	mknod stderr		c 22 2	; chmod 666 stderr
	;;

ttyv*)
	chr=12; unit=${i#ttyv}
	rm -f ttyv$unit
	mknod ttyv$unit	c $chr $unit
	chown root.wheel ttyv$unit
#	case $unit in
#	0)
#		rm -f vga
#		ln -s ttyv0 vga
#		;;
#	esac
d177 1
a177 1
		mknod fd/$n c 22 $n
d186 11
d198 1
a198 1
	md*) name=md;	unit=${i#md};	chr=24;	blk=17;;
d200 6
a205 9
	rm -f $name$unit? r$name$unit?
	mknod ${name}${unit}a	b $blk $(($unit * 8 + 0))
	mknod ${name}${unit}b	b $blk $(($unit * 8 + 1))
	mknod ${name}${unit}c	b $blk $(($unit * 8 + 2))
	mknod r${name}${unit}a	c $chr $(($unit * 8 + 0))
	mknod r${name}${unit}b	c $chr $(($unit * 8 + 1))
	mknod r${name}${unit}c	c $chr $(($unit * 8 + 2))
	chgrp operator $name$unit? r$name$unit?
	chmod 640 $name$unit? r$name$unit?
d208 1
a208 1
ccd*|fd*|sd*|vnd*|wd*)
d210 5
a214 5
	ccd*) name=ccd;	unit=${i#ccd};	blk=16;	chr=18;;
	fd*) name=fd;	unit=${i#fd};	blk=2;	chr=9;;
	sd*) name=sd;	unit=${i#sd};	blk=4;	chr=13;;
	vnd*) name=vnd;	unit=${i#vnd};	blk=14;	chr=41;;
	wd*) name=wd;	unit=${i#wd};	blk=0;	chr=3;;
d239 4
a242 3
	rm -f com$unit tty0$unit
	mknod tty0$unit c 8 $unit
	chown uucp.wheel tty0$unit
d282 1
a282 1
		mknod tty$name$j c 5 $unit
d289 1
a289 1
cd*|mcd*)
d291 32
a322 2
	cd*) name=cd;	unit=${i#cd};	chr=15;	blk=6;;
	mcd*) name=mcd;	unit=${i#mcd};	chr=39;	blk=7;;
d333 1
a333 1
bpf*|tun*|mms*|lms*|pms*|joy*)
d335 2
a336 6
	bpf*) name=bpf;	unit=${i#bpf};	chr=23;;
	tun*) name=tun;	unit=${i#tun};	chr=40;;
	mms*) name=mms;	unit=${i#mms};	chr=35;;
	lms*) name=lms;	unit=${i#lms};	chr=36;;
	pms*) name=pms;	unit=${i#pms};	chr=37;;
	joy*) name=joy;	unit=${i#joy};	chr=26;;
d345 4
a348 4
	mknod ipl c 44 0
	mknod ipnat c 44 1
	mknod ipstate c 44 2
	mknod ipauth c 44 3
a352 24
lkm)
	rm -f lkm
	mknod lkm c 28 0
	chown root.kmem lkm
	chmod 640 lkm
	;;

audio*)
	unit=${i#audio}
	audio=audio$unit
	sound=sound$unit
	mixer=mixer$unit
	major=42
	audioctl=audioctl$unit
	if [ "$unit" = "" ]; then unit=0; fi
	rm -f $audio $sound $mixer $audioctl
	mknod $sound    c $major $(($unit + 0))
	mknod $audio    c $major $(($unit + 128))
	mknod $mixer    c $major $(($unit + 16))
	mknod $audioctl c $major $(($unit + 192))
	chown root.wheel $audio $sound $mixer $audioctl
	chmod 666 $audio $sound $mixer $audioctl
	;;

d355 2
a356 2
	mknod random c 46 0
	mknod urandom c 46 1
d362 9
d373 1
a373 1
	#sh $0.local all
@

