update tz minor numbers
[unix-history] / usr / src / etc / etc.pmax / MAKEDEV
CommitLineData
f0cc8554
KB
1#!/bin/sh -
2#
3# Copyright (c) 1991 The Regents of the University of California.
4# All rights reserved.
5#
6# %sccs.include.redist.sh%
7#
d23cd13a 8# @(#)MAKEDEV 5.2 (Berkeley) %G%
f0cc8554
KB
9#
10
11# Device "make" file. Valid arguments:
12# std standard devices
13# local configuration specific devices
14# Tapes:
d23cd13a 15# tz* SCSI tapes, DEC TK50 cartridge tape
f0cc8554
KB
16# Disks:
17# rz* SCSI disks
18# vnd* "file" pseudo-disks
19# Terminal multiplexors:
20# dc* 4 channel serial interface (keyboard, mouse, modem, printer)
21# Pseudo terminals:
22# pty* set of 16 master and slave pseudo terminals
23# Printers:
24# Call units:
25# Special purpose devices:
26# pm* raw interface to PMAX graphics devices
27
28PATH=/sbin:/bin/:/usr/bin:/usr/sbin
29umask 77
30for i
31do
32case $i in
33
34std)
35 mknod console c 0 0
36 mknod drum c 3 0 ; chmod 640 drum ; chgrp kmem drum
37 mknod kmem c 2 1 ; chmod 640 kmem ; chgrp kmem kmem
38 mknod mem c 2 0 ; chmod 640 mem ; chgrp kmem mem
39 mknod null c 2 2 ; chmod 666 null
40 mknod zero c 2 12 ; chmod 666 zero
41 mknod tty c 1 0 ; chmod 666 tty
42 mknod klog c 6 0 ; chmod 600 klog
43 mknod stdin c 7 0 ; chmod 666 stdin
44 mknod stdout c 7 1 ; chmod 666 stdout
45 mknod stderr c 7 2 ; chmod 666 stderr
46 mkdir fd > /dev/null 2>&1
47 (cd fd && eval `echo "" | awk ' BEGIN { \
48 for (i = 0; i < 64; i++) \
49 printf("mknod %d c 7 %d;", i, i)}'`)
50 chown -R bin.bin fd
51 chmod 555 fd
52 chmod 666 fd/*
53 ;;
54
55tz*)
56 umask 0 ; unit=`expr $i : '..\(.*\)'`
57 case $i in
58 tz*) chr=10;;
59 esac
60 case $unit in
61 0|1|2|3|4|5|6)
d23cd13a
RC
62 unit0=`expr $unit \* 16`
63 unit1=`expr $unit \* 16 + 1`
64 unit2=`expr $unit \* 16 + 2`
65 unit3=`expr $unit \* 16 + 3`
66 mknod rmt$unit c $chr $unit0
67 mknod nrmt$unit c $chr $unit1
68 mknod rmth$unit c $chr $unit2
69 mknod nrmth$unit c $chr $unit3
70 chmod 666 rmt$unit nrmt$unit rmth$unit nrmth$unit
f0cc8554
KB
71 ;;
72 *)
73 echo bad unit for tape in: $1
74 ;;
75 esac
76 umask 77
77 ;;
78
79rz*|vnd*)
80 umask 2 ; unit=`expr $i : '..\(.*\)'`
81 case $i in
82 rz*) name=rz; blk=0; chr=9;;
83 vnd*) name=vnd; blk=2; chr=11;;
84 esac
85 case $unit in
86 0|1|2|3|4|5|6)
87 mknod ${name}${unit}c b $blk `expr $unit '*' 8 + 2`
88 mknod r${name}${unit}c c $chr `expr $unit '*' 8 + 2`
89 if [ $name != vnd ]
90 then
91 mknod ${name}${unit}a b $blk `expr $unit '*' 8 + 0`
92 mknod ${name}${unit}b b $blk `expr $unit '*' 8 + 1`
93 mknod ${name}${unit}d b $blk `expr $unit '*' 8 + 3`
94 mknod ${name}${unit}e b $blk `expr $unit '*' 8 + 4`
95 mknod ${name}${unit}f b $blk `expr $unit '*' 8 + 5`
96 mknod ${name}${unit}g b $blk `expr $unit '*' 8 + 6`
97 mknod ${name}${unit}h b $blk `expr $unit '*' 8 + 7`
98 mknod r${name}${unit}a c $chr `expr $unit '*' 8 + 0`
99 mknod r${name}${unit}b c $chr `expr $unit '*' 8 + 1`
100 mknod r${name}${unit}d c $chr `expr $unit '*' 8 + 3`
101 mknod r${name}${unit}e c $chr `expr $unit '*' 8 + 4`
102 mknod r${name}${unit}f c $chr `expr $unit '*' 8 + 5`
103 mknod r${name}${unit}g c $chr `expr $unit '*' 8 + 6`
104 mknod r${name}${unit}h c $chr `expr $unit '*' 8 + 7`
105 fi
106 chgrp operator ${name}${unit}[a-h] r${name}${unit}[a-h]
107 chmod 640 ${name}${unit}[a-h] r${name}${unit}[a-h]
108 ;;
109 *)
110 echo bad unit for disk in: $i
111 ;;
112 esac
113 umask 77
114 ;;
115
116dc*)
117 unit=`expr $i : 'dc\(.*\)'`
118 case $unit in
119 0)
120 mknod tty0 c 0 2
121 mknod tty1 c 0 3
122 ;;
123 *)
124 echo bad unit for dc in: $i
125 ;;
126 esac
127 ;;
128
129pm*)
130 unit=`expr $i : 'pm\(.*\)'`
131 case $unit in
132 0)
133 mknod mouse c 8 0
134 ;;
135 *)
136 echo bad unit for pm in: $i
137 ;;
138 esac
139 ;;
140
141pty*)
142 class=`expr $i : 'pty\(.*\)'`
143 case $class in
144 0) offset=0 name=p;;
145 1) offset=16 name=q;;
146 2) offset=32 name=r;;
147 3) offset=48 name=s;;
148# Note that telnetd, rlogind, and xterm (at least) only look at p-s.
149 4) offset=64 name=t;;
150 *) echo bad unit for pty in: $i;;
151 esac
152 case $class in
153 0|1|2|3|4)
154 umask 0
155 eval `echo $offset $name | awk ' { b=$1; n=$2 } END {
156 for (i = 0; i < 16; i++)
157 printf("mknod tty%s%x c 4 %d; \
158 mknod pty%s%x c 5 %d; ", \
159 n, i, b+i, n, i, b+i); }'`
160 umask 77
161 if [ $class = 1 ]; then
162 mv ttyqf ttyv0; mv ptyqf ptyv0
163 fi
164 ;;
165 esac
166 ;;
167
168local)
169 umask 0
170 sh MAKEDEV.local
171 ;;
172
173*)
174 echo $i: unknown device
175 ;;
176esac
177done