Browse Source

add hex() and kill awk

OPENBSD_2_1
deraadt 28 years ago
parent
commit
84b8ebaa41
3 changed files with 56 additions and 11 deletions
  1. +15
    -1
      src/etc/etc.alpha/MAKEDEV
  2. +26
    -9
      src/etc/etc.arc/MAKEDEV
  3. +15
    -1
      src/etc/etc.powerpc/MAKEDEV

+ 15
- 1
src/etc/etc.alpha/MAKEDEV View File

@ -1,5 +1,5 @@
#!/bin/sh -
# $OpenBSD: MAKEDEV,v 1.16 1997/05/10 23:01:47 millert Exp $
# $OpenBSD: MAKEDEV,v 1.17 1997/05/11 02:18:40 deraadt Exp $
# $NetBSD: MAKEDEV,v 1.8.4.1 1996/06/18 00:41:56 cgd Exp $
#
# Copyright (c) 1990 The Regents of the University of California.
@ -76,6 +76,20 @@
PATH=/sbin:/usr/sbin:/bin:/usr/bin
umask 77
hex ()
{
case $1 in
[0-9]) echo -n $1 ;;
10) echo -n a;;
11) echo -n b;;
12) echo -n c;;
13) echo -n d;;
14) echo -n e;;
15) echo -n f;;
esac
}
for i
do
case $i in


+ 26
- 9
src/etc/etc.arc/MAKEDEV View File

@ -1,6 +1,6 @@
#!/bin/sh -
#
# $OpenBSD: MAKEDEV,v 1.13 1997/05/04 02:03:02 imp Exp $
# $OpenBSD: MAKEDEV,v 1.14 1997/05/11 02:18:41 deraadt Exp $
# @(#)MAKEDEV 8.1 (Berkeley) 6/9/93
#
@ -49,6 +49,20 @@
PATH=/sbin:/bin/:/usr/bin:/usr/sbin
umask 77
hex ()
{
case $1 in
[0-9]) echo -n $1 ;;
10) echo -n a;;
11) echo -n b;;
12) echo -n c;;
13) echo -n d;;
14) echo -n e;;
15) echo -n f;;
esac
}
for i
do
case $i in
@ -100,9 +114,8 @@ pms*)
fd)
rm -rf fd/*
mkdir fd > /dev/null 2>&1
(cd fd && eval `echo "" | awk ' BEGIN { \
for (i = 0; i < 64; i++) \
printf("mknod %d c 7 %d;", i, i)}'`)
n=0
(cd fd && while [ $n -lt 64 ]; do mknod $n c 7 $n; n="$(( $n + 1 ))"; done)
chown -R root.wheel fd
chmod 555 fd
chmod 666 fd/*
@ -263,11 +276,15 @@ pty*)
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); }'`
n=0
while [ $n -lt 16 ]
do
nam=$name`hex $n`
rm -rf {tty,pty}$n
mknod tty$nam c 4 "$(( $offset + $n ))"
mknod pty$nam c 5 "$(( $offset + $n ))"
n="$(( $n + 1 ))"
done
umask 77
;;
esac


+ 15
- 1
src/etc/etc.powerpc/MAKEDEV View File

@ -1,5 +1,5 @@
#!/bin/sh -
# $OpenBSD: MAKEDEV,v 1.7 1997/05/11 02:14:05 deraadt Exp $
# $OpenBSD: MAKEDEV,v 1.8 1997/05/11 02:18:42 deraadt Exp $
#
# Copyright (c) 1990 The Regents of the University of California.
# All rights reserved.
@ -62,6 +62,20 @@
PATH=/sbin:/bin/:/usr/bin:/usr/sbin
umask 77
hex ()
{
case $1 in
[0-9]) echo -n $1 ;;
10) echo -n a;;
11) echo -n b;;
12) echo -n c;;
13) echo -n d;;
14) echo -n e;;
15) echo -n f;;
esac
}
for i
do
case $i in


Loading…
Cancel
Save