Make all tty??/pty?? pairs that can be opened by openpty().

Remove use of awk for generating names.
Make all consistent as possible.
Closes PR 3420.
This commit is contained in:
phil 1997-07-23 01:29:36 +00:00
parent 0afaee97a4
commit ffde90f14b
14 changed files with 545 additions and 335 deletions

View File

@ -1,5 +1,5 @@
#!/bin/sh -
# $NetBSD: MAKEDEV,v 1.18 1997/07/22 23:13:05 phil Exp $
# $NetBSD: MAKEDEV,v 1.19 1997/07/23 01:29:36 phil Exp $
#
# Copyright (c) 1990 The Regents of the University of California.
# All rights reserved.
@ -167,31 +167,51 @@ ttyB*|ttyC*|ttyE*)
;;
pty*)
class=`expr $i : 'pty\(.*\)'`
class=${i#pty}
case $class in
0) offset=0 name=p;;
1) offset=16 name=q;;
2) offset=32 name=r;;
3) offset=48 name=s;;
# Note that telnetd, rlogind, and xterm (at least) only look at p-s.
4) offset=64 name=t;;
*) echo bad unit for pty in: $i;;
0) name=p;;
1) name=q;;
2) name=r;;
3) name=s;;
4) name=t;;
5) name=u;;
6) name=v
echo "$0: $i: pty unit conflicts with another use."
continue;;
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;;
*) echo "$0: $i: pty unit must be between 0 and 15"
continue ;;
esac
case $class in
0|1|2|3|4)
umask 0
eval `echo $offset $name | awk ' { b=$1; n=$2 } END {
for (i = 0; i < 16; i++)
printf("rm -f tty%s%x; mknod tty%s%x c 4 %d; \
rm -f pty%s%x; mknod pty%s%x c 5 %d; ", \
n, i, n, i, b+i, n, i, n, i, b+i); }'`
umask 77
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
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
unit=$(($class * 16 + $jn))
mknod tty$name$j c 4 $unit
mknod pty$name$j c 5 $unit
done
chgrp wheel tty$name? pty$name?
chmod 666 tty$name? pty$name?
if [ $class = 1 ]; then
mv ttyqf ttyv0; mv ptyqf ptyv0
fi
;;
esac
;;
st*)
umask 2 ; unit=`expr $i : '..\(.*\)'`
@ -311,6 +331,7 @@ satlink*)
rm -f satlink$unit
mknod satlink$unit c 38 $unit
chmod 444 satlink$unit
;;
local)
umask 0

View File

@ -1,6 +1,6 @@
#!/bin/sh -
#
# $NetBSD: MAKEDEV,v 1.29 1997/07/22 23:13:09 phil Exp $
# $NetBSD: MAKEDEV,v 1.30 1997/07/23 01:29:39 phil Exp $
#
# Copyright (c) 1990 The Regents of the University of California.
# All rights reserved.
@ -366,25 +366,43 @@ view*)
pty*)
class=${i#pty}
case $class in
0) offset=0 name=p;;
1) offset=16 name=q;;
2) offset=32 name=r;;
3) offset=48 name=s;;
# Note that telnetd, rlogind, and xterm (at least) only look at p-s.
4) offset=64 name=t;;
*) echo bad unit for pty in: $i;;
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;;
*) echo "$0: $i: pty unit must be between 0 and 15"
continue ;;
esac
case $class in
0|1|2|3|4)
umask 0
eval `echo $offset $name | awk ' { b=$1; n=$2 } END {
for (i = 0; i < 16; i++)
printf("rm -f tty%s%x; mknod tty%s%x c 4 %d; \
rm -f pty%s%x; mknod pty%s%x c 5 %d; ", \
n, i, n, i, b+i, n, i, n, i, b+i); }'`
umask 77
;;
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
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
unit=$(($class * 16 + $jn))
mknod tty$name$j c 4 $unit
mknod pty$name$j c 5 $unit
done
chgrp wheel tty$name? pty$name?
chmod 666 tty$name? pty$name?
;;
bpf*|tun*)

View File

