diff options
author | Matt Jacob <mjacob@FreeBSD.org> | 1999-02-05 22:54:37 +0000 |
---|---|---|
committer | Matt Jacob <mjacob@FreeBSD.org> | 1999-02-05 22:54:37 +0000 |
commit | 7f897c3ce44fb43c1a98808136f19c90698e11fb (patch) | |
tree | 6ec5d91d7849d35953a498a15337332b8fdc33ab /etc/etc.i386 | |
parent | b1e7bed4c0a33b6edf3849ab775bb9abc831fef1 (diff) | |
download | src-7f897c3ce44fb43c1a98808136f19c90698e11fb.tar.gz src-7f897c3ce44fb43c1a98808136f19c90698e11fb.zip |
Bruce gently nudged me into doing this right
Notes
Notes:
svn path=/head/; revision=43690
Diffstat (limited to 'etc/etc.i386')
-rw-r--r-- | etc/etc.i386/MAKEDEV | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/etc/etc.i386/MAKEDEV b/etc/etc.i386/MAKEDEV index efaa7d10431f..7bcd13d2ad20 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} |