cleaned up, added support for various devices. hacked, from patch 135

This commit is contained in:
cgd 1993-05-07 06:26:41 +00:00
parent 5220c82b50
commit 14f7e1974f

View File

@ -22,6 +22,7 @@
# @(#)MAKEDEV 5.2 (Berkeley) 6/22/90
#
# Device "make" file. Valid arguments:
# all makes all known devices, standard number of units (or close)
# std standard devices
# local configuration specific devices
#
@ -43,6 +44,7 @@
#
# Terminal ports:
# com* standard PC COM ports
# tty* alias for PC COM ports, this is what the system really wants
#
# Pseudo terminals:
# pty* set of 16 master and slave pseudo terminals
@ -55,6 +57,8 @@
#
# Special purpose devices:
# bpf* packet filter
# speaker pc speaker
# dcf* dcf clock
#
PATH=/sbin:/bin/:/usr/bin
@ -63,6 +67,10 @@ for i
do
case $i in
all)
sh MAKEDEV std wt0 fd0 fd1 wd0 wd1 sd0 sd1 tty0 tty1 pty0 st0
sh MAKEDEV ch0 cd0 lpt0 lpt1 lpt2 lpa0 lpa1 lpa2 speaker
std)
rm -f console drum mem kmem null tty klog stdin stdout stderr
mknod console c 0 0
@ -88,18 +96,19 @@ std)
wt*)
umask 2
mknod wt0 b 3 0
mknod rwt0 c 10 0
rm -f wt0 rwt0
mknod wt0 b 3 0; chown root.operator wt0
mknod rwt0 c 10 0; chown root.operator rwt0
umask 77
;;
fd*|wd*|as*|sd*)
umask 2 ; unit=`expr $i : '..\(.*\)'`
case $i in
# as*) name=as; blk=4; chr=13;;
fd*) name=fd; blk=2; chr=9;;
wd*) name=wd; blk=0; chr=3;;
as*) name=as; blk=4; chr=13;;
sd*) name=sd; blk=4; chr=13;;
wd*) name=wd; blk=0; chr=3;;
esac
rm -f $name$unit? r$name$unit?
case $unit in
@ -130,10 +139,12 @@ fd*|wd*|as*|sd*)
umask 77
;;
com*)
com*|tty*)
unit=`expr $i : 'com\(.*\)'`
rm -f com$unit
mknod com$unit c 8 $unit
rm -f com$unit tty0$unit
mknod tty0$unit c 8 $unit
ln -s tty0$unit com$unit
chown uucp.wheel tty0$unit
;;
pty*)
@ -152,9 +163,9 @@ pty*)
umask 0
eval `echo $offset $name | awk ' { b=$1; n=$2 } END {
for (i = 0; i < 16; i++)
printf("mknod tty%s%x c 5 %d; \
mknod pty%s%x c 6 %d; ", \
n, i, b+i, n, i, b+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, b+i); }'`
umask 77
if [ $class = 1 ]; then
mv ttyqf ttyv0; mv ptyqf ptyv0
@ -241,6 +252,7 @@ lpt*)
unit=`expr $i : 'lpt\(.*\)'`
rm -f lpt$unit
mknod lpt$unit c 16 $unit
chown root.wheel lpt$unit
;;
# Note: the stock pccons driver does not have a minor for the keyboard
@ -254,18 +266,36 @@ vga|vgaco|kbdco)
esac
rm -f ${name}
mknod ${name} c ${chr} ${minor}
chown root.wheel $name
;;
bpf*)
unit=`expr $i : 'bpf\(.*\)'`
rm -f bpf$unit
mknod bpf$unit c 23 $unit
chown root.wheel bpf$unit
;;
dcf*)
unit=`expr $i : 'dcf\(.*\)'`
rm -f dcf$unit
mknod dcf$unit c 24 $unit
chown root.wheel dcf$unit
;;
lpa*)
unit=`expr $i : 'lpa\(.*\)'`
rm -f lpa$unit
mknod lpa$unit c 25 $unit
chr=25
rm -f lpa$unit lpa${unit}p
mknod lpa${unit} c $chr `expr $unit + 0`
mknod lpa${unit}p c $chr `expr $unit + 32`
chown root.wheel lpa${unit} lpa${unit}p
;;
speaker)
rm -f speaker
mknod speaker c 27 0
chown root.wheel speaker
;;
local)