@ -1,6 +1,6 @@
#!/bin/sh -
#
# $NetBSD: MAKEDEV,v 1.10 1997/07/22 23:13:11 phil Exp $
# $NetBSD: MAKEDEV,v 1.11 1997/07/23 01:29:41 phil Exp $
#
# Copyright (c) 1990 The Regents of the University of California.
# All rights reserved.
@ -185,25 +185,43 @@ tty*)
pty*)
class=${i#pty}
case $class in
0) offset=0 name=p;;
1) offset=16 name=q;;
2) offset=32 name=r;;
3) offset=48 name=s;;
# Note that telnetd, rlogind, and xterm (at least) only look at p-s.
4) offset=64 name=t;;
*) echo bad unit for pty in: $i;;
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;;
*) echo "$0: $i: pty unit must be between 0 and 15"
continue ;;
esac
case $class in
0|1|2|3|4)
umask 0
eval `echo $offset $name | awk ' { b=$1; n=$2 } END {
for (i = 0; i < 16; i++)
printf("rm -f tty%s%x; mknod tty%s%x c 7 %d; \
rm -f pty%s%x; mknod pty%s%x c 6 %d; ", \
n, i, n, i, b+i, n, i, n, i, b+i); }'`
umask 77
;;
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
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
unit=$(($class * 16 + $jn))
mknod tty$name$j c 7 $unit
mknod pty$name$j c 6 $unit
done
chgrp wheel tty$name? pty$name?
chmod 666 tty$name? pty$name?
;;
st*)

View File

@ -1,6 +1,6 @@
#!/bin/sh -
#
# $NetBSD: MAKEDEV,v 1.18 1997/07/22 23:13:13 phil Exp $
# $NetBSD: MAKEDEV,v 1.19 1997/07/23 01:29:43 phil Exp $
#
# Copyright (c) 1990 The Regents of the University of California.
# All rights reserved.
@ -383,27 +383,43 @@ view*)
pty*)
class=${i#pty}
case $class in
0) offset=0 name=p;;
1) offset=16 name=q;;
2) offset=32 name=r;;
3) offset=48 name=s;;
# Note that telnetd, rlogind, and xterm (at least) only look at p-s.
4) offset=64 name=t;;
*) echo bad unit for pty in: $i;;
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;;
*) echo "$0: $i: pty unit must be between 0 and 15"
continue ;;
esac
case $class in
0|1|2|3|4)
umask 0
(i=0; while [ $i -lt 16 ]; do
eval `printf "rm -f tty%s%x; mknod tty%s%x c 4 %d; \
rm -f pty%s%x; mknod pty%s%x c 5 %d" $name $i \
$name $i $offset $name $i $name $i $offset`
offset=$(($offset+1))
i=$(($i+1))
done)
umask 77
;;
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
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
unit=$(($class * 16 + $jn))
mknod tty$name$j c 4 $unit
mknod pty$name$j c 5 $unit
done
chgrp wheel tty$name? pty$name?
chmod 666 tty$name? pty$name?
;;
lpt*)

View File

@ -1,6 +1,6 @@
#!/bin/sh -
#
# $NetBSD: MAKEDEV,v 1.18 1997/07/22 23:13:16 phil Exp $
# $NetBSD: MAKEDEV,v 1.19 1997/07/23 01:29:45 phil Exp $
#
# Copyright (c) 1990 The Regents of the University of California.
# All rights reserved.
@ -324,30 +324,49 @@ ipl)
pty*)
class=${i#pty}
case $class in
0) offset=0 name=p;;
1) offset=16 name=q;;
2) offset=32 name=r;;
3) offset=48 name=s;;
# Note that telnetd, rlogind, and xterm (at least) only look at p-s.
4) offset=64 name=t;;
*) echo bad unit for pty in: $i;;
0) name=p;;
1) name=q;;
2) name=r;;
3) name=s;;
4) name=t;;
5) name=u;;
6) name=v
echo "$0: $i: pty unit conflicts with another use."
continue;;
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;;
*) echo "$0: $i: pty unit must be between 0 and 15"
continue ;;
esac
case $class in
0|1|2|3|4)
umask 0
eval `echo $offset $name | awk ' { b=$1; n=$2 } END {
for (i = 0; i < 16; i++)
printf("rm -f tty%s%x pty%s%x; \
mknod tty%s%x c 4 %d; \
mknod pty%s%x c 5 %d; ", \
n, i, n, i, n, i, b+i, n, i, b+i); }'`
umask 77
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
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
unit=$(($class * 16 + $jn))
mknod tty$name$j c 4 $unit
mknod pty$name$j c 5 $unit
done
chgrp wheel tty$name? pty$name?
chmod 666 tty$name? pty$name?
if [ $class = 1 ]; then
mv ttyqf ttyv0; mv ptyqf ptyv0
fi
;;
esac
;;
local)
umask 0

