Browse Source

Avoid dependency on printf(1) by replacing it with a ksh array.

Has side effect of constraining dmz dev entries to the ttyXX convention.
OPENBSD_2_9
hugh 24 years ago
parent
commit
c39be97598
1 changed files with 27 additions and 10 deletions
  1. +27
    -10
      src/etc/etc.vax/MAKEDEV

+ 27
- 10
src/etc/etc.vax/MAKEDEV View File

@ -1,6 +1,6 @@
#!/bin/sh - #!/bin/sh -
# #
# $OpenBSD: MAKEDEV,v 1.24 2000/12/04 09:56:06 hugh Exp $
# $OpenBSD: MAKEDEV,v 1.25 2000/12/05 07:27:36 hugh Exp $
# $NetBSD: MAKEDEV,v 1.30 2000/01/21 12:28:29 tsutsui Exp $ # $NetBSD: MAKEDEV,v 1.30 2000/01/21 12:28:29 tsutsui Exp $
# #
# @(#)MAKEDEV 8.1 (Berkeley) 6/9/93 # @(#)MAKEDEV 8.1 (Berkeley) 6/9/93
@ -64,6 +64,7 @@
# *random Random number generator # *random Random number generator
# #
PATH=/sbin:/usr/sbin:/bin:/usr/bin PATH=/sbin:/usr/sbin:/bin:/usr/bin
set -A cnvtbl 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
umask 77 umask 77
for i for i
do do
@ -378,9 +379,12 @@ dz*)
[0-7]) [0-7])
i=0 i=0
while [ $i -lt 8 ]; do while [ $i -lt 8 ]; do
no=$(($unit * 8 + $i))
`printf "mknod tty%02d c 1 %d\n" $no $no`
i=$(($i + 1))
no=$(($unit * 8 + $i))
if [ $no -lt 10 ]; then
no="0${no}"
fi
mknod tty${no} c 1 $no
i=$(($i + 1))
done done
;; ;;
*) *)
@ -427,9 +431,13 @@ dhu*|dh*|dmf*|dmz*|vt*)
esac esac
i=0 i=0
while [ $i -lt $count ]; do while [ $i -lt $count ]; do
`printf "mknod tty%s%x c %d %d\n" \
$ch $i $major $(($unit * $count + $i))`
i=$(($i + 1))
let=${cnvtbl[$i]}
if [ -n "$let" ] ;then
mknod tty${ch}${let} c $major $(($unit * $count + $i))
else
echo bad count for ${name}: $unit, $count, $i
fi
i=$(($i + 1))
done done
;; ;;
@ -437,7 +445,12 @@ dhu*|dh*|dmf*|dmz*|vt*)
dl*) dl*)
unit=${i#dl} unit=${i#dl}
major=66 major=66
`printf "mknod ttyJ%x c %d %d\n" $unit $major $unit`
let=${cnvtbl[$unit]}
if [ -n "$let" ] ;then
mknod ttyJ${let} c $major $unit
else
echo bad number for ${name}: $unit
fi
;; ;;
lp*|va*|vp*) lp*|va*|vp*)
@ -513,8 +526,12 @@ np*)
0|1|2) 0|1|2)
i=0 i=0
while [ $i -lt 4 ]; do while [ $i -lt 4 ]; do
`printf "mknod np%02d c 39 %d\n" $(($offset + $i)) $(($offset + $i))`
i=$(($i + 1))
no=$(($offset + $i))
if [ $no -lt 10 ]; then
no="0${no}"
fi
mknod np${no} c 39 $no
i=$(($i + 1))
done done
esac esac
;; ;;


Loading…
Cancel
Save