summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>1999-02-05 22:54:37 +0000
committermjacob <mjacob@FreeBSD.org>1999-02-05 22:54:37 +0000
commit9123f355f2ecf6b419d9ef2b96ccdf81ae744962 (patch)
tree91dc170465f78b5136d563a0cb2b5bd612d863a7 /etc
parent2714bb3817e06e087daa7c8ff75ed13a4b0a25a7 (diff)
downloadFreeBSD-src-9123f355f2ecf6b419d9ef2b96ccdf81ae744962.zip
FreeBSD-src-9123f355f2ecf6b419d9ef2b96ccdf81ae744962.tar.gz
Bruce gently nudged me into doing this right
Diffstat (limited to 'etc')
-rw-r--r--etc/MAKEDEV32
-rw-r--r--etc/etc.alpha/MAKEDEV38
-rw-r--r--etc/etc.i386/MAKEDEV32
3 files changed, 45 insertions, 57 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}
diff --git a/etc/etc.alpha/MAKEDEV b/etc/etc.alpha/MAKEDEV
index d4a5aea..38b4e94 100644
--- a/etc/etc.alpha/MAKEDEV
+++ b/etc/etc.alpha/MAKEDEV
@@ -107,7 +107,7 @@
# pci PCI configuration-space access from user mode
# ipl ipfilter control devices (ipl, ipnat, ipstate, ipauth)
#
-# $Id: MAKEDEV,v 1.3 1998/09/16 09:21:43 dfr Exp $
+# $Id: MAKEDEV,v 1.4 1999/02/04 20:35:07 mjacob Exp $
# from etc.i386 MAKEDEV,v 1.171 1998/09/15 10:21:35 gibbs Exp
#
@@ -148,6 +148,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() {
@@ -596,28 +601,19 @@ 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 rsa${unit}.0 rsa${unit}
- ln nrsa${unit}.0 nrsa${unit}
- ln ersa${unit}.0 ersa${unit}
+ ln -f rsa${unit}.0 rsa${unit}
+ ln -f nrsa${unit}.0 nrsa${unit}
+ ln -f ersa${unit}.0 ersa${unit}
;;
*)
echo bad unit for tape in: $i
diff --git a/etc/etc.i386/MAKEDEV b/etc/etc.i386/MAKEDEV
index efaa7d1..7bcd13d 100644
--- a/etc/etc.i386/MAKEDEV
+++ b/etc/etc.i386/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