View File

@ -1,6 +1,6 @@
#!/bin/sh -
#
# $NetBSD: MAKEDEV,v 1.53 1997/07/22 23:13:18 phil Exp $
# $NetBSD: MAKEDEV,v 1.54 1997/07/23 01:29:47 phil Exp $
#
# Copyright (c) 1990 The Regents of the University of California.
# All rights reserved.
@ -226,47 +226,43 @@ com*|tty*) # (XXX -- com should die)
pty*)
class=${i#pty}
case $class in
0) offset=0 name=p;;
1) offset=16 name=q;;
2) offset=32 name=r;;
3) offset=48 name=s;;
# Note that telnetd, rlogind, and xterm (at least) only look at p-s.
4) offset=64 name=t;;
*) echo bad unit for pty in: $i;;
0) name=p;;
1) name=q;;
2) name=r;;
3) name=s;;
4) name=t;;
5) name=u;;
6) name=v
echo "$0: $i: pty unit conflicts with console ttyv* devices."
continue;;
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;;
*) echo "$0: $i: pty unit must be between 0 and 15"
continue ;;
esac
rm -f tty$name? pty$name?
mknod tty${name}0 c 5 $(($offset + 0))
mknod tty${name}1 c 5 $(($offset + 1))
mknod tty${name}2 c 5 $(($offset + 2))
mknod tty${name}3 c 5 $(($offset + 3))
mknod tty${name}4 c 5 $(($offset + 4))
mknod tty${name}5 c 5 $(($offset + 5))
mknod tty${name}6 c 5 $(($offset + 6))
mknod tty${name}7 c 5 $(($offset + 7))
mknod tty${name}8 c 5 $(($offset + 8))
mknod tty${name}9 c 5 $(($offset + 9))
mknod tty${name}a c 5 $(($offset + 10))
mknod tty${name}b c 5 $(($offset + 11))
mknod tty${name}c c 5 $(($offset + 12))
mknod tty${name}d c 5 $(($offset + 13))
mknod tty${name}e c 5 $(($offset + 14))
mknod tty${name}f c 5 $(($offset + 15))
mknod pty${name}0 c 6 $(($offset + 0))
mknod pty${name}1 c 6 $(($offset + 1))
mknod pty${name}2 c 6 $(($offset + 2))
mknod pty${name}3 c 6 $(($offset + 3))
mknod pty${name}4 c 6 $(($offset + 4))
mknod pty${name}5 c 6 $(($offset + 5))
mknod pty${name}6 c 6 $(($offset + 6))
mknod pty${name}7 c 6 $(($offset + 7))
mknod pty${name}8 c 6 $(($offset + 8))
mknod pty${name}9 c 6 $(($offset + 9))
mknod pty${name}a c 6 $(($offset + 10))
mknod pty${name}b c 6 $(($offset + 11))
mknod pty${name}c c 6 $(($offset + 12))
mknod pty${name}d c 6 $(($offset + 13))
mknod pty${name}e c 6 $(($offset + 14))
mknod pty${name}f c 6 $(($offset + 15))
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
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
unit=$(($class * 16 + $jn))
mknod tty$name$j c 5 $unit
mknod pty$name$j c 6 $unit
done
chgrp wheel tty$name? pty$name?
chmod 666 tty$name? pty$name?
;;

View File

@ -20,7 +20,7 @@
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
# from: @(#)MAKEDEV 5.2 (Berkeley) 6/22/90
# $NetBSD: MAKEDEV,v 1.27 1997/07/22 23:13:20 phil Exp $
# $NetBSD: MAKEDEV,v 1.28 1997/07/23 01:29:49 phil Exp $
#
# Device "make" file. Valid arguments:
# all a smattering--at least one of each except
@ -200,25 +200,43 @@ tty*)
pty*)
class=${i#pty}
case $class in
0) offset=0 name=p;;
1) offset=16 name=q;;
2) offset=32 name=r;;
3) offset=48 name=s;;
# Note that telnetd, rlogind, and xterm (at least) only look at p-s.
4) offset=64 name=t;;
*) echo bad unit for pty in: $i;;
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;;
*) echo "$0: $i: pty unit must be between 0 and 15"
continue ;;
esac
case $class in
0|1|2|3|4)
umask 0
eval `echo $offset $name | awk ' { b=$1; n=$2 } END {
for (i = 0; i < 16; i++)
printf("rm -f tty%s%x; mknod tty%s%x c 4 %d; \
rm -f pty%s%x; mknod pty%s%x c 5 %d; ", \
n, i, n, i, b+i, n, i, n, i, b+i); }'`
umask 77
;;
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
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
unit=$(($class * 16 + $jn))
mknod tty$name$j c 4 $unit
mknod pty$name$j c 5 $unit
done
chgrp wheel tty$name? pty$name?
chmod 666 tty$name? pty$name?
;;
st*)

