xref: /original-bsd/etc/etc.hp300/MAKEDEV (revision a4e9879d)
12ee6fecfSbostic#!/bin/sh -
22ee6fecfSbostic#
3*a4e9879dSbostic#	@(#)MAKEDEV	8.1 (Berkeley) 06/09/93
42ee6fecfSbostic#
53d4cdabdSbostic
62ee6fecfSbostic# Device "make" file.  Valid arguments:
72ee6fecfSbostic#	std	standard devices
82ee6fecfSbostic#	local	configuration specific devices
92ee6fecfSbostic# Tapes:
102ee6fecfSbostic#	ct*	HP300 HP-IB cartridge tape
117210b43aSmckusick#	st*	Exabyte tape
122ee6fecfSbostic# Disks:
132ee6fecfSbostic#	cd*	"concatenated" pseudo-disks
142ee6fecfSbostic#	rd*	HP300 HP-IB disks
152ee6fecfSbostic#	sd*	HP300 SCSI disks
16b81b2304Sbostic#	vnd*	"file" pseudo-disks
172ee6fecfSbostic# Terminal multiplexors:
182ee6fecfSbostic#	dca*	HP200/300 single port serial interface
192ee6fecfSbostic#	dcm*	HP200/300 4 port serial mux interface
202ee6fecfSbostic# Pseudo terminals:
212ee6fecfSbostic#	pty*	set of 16 master and slave pseudo terminals
222ee6fecfSbostic# Printers:
232ee6fecfSbostic# Call units:
242ee6fecfSbostic# Special purpose devices:
252ee6fecfSbostic#	flog*	kernel logging device
262ee6fecfSbostic#	grf*	raw interface to HP300 graphics devices
272ee6fecfSbostic#	ite*	terminal emulator interface to HP300 graphics devices
282ee6fecfSbostic#	hil	HP300 HIL input devices
29b81b2304Sbostic
30e83bae91SmckusickPATH=/sbin:/bin/:/usr/bin:/usr/sbin
312ee6fecfSbosticumask 77
322ee6fecfSbosticfor i
332ee6fecfSbosticdo
342ee6fecfSbosticcase $i in
352ee6fecfSbostic
362ee6fecfSbosticstd)
37b81b2304Sbostic	mknod console		c 0 0
38b81b2304Sbostic	mknod drum		c 3 0	; chmod 640 drum ; chgrp kmem drum
39b81b2304Sbostic	mknod kmem		c 2 1	; chmod 640 kmem ; chgrp kmem kmem
40b81b2304Sbostic	mknod mem		c 2 0	; chmod 640 mem ; chgrp kmem mem
41b81b2304Sbostic	mknod null		c 2 2	; chmod 666 null
423440f2bcSmarc	mknod zero      	c 2 12  ; chmod 666 zero
43b81b2304Sbostic	mknod tty		c 1 0	; chmod 666 tty
44b81b2304Sbostic	mknod klog		c 6 0	; chmod 600 klog
4573bcfac7Smckusick	mknod stdin		c 21 0	; chmod 666 stdin
4673bcfac7Smckusick	mknod stdout		c 21 1	; chmod 666 stdout
4773bcfac7Smckusick	mknod stderr		c 21 2	; chmod 666 stderr
48b81b2304Sbostic	mkdir fd > /dev/null 2>&1
49b81b2304Sbostic	(cd fd && eval `echo "" | awk ' BEGIN { \
50b81b2304Sbostic		for (i = 0; i < 64; i++) \
5173bcfac7Smckusick			printf("mknod %d c 21 %d;", i, i)}'`)
52b81b2304Sbostic	chown -R bin.bin fd
53b81b2304Sbostic	chmod 555 fd
54b81b2304Sbostic	chmod 666 fd/*
552ee6fecfSbostic	;;
562ee6fecfSbostic
577210b43aSmckusickct*|st*)
582ee6fecfSbostic	umask 0 ; unit=`expr $i : '..\(.*\)'`
592ee6fecfSbostic	case $i in
607210b43aSmckusick	ct*) name=ct; blk=0; chr=7;;
617210b43aSmckusick	st*) name=st; blk=6; chr=20;;
622ee6fecfSbostic	esac
632ee6fecfSbostic	case $unit in
642ee6fecfSbostic	0|1|2|3|4|5|6|7)
652ee6fecfSbostic		four=`expr $unit + 4` ; eight=`expr $unit + 8`
662ee6fecfSbostic		twelve=`expr $unit + 12`; twenty=`expr $unit + 20`
672ee6fecfSbostic		#
682ee6fecfSbostic		# block devices don't work so don't make them
697210b43aSmckusick		#mknod ${name}${unit}	b $blk $unit
707210b43aSmckusick		#mknod ${name}${four}	b $blk $four
717210b43aSmckusick		#mknod ${name}${eight}	b $blk $eight
727210b43aSmckusick		#mknod ${name}${twelve}	b $blk $twelve
737210b43aSmckusick		#mknod n${name}${unit}	b $blk $four ;: sanity w/pdp11 v7
747210b43aSmckusick		#mknod n${name}${eight}	b $blk $twelve ;: ditto
752ee6fecfSbostic		#
767210b43aSmckusick		mknod r${name}${unit}	c $chr $unit
777210b43aSmckusick		mknod r${name}${four}	c $chr $four
787210b43aSmckusick		mknod r${name}${eight}	c $chr $eight
797210b43aSmckusick		mknod r${name}${twelve}	c $chr $twelve
807210b43aSmckusick		ln r${name}${four} nr${name}${unit} ;: sanity w/pdp11 v7
817210b43aSmckusick		ln r${name}${twelve} nr${name}${eight} ;: ditto
822ee6fecfSbostic		;;
832ee6fecfSbostic	*)
842ee6fecfSbostic		echo bad unit for tape in: $1
852ee6fecfSbostic		;;
862ee6fecfSbostic	esac
872ee6fecfSbostic	umask 77
882ee6fecfSbostic	;;
892ee6fecfSbostic
902ee6fecfSbosticcd*|fd*|rd*|sd*)
912ee6fecfSbostic	umask 2 ; unit=`expr $i : '..\(.*\)'`
922ee6fecfSbostic	case $i in
932ee6fecfSbostic	rd*) name=rd; blk=2; chr=9;;
942ee6fecfSbostic	sd*) name=sd; blk=4; chr=8;;
952ee6fecfSbostic	cd*) name=cd; blk=5; chr=17;;
96b81b2304Sbostic	vnd*) name=vnd; blk=6; chr=19;;
972ee6fecfSbostic	esac
982ee6fecfSbostic	case $unit in
992ee6fecfSbostic	0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|\
1002ee6fecfSbostic	17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)
101b81b2304Sbostic		mknod ${name}${unit}c	b $blk `expr $unit '*' 8 + 2`
102b81b2304Sbostic		mknod r${name}${unit}c	c $chr `expr $unit '*' 8 + 2`
103b81b2304Sbostic		if [ $name != cd -a $name != vnd ]
1042ee6fecfSbostic		then
105b81b2304Sbostic		mknod ${name}${unit}a	b $blk `expr $unit '*' 8 + 0`
106b81b2304Sbostic		mknod ${name}${unit}b	b $blk `expr $unit '*' 8 + 1`
107b81b2304Sbostic		mknod ${name}${unit}d	b $blk `expr $unit '*' 8 + 3`
108b81b2304Sbostic		mknod ${name}${unit}e	b $blk `expr $unit '*' 8 + 4`
109b81b2304Sbostic		mknod ${name}${unit}f	b $blk `expr $unit '*' 8 + 5`
110b81b2304Sbostic		mknod ${name}${unit}g	b $blk `expr $unit '*' 8 + 6`
111b81b2304Sbostic		mknod ${name}${unit}h	b $blk `expr $unit '*' 8 + 7`
112b81b2304Sbostic		mknod r${name}${unit}a	c $chr `expr $unit '*' 8 + 0`
113b81b2304Sbostic		mknod r${name}${unit}b	c $chr `expr $unit '*' 8 + 1`
114b81b2304Sbostic		mknod r${name}${unit}d	c $chr `expr $unit '*' 8 + 3`
115b81b2304Sbostic		mknod r${name}${unit}e	c $chr `expr $unit '*' 8 + 4`
116b81b2304Sbostic		mknod r${name}${unit}f	c $chr `expr $unit '*' 8 + 5`
117b81b2304Sbostic		mknod r${name}${unit}g	c $chr `expr $unit '*' 8 + 6`
118b81b2304Sbostic		mknod r${name}${unit}h	c $chr `expr $unit '*' 8 + 7`
1192ee6fecfSbostic		fi
1202ee6fecfSbostic		chgrp operator ${name}${unit}[a-h] r${name}${unit}[a-h]
1212ee6fecfSbostic		chmod 640 ${name}${unit}[a-h] r${name}${unit}[a-h]
1222ee6fecfSbostic		;;
1232ee6fecfSbostic	*)
1242ee6fecfSbostic		echo bad unit for disk in: $i
1252ee6fecfSbostic		;;
1262ee6fecfSbostic	esac
1272ee6fecfSbostic	umask 77
1282ee6fecfSbostic	;;
1292ee6fecfSbostic
1302ee6fecfSbosticdca*)
1312ee6fecfSbostic	unit=`expr $i : 'dca\(.*\)'`
1322ee6fecfSbostic	case $unit in
1332ee6fecfSbostic	0)
134b81b2304Sbostic		mknod tty0 c 12 0
1352ee6fecfSbostic		;;
1362ee6fecfSbostic	*)
1372ee6fecfSbostic		echo bad unit for dca in: $i
1382ee6fecfSbostic		;;
1392ee6fecfSbostic	esac
1402ee6fecfSbostic	;;
1412ee6fecfSbostic
1422ee6fecfSbosticdcm*)
1432ee6fecfSbostic	unit=`expr $i : 'dcm\(.*\)'`
1442ee6fecfSbostic	case $unit in
1452ee6fecfSbostic	0|1|2|3)
1462ee6fecfSbostic		eval `echo $unit | awk ' { unit = $1; u = 4 * $1 } END {
1472ee6fecfSbostic		for (i = 0; i < 4; i++)
148b81b2304Sbostic		printf("mknod tty0%x c 15 %d; ",u+i,u+i); }'`
1492ee6fecfSbostic	;;
1502ee6fecfSbostic	*)
1512ee6fecfSbostic		echo bad unit for dcm in: $i
1522ee6fecfSbostic		;;
1532ee6fecfSbostic	esac
1542ee6fecfSbostic	;;
1552ee6fecfSbostic
1562ee6fecfSbosticite*)
1572ee6fecfSbostic	unit=`expr $i : 'ite\(.*\)'`
1582ee6fecfSbostic	case $unit in
1592ee6fecfSbostic	0|1|2|3)
160b81b2304Sbostic		mknod ttye${unit} c 13 ${unit}
1612ee6fecfSbostic		;;
1622ee6fecfSbostic	*)
1632ee6fecfSbostic		echo bad unit for ite in: $i
1642ee6fecfSbostic		;;
1652ee6fecfSbostic	esac
1662ee6fecfSbostic	;;
1672ee6fecfSbostic
1682ee6fecfSbosticgrf*)
1692ee6fecfSbostic	unit=`expr $i : 'grf\(.*\)'`
1702ee6fecfSbostic	case $unit in
1712ee6fecfSbostic	0|1|2|3)
172b81b2304Sbostic		mknod grf${unit} c 10 ${unit}; chmod 666 grf${unit}
1732ee6fecfSbostic		echo "grf${unit}: use MAKEDEV.hpux to make HP-UX names for device"
1742ee6fecfSbostic		;;
1752ee6fecfSbostic	*)
1762ee6fecfSbostic		echo bad unit for grf in: $i
1772ee6fecfSbostic		;;
1782ee6fecfSbostic	esac
1792ee6fecfSbostic	;;
1802ee6fecfSbostic
1812ee6fecfSbostichil)
1822ee6fecfSbostic	for unit in 0 1 2 3 4 5 6 7
1832ee6fecfSbostic	do
184b81b2304Sbostic		mknod hil${unit} c 14 ${unit}
1852ee6fecfSbostic		if [ -f /usr/local/hilinfo ]
1862ee6fecfSbostic		then
1872ee6fecfSbostic			case `/usr/local/hilinfo -t hil${unit}` in
1882ee6fecfSbostic			mouse)
1892ee6fecfSbostic				if [ ! -f locator ]
1902ee6fecfSbostic				then
1912ee6fecfSbostic					ln hil${unit} locator
1922ee6fecfSbostic				fi
1932ee6fecfSbostic				;;
1942ee6fecfSbostic			keyboard)
1952ee6fecfSbostic				if [ ! -f keyboard ]
1962ee6fecfSbostic				then
1972ee6fecfSbostic					ln hil${unit} keyboard
1982ee6fecfSbostic				fi
1992ee6fecfSbostic				;;
2002ee6fecfSbostic			*)
2012ee6fecfSbostic				;;
2022ee6fecfSbostic			esac
2032ee6fecfSbostic		fi
2042ee6fecfSbostic	done
2052ee6fecfSbostic	if [ ! -f /usr/local/hilinfo ]
2062ee6fecfSbostic	then
2072ee6fecfSbostic		ln hil1 keyboard
2082ee6fecfSbostic		ln hil3 locator
2092ee6fecfSbostic	fi
2102ee6fecfSbostic	chmod 666 hil*
2112ee6fecfSbostic	echo "hil: use MAKEDEV.hpux to make HP-UX names for devices"
2122ee6fecfSbostic	;;
2132ee6fecfSbostic
2142ee6fecfSbosticpty*)
2152ee6fecfSbostic	class=`expr $i : 'pty\(.*\)'`
2162ee6fecfSbostic	case $class in
2172ee6fecfSbostic	0) offset=0 name=p;;
2182ee6fecfSbostic	1) offset=16 name=q;;
2192ee6fecfSbostic	2) offset=32 name=r;;
2202ee6fecfSbostic	3) offset=48 name=s;;
2212ee6fecfSbostic# Note that telnetd, rlogind, and xterm (at least) only look at p-s.
2222ee6fecfSbostic	4) offset=64 name=t;;
2232ee6fecfSbostic	*) echo bad unit for pty in: $i;;
2242ee6fecfSbostic	esac
2252ee6fecfSbostic	case $class in
2262ee6fecfSbostic	0|1|2|3|4)
2272ee6fecfSbostic		umask 0
2282ee6fecfSbostic		eval `echo $offset $name | awk ' { b=$1; n=$2 } END {
2292ee6fecfSbostic			for (i = 0; i < 16; i++)
230b81b2304Sbostic				printf("mknod tty%s%x c 4 %d; \
231b81b2304Sbostic					mknod pty%s%x c 5 %d; ", \
2322ee6fecfSbostic					n, i, b+i, n, i, b+i); }'`
2332ee6fecfSbostic		umask 77
2342ee6fecfSbostic		if [ $class = 1 ]; then
2352ee6fecfSbostic			mv ttyqf ttyv0; mv ptyqf ptyv0
2362ee6fecfSbostic		fi
2372ee6fecfSbostic		;;
2382ee6fecfSbostic	esac
2392ee6fecfSbostic	;;
2402ee6fecfSbostic
2412ee6fecfSbosticlocal)
2422ee6fecfSbostic	umask 0
2432ee6fecfSbostic	sh MAKEDEV.local
2442ee6fecfSbostic	;;
2457210b43aSmckusick*)
2467210b43aSmckusick	echo $i: unknown device
2477210b43aSmckusick	;;
2482ee6fecfSbosticesac
2492ee6fecfSbosticdone
250