head	1.13;
access;
symbols
	perseant-exfatfs-base-20250801:1.13
	perseant-exfatfs-base-20240630:1.13
	perseant-exfatfs:1.13.0.48
	perseant-exfatfs-base:1.13
	cjep_sun2x:1.13.0.46
	cjep_sun2x-base:1.13
	cjep_staticlib_x-base1:1.13
	cjep_staticlib_x:1.13.0.44
	cjep_staticlib_x-base:1.13
	phil-wifi-20200421:1.13
	phil-wifi-20200411:1.13
	phil-wifi-20200406:1.13
	pgoyette-compat-merge-20190127:1.13
	pgoyette-compat-20190127:1.13
	pgoyette-compat-20190118:1.13
	pgoyette-compat-1226:1.13
	pgoyette-compat-1126:1.13
	pgoyette-compat-1020:1.13
	pgoyette-compat-0930:1.13
	pgoyette-compat-0906:1.13
	pgoyette-compat-0728:1.13
	pgoyette-compat-0625:1.13
	pgoyette-compat-0521:1.13
	pgoyette-compat-0502:1.13
	pgoyette-compat-0422:1.13
	pgoyette-compat-0415:1.13
	pgoyette-compat-0407:1.13
	pgoyette-compat-0330:1.13
	pgoyette-compat-0322:1.13
	pgoyette-compat-0315:1.13
	pgoyette-compat:1.13.0.42
	pgoyette-compat-base:1.13
	perseant-stdc-iso10646:1.13.0.40
	perseant-stdc-iso10646-base:1.13
	prg-localcount2-base3:1.13
	prg-localcount2-base2:1.13
	prg-localcount2-base1:1.13
	prg-localcount2:1.13.0.38
	prg-localcount2-base:1.13
	pgoyette-localcount-20170426:1.13
	bouyer-socketcan-base1:1.13
	pgoyette-localcount-20170320:1.13
	bouyer-socketcan:1.13.0.36
	bouyer-socketcan-base:1.13
	pgoyette-localcount-20170107:1.13
	pgoyette-localcount-20161104:1.13
	localcount-20160914:1.13
	pgoyette-localcount-20160806:1.13
	pgoyette-localcount-20160726:1.13
	pgoyette-localcount:1.13.0.34
	pgoyette-localcount-base:1.13
	netbsd-5-2-3-RELEASE:1.13
	netbsd-5-1-5-RELEASE:1.13
	yamt-pagecache-base9:1.13
	yamt-pagecache-tag8:1.13
	tls-earlyentropy:1.13.0.30
	tls-earlyentropy-base:1.13
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.13
	riastradh-drm2-base3:1.13
	netbsd-5-2-2-RELEASE:1.13
	netbsd-5-1-4-RELEASE:1.13
	netbsd-5-2-1-RELEASE:1.13
	netbsd-5-1-3-RELEASE:1.13
	agc-symver:1.13.0.32
	agc-symver-base:1.13
	tls-maxphys-base:1.13
	yamt-pagecache-base8:1.13
	netbsd-5-2:1.13.0.28
	yamt-pagecache-base7:1.13
	netbsd-5-2-RELEASE:1.13
	netbsd-5-2-RC1:1.13
	yamt-pagecache-base6:1.13
	yamt-pagecache-base5:1.13
	yamt-pagecache-base4:1.13
	netbsd-5-1-2-RELEASE:1.13
	netbsd-5-1-1-RELEASE:1.13
	yamt-pagecache-base3:1.13
	yamt-pagecache-base2:1.13
	yamt-pagecache:1.13.0.26
	yamt-pagecache-base:1.13
	bouyer-quota2-nbase:1.13
	bouyer-quota2:1.13.0.24
	bouyer-quota2-base:1.13
	matt-nb5-pq3:1.13.0.22
	matt-nb5-pq3-base:1.13
	netbsd-5-1:1.13.0.20
	netbsd-5-1-RELEASE:1.13
	netbsd-5-1-RC4:1.13
	netbsd-5-1-RC3:1.13
	netbsd-5-1-RC2:1.13
	netbsd-5-1-RC1:1.13
	netbsd-5-0-2-RELEASE:1.13
	netbsd-5-0-1-RELEASE:1.13
	jym-xensuspend-nbase:1.13
	netbsd-5-0:1.13.0.18
	netbsd-5-0-RELEASE:1.13
	netbsd-5-0-RC4:1.13
	netbsd-5-0-RC3:1.13
	netbsd-5-0-RC2:1.13
	jym-xensuspend:1.13.0.16
	jym-xensuspend-base:1.13
	netbsd-5-0-RC1:1.13
	mjf-devfs2-base2:1.13
	netbsd-5:1.13.0.14
	netbsd-5-base:1.13
	yamt-pf42-base4:1.13
	yamt-pf42-base3:1.13
	hpcarm-cleanup-nbase:1.13
	yamt-pf42-base2:1.13
	yamt-pf42:1.13.0.12
	yamt-pf42-base:1.13
	mjf-devfs2:1.13.0.10
	mjf-devfs2-base:1.13
	keiichi-mipv6:1.13.0.8
	keiichi-mipv6-base:1.13
	mjf-devfs:1.13.0.6
	mjf-devfs-base:1.13
	cube-autoconf:1.13.0.4
	cube-autoconf-base:1.13
	hpcarm-cleanup:1.13.0.2
	hpcarm-cleanup-base:1.13
	unifiedMKDEV-pre:1.12
	fvdl_fs64_base:1.4;