View File

@ -1,6 +1,6 @@
#!/bin/sh -
#
# $NetBSD: MAKEDEV,v 1.8 1997/07/22 23:13:24 phil Exp $
# $NetBSD: MAKEDEV,v 1.9 1997/07/23 01:29:50 phil Exp $
#
# Copyright (c) 1990 The Regents of the University of California.
# All rights reserved.
@ -153,25 +153,43 @@ ccd*|sd*|vnd*)
pty*)
class=${i#pty}
case $class in
0) offset=0 name=p;;
1) offset=16 name=q;;
2) offset=32 name=r;;
3) offset=48 name=s;;
# Note that telnetd, rlogind, and xterm (at least) only look at p-s.
4) offset=64 name=t;;
*) echo bad unit for pty in: $i;;
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;;
*) echo "$0: $i: pty unit must be between 0 and 15"
continue ;;
esac
case $class in
0|1|2|3|4)
umask 0
eval `echo $offset $name | awk ' { b=$1; n=$2 } END {
for (i = 0; i < 16; i++)
printf("rm -f tty%s%x; mknod tty%s%x c 4 %d; \
rm -f pty%s%x; mknod pty%s%x c 5 %d; ", \
n, i, n, i, b+i, n, i, n, i, b+i); }'`
umask 77
;;
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
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
unit=$(($class * 16 + $jn))
mknod tty$name$j c 4 $unit
mknod pty$name$j c 5 $unit
done
chgrp wheel tty$name? pty$name?
chmod 666 tty$name? pty$name?
;;
st*)

View File

@ -1,6 +1,6 @@
#!/bin/sh -
#
# $NetBSD: MAKEDEV,v 1.14 1997/07/22 23:13:26 phil Exp $
# $NetBSD: MAKEDEV,v 1.15 1997/07/23 01:29:52 phil Exp $
#
# Copyright (c) 1990 The Regents of the University of California.
# All rights reserved.
@ -23,6 +23,8 @@
#
# @(#)MAKEDEV 5.2 (Berkeley) 6/22/90
#
# PC532 MAKEDEV
#
# Device "make" file. Valid arguments:
# all makes all known devices, including local devices.
# Tries to make the 'standard' number of each type.
@ -169,25 +171,43 @@ tty*)
pty*)
class=${i#pty}
case $class in
0) offset=0 name=p;;
1) offset=16 name=q;;
2) offset=32 name=r;;
3) offset=48 name=s;;
# Note that telnetd, rlogind, and xterm (at least) only look at p-s.
4) offset=64 name=t;;
*) echo bad unit for pty in: $i;;
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;;
*) echo "$0: $i: pty unit must be between 0 and 15"
continue ;;
esac
case $class in
0|1|2|3|4)
umask 0
eval `echo $offset $name | awk ' { b=$1; n=$2 } END {
for (i = 0; i < 16; i++)
printf("rm -f tty%s%x; mknod tty%s%x c 5 %d; \
rm -f pty%s%x; mknod pty%s%x c 6 %d; ", \
n, i, n, i, b+i, n, i, n, i, b+i); }'`
umask 77
;;
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
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
unit=$(($class * 16 + $jn))
mknod tty$name$j c 5 $unit
mknod pty$name$j c 6 $unit
done
chgrp wheel tty$name? pty$name?
chmod 666 tty$name? pty$name?
;;
st*)

View File

