summaryrefslogtreecommitdiffstats
path: root/etc/MAKEDEV
diff options
context:
space:
mode:
Diffstat (limited to 'etc/MAKEDEV')
-rw-r--r--etc/MAKEDEV32
1 files changed, 14 insertions, 18 deletions
diff --git a/etc/MAKEDEV b/etc/MAKEDEV
index efaa7d1..7bcd13d 100644
--- a/etc/MAKEDEV
+++ b/etc/MAKEDEV
@@ -121,7 +121,7 @@
# ipl ipfilter control devices (ipl, ipnat, ipstate, ipauth)
# kbd keyboard devices
#
-# $Id: MAKEDEV,v 1.184 1999/01/24 13:51:26 markm Exp $
+# $Id: MAKEDEV,v 1.185 1999/02/04 20:35:07 mjacob Exp $
#
PATH=/sbin:/bin/:/usr/bin:/usr/sbin:$PATH
@@ -161,6 +161,11 @@ dkminor()
{
echo $(($1 << 25 | ($2 / 32) << 21 | ($2 % 32) << 3 | $3 << 16 | $4))
}
+# Convert tape (ctrl, unit, mode, access) to minor number
+saminor()
+{
+ echo $(($1 << 29 | ($2 / 16) << 16 | ($2 % 16) << 4 | $3 << 2 | $4))
+}
# Override mknod(2) to add extra handling to it.
mknod() {
@@ -614,25 +619,16 @@ sa*)
chr=14
case $unit in
- [0-9]|[1-9][0-9]|[1-9][0-9][0-9])
- if [ $unit -gt 15 ]; then
- mult=65536
- else
- mult=16
- fi
- rm -f rsa${unit} nrsa${unit} ersa${unit} rsa${unit}.ctl
- mknod rsa${unit}.ctl c $chr `expr $unit '*' $mult + 536870912`
- for mode in 0 1 2 3
+ [0-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9])
+ mknod rsa${unit}.ctl c $chr `saminor 1 ${unit} 0 0`
+ for m in 0 1 2 3
do
- rm -f rsa${unit}.${mode} nrsa${unit}.${mode} ersa${unit}.${mode}
- mknod rsa${unit}.${mode} c $chr `expr $unit '*' $mult + $mode '*' 4 + 0`
- mknod nrsa${unit}.${mode} c $chr `expr $unit '*' $mult + $mode '*' 4 + 1`
- mknod ersa${unit}.${mode} c $chr `expr $unit '*' $mult + $mode '*' 4 + 2`
- chgrp operator rsa${unit}.${mode}\
- nrsa${unit}.${mode} \
- ersa${unit}.${mode}
+ mknod rsa${unit}.${m} c $chr `saminor 0 ${unit} ${m} 0`
+ mknod nrsa${unit}.${m} c $chr `saminor 0 ${unit} ${m} 1`
+ mknod ersa${unit}.${m} c $chr `saminor 0 ${unit} ${m} 2`
+ chgrp operator rsa${unit}.${m} nrsa${unit}.${m} \
+ ersa${unit}.${m}
done
-
ln -f rsa${unit}.0 rsa${unit}
ln -f nrsa${unit}.0 nrsa${unit}
ln -f ersa${unit}.0 ersa${unit}
OpenPOWER on IntegriCloud