locks; strict;
comment	@# @;


1.13
date	2003.10.24.20.12.05;	author jdolecek;	state dead;
branches;
next	1.12;

1.12
date	2003.10.10.22.47.11;	author jdolecek;	state Exp;
branches;
next	1.11;

1.11
date	2003.10.03.14.35.37;	author dsl;	state Exp;
branches;
next	1.10;

1.10
date	2003.09.05.17.02.55;	author dsl;	state Exp;
branches;
next	1.9;

1.9
date	2003.08.30.11.00.24;	author dsl;	state Exp;
branches;
next	1.8;

1.8
date	2003.08.22.05.06.27;	author itojun;	state Exp;
branches;
next	1.7;

1.7
date	2003.07.27.14.18.00;	author itojun;	state Exp;
branches;
next	1.6;

1.6
date	2003.04.27.13.15.32;	author ragge;	state Exp;
branches;
next	1.5;

1.5
date	2003.04.17.18.03.12;	author fvdl;	state Exp;
branches;
next	1.4;

1.4
date	2002.10.21.04.14.51;	author lukem;	state Exp;
branches;
next	1.3;

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

1.2
date	2002.06.18.13.54.26;	author wiz;	state Exp;
branches;
next	1.1;

1.1
date	2002.06.17.10.50.01;	author drochner;	state Exp;
branches;
next	;


desc
@@


1.13
log
@switch over to unified MAKEDEV
@
text
@#!/bin/sh -

# $NetBSD: MAKEDEV,v 1.12 2003/10/10 22:47:11 jdolecek Exp $
#
###########################################################################
#
#   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
#
# Terminal ports:
#	tty*	serial ports
#
# Pseudo terminals:
#	pty*	set of 62 master and slave pseudo terminals
#
# Special purpose devices:
#	bpf*	packet filter
#	clockctl clock control for non root users
#	fd	file descriptors
#	lkm	loadable kernel modules interface
#	random	Random number generator, see rnd(4)
#	systrace syscall tracer
#	tun*	network tunnel driver
#	pf	PF packet filter
#	crypto	hardware crypto access driver
#

dialin=0
dialout=524288

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
	makedev tty0 tty1 pty0
	makedev bpf0 bpf1 bpf2 bpf3 bpf4 bpf5 bpf6 bpf7
	makedev lkm random
	makedev clockctl
	makedev local
	;;

