Add `ss' and `uk'. Sync `all'. General cleanup. (No more expr!)

This commit is contained in:
mycroft 1996-09-08 03:12:23 +00:00
parent ed0c45596a
commit 838bd1a7ae
1 changed files with 95 additions and 118 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh -
#
# $NetBSD: MAKEDEV,v 1.41 1996/08/25 23:38:57 jtk Exp $
# $NetBSD: MAKEDEV,v 1.42 1996/09/08 03:12:23 mycroft Exp $
#
# Copyright (c) 1990 The Regents of the University of California.
# All rights reserved.
@ -52,7 +52,6 @@
# mms* Microsoft bus mouse
# lms* Logitech bus mouse
# pms* PS/2 mouse
# mouse-* "mouse link" (XXX)
#
# Terminal ports:
# com* standard PC COM ports (XXX)
@ -76,6 +75,8 @@
# apm power management device
# tun* network tunnel driver
# joy* joystick device
# ss* SCSI scanner
# uk* SCSI unknown
#
PATH=/sbin:/usr/sbin:/bin:/usr/bin
@ -85,18 +86,17 @@ do
case $i in
all)
sh MAKEDEV std fd wt0 fd0 fd1 wd0 wd1 sd0 sd1 sd2 tty0 tty1 pty0 pty1
sh MAKEDEV st0 st1 ch0 cd0 cd1 mcd0 vnd0 vnd1 lpa0 lpa1
sh MAKEDEV ccd0 ccd1 ccd2 ccd3
sh MAKEDEV lpt0 lpt1 lpt2 ttyv0 bpf0 bpf1 bpf2 bpf3 tun0 tun1 tun2
sh MAKEDEV speaker lkm mms0 lms0 pms0 audio joy0 joy1 apm local
# MISSING:
# sh MAKEDEV mouse-?
sh $0 std fd wt0 fd0 fd1 wd0 wd1 sd0 sd1 sd2 tty0 tty1 pty0 pty1
sh $0 st0 st1 ch0 cd0 cd1 mcd0 vnd0 vnd1 lpa0 lpa1 lpa2
sh $0 lpt0 lpt1 lpt2 ttyv0 bpf0 bpf1 bpf2 bpf3 tun0 tun1
sh $0 ccd0 ccd1 ccd2 ccd3 rd0 ss0 ch0 uk0 uk1
sh $0 speaker lkm mms0 lms0 pms0 audio joy0 joy1 apm local
sh $0 ttyv0 ttyv1 ttyv2 ttyv3 ttyv4 ttyv5 ttyv6 ttyv7 ttyv8
;;
floppy)
sh MAKEDEV std wt0 fd0 fd1 wd0 wd1 sd0 sd1 sd2 tty0 tty1
sh MAKEDEV st0 st1 cd0 cd1 mcd0 ttyv0
sh $0 std wt0 fd0 fd1 wd0 wd1 sd0 sd1 sd2 tty0 tty1
sh $0 st0 st1 cd0 cd1 mcd0 ttyv0
;;
std)
@ -116,9 +116,9 @@ std)
;;
ttyv*)
unit=`expr $i : 'ttyv\(.*\)'`
chr=12; unit=${i#ttyv}
rm -f ttyv$unit
mknod ttyv$unit c 12 $unit
mknod ttyv$unit c $chr $unit
chown root.wheel ttyv$unit
case $unit in
0)
@ -140,69 +140,78 @@ fd)
;;
wt*)
umask 2 ; unit=`expr $i : '..\(.*\)'`
case $i in
wt*) name=wt; chr=10; blk=3;;
wt*) name=wt; unit=${i#wt}; chr=10; blk=3;;
esac
rm -f $name$unit n$name$unit r$name$unit nr$name$unit
mknod $name$unit b $blk `expr $unit '*' 8 + 0`
mknod n$name$unit b $blk `expr $unit '*' 8 + 4`
mknod r$name$unit c $chr `expr $unit '*' 8 + 0`
mknod nr$name$unit c $chr `expr $unit '*' 8 + 4`
mknod $name$unit b $blk $(($unit * 8 + 0))
mknod n$name$unit b $blk $(($unit * 8 + 4))
mknod r$name$unit c $chr $(($unit * 8 + 0))
mknod nr$name$unit c $chr $(($unit * 8 + 4))
chgrp operator $name$unit n$name$unit r$name$unit nr$name$unit
chmod 640 $name$unit n$name$unit r$name$unit nr$name$unit
umask 77
;;
rd*)
umask 2 ; unit=`expr $i : '.*d\(.*\)'`
mknod rd${unit} b 17 $unit
# mknod rrd${unit} c 9 $unit
chgrp operator rd${unit} rrd${unit}
chmod 640 rd${unit} rrd${unit}
umask 77
case $i in
rd*) name=rd; unit=${i#rd}; chr=9; blk=17;;
esac
rm -f $name$unit r$name$unit
mknod $name$unit b $blk $(($unit + 0))
mknod r$name$unit c $chr $(($unit + 16))
chgrp operator $name$unit r$name$unit
chmod 640 $name$unit r$name$unit
;;
ss*)
case $i in
ss*) name=ss; unit=${i#ss}; chr=19;;
esac
rm -f $name$unit n$name$unit
mknod $name$unit c $chr $(($unit * 16 + 0))
mknod n$name$unit c $chr $(($unit * 16 + 1))
chgrp operator $name$unit n$name$unit
chmod 640 $name$unit n$name$unit
;;
ccd*|fd*|sd*|vnd*|wd*)
umask 2 ; unit=`expr $i : '.*d\(.*\)'`
case $i in
ccd*) name=ccd; blk=16; chr=18;;
fd*) name=fd; blk=2; chr=9;;
sd*) name=sd; blk=4; chr=13;;
vnd*) name=vnd; blk=14; chr=41;;
wd*) name=wd; blk=0; chr=3;;
ccd*) name=ccd; unit=${i#ccd}; blk=16; chr=18;;
fd*) name=fd; unit=${i#fd}; blk=2; chr=9;;
sd*) name=sd; unit=${i#sd}; blk=4; chr=13;;
vnd*) name=vnd; unit=${i#vnd}; blk=14; chr=41;;
wd*) name=wd; unit=${i#wd}; blk=0; chr=3;;
esac
rm -f $name$unit? r$name$unit?
mknod ${name}${unit}a b $blk `expr $unit '*' 8 + 0`
mknod ${name}${unit}b b $blk `expr $unit '*' 8 + 1`
mknod ${name}${unit}c b $blk `expr $unit '*' 8 + 2`
mknod ${name}${unit}d b $blk `expr $unit '*' 8 + 3`
mknod ${name}${unit}e b $blk `expr $unit '*' 8 + 4`
mknod ${name}${unit}f b $blk `expr $unit '*' 8 + 5`
mknod ${name}${unit}g b $blk `expr $unit '*' 8 + 6`
mknod ${name}${unit}h b $blk `expr $unit '*' 8 + 7`
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}c c $chr `expr $unit '*' 8 + 2`
mknod r${name}${unit}d c $chr `expr $unit '*' 8 + 3`
mknod r${name}${unit}e c $chr `expr $unit '*' 8 + 4`
mknod r${name}${unit}f c $chr `expr $unit '*' 8 + 5`
mknod r${name}${unit}g c $chr `expr $unit '*' 8 + 6`
mknod r${name}${unit}h c $chr `expr $unit '*' 8 + 7`
chgrp operator ${name}${unit}[a-h] r${name}${unit}[a-h]
chmod 640 ${name}${unit}[a-h] r${name}${unit}[a-h]
umask 77
mknod ${name}${unit}a b $blk $(($unit * 8 + 0))
mknod ${name}${unit}b b $blk $(($unit * 8 + 1))
mknod ${name}${unit}c b $blk $(($unit * 8 + 2))
mknod ${name}${unit}d b $blk $(($unit * 8 + 3))
mknod ${name}${unit}e b $blk $(($unit * 8 + 4))
mknod ${name}${unit}f b $blk $(($unit * 8 + 5))
mknod ${name}${unit}g b $blk $(($unit * 8 + 6))
mknod ${name}${unit}h b $blk $(($unit * 8 + 7))
mknod r${name}${unit}a c $chr $(($unit * 8 + 0))
mknod r${name}${unit}b c $chr $(($unit * 8 + 1))
mknod r${name}${unit}c c $chr $(($unit * 8 + 2))
mknod r${name}${unit}d c $chr $(($unit * 8 + 3))
mknod r${name}${unit}e c $chr $(($unit * 8 + 4))
mknod r${name}${unit}f c $chr $(($unit * 8 + 5))
mknod r${name}${unit}g c $chr $(($unit * 8 + 6))
mknod r${name}${unit}h c $chr $(($unit * 8 + 7))
chgrp operator $name$unit? r$name$unit?
chmod 640 $name$unit? r$name$unit?
;;
com*|tty*) # (XXX -- com should die)
unit=`expr $i : '...\(.*\)'`
unit=${i#???}
rm -f com$unit tty0$unit
mknod tty0$unit c 8 $unit
chown uucp.wheel tty0$unit
;;
pty*)
class=`expr $i : 'pty\(.*\)'`
class=${i#pty}
case $class in
0) offset=0 name=p;;
1) offset=16 name=q;;
@ -226,74 +235,71 @@ pty*)
;;
st*)
umask 2 ; unit=`expr $i : '..\(.*\)'`
case $i in
st*) name=st; chr=14; blk=5;;
st*) name=st; unit=${i#st}; chr=14; blk=5;;
esac
rm -f $name$unit n$name$unit e$name$unit en$name$unit \
r$name$unit nr$name$unit er$name$unit enr$name$unit
mknod $name$unit b $blk `expr $unit '*' 16 + 0`
mknod n$name$unit b $blk `expr $unit '*' 16 + 1`
mknod e$name$unit b $blk `expr $unit '*' 16 + 2`
mknod en$name$unit b $blk `expr $unit '*' 16 + 3`
mknod r$name$unit c $chr `expr $unit '*' 16 + 0`
mknod nr$name$unit c $chr `expr $unit '*' 16 + 1`
mknod er$name$unit c $chr `expr $unit '*' 16 + 2`
mknod enr$name$unit c $chr `expr $unit '*' 16 + 3`
mknod $name$unit b $blk $(($unit * 16 + 0))
mknod n$name$unit b $blk $(($unit * 16 + 1))
mknod e$name$unit b $blk $(($unit * 16 + 2))
mknod en$name$unit b $blk $(($unit * 16 + 3))
mknod r$name$unit c $chr $(($unit * 16 + 0))
mknod nr$name$unit c $chr $(($unit * 16 + 1))
mknod er$name$unit c $chr $(($unit * 16 + 2))
mknod enr$name$unit c $chr $(($unit * 16 + 3))
chgrp operator $name$unit n$name$unit e$name$unit en$name$unit \
r$name$unit nr$name$unit er$name$unit enr$name$unit
chmod 640 $name$unit n$name$unit e$name$unit en$name$unit \
r$name$unit nr$name$unit er$name$unit enr$name$unit
umask 77
;;
ch*)
umask 2 ; unit=`expr $i : '..\(.*\)'`
ch*|uk*)
case $i in
ch*) name=ch; chr=17;;
ch*) name=ch; unit=${i#ch}; chr=17;;
uk*) name=uk; unit=${i#uk}; chr=20;;
esac
rm -f $name$unit
mknod $name$unit c $chr `expr $unit '*' 16 + 0`
mknod $name$unit c $chr $unit
chgrp operator $name$unit
chmod 640 $name$unit
umask 77
;;
cd*|mcd*)
umask 2 ; unit=`expr $i : '.*cd\(.*\)'`
case $i in
cd*) name=cd; blk=6; chr=15;;
mcd*) name=mcd; blk=7; chr=39;;
cd*) name=cd; unit=${i#cd}; chr=15; blk=6;;
mcd*) name=mcd; unit=${i#mcd}; chr=39; blk=7;;
esac
rm -f $name$unit? r$name$unit?
mknod ${name}${unit}a b $blk `expr $unit '*' 8 + 0`
mknod ${name}${unit}d b $blk `expr $unit '*' 8 + 3`
mknod r${name}${unit}a c $chr `expr $unit '*' 8 + 0`
mknod r${name}${unit}d c $chr `expr $unit '*' 8 + 3`
chgrp operator ${name}${unit}[a-h] r${name}${unit}[a-h]
chmod 640 ${name}${unit}[a-h] r${name}${unit}[a-h]
umask 77
mknod ${name}${unit}a b $blk $(($unit * 8 + 0))
mknod ${name}${unit}d b $blk $(($unit * 8 + 3))
mknod r${name}${unit}a c $chr $(($unit * 8 + 0))
mknod r${name}${unit}d c $chr $(($unit * 8 + 3))
chgrp operator $name$unit? r$name$unit?
chmod 640 $name$unit? r$name$unit?
;;
lpt*|lpa*)
unit=`expr $i : '...\(.*\)'`
case $i in
lpt*) name=lpt; flags=0;;
lpa*) name=lpa; flags=128;;
lpt*) name=lpt; unit=${i#lpt}; chr=16; flags=0;;
lpa*) name=lpa; unit=${i#lpa}; chr=16; flags=128;;
esac
rm -f $name$unit
mknod $name$unit c 16 `expr $unit + $flags`
mknod $name$unit c $chr $(($unit + $flags))
chown root.wheel $name$unit
;;
bpf*|tun*)
unit=`expr $i : '...\(.*\)'`
bpf*|tun*|mms*|lms*|pms*|joy*)
case $i in
bpf*) name=bpf; chr=23;;
tun*) name=tun; chr=40;;
bpf*) name=bpf; unit=${i#bpf}; chr=23;;
tun*) name=tun; unit=${i#tun}; chr=40;;
mms*) name=mms; unit=${i#mms}; chr=35;;
lms*) name=lms; unit=${i#lms}; chr=36;;
pms*) name=pms; unit=${i#pms}; chr=37;;
joy*) name=joy; unit=${i#joy}; chr=26;;
esac
rm -f $name$unit
mknod $name$unit c $chr $unit
mknod $name$unit c $chr $unit
chown root.wheel $name$unit
;;
@ -310,27 +316,6 @@ lkm)
chmod 640 lkm
;;
mms*|lms*|pms*)
unit=`expr $i : '.ms\(.*\)'`
case $i in
mms*) name=mms; chr=35;;
lms*) name=lms; chr=36;;
pms*) name=pms; chr=37;;
esac
rm -f $name$unit
mknod $name$unit c $chr $unit
chown root.wheel $name$unit
;;
mouse*) # (XXX)
name=`expr $i : 'mouse-\(.*\)'`
if [ ! -c $name ]; then
$0 $name # make the appropriate device
fi
rm -f mouse
ln -s $name mouse
;;
audio*)
rm -f audio sound mixer
mknod sound c 42 0
@ -340,14 +325,6 @@ audio*)
chmod 666 audio sound mixer
;;
joy*)
unit=`expr $i : 'joy\(.*\)'`
rm -f joy$unit
mknod joy$unit c 26 $unit
chown root.wheel joy$unit
chmod 666 joy$unit
;;
apm*)
rm -f apm apmctl
mknod apm c 21 0
@ -358,7 +335,7 @@ apm*)
local)
umask 0
sh MAKEDEV.local
sh $0.local
;;
esac