# Copyright (c) 1988 Regents of the University of California.
# Redistribution and use in source and binary forms are permitted
# provided that the above copyright notice and this paragraph are
# duplicated in all such forms and that any documentation,
# advertising materials, and other materials related to such
# distribution and use acknowledge that the software was developed
# by the University of California, Berkeley. The name of the
# University may not 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 MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
# @(#)MAKEDEV 5.7 (Berkeley) %G%
# Device "make" file. Valid arguments:
# local configuration specific devices
# pty* set of 32 master and slave pseudo terminals
# Special purpose devices:
# enp* CMC Ethernet interface for loading RAM
# ik* IKON DR-11W w/ E&S PS300
/etc
/mknod drum c
8 0 ; chmod 640 drum
; chgrp kmem drum
/etc
/mknod mem c
3 0 ; chmod 640 mem
; chgrp kmem mem
/etc
/mknod kmem c
3 1 ; chmod 640 kmem
; chgrp kmem kmem
/etc
/mknod null c
3 2 ; chmod 666 null
/etc
/mknod vmem c
3 3 ; chmod 640 vmem
; chgrp kmem vmem
/etc
/mknod tty c
2 0 ; chmod 666 tty
/etc
/mknod klog c
15 0 ; chmod 400 klog
umask 0 ; unit
=`expr $i : '..\(.*\)'`
# twenty=`expr $unit + 20`
/etc
/mknod mt
$unit b
$blk $unit
/etc
/mknod mt
$four b
$blk $four
/etc
/mknod mt
$eight b
$blk $eight
/etc
/mknod mt
$twelve b
$blk $twelve
ln mt
$four nmt
$unit ;: sanity
ln mt
$twelve nmt
$eight ;: ditto
/etc
/mknod rmt
$unit c
$chr $unit
/etc
/mknod rmt
$four c
$chr $four
/etc
/mknod rmt
$eight c
$chr $eight
/etc
/mknod rmt
$twelve c
$chr $twelve
ln rmt
$four nrmt
$unit ;: sanity
ln rmt
$twelve nrmt
$eight ;: ditto
# /etc/mknod mt$twenty b $blk $twenty
# /etc/mknod rmt$twenty c $chr $twenty
echo bad unit
for tape
in: $1
unit
=`expr $i : '..\(.*\)'`
dk
*) name
=dk
; blk
=1; chr
=5;;
0|
1|
2|
3|
4|
5|
6|
7|
8|
9|a|b|c|d|e|f|g|h
)
/etc
/mknod
${name}${unit}a b
$blk `expr $u '*' 8 + 0`
/etc
/mknod
${name}${unit}b b
$blk `expr $u '*' 8 + 1`
/etc
/mknod
${name}${unit}c b
$blk `expr $u '*' 8 + 2`
/etc
/mknod
${name}${unit}d b
$blk `expr $u '*' 8 + 3`
/etc
/mknod
${name}${unit}e b
$blk `expr $u '*' 8 + 4`
/etc
/mknod
${name}${unit}f b
$blk `expr $u '*' 8 + 5`
/etc
/mknod
${name}${unit}g b
$blk `expr $u '*' 8 + 6`
/etc
/mknod
${name}${unit}h b
$blk `expr $u '*' 8 + 7`
/etc
/mknod r
${name}${unit}a c
$chr `expr $u '*' 8 + 0`
/etc
/mknod r
${name}${unit}b c
$chr `expr $u '*' 8 + 1`
/etc
/mknod r
${name}${unit}c c
$chr `expr $u '*' 8 + 2`
/etc
/mknod r
${name}${unit}d c
$chr `expr $u '*' 8 + 3`
/etc
/mknod r
${name}${unit}e c
$chr `expr $u '*' 8 + 4`
/etc
/mknod r
${name}${unit}f c
$chr `expr $u '*' 8 + 5`
/etc
/mknod r
${name}${unit}g c
$chr `expr $u '*' 8 + 6`
/etc
/mknod r
${name}${unit}h c
$chr `expr $u '*' 8 + 7`
chmod 640 ${name}${unit}[a-h
]
chgrp operator
${name}${unit}[a-h
]
chmod 640 r
${name}${unit}[a-h
]
chgrp operator r
${name}${unit}[a-h
]
echo bad unit
for disk
in: $i
vx
*) name
=vx
; major
=1; count
=16;
unit
=`expr $i : "$name\(.*\)"`
0|
1|
2|
3|
4|
5|
6|
7|
8|
9|a|b|c|d|e|f
) ch
=$unit ;;
*) echo bad unit
for $name in: $i ;;
mp
*) name
=mp
; major
=12; count
=16;
unit
=`expr $i : "$name\(.*\)"`
0) ch
=A
;; 1) ch
=B
;; 2) ch
=C
;; 3) ch
=D
;;
4) ch
=E
;; 5) ch
=F
;; 6) ch
=G
;; 7) ch
=H
;;
8) ch
=I
;; 9) ch
=J
;; a
) ch
=K
;; b
) ch
=L
;;
c
) ch
=M
;; d
) ch
=N
;; e
) ch
=O
;; f
) ch
=P
;;
*) echo bad unit
for $name in: $i ;;
a
) un
=10 ;; b
) un
=11 ;; c
) un
=12 ;; d
) un
=13 ;;
e
) un
=14 ;; f
) un
=15 ;; *) un
=$unit ;;
eval `echo $ch $major $count $un |
awk ' { ch = $1; u = $3 * $4; m = $2; cnt = $3; nd = $4 } END {
printf("/etc/mknod mpcc%d c 11 %d; /bin/chmod 0600 mpcc%d; ",nd,u,nd);
for (i = 0; i < cnt; i++)
printf("/etc/mknod tty%s%x c %d %d; ",ch,i,m,u+i);
printf("/etc/mknod tty%s%c c %d %d; ",ch,87+i,m,u+i); }'`
class
=`expr $i : 'pty\(.*\)'`
*) echo bad unit
for pty
in: $i;;
eval `echo $offset $name | awk ' { b=$1; n=$2 } END {
printf("/etc/mknod tty%s%x c 9 %d; \
/etc/mknod pty%s%x c 10 %d; ", \
n, i, b+i, n, i, b+i); }'`
unit
=`expr $i : 'enp\(.*\)'`
/etc
/mknod enp
${unit}ram c
16 $unit; chmod 644 enp
${unit}ram
echo bad unit
for enp
in: $i
unit
=`expr $i : 'dr\(.*\)'`
/etc
/mknod dr
${unit} c
18 $unit; chmod 644 dr
${unit}
echo bad unit
for dr
in: $i
unit
=`expr $i : 'ik\(.*\)'`
/etc
/mknod ik
${unit} c
20 $unit; chmod 644 ik
${unit}
echo bad unit
for ik
in: $i