diff options
author | gibbs <gibbs@FreeBSD.org> | 1998-09-15 10:21:35 +0000 |
---|---|---|
committer | gibbs <gibbs@FreeBSD.org> | 1998-09-15 10:21:35 +0000 |
commit | 1a3dd0db4485431b76be1e7c4f33cd2d366be071 (patch) | |
tree | cd2c83b43f9832d050ccdc480ddffd5a457e66d1 /etc | |
parent | d16e0e3b77e01af7aa6dd25eb69d162bb74788fb (diff) | |
download | FreeBSD-src-1a3dd0db4485431b76be1e7c4f33cd2d366be071.zip FreeBSD-src-1a3dd0db4485431b76be1e7c4f33cd2d366be071.tar.gz |
Update for CAM.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/MAKEDEV | 186 | ||||
-rw-r--r-- | etc/etc.i386/MAKEDEV | 186 |
2 files changed, 204 insertions, 168 deletions
diff --git a/etc/MAKEDEV b/etc/MAKEDEV index 9ac4bad..5510138 100644 --- a/etc/MAKEDEV +++ b/etc/MAKEDEV @@ -30,8 +30,7 @@ # # Tapes: # wt* QIC-interfaced (e.g. not SCSI) 3M cartridge tape -# st* "NEW type scsi tapes" (old driver uses the -# block devices of the disks to get access) +# sa* SCSI Sequential Access Devices # ft* QIC-40/QIC-80 3M cartridge tape (interfaced # via the floppy disk controller) # @@ -39,7 +38,7 @@ # wd* "Winchester" disk drives (ST506,IDE,ESDI,RLL,...) # wfd* "IDE floppy" disk drives (LS-120) # fd* "floppy" disk drives (3 1/2", 5 1/4") -# sd* "SCSI disks" +# da* "SCSI Direct Access Devices" # cd* "SCSI CD-ROM disks" # mcd* "Mitsumi CD-ROM disks" # scd* "Sony CD-ROM disks" @@ -79,9 +78,9 @@ # # SCSI devices (other than CD-ROM, tape and disk): # ssc The ``super scsi'' device -# uk* "unknown" device (supports ioctl calls only) # worm* WORM driver # pt* Processor Type (HP scanner, as one example) +# pass* CAM Passthrough device # # PC-CARD (previously called PCMCIA) support # card* PC-CARD slots @@ -108,7 +107,7 @@ # pci PCI configuration-space access from user mode # ipl ipfilter control devices (ipl, ipnat, ipstate, ipauth) # -# $Id: MAKEDEV,v 1.169 1998/09/09 18:59:46 sos Exp $ +# $Id: MAKEDEV,v 1.170 1998/09/10 18:47:20 phk Exp $ # PATH=/sbin:/bin/:/usr/bin:/usr/sbin:$PATH @@ -179,9 +178,6 @@ dkcompatslice=0 # Raw slice for disks dkrawslice=1 -# Control bit for SCSI -scsictl=$((1 << 29)) - # Standard umasks disk_umask=037 # allow group operator to read disks tape_umask=017 # allow group operator to read/write tapes @@ -192,12 +188,12 @@ case $i in all) sh MAKEDEV std # standard sh MAKEDEV fd0 fd1 # bdev, floppy disk - sh MAKEDEV sd0 sd1 sd2 sd3 wd0 wd1 wd2 wd3 # bdev, ordinary disk + sh MAKEDEV da0 da1 da2 da3 wd0 wd1 wd2 wd3 # bdev, ordinary disk sh MAKEDEV od0 # bdev, optical disk sh MAKEDEV wfd0 # bdev, LS-120 floppy sh MAKEDEV vn0 # bdev, virtual disk - sh MAKEDEV cd0 matcd0 mcd0 scd0 wcd0 wst0 # bdev, cdrom - sh MAKEDEV ft0 st0 wt0 # bdev, tape + sh MAKEDEV cd0 matcd0 mcd0 scd0 wcd0 # bdev, cdrom + sh MAKEDEV ft0 sa0 wt0 wst0 # bdev, tape sh MAKEDEV vty4 # cdev, virtual tty sh MAKEDEV cuaa0 cuaa1 cuaa2 cuaa3 # cdev, serial tty sh MAKEDEV pty0 # cdev, pseudo tty @@ -208,6 +204,7 @@ all) sh MAKEDEV bpf0 ipl tun0 # cdev, network sh MAKEDEV ch0 perfmon tw0 # cdev, miscellaneous sh MAKEDEV apm card0 card1 # cdev, laptop + sh MAKEDEV pass4 xpt2 # cdev, CAM ;; std) mknod console c 0 0; chmod 600 console @@ -267,12 +264,13 @@ wt*) ;; # Individual slices. -od*s*|sd*s*|vn*s*|wd*s*|wfd*s*|fla*s*) +od*s*|da*s*|vn*s*|wd*s*|wfd*s*|fla*s*) umask $disk_umask case $i in fla*s*) name=fla; blk=28; chr=101;; - od*s*) name=od; blk=20; chr=70;; + od*s*) name=od; blk=4; chr=13;; sd*s*) name=sd; blk=4; chr=13;; + da*s*) name=da; blk=4; chr=13;; vn*s*) name=vn; blk=15; chr=43;; wd*s*) name=wd; blk=0; chr=3;; wfd*s*) name=wfd; blk=1; chr=87;; @@ -437,12 +435,13 @@ ft*) umask 77 ;; -od*|sd*|vn*|wd*|wfd*|fla*) +sd*|od*|da*|vn*|wd*|wfd*|fla*) umask $disk_umask case $i in fla*) name=fla; blk=28; chr=101;; - od*) name=od; blk=20; chr=70;; - sd*) name=sd; blk=4; chr=13;; + sd*) name=sd; blk=4; chr=13;; + od*) name=od; blk=4; chr=13;; + da*) name=da; blk=4; chr=13;; vn*) name=vn; blk=15; chr=43;; wd*) name=wd; blk=0; chr=3;; wfd*) name=wfd; blk=1; chr=87;; @@ -461,13 +460,6 @@ od*|sd*|vn*|wd*|wfd*|fla*) do sh MAKEDEV $name$unit$slicepartname done - case $name in - od|sd) - minor=`dkminor 0 $unit 0 0` - mknod r${name}${unit}.ctl c $chr $(($minor | $scsictl)) - chmod 600 r${name}${unit}.ctl - ;; - esac ;; *) echo bad unit for disk in: $i @@ -503,27 +495,6 @@ ssc*) mknod ssc c 49 0 ;; -uk*) - unit=`expr $i : 'uk\(.*\)'` - mknod uk$unit c 31 $unit - ;; - -worm*) - umask $disk_umask - unit=`expr $i : 'worm\(.*\)'` - if [ "X${unit}" = "X" ]; then - unit=0 - fi - chr=62 - blk=23 - name=worm - mknod ${name}${unit} b $blk ${unit} - mknod r${name}${unit} c $chr ${unit} - chgrp operator ${name}${unit} r${name}${unit} - umask 077 - mknod r${name}${unit}.ctl c $chr `expr $unit + $scsictl ` - ;; - # SCSI processor type driver pt[0-9]*) chr=61 @@ -534,9 +505,58 @@ pt[0-9]*) fi unit=`expr $unit + 1 - 1` mknod ${name}${unit} c $chr $unit - mknod ${name}${unit}.ctl c $chr `expr $unit + $scsictl ` ;; +# SCSI target mode sample driver +targ[0-9]*) + chr=65 + name=targ + unit=`expr $i : 'targ\([0-9][0-9]*\)'` + if [ "X${unit}" = "X" ]; then + unit=0 + fi + unit=`expr $unit + 1 - 1` + mknod ${name}${unit} c $chr $unit + ;; + +# CAM transport layer device +xpt*) + umask $disk_umask + # This major number is temporary + chr=104 + name=xpt + units=`expr $i : 'xpt\(.*\)'` + if [ "X${units}" = "X" ]; then + units=1 + fi + eval `echo ${chr} ${units} ${name} |awk \ + '{ c=$1; n=$2; name=$3;} END { + for (i = 0; i < n; i++) + printf("rm -f %s%d r%s%d; mknod %s%d c %d %d; \ + chgrp operator %s%d;", \ + name, i, name, i, name, i, c, i, \ + name, i); }'` + umask 077 + ;; +# CAM passthrough device +pass*|uk*) + umask $disk_umask + # This major number is temporary + chr=31 + name=pass + units=`expr $i : 'pass\(.*\)'` + if [ "X${units}" = "X" ]; then + units=1 + fi + eval `echo ${chr} ${units} ${name} |awk \ + '{ c=$1; n=$2; name=$3;} END { + for (i = 0; i < n; i++) + printf("rm -f %s%d r%s%d; mknod %s%d c %d %d; \ + chgrp operator %s%d;", \ + name, i, name, i, name, i, c, i, \ + name, i); }'` + umask 077 + ;; pty*) class=`expr $i : 'pty\(.*\)'` case $class in @@ -569,7 +589,7 @@ pty*) esac ;; -st*) +sa*) umask $tape_umask unit=`expr $i : '..\(.*\)'` chr=14 @@ -578,22 +598,17 @@ st*) 0|1|2|3|4|5|6) for mode in 0 1 2 3 do - mknod rst${unit}.${mode} c $chr `expr $unit '*' 16 + $mode '*' 4 + 0` - mknod nrst${unit}.${mode} c $chr `expr $unit '*' 16 + $mode '*' 4 + 1` - mknod erst${unit}.${mode} c $chr `expr $unit '*' 16 + $mode '*' 4 + 2` - mknod st${unit}ctl.${mode} c $chr `expr $unit '*' 16 + $mode '*' 4 + 3` - chgrp operator rst${unit}.${mode}\ - nrst${unit}.${mode} \ - erst${unit}.${mode} \ - st${unit}ctl.${mode} - chmod 600 st${unit}ctl.${mode} + mknod rsa${unit}.${mode} c $chr `expr $unit '*' 16 + $mode '*' 4 + 0` + mknod nrsa${unit}.${mode} c $chr `expr $unit '*' 16 + $mode '*' 4 + 1` + mknod ersa${unit}.${mode} c $chr `expr $unit '*' 16 + $mode '*' 4 + 2` + chgrp operator rsa${unit}.${mode}\ + nrsa${unit}.${mode} \ + ersa${unit}.${mode} done - mknod rst${unit}.ctl c $chr `expr $unit '*' 16 + $scsictl ` - chmod 600 rst${unit}.ctl - ln rst${unit}.0 rst${unit} - ln nrst${unit}.0 nrst${unit} - ln erst${unit}.0 erst${unit} + ln rsa${unit}.0 rsa${unit} + ln nrsa${unit}.0 nrsa${unit} + ln ersa${unit}.0 ersa${unit} ;; *) echo bad unit for tape in: $i @@ -610,10 +625,8 @@ ch*) esac case $unit in 0|1|2|3|4|5|6) - mknod ${name}${unit} c $chr `expr $unit '*' 16 + 0` + mknod ${name}${unit} c $chr $unit chgrp operator ${name}${unit} - mknod r${name}${unit}.ctl c $chr `expr $unit '*' 16 + $scsictl ` - chmod 600 r${name}${unit}.ctl ;; *) echo bad unit for media changer in: $i @@ -625,28 +638,33 @@ ch*) cd*|mcd*|scd*) umask $disk_umask case $i in - cd*) unit=`expr $i : '..\(.*\)'`; name=cd; blk=6; chr=15;; - mcd*) unit=`expr $i : '...\(.*\)'`; name=mcd; blk=7; chr=29;; - scd*) unit=`expr $i : '...\(.*\)'`; name=scd; blk=16; chr=45;; - esac - case $unit in - 0|1|2|3|4|5|6) - mknod ${name}${unit}a b $blk `expr $unit '*' 8 + 0` - mknod ${name}${unit}c b $blk `expr $unit '*' 8 + 2` - mknod r${name}${unit}a c $chr `expr $unit '*' 8 + 0` - mknod r${name}${unit}c c $chr `expr $unit '*' 8 + 2` - chgrp operator ${name}${unit}[a-h] r${name}${unit}[a-h] - case $name in - cd) - mknod r${name}${unit}.ctl c $chr `expr $unit '*' 8 + $scsictl ` - chmod 600 r${name}${unit}.ctl - ;; - esac - ;; - *) - echo bad unit for disk in: $i - ;; + cd*) units=`expr $i : '..\(.*\)'`; name=cd; blk=6; chr=15;; + mcd*) units=`expr $i : '...\(.*\)'`; name=mcd; blk=7; chr=29;; + scd*) units=`expr $i : '...\(.*\)'`; name=scd; blk=16; chr=45;; esac + if [ "X${units}" = "X" -o ${units} -le 0 ]; then + units=1 + fi + if [ "${units}" -le 31 ]; then + eval `echo ${chr} ${blk} ${units} ${name} |awk \ + '{ c=$1; b=$2; n=$3; name=$4;} END{ + for (i = 0; i < n; i++){ + printf("rm -f %s%d* r%s%d*; \ + mknod %s%da b %d %d; \ + mknod %s%dc b %d %d; \ + mknod r%s%da c %d %d; \ + mknod r%s%dc c %d %d; \ + chgrp operator %s%d* r%s%d*;", + name, i, name, i, + name, i, b, (i * 8), + name, i, b, (i * 8) + 2, + name, i, c, (i * 8), + name, i, c, (i * 8) + 2, + name, i, name, i); }}'` + + else + echo "$i is invalid -- can't have more than 32 cd devices" + fi umask 77 ;; diff --git a/etc/etc.i386/MAKEDEV b/etc/etc.i386/MAKEDEV index 9ac4bad..5510138 100644 --- a/etc/etc.i386/MAKEDEV +++ b/etc/etc.i386/MAKEDEV @@ -30,8 +30,7 @@ # # Tapes: # wt* QIC-interfaced (e.g. not SCSI) 3M cartridge tape -# st* "NEW type scsi tapes" (old driver uses the -# block devices of the disks to get access) +# sa* SCSI Sequential Access Devices # ft* QIC-40/QIC-80 3M cartridge tape (interfaced # via the floppy disk controller) # @@ -39,7 +38,7 @@ # wd* "Winchester" disk drives (ST506,IDE,ESDI,RLL,...) # wfd* "IDE floppy" disk drives (LS-120) # fd* "floppy" disk drives (3 1/2", 5 1/4") -# sd* "SCSI disks" +# da* "SCSI Direct Access Devices" # cd* "SCSI CD-ROM disks" # mcd* "Mitsumi CD-ROM disks" # scd* "Sony CD-ROM disks" @@ -79,9 +78,9 @@ # # SCSI devices (other than CD-ROM, tape and disk): # ssc The ``super scsi'' device -# uk* "unknown" device (supports ioctl calls only) # worm* WORM driver # pt* Processor Type (HP scanner, as one example) +# pass* CAM Passthrough device # # PC-CARD (previously called PCMCIA) support # card* PC-CARD slots @@ -108,7 +107,7 @@ # pci PCI configuration-space access from user mode # ipl ipfilter control devices (ipl, ipnat, ipstate, ipauth) # -# $Id: MAKEDEV,v 1.169 1998/09/09 18:59:46 sos Exp $ +# $Id: MAKEDEV,v 1.170 1998/09/10 18:47:20 phk Exp $ # PATH=/sbin:/bin/:/usr/bin:/usr/sbin:$PATH @@ -179,9 +178,6 @@ dkcompatslice=0 # Raw slice for disks dkrawslice=1 -# Control bit for SCSI -scsictl=$((1 << 29)) - # Standard umasks disk_umask=037 # allow group operator to read disks tape_umask=017 # allow group operator to read/write tapes @@ -192,12 +188,12 @@ case $i in all) sh MAKEDEV std # standard sh MAKEDEV fd0 fd1 # bdev, floppy disk - sh MAKEDEV sd0 sd1 sd2 sd3 wd0 wd1 wd2 wd3 # bdev, ordinary disk + sh MAKEDEV da0 da1 da2 da3 wd0 wd1 wd2 wd3 # bdev, ordinary disk sh MAKEDEV od0 # bdev, optical disk sh MAKEDEV wfd0 # bdev, LS-120 floppy sh MAKEDEV vn0 # bdev, virtual disk - sh MAKEDEV cd0 matcd0 mcd0 scd0 wcd0 wst0 # bdev, cdrom - sh MAKEDEV ft0 st0 wt0 # bdev, tape + sh MAKEDEV cd0 matcd0 mcd0 scd0 wcd0 # bdev, cdrom + sh MAKEDEV ft0 sa0 wt0 wst0 # bdev, tape sh MAKEDEV vty4 # cdev, virtual tty sh MAKEDEV cuaa0 cuaa1 cuaa2 cuaa3 # cdev, serial tty sh MAKEDEV pty0 # cdev, pseudo tty @@ -208,6 +204,7 @@ all) sh MAKEDEV bpf0 ipl tun0 # cdev, network sh MAKEDEV ch0 perfmon tw0 # cdev, miscellaneous sh MAKEDEV apm card0 card1 # cdev, laptop + sh MAKEDEV pass4 xpt2 # cdev, CAM ;; std) mknod console c 0 0; chmod 600 console @@ -267,12 +264,13 @@ wt*) ;; # Individual slices. -od*s*|sd*s*|vn*s*|wd*s*|wfd*s*|fla*s*) +od*s*|da*s*|vn*s*|wd*s*|wfd*s*|fla*s*) umask $disk_umask case $i in fla*s*) name=fla; blk=28; chr=101;; - od*s*) name=od; blk=20; chr=70;; + od*s*) name=od; blk=4; chr=13;; sd*s*) name=sd; blk=4; chr=13;; + da*s*) name=da; blk=4; chr=13;; vn*s*) name=vn; blk=15; chr=43;; wd*s*) name=wd; blk=0; chr=3;; wfd*s*) name=wfd; blk=1; chr=87;; @@ -437,12 +435,13 @@ ft*) umask 77 ;; -od*|sd*|vn*|wd*|wfd*|fla*) +sd*|od*|da*|vn*|wd*|wfd*|fla*) umask $disk_umask case $i in fla*) name=fla; blk=28; chr=101;; - od*) name=od; blk=20; chr=70;; - sd*) name=sd; blk=4; chr=13;; + sd*) name=sd; blk=4; chr=13;; + od*) name=od; blk=4; chr=13;; + da*) name=da; blk=4; chr=13;; vn*) name=vn; blk=15; chr=43;; wd*) name=wd; blk=0; chr=3;; wfd*) name=wfd; blk=1; chr=87;; @@ -461,13 +460,6 @@ od*|sd*|vn*|wd*|wfd*|fla*) do sh MAKEDEV $name$unit$slicepartname done - case $name in - od|sd) - minor=`dkminor 0 $unit 0 0` - mknod r${name}${unit}.ctl c $chr $(($minor | $scsictl)) - chmod 600 r${name}${unit}.ctl - ;; - esac ;; *) echo bad unit for disk in: $i @@ -503,27 +495,6 @@ ssc*) mknod ssc c 49 0 ;; -uk*) - unit=`expr $i : 'uk\(.*\)'` - mknod uk$unit c 31 $unit - ;; - -worm*) - umask $disk_umask - unit=`expr $i : 'worm\(.*\)'` - if [ "X${unit}" = "X" ]; then - unit=0 - fi - chr=62 - blk=23 - name=worm - mknod ${name}${unit} b $blk ${unit} - mknod r${name}${unit} c $chr ${unit} - chgrp operator ${name}${unit} r${name}${unit} - umask 077 - mknod r${name}${unit}.ctl c $chr `expr $unit + $scsictl ` - ;; - # SCSI processor type driver pt[0-9]*) chr=61 @@ -534,9 +505,58 @@ pt[0-9]*) fi unit=`expr $unit + 1 - 1` mknod ${name}${unit} c $chr $unit - mknod ${name}${unit}.ctl c $chr `expr $unit + $scsictl ` ;; +# SCSI target mode sample driver +targ[0-9]*) + chr=65 + name=targ + unit=`expr $i : 'targ\([0-9][0-9]*\)'` + if [ "X${unit}" = "X" ]; then + unit=0 + fi + unit=`expr $unit + 1 - 1` + mknod ${name}${unit} c $chr $unit + ;; + +# CAM transport layer device +xpt*) + umask $disk_umask + # This major number is temporary + chr=104 + name=xpt + units=`expr $i : 'xpt\(.*\)'` + if [ "X${units}" = "X" ]; then + units=1 + fi + eval `echo ${chr} ${units} ${name} |awk \ + '{ c=$1; n=$2; name=$3;} END { + for (i = 0; i < n; i++) + printf("rm -f %s%d r%s%d; mknod %s%d c %d %d; \ + chgrp operator %s%d;", \ + name, i, name, i, name, i, c, i, \ + name, i); }'` + umask 077 + ;; +# CAM passthrough device +pass*|uk*) + umask $disk_umask + # This major number is temporary + chr=31 + name=pass + units=`expr $i : 'pass\(.*\)'` + if [ "X${units}" = "X" ]; then + units=1 + fi + eval `echo ${chr} ${units} ${name} |awk \ + '{ c=$1; n=$2; name=$3;} END { + for (i = 0; i < n; i++) + printf("rm -f %s%d r%s%d; mknod %s%d c %d %d; \ + chgrp operator %s%d;", \ + name, i, name, i, name, i, c, i, \ + name, i); }'` + umask 077 + ;; pty*) class=`expr $i : 'pty\(.*\)'` case $class in @@ -569,7 +589,7 @@ pty*) esac ;; -st*) +sa*) umask $tape_umask unit=`expr $i : '..\(.*\)'` chr=14 @@ -578,22 +598,17 @@ st*) 0|1|2|3|4|5|6) for mode in 0 1 2 3 do - mknod rst${unit}.${mode} c $chr `expr $unit '*' 16 + $mode '*' 4 + 0` - mknod nrst${unit}.${mode} c $chr `expr $unit '*' 16 + $mode '*' 4 + 1` - mknod erst${unit}.${mode} c $chr `expr $unit '*' 16 + $mode '*' 4 + 2` - mknod st${unit}ctl.${mode} c $chr `expr $unit '*' 16 + $mode '*' 4 + 3` - chgrp operator rst${unit}.${mode}\ - nrst${unit}.${mode} \ - erst${unit}.${mode} \ - st${unit}ctl.${mode} - chmod 600 st${unit}ctl.${mode} + mknod rsa${unit}.${mode} c $chr `expr $unit '*' 16 + $mode '*' 4 + 0` + mknod nrsa${unit}.${mode} c $chr `expr $unit '*' 16 + $mode '*' 4 + 1` + mknod ersa${unit}.${mode} c $chr `expr $unit '*' 16 + $mode '*' 4 + 2` + chgrp operator rsa${unit}.${mode}\ + nrsa${unit}.${mode} \ + ersa${unit}.${mode} done - mknod rst${unit}.ctl c $chr `expr $unit '*' 16 + $scsictl ` - chmod 600 rst${unit}.ctl - ln rst${unit}.0 rst${unit} - ln nrst${unit}.0 nrst${unit} - ln erst${unit}.0 erst${unit} + ln rsa${unit}.0 rsa${unit} + ln nrsa${unit}.0 nrsa${unit} + ln ersa${unit}.0 ersa${unit} ;; *) echo bad unit for tape in: $i @@ -610,10 +625,8 @@ ch*) esac case $unit in 0|1|2|3|4|5|6) - mknod ${name}${unit} c $chr `expr $unit '*' 16 + 0` + mknod ${name}${unit} c $chr $unit chgrp operator ${name}${unit} - mknod r${name}${unit}.ctl c $chr `expr $unit '*' 16 + $scsictl ` - chmod 600 r${name}${unit}.ctl ;; *) echo bad unit for media changer in: $i @@ -625,28 +638,33 @@ ch*) cd*|mcd*|scd*) umask $disk_umask case $i in - cd*) unit=`expr $i : '..\(.*\)'`; name=cd; blk=6; chr=15;; - mcd*) unit=`expr $i : '...\(.*\)'`; name=mcd; blk=7; chr=29;; - scd*) unit=`expr $i : '...\(.*\)'`; name=scd; blk=16; chr=45;; - esac - case $unit in - 0|1|2|3|4|5|6) - mknod ${name}${unit}a b $blk `expr $unit '*' 8 + 0` - mknod ${name}${unit}c b $blk `expr $unit '*' 8 + 2` - mknod r${name}${unit}a c $chr `expr $unit '*' 8 + 0` - mknod r${name}${unit}c c $chr `expr $unit '*' 8 + 2` - chgrp operator ${name}${unit}[a-h] r${name}${unit}[a-h] - case $name in - cd) - mknod r${name}${unit}.ctl c $chr `expr $unit '*' 8 + $scsictl ` - chmod 600 r${name}${unit}.ctl - ;; - esac - ;; - *) - echo bad unit for disk in: $i - ;; + cd*) units=`expr $i : '..\(.*\)'`; name=cd; blk=6; chr=15;; + mcd*) units=`expr $i : '...\(.*\)'`; name=mcd; blk=7; chr=29;; + scd*) units=`expr $i : '...\(.*\)'`; name=scd; blk=16; chr=45;; esac + if [ "X${units}" = "X" -o ${units} -le 0 ]; then + units=1 + fi + if [ "${units}" -le 31 ]; then + eval `echo ${chr} ${blk} ${units} ${name} |awk \ + '{ c=$1; b=$2; n=$3; name=$4;} END{ + for (i = 0; i < n; i++){ + printf("rm -f %s%d* r%s%d*; \ + mknod %s%da b %d %d; \ + mknod %s%dc b %d %d; \ + mknod r%s%da c %d %d; \ + mknod r%s%dc c %d %d; \ + chgrp operator %s%d* r%s%d*;", + name, i, name, i, + name, i, b, (i * 8), + name, i, b, (i * 8) + 2, + name, i, c, (i * 8), + name, i, c, (i * 8) + 2, + name, i, name, i); }}'` + + else + echo "$i is invalid -- can't have more than 32 cd devices" + fi umask 77 ;; |