|
@ -1,6 +1,6 @@ |
|
|
#!/bin/sh - |
|
|
#!/bin/sh - |
|
|
# |
|
|
# |
|
|
# $OpenBSD: MAKEDEV,v 1.14 1998/01/26 04:19:52 dgregor Exp $ |
|
|
|
|
|
|
|
|
# $OpenBSD: MAKEDEV,v 1.15 1998/05/14 17:07:22 niklas Exp $ |
|
|
# $NetBSD: MAKEDEV,v 1.3 1996/01/07 16:53:15 ragge Exp $ |
|
|
# $NetBSD: MAKEDEV,v 1.3 1996/01/07 16:53:15 ragge Exp $ |
|
|
# |
|
|
# |
|
|
# @(#)MAKEDEV 8.1 (Berkeley) 6/9/93 |
|
|
# @(#)MAKEDEV 8.1 (Berkeley) 6/9/93 |
|
@ -70,6 +70,8 @@ all) |
|
|
;; |
|
|
;; |
|
|
|
|
|
|
|
|
std) |
|
|
std) |
|
|
|
|
|
rm -f console drum floppy crl csa1 csa2 tu0 tu1 kUmem kmem mem null |
|
|
|
|
|
rm -f zero tty klog stdin stdout stderr |
|
|
mknod console c 0 0 |
|
|
mknod console c 0 0 |
|
|
mknod drum c 7 0 ; chmod 640 drum ; chown root.kmem drum |
|
|
mknod drum c 7 0 ; chmod 640 drum ; chown root.kmem drum |
|
|
mknod floppy c 8 0 |
|
|
mknod floppy c 8 0 |
|
@ -91,7 +93,7 @@ std) |
|
|
mkdir fd > /dev/null 2>&1 |
|
|
mkdir fd > /dev/null 2>&1 |
|
|
(cd fd && eval `echo "" | awk ' BEGIN { \ |
|
|
(cd fd && eval `echo "" | awk ' BEGIN { \ |
|
|
for (i = 0; i < 64; i++) \ |
|
|
for (i = 0; i < 64; i++) \ |
|
|
printf("mknod %d c 53 %d;", i, i)}'`) |
|
|
|
|
|
|
|
|
printf("rm -f %d; mknod %d c 53 %d;", i, i, i)}'`) |
|
|
chown -R root.wheel fd |
|
|
chown -R root.wheel fd |
|
|
chmod 555 fd |
|
|
chmod 555 fd |
|
|
chmod 666 fd/* |
|
|
chmod 666 fd/* |
|
@ -111,6 +113,9 @@ ht*|tm*|tms*|ts*|ut*|st*) |
|
|
0|1|2|3|4|5|6|7) |
|
|
0|1|2|3|4|5|6|7) |
|
|
four=`expr $unit + 4` ; eight=`expr $unit + 8` |
|
|
four=`expr $unit + 4` ; eight=`expr $unit + 8` |
|
|
twelve=`expr $unit + 12`; twenty=`expr $unit + 20` |
|
|
twelve=`expr $unit + 12`; twenty=`expr $unit + 20` |
|
|
|
|
|
rm -f $name$unit $name$four $name$eight $name$twelve |
|
|
|
|
|
rm -f n$name$unit n$name$eight nr$name$unit nr$name$eight |
|
|
|
|
|
rm -f r$name$unit r$name$four r$name$eight r$name$twelve |
|
|
mknod $name$unit b $blk $unit |
|
|
mknod $name$unit b $blk $unit |
|
|
mknod $name$four b $blk $four |
|
|
mknod $name$four b $blk $four |
|
|
mknod $name$eight b $blk $eight |
|
|
mknod $name$eight b $blk $eight |
|
@ -125,11 +130,15 @@ ht*|tm*|tms*|ts*|ut*|st*) |
|
|
mknod r$name$twelve c $chr $twelve |
|
|
mknod r$name$twelve c $chr $twelve |
|
|
if [ $i = ut ] |
|
|
if [ $i = ut ] |
|
|
then |
|
|
then |
|
|
|
|
|
rm -f $name$twenty r$name$twenty |
|
|
mknod $name$twenty b $blk $twenty |
|
|
mknod $name$twenty b $blk $twenty |
|
|
mknod r$name$twenty c $chr $twenty |
|
|
mknod r$name$twenty c $chr $twenty |
|
|
fi |
|
|
fi |
|
|
if [ ! -e rmt$eight ] # compatibility stuff |
|
|
if [ ! -e rmt$eight ] # compatibility stuff |
|
|
then |
|
|
then |
|
|
|
|
|
rm -f mt$unit mt$four mt$eight mt$twelve |
|
|
|
|
|
rm -f nmt$unit nmt$eight nrmt$unit nrmt$eight |
|
|
|
|
|
rm -f rmt$unit rmt$four rmt$eight rmt$twelve |
|
|
ln -s $name$unit mt$unit |
|
|
ln -s $name$unit mt$unit |
|
|
ln -s $name$four mt$four |
|
|
ln -s $name$four mt$four |
|
|
ln -s $name$eight mt$eight |
|
|
ln -s $name$eight mt$eight |
|
@ -162,6 +171,8 @@ mt*) |
|
|
twelve=`expr $unit + 4`; |
|
|
twelve=`expr $unit + 4`; |
|
|
sixteen=`expr $unit + 8`; |
|
|
sixteen=`expr $unit + 8`; |
|
|
twenty=`expr $unit + 12`; |
|
|
twenty=`expr $unit + 12`; |
|
|
|
|
|
rm -f mt8 mt12 mt16 mt20 nmt8 nrmt8 rmt8 rmt12 rmt16 rmt20 |
|
|
|
|
|
rm -f nmt16 nrmt16 |
|
|
mknod mt8 b $blk $eight |
|
|
mknod mt8 b $blk $eight |
|
|
mknod mt12 b $blk $twelve |
|
|
mknod mt12 b $blk $twelve |
|
|
mknod mt16 b $blk $sixteen |
|
|
mknod mt16 b $blk $sixteen |
|
@ -182,6 +193,17 @@ mt*) |
|
|
umask 77 |
|
|
umask 77 |
|
|
;; |
|
|
;; |
|
|
|
|
|
|
|
|
|
|
|
random|srandom|urandom|prandom|arandom) |
|
|
|
|
|
rm -f random urandom srandom prandom arandom |
|
|
|
|
|
mknod random c 58 0 |
|
|
|
|
|
mknod srandom c 58 1 |
|
|
|
|
|
mknod urandom c 58 2 |
|
|
|
|
|
mknod prandom c 58 3 |
|
|
|
|
|
mknod arandom c 58 4 |
|
|
|
|
|
chown root.wheel random srandom urandom prandom arandom |
|
|
|
|
|
chmod 644 random srandom urandom prandom arandom |
|
|
|
|
|
;; |
|
|
|
|
|
|
|
|
hp*|hk*|up*|ra*|kra*|rl*|rb*|ccd*|hd*|sd*) |
|
|
hp*|hk*|up*|ra*|kra*|rl*|rb*|ccd*|hd*|sd*) |
|
|
umask 2 ; unit=`expr $i : '.*[^0-9]\([0-9]*\)'` |
|
|
umask 2 ; unit=`expr $i : '.*[^0-9]\([0-9]*\)'` |
|
|
case $i in |
|
|
case $i in |
|
@ -199,6 +221,7 @@ hp*|hk*|up*|ra*|kra*|rl*|rb*|ccd*|hd*|sd*) |
|
|
case $unit in |
|
|
case $unit in |
|
|
0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|\ |
|
|
0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|\ |
|
|
17|18|19|20|21|22|23|24|25|26|27|28|29|30|31) |
|
|
17|18|19|20|21|22|23|24|25|26|27|28|29|30|31) |
|
|
|
|
|
rm -f ${name}${unit}[abcg] r${name}${unit}[abcg] |
|
|
mknod ${name}${unit}a b $blk `expr $unit '*' 8 + 0` |
|
|
mknod ${name}${unit}a b $blk `expr $unit '*' 8 + 0` |
|
|
mknod ${name}${unit}b b $blk `expr $unit '*' 8 + 1` |
|
|
mknod ${name}${unit}b b $blk `expr $unit '*' 8 + 1` |
|
|
mknod ${name}${unit}c b $blk `expr $unit '*' 8 + 2` |
|
|
mknod ${name}${unit}c b $blk `expr $unit '*' 8 + 2` |
|
@ -209,6 +232,7 @@ hp*|hk*|up*|ra*|kra*|rl*|rb*|ccd*|hd*|sd*) |
|
|
mknod r${name}${unit}g c $chr `expr $unit '*' 8 + 6` |
|
|
mknod r${name}${unit}g c $chr `expr $unit '*' 8 + 6` |
|
|
if [ $name != hk ] |
|
|
if [ $name != hk ] |
|
|
then |
|
|
then |
|
|
|
|
|
rm -f ${name}${unit}[defh] r${name}${unit}[defh] |
|
|
mknod ${name}${unit}d b $blk `expr $unit '*' 8 + 3` |
|
|
mknod ${name}${unit}d b $blk `expr $unit '*' 8 + 3` |
|
|
mknod ${name}${unit}e b $blk `expr $unit '*' 8 + 4` |
|
|
mknod ${name}${unit}e b $blk `expr $unit '*' 8 + 4` |
|
|
mknod ${name}${unit}f b $blk `expr $unit '*' 8 + 5` |
|
|
mknod ${name}${unit}f b $blk `expr $unit '*' 8 + 5` |
|
@ -279,6 +303,7 @@ rx*) |
|
|
name=rx; chr=30; blk=12; |
|
|
name=rx; chr=30; blk=12; |
|
|
case $unit in |
|
|
case $unit in |
|
|
0|1|2|3|4|5|6|7) |
|
|
0|1|2|3|4|5|6|7) |
|
|
|
|
|
rm -f ${name}{${unit} r${name}${unit}[abcd] |
|
|
mknod ${name}${unit} b $blk `expr $unit '*' 8 + 0` |
|
|
mknod ${name}${unit} b $blk `expr $unit '*' 8 + 0` |
|
|
mknod r${name}${unit}a c $chr `expr $unit '*' 8 + 0` |
|
|
mknod r${name}${unit}a c $chr `expr $unit '*' 8 + 0` |
|
|
mknod r${name}${unit}b c $chr `expr $unit '*' 8 + 1` |
|
|
mknod r${name}${unit}b c $chr `expr $unit '*' 8 + 1` |
|
@ -296,6 +321,7 @@ uu*) |
|
|
name=uu; blk=13; |
|
|
name=uu; blk=13; |
|
|
case $unit in |
|
|
case $unit in |
|
|
0|1|2|3) |
|
|
0|1|2|3) |
|
|
|
|
|
rm -f ${name}${unit} ${name}${unit}a |
|
|
mknod ${name}${unit} b $blk `expr $unit '*' 2 + 0` |
|
|
mknod ${name}${unit} b $blk `expr $unit '*' 2 + 0` |
|
|
mknod ${name}${unit}a b $blk `expr $unit '*' 2 + 1` |
|
|
mknod ${name}${unit}a b $blk `expr $unit '*' 2 + 1` |
|
|
;; |
|
|
;; |
|
@ -311,7 +337,7 @@ dz*) |
|
|
0|1|2|3|4|5|6|7) |
|
|
0|1|2|3|4|5|6|7) |
|
|
eval `echo $unit | awk ' { u = $1 } END { |
|
|
eval `echo $unit | awk ' { u = $1 } END { |
|
|
for (i = 0; i < 8; i++) |
|
|
for (i = 0; i < 8; i++) |
|
|
printf("mknod tty%02d c 1 %d; ",u*8+i,u*8+i); }'` |
|
|
|
|
|
|
|
|
printf("rm -f tty%02d; mknod tty%02d c 1 %d; ", u * 8 + i, u * 8 + i, u * 8 + i); }'` |
|
|
;; |
|
|
;; |
|
|
*) |
|
|
*) |
|
|
echo bad unit for dz in: $i |
|
|
echo bad unit for dz in: $i |
|
@ -354,9 +380,9 @@ dhu*|dh*|dmf*|dmz*) |
|
|
awk ' { ch = $1; u = $4 * $2; m = $3; cnt = $4 } END { |
|
|
awk ' { ch = $1; u = $4 * $2; m = $3; cnt = $4 } END { |
|
|
for (i = 0; i < cnt; i++) |
|
|
for (i = 0; i < cnt; i++) |
|
|
if (i < 10) |
|
|
if (i < 10) |
|
|
printf("mknod tty%s%x c %d %d; ",ch,i,m,u+i); |
|
|
|
|
|
|
|
|
printf("rm -f tty%s%x; mknod tty%s%x c %d %d; ", ch, i, ch, i, m, u + i); |
|
|
else |
|
|
else |
|
|
printf("mknod tty%s%c c %d %d; ",ch,87+i,m,u+i); }'` |
|
|
|
|
|
|
|
|
printf("rm -f tty%s%c; mknod tty%s%c c %d %d; ", ch, 87 + i, ch, 87 + i, m, u + i); }'` |
|
|
;; |
|
|
;; |
|
|
|
|
|
|
|
|
lp*|va*|vp*) |
|
|
lp*|va*|vp*) |
|
@ -368,6 +394,7 @@ lp*|va*|vp*) |
|
|
unit=`expr $i : "$name\(.*\)"` |
|
|
unit=`expr $i : "$name\(.*\)"` |
|
|
case $unit in |
|
|
case $unit in |
|
|
0|1|2|3|4|5|6|7) |
|
|
0|1|2|3|4|5|6|7) |
|
|
|
|
|
rm -f $i |
|
|
mknod $i c $major $unit; |
|
|
mknod $i c $major $unit; |
|
|
chmod 666 $i |
|
|
chmod 666 $i |
|
|
;; |
|
|
;; |
|
@ -393,9 +420,9 @@ pty*) |
|
|
umask 0 |
|
|
umask 0 |
|
|
eval `echo $offset $name | awk ' { b=$1; n=$2 } END { |
|
|
eval `echo $offset $name | awk ' { b=$1; n=$2 } END { |
|
|
for (i = 0; i < 16; i++) |
|
|
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); }'` |
|
|
|
|
|
|
|
|
printf("rm -f tty%s%x; mknod tty%s%x c 20 %d;" \ |
|
|
|
|
|
"rm -f pty%s%x; mknod pty%s%x c 21 %d; ", \ |
|
|
|
|
|
n, i, n, i, b + i, n, i, n, i, b + i); }'` |
|
|
umask 77 |
|
|
umask 77 |
|
|
;; |
|
|
;; |
|
|
esac |
|
|
esac |
|
@ -421,8 +448,8 @@ np*) |
|
|
0|1|2) |
|
|
0|1|2) |
|
|
eval `echo $offset | awk ' { b=$1 } END { |
|
|
eval `echo $offset | awk ' { b=$1 } END { |
|
|
for (i = 0; i < 4; i++) |
|
|
for (i = 0; i < 4; i++) |
|
|
printf("mknod np%02d c 39 %d;", \ |
|
|
|
|
|
b+i, b+i); }'` |
|
|
|
|
|
|
|
|
printf("rm -f np%02d; mknod np%02d c 39 %d;", \ |
|
|
|
|
|
b + i, b + i, b + i); }'` |
|
|
;; |
|
|
;; |
|
|
esac |
|
|
esac |
|
|
;; |
|
|
;; |
|
@ -439,6 +466,7 @@ dn*|ik*|ps*|ad*|ct*) |
|
|
case $unit in |
|
|
case $unit in |
|
|
0|1|2|3|4|5|6|7) |
|
|
0|1|2|3|4|5|6|7) |
|
|
umask 0 |
|
|
umask 0 |
|
|
|
|
|
rm -f ${name}${unit} |
|
|
mknod ${name}${unit} c ${chr} ${unit} |
|
|
mknod ${name}${unit} c ${chr} ${unit} |
|
|
umask 77 |
|
|
umask 77 |
|
|
;; |
|
|
;; |
|
@ -449,28 +477,19 @@ dn*|ik*|ps*|ad*|ct*) |
|
|
;; |
|
|
;; |
|
|
|
|
|
|
|
|
lkm) |
|
|
lkm) |
|
|
|
|
|
rm -f lkm |
|
|
mknod lkm c 28 0 |
|
|
mknod lkm c 28 0 |
|
|
chown root.kmem lkm |
|
|
chown root.kmem lkm |
|
|
chmod 640 lkm |
|
|
chmod 640 lkm |
|
|
;; |
|
|
;; |
|
|
|
|
|
|
|
|
qv0) |
|
|
qv0) |
|
|
|
|
|
rm -f qv0 qvcons mouse |
|
|
mknod qv0 c 40 0 |
|
|
mknod qv0 c 40 0 |
|
|
mknod qvcons c 40 1 |
|
|
mknod qvcons c 40 1 |
|
|
mknod mouse c 40 2 |
|
|
mknod mouse c 40 2 |
|
|
;; |
|
|
;; |
|
|
|
|
|
|
|
|
random|srandom|urandom|prandom|arandom) |
|
|
|
|
|
rm -f random urandom srandom prandom arandom |
|
|
|
|
|
mknod random c 58 0 |
|
|
|
|
|
mknod srandom c 58 1 |
|
|
|
|
|
mknod urandom c 58 2 |
|
|
|
|
|
mknod prandom c 58 3 |
|
|
|
|
|
mknod arandom c 58 4 |
|
|
|
|
|
chown root.wheel random srandom urandom prandom arandom |
|
|
|
|
|
chmod 644 random srandom urandom prandom arandom |
|
|
|
|
|
;; |
|
|
|
|
|
|
|
|
|
|
|
local) |
|
|
local) |
|
|
test -s MAKEDEV.local && sh MAKEDEV.local |
|
|
test -s MAKEDEV.local && sh MAKEDEV.local |
|
|
;; |
|
|
;; |
|
|