@ -1,6 +1,6 @@
#!/bin/sh -
#
# $NetBSD: MAKEDEV,v 1.8 1997/07/22 23:13:31 phil Exp $
# $NetBSD: MAKEDEV,v 1.9 1997/07/23 01:29:54 phil Exp $
#
# from: @(#)MAKEDEV 8.1 (Berkeley) 6/9/93
#
@ -248,29 +248,49 @@ mfb*)
pty*)
class=`expr $i : 'pty\(.*\)'`
case $class in
0) offset=0 name=p;;
1) offset=16 name=q;;
2) offset=32 name=r;;
3) offset=48 name=s;;
# Note that telnetd, rlogind, and xterm (at least) only look at p-s.
4) offset=64 name=t;;
*) echo bad unit for pty in: $i;;
0) name=p;;
1) name=q;;
2) name=r;;
3) name=s;;
4) name=t;;
5) name=u;;
6) name=v
echo "$0: $i: pty unit conflicts with another use."
continue;;
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;;
*) echo "$0: $i: pty unit must be between 0 and 15"
continue ;;
esac
case $class in
0|1|2|3|4)
umask 0
eval `echo $offset $name | awk ' { b=$1; n=$2 } END {
for (i = 0; i < 16; i++)
printf("mknod tty%s%x c 4 %d; \
mknod pty%s%x c 5 %d; ", \
n, i, b+i, n, i, b+i); }'`
umask 77
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
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
unit=$(($class * 16 + $jn))
mknod tty$name$j c 4 $unit
mknod pty$name$j c 5 $unit
done
chgrp wheel tty$name? pty$name?
chmod 666 tty$name? pty$name?
if [ $class = 1 ]; then
mv ttyqf ttyv0; mv ptyqf ptyv0
fi
;;
esac
;;
ipl)
umask 0

View File

@ -1,6 +1,6 @@
#!/bin/sh -
#
# $NetBSD: MAKEDEV,v 1.26 1997/07/22 23:13:32 phil Exp $
# $NetBSD: MAKEDEV,v 1.27 1997/07/23 01:29:56 phil Exp $
#
# Copyright (c) 1990 The Regents of the University of California.
# All rights reserved.
@ -310,33 +310,49 @@ ipl)
pty*)
class=${i#pty}
case $class in
0) offset=0 name=p;;
1) offset=16 name=q;;
2) offset=32 name=r;;
3) offset=48 name=s;;
# Note that telnetd, rlogind, and xterm (at least) only look at p-s.
4) offset=64 name=t;;
*) echo bad unit for pty in: $i;;
0) name=p;;
1) name=q;;
2) name=r;;
3) name=s;;
4) name=t;;
5) name=u;;
6) name=v
echo "$0: $i: pty unit conflicts with another use."
continue ;;
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;;
*) echo "$0: $i: pty unit must be between 0 and 15"
continue ;;
esac
case $class in
0|1|2|3|4)
umask 0
eval `echo $offset $name | awk ' { b=$1; n=$2 } END {
for (i = 0; i < 16; i++) { \
printf("rm -f tty%s%x pty%s%x; ", \
n, i, n, i); \
printf("mknod tty%s%x c 20 %d; \
mknod pty%s%x c 21 %d; ", \
n, i, b+i, n, i, b+i); \
} \
}'`
umask 77
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
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
unit=$(($class * 16 + $jn))
mknod tty$name$j c 20 $unit
mknod pty$name$j c 21 $unit
done
chgrp wheel tty$name? pty$name?
chmod 666 tty$name? pty$name?
if [ $class = 1 ]; then
mv ttyqf ttyv0; mv ptyqf ptyv0
fi
;;
esac
;;
local)
umask 0

View File

@ -1,6 +1,6 @@
#!/bin/sh -
#
# $NetBSD: MAKEDEV,v 1.12 1997/07/22 23:13:34 phil Exp $
# $NetBSD: MAKEDEV,v 1.13 1997/07/23 01:29:59 phil Exp $
#
# Copyright (c) 1990 The Regents of the University of California.
# All rights reserved.
@ -137,27 +137,45 @@ tun*)
;;
pty*)
class=${arg#pty}
case $unit in
0) offset=0 name=p;;
1) offset=16 name=q;;
2) offset=32 name=r;;
3) offset=48 name=s;;
# Note that telnetd, rlogind, and xterm (at least) only look at p-s.
4) offset=64 name=t;;
*) echo bad unit for pty in: $arg;;
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;;
*) echo "$0: $i: pty unit must be between 0 and 15"
continue ;;
esac
for pair in 0.0 1.1 2.2 3.3 4.4 5.5 6.6 7.7 \
8.8 9.9 a.10 b.11 c.12 d.13 e.14 f.15
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
do
(
tmp="$IFS" ; IFS="$IFS."
set -- $pair
IFS="$tmp" ; unset tmp
minor=`expr $offset + $2`
mk tty$name$1 c 20 $minor
mk pty$name$1 c 21 $minor
)
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))
mknod tty$name$j c 20 $unit
mknod pty$name$j c 21 $unit
done
chgrp wheel tty$name? pty$name?
chmod 666 tty$name? pty$name?
;;
cd*|sd*|xd*|xy*|vnd*|ccd*)

