#!/bin/sh - # # Copyright (c) 1980 Regents of the University of California. # All rights reserved. The Berkeley software License Agreement # specifies the terms and conditions for redistribution. # # @(#)MAKEDEV 4.28 (Berkeley) 4/28/86 # # Device "make" file. Valid arguments: # std standard devices # local configuration specific devices # Tapes: # ht* massbus tm03 & tu?? # tm* unibus tm11 & te10 emulations (e.g. Emulex tc-11) # ts* unibus ts11 # mt* massbus tu78 # ut* unibus tu45 emulations (e.g.si 9700) # uu* tu58 cassettes on dl11 controller # Disks: # hp* massbus rm?? # hk* unibus rk06 and rk07 # up* other unibus devices (e.g. on Emulex sc-21v controller) # ra* unibus uda50 w/ ra?? # rl* unibus rl02 # rb* 730 idc w/ rb80 and/or rb02 # rx* unibus rx211 floppy disk # Terminal multiplexors: # dz* unibus dz11 and dz32 # dh* unibus dh11 and emulations (e.g. Able dmax, Emulex cs-11) # dmf* unibus dmf32 # dhu* unibus dhu11 # dmz* unibus dmz32 # Pseudo terminals: # pty* set of 16 master and slave pseudo terminals # Printers: # ct* unibus parallel interface to CAT typesetter # lp* unibus lp11 parallel interface # va* unibus varian parallel interface # vp* unibus versatec parallel interface # Call units: # dn* unibus dn11 and emulations (e.g. Able Quadracall) # Special purpose devices: # ik* unibus interface to ikonas frame buffer # ps* unibus interface to e&s picture system 2 # ad* unibus interface to data translation a/d converter # np* unibus ethernet co-processor interface, for downloading. umask 77 for i do case $i in std) /etc/mknod console c 0 0 /etc/mknod drum c 7 0 ; chmod 640 drum ; chgrp kmem drum /etc/mknod floppy c 8 0 /etc/mknod crl c 35 0 /etc/mknod tu0 b 8 0 /etc/mknod tu1 b 8 1 /etc/mknod kUmem c 3 3 ; chmod 600 kUmem ;: untested /etc/mknod kmem c 3 1 ; chmod 640 kmem ; chgrp kmem kmem /etc/mknod mem c 3 0 ; chmod 640 mem ; chgrp kmem mem /etc/mknod null c 3 2 ; chmod 666 null /etc/mknod tty c 2 0 ; chmod 666 tty /etc/mknod klog c 33 0 ; chmod 600 klog ;; ht*|tm*|ts*|ut*) umask 0 ; unit=`expr $i : '..\(.*\)'` case $i in ht*) blk=1; chr=5 ;; tm*) blk=5; chr=14;; ts*) blk=6; chr=16;; mt*) blk=7; chr=19;; ut*) blk=10; chr=17;; esac case $unit in 0|1|2|3|4|5|6|7) four=`expr $unit + 4` ; eight=`expr $unit + 8` twelve=`expr $unit + 12`; twenty=`expr $unit + 20` /etc/mknod mt$unit b $blk $unit /etc/mknod mt$four b $blk $four /etc/mknod mt$eight b $blk $eight /etc/mknod mt$twelve b $blk $twelve /etc/mknod nmt$unit b $blk $four ;: sanity w/pdp11 v7 /etc/mknod nmt$eight b $blk $twelve ;: ditto /etc/mknod nrmt$unit c $chr $four ;: sanity w/pdp11 v7 /etc/mknod nrmt$eight c $chr $twelve ;: ditto /etc/mknod rmt$unit c $chr $unit /etc/mknod rmt$four c $chr $four /etc/mknod rmt$eight c $chr $eight /etc/mknod rmt$twelve c $chr $twelve if [ $i = ut ] then /etc/mknod mt$twenty b $blk $twenty /etc/mknod rmt$twenty c $chr $twenty fi ;; *) echo bad unit for tape in: $1 ;; esac umask 77 ;; mt*) umask 0 ; unit=`expr $i : '..\(.*\)'` case $i in mt*) blk=7; chr=19;; esac case $unit in 0|1|2|3|4|5|6|7) eight=`expr $unit + 0`; twelve=`expr $unit + 4`; sixteen=`expr $unit + 8`; twenty=`expr $unit + 12`; /etc/mknod mt8 b $blk $eight /etc/mknod mt12 b $blk $twelve /etc/mknod mt16 b $blk $sixteen /etc/mknod mt20 b $blk $twenty /etc/mknod nmt8 b $blk $twelve ;: ditto /etc/mknod nrmt8 c $chr $twelve ;: ditto /etc/mknod rmt8 c $chr $eight /etc/mknod rmt12 c $chr $twelve /etc/mknod rmt16 c $chr $sixteen /etc/mknod rmt20 c $chr $twenty /etc/mknod nmt16 b $blk $twenty ;: ditto /etc/mknod nrmt16 c $blk $twenty ;: ditto ;; *) echo bad unit for tape in: $1 ;; esac umask 77 ;; hp*|hk*|up*|ra*|rl*|rb*) umask 2 ; unit=`expr $i : '..\(.*\)'` case $i in hp*) name=hp; blk=0; chr=4;; hk*) name=hk; blk=3; chr=11;; up*) name=up; blk=2; chr=13;; ra*) name=ra; blk=9; chr=9;; rb*) name=rb; blk=11; chr=23;; rl*) name=rl; blk=14; chr=32;; esac case $unit in 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|\ 17|18|19|20|21|22|23|24|25|26|27|28|29|30|31) /etc/mknod ${name}${unit}a b $blk `expr $unit '*' 8 + 0` /etc/mknod ${name}${unit}b b $blk `expr $unit '*' 8 + 1` /etc/mknod ${name}${unit}c b $blk `expr $unit '*' 8 + 2` /etc/mknod ${name}${unit}g b $blk `expr $unit '*' 8 + 6` /etc/mknod r${name}${unit}a c $chr `expr $unit '*' 8 + 0` /etc/mknod r${name}${unit}b c $chr `expr $unit '*' 8 + 1` /etc/mknod r${name}${unit}c c $chr `expr $unit '*' 8 + 2` /etc/mknod r${name}${unit}g c $chr `expr $unit '*' 8 + 6` if [ $name != hk ] then /etc/mknod ${name}${unit}d b $blk `expr $unit '*' 8 + 3` /etc/mknod ${name}${unit}e b $blk `expr $unit '*' 8 + 4` /etc/mknod ${name}${unit}f b $blk `expr $unit '*' 8 + 5` /etc/mknod ${name}${unit}h b $blk `expr $unit '*' 8 + 7` /etc/mknod r${name}${unit}d c $chr `expr $unit '*' 8 + 3` /etc/mknod r${name}${unit}e c $chr `expr $unit '*' 8 + 4` /etc/mknod r${name}${unit}f c $chr `expr $unit '*' 8 + 5` /etc/mknod r${name}${unit}h c $chr `expr $unit '*' 8 + 7` fi chgrp operator ${name}${unit}[a-h] r${name}${unit}[a-h] chmod 640 ${name}${unit}[a-h] r${name}${unit}[a-h] ;; *) echo bad unit for disk in: $i ;; esac umask 77 ;; rx*) unit=`expr $i : '..\(.*\)'` name=rx; chr=30; blk=12; case $unit in 0|1|2|3|4|5|6|7) /etc/mknod ${name}${unit} b $blk `expr $unit '*' 8 + 0` /etc/mknod r${name}${unit}a c $chr `expr $unit '*' 8 + 0` /etc/mknod r${name}${unit}b c $chr `expr $unit '*' 8 + 1` /etc/mknod r${name}${unit}c c $chr `expr $unit '*' 8 + 2` /etc/mknod r${name}${unit}d c $chr `expr $unit '*' 8 + 3` ;; *) echo bad unit for floppy disk in: $i ;; esac ;; uu*) unit=`expr $i : '..\(.*\)'` name=uu; blk=13; case $unit in 0|1|2|3) /etc/mknod ${name}${unit} b $blk `expr $unit '*' 2 + 0` /etc/mknod ${name}${unit}a b $blk `expr $unit '*' 2 + 1` ;; *) echo bad unit for uu cassette in: $i ;; esac ;; dz*) unit=`expr $i : 'dz\(.*\)'` case $unit in 0|1|2|3|4|5|6|7) eval `echo $unit | awk ' { u = $1 } END { for (i = 0; i < 8; i++) printf("/etc/mknod tty%02d c 1 %d; ",u*8+i,u*8+i); }'` ;; *) echo bad unit for dz in: $i ;; esac ;; dhu*|dh*|dmf*|dmz*) case $i in dmz*) name=dmz; major=37; count=24; unit=`expr $i : "$name\(.*\)"` case $unit in 0) ch=a ;; 1) ch=b ;; 2) ch=c ;; 3) ch=e ;; 4) ch=f ;; 5) ch=g ;; *) echo bad unit for $name in: $i ;; esac;; dmf*) name=dmf; major=22; count=8; unit=`expr $i : "$name\(.*\)"` case $unit in 0) ch=A ;; 1) ch=B ;; 2) ch=C ;; 3) ch=E ;; 4) ch=F ;; 5) ch=G ;; 6) ch=H ;; 7) ch=I ;; *) echo bad unit for $name in: $i ;; esac;; dhu*) name=dhu; major=34; count=16; unit=`expr $i : "$name\(.*\)"`; case $unit in 0) ch=S ;; 1) ch=T ;; 2) ch=U ;; 3) ch=V ;; 4) ch=W ;; 5) ch=X ;; 6) ch=Y ;; 7) ch=Z ;; *) echo bad unit for $name in: $i ;; esac;; dh*) name=dh; major=12; count=16; unit=`expr $i : "$name\(.*\)"` case $unit in 0) ch=h ;; 1) ch=i ;; 2) ch=j ;; 3) ch=k ;; 4) ch=l ;; 5) ch=m ;; 6) ch=n ;; 7) ch=o ;; *) echo bad unit for $name in: $i ;; esac;; esac eval `echo $ch $unit $major $count | awk ' { ch = $1; u = $4 * $2; m = $3; cnt = $4 } END { for (i = 0; i < cnt; i++) if (i < 10) printf("/etc/mknod tty%s%x c %d %d; ",ch,i,m,u+i); else printf("/etc/mknod tty%s%c c %d %d; ",ch,87+i,m,u+i); }'` ;; lp*|va*|vp*) case $i in lp*) name=lp; major=15;; va*) name=va; major=10;; vp*) name=vp; major=6;; esac unit=`expr $i : "$name\(.*\)"` case $unit in 0|1|2|3|4|5|6|7) /etc/mknod $i c $major $unit; chmod 666 $i ;; *) echo bad unit for $name in: $i ;; esac ;; pty*) class=`expr $i : 'pty\(.*\)'` case $class in 0) offset=0 name=p;; 1) offset=16 name=q;; 2) offset=32 name=r;; 3) offset=48 name=s;; 4) offset=64 name=t;; 5) offset=80 name=u;; *) echo bad unit for pty in: $i;; esac case $class in 0|1|2|3|4|5) umask 0 eval `echo $offset $name | awk ' { b=$1; n=$2 } END { for (i = 0; i < 16; i++) printf("/etc/mknod tty%s%x c 20 %d; \ /etc/mknod pty%s%x c 21 %d; ", \ n, i, b+i, n, i, b+i); }'` umask 77 ;; esac ;; np*) class=`expr $i : 'np\(.*\)'` case $class in 0) offset=0 name=0;; 1) offset=16 name=1;; 2) offset=32 name=2;; *) echo bad unit for pty in: $i;; esac case $class in 0|1|2) eval `echo $offset | awk ' { b=$1 } END { for (i = 0; i < 4; i++) printf("/etc/mknod np%02d c 39 %d;", \ b+i, b+i); }'` ;; esac ;; dn*|ik*|ps*|ad*|ct*) unit=`expr $i : '..\(.*\)'` case $i in ct*) name=ct; chr=18;; dn*) name=cu; chr=24;; ps*) name=ps; chr=27;; ad*) name=ad; chr=29;; ik*) name=ik; chr=31;; esac case $unit in 0|1|2|3|4|5|6|7) umask 0 /etc/mknod ${name}${unit} c ${chr} ${unit} umask 77 ;; *) echo bad unit for ${name} in: $i ;; esac ;; local) sh MAKEDEV.local ;; esac done