std)
	rm -f console constty drum mem kmem null zero klog
	mknod console		c 0 0
	mknod constty		c 0 1
	mknod drum		c 3 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 klog		c 6 0	; chmod 600 klog
	mknod ksyms		c 25 0	; chmod 444 ksyms
	if $nofdesc; then
		rm -f tty stdin stdout stderr
		mknod tty	c 1 0	; chmod 666 tty
		mknod stdin	c 11 0	; chmod 666 stdin
		mknod stdout	c 11 1	; chmod 666 stdout
		mknod stderr	c 11 2	; chmod 666 stderr
	fi
	;;


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


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 4 $unit
		mknod pty$name$j c 5 $unit
		names="$names tty$name$j pty$name$j"
		unit=$(($unit + 1))
	done
	chmod 666 $names
	unset names
	;;

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

tty*)
	ounit=${i#???}
	ounit=$(($ounit + 0))
	if [ $ounit -lt 10 ]; then
		unit=0$ounit
		rm -f com$ounit
	else
		unit=$ounit
	fi
	rm -f tty$unit dty$unit
	mknod tty$unit c 10 $(($ounit + $dialin ))
	mknod dty$unit c 10 $(($ounit + $dialout))
	chown uucp tty$unit dty$unit
	;;

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

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

lkm)
	rm -f lkm
	mknod lkm c 14 0
	chgrp kmem lkm
	chmod 640 lkm
	;;

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

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

*)
	echo $i: unknown device
	;;

esac
done

}

makedev $*
@


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


1.11
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.10 2003/09/05 17:02:55 dsl Exp $
d161 1
a161 1
	mknod pf c 26 0
d167 1
a167 1
	mknod crypto c 27 0
@


1.10
log
@Put back port specific majors for ptys
@
text
@d3 1
a3 1
# $NetBSD: MAKEDEV,v 1.9 2003/08/30 11:00:24 dsl Exp $
d71 1
a71 1
	rm -f console drum mem kmem null zero klog
d73 1
@


1.9
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.8 2003/08/22 05:06:27 itojun Exp $
d126 2
a127 2
		mknod tty$name$j c 5 $unit
		mknod pty$name$j c 6 $unit
@


1.8
log
@create /dev/crypto
@
text
@d3 1
a3 1
# $NetBSD: MAKEDEV,v 1.7 2003/07/27 14:18:00 itojun Exp $
d102 11
a112 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
d115 7
a121 1
	while [ $jn -lt 62 ]
d123 2
a124 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))
d126 4
a129 4
		unit=$(($class * 16 + $jn + $skip))
		mknod tty$name$j c 4 $unit
		mknod pty$name$j c 5 $unit
		jn=$(($jn + 1))
d131 2
a132 1
	chmod 666 tty$name[0-9a-zA-Z] pty$name[0-9a-zA-Z]
@


1.7
log
@reserve cdev major # for PF.  ok'ed by technical-exec
@
text
@d3 1
a3 1
# $NetBSD: MAKEDEV,v 1.6 2003/04/27 13:15:32 ragge Exp $
d34 1
d154 6
@


1.6
log
@Add ksyms to "std" devices.
@
text
@d3 1
a3 1
# $NetBSD: MAKEDEV,v 1.5 2003/04/17 18:03:12 fvdl Exp $
d33 1
d147 6
@


1.5
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.4 2002/10/21 04:14:51 lukem Exp $
d77 1
@


1.4
log
@whitespace consistency cleanup
@
text
@d3 1
a3 1
# $NetBSD: MAKEDEV,v 1.3 2002/08/09 02:39:19 lukem Exp $
d15 2
d59 1
a59 1
all)
@


1.3
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.2 2002/06/18 13:54:26 wiz Exp $
d100 4
a103 4
		continue;;
	?)      ;;
	*)      echo "$0: $i: pty unit must be between 0 and 15"
	        continue ;;
@


1.2
log
@Add comments so that the autogenerated MAKEDEV(8) has some contents.
@
text
@d3 1
a3 1
# $NetBSD: MAKEDEV,v 1.1 2002/06/17 10:50:01 drochner Exp $
d160 5
a164 3
	umask 0
	sh $0.local all
	umask 77
@


1.1
log
@make the port more complete
@
text
@d3 29
a31 1
# $NetBSD$
@