View File

@ -1,5 +1,5 @@
#!/bin/sh -
# $NetBSD: MAKEDEV,v 1.9 1997/07/22 23:13:36 phil Exp $
# $NetBSD: MAKEDEV,v 1.10 1997/07/23 01:30:01 phil Exp $
#
# @(#)MAKEDEV 8.1 (Berkeley) 6/9/93
#
@ -374,25 +374,45 @@ lp*|va*|vp*)
pty*)
class=${i#pty};
case $class in
0) offset=0 name=p;;
1) offset=16 name=q;;
2) offset=32 name=r;;
3) offset=48 name=s;;
4) offset=64 name=t;;
5) offset=80 name=u;;
*) echo bad unit for pty in: $i;;
0) name=p;;
1) name=q;;
2) name=r;;
3) name=s;;
4) name=t;;
5) name=u;;
6) name=v
echo "$0: $i: pty unit conflicts with another use."
continue;;
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;;
*) echo "$0: $i: pty unit must be between 0 and 15"
continue ;;
esac
case $class in
0|1|2|3|4|5)
umask 0
eval `echo $offset $name | awk ' { b=$1; n=$2 } END {
for (i = 0; i < 16; i++)
printf("mknod tty%s%x c 20 %d; \
mknod pty%s%x c 21 %d; ", \
n, i, b+i, n, i, b+i); }'`
umask 77
;;
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
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
unit=$(($class * 16 + $jn))
mknod tty$name$j c 20 $unit
mknod pty$name$j c 21 $unit
done
chgrp wheel tty$name? pty$name?
chmod 666 tty$name? pty$name?
;;
np*)

View File

@ -1,6 +1,6 @@
#!/bin/sh -
#
# $NetBSD: MAKEDEV,v 1.10 1997/07/22 23:13:38 phil Exp $
# $NetBSD: MAKEDEV,v 1.11 1997/07/23 01:30:04 phil Exp $
#
# Copyright (c) 1990 The Regents of the University of California.
# All rights reserved.
@ -370,54 +370,46 @@ kbd)
;;
# pty*)
# class=${i#pty}
# case $class in
# 0) offset=0 name=p;;
# 1) offset=16 name=q;;
# 2) offset=32 name=r;;
# 3) offset=48 name=s;;
# # Note that telnetd, rlogind, and xterm (at least) only look at p-s.
# 4) offset=64 name=t;;
# *) echo bad unit for pty in: $i;;
# esac
# case $class in
# 0|1|2|3|4)
# umask 0
# eval `echo $offset $name | awk ' { b=$1; n=$2 } END {
# for (i = 0; i < 16; i++)
# printf("rm -f tty%s%x; mknod tty%s%x c 4 %d; \
# rm -f pty%s%x; mknod pty%s%x c 5 %d; ", \
# n, i, n, i, b+i, n, i, n, i, b+i); }'`
# umask 77
# ;;
# esac
# ;;
pty*)
class=${i#pty}
case $class in
0) offset=0 name=p;;
1) offset=16 name=q;;
2) offset=32 name=r;;
3) offset=48 name=s;;
# Note that telnetd, rlogind, and xterm (at least) only look at p-s.
4) offset=64 name=t;;
*) echo bad unit for pty in: $i;;
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;;
*) echo "$0: $i: pty unit must be between 0 and 15"
continue ;;
esac
case $class in
0|1|2|3|4)
umask 0
(i=0; while [ $i -lt 16 ]; do
eval `printf "rm -f tty%s%x; mknod tty%s%x c 4 %d; \
rm -f pty%s%x; mknod pty%s%x c 5 %d" $name $i \
$name $i $offset $name $i $name $i $offset`
offset=$(($offset+1))
i=$(($i+1))
done)
umask 77
;;
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
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
unit=$(($class * 16 + $jn))
mknod tty$name$j c 4 $unit
mknod pty$name$j c 5 $unit
done
chgrp wheel tty$name? pty$name?
chmod 666 tty$name? pty$name?
;;
bpf*|tun*|par*)