BSD 4_3_Net_2 release
[unix-history] / usr / src / etc / etc.tahoe / MAKEDEV
index 849bc88..8b27256 100644 (file)
@@ -1,15 +1,50 @@
-#! /bin/sh
-#      @(#)MAKEDEV     5.4     %G%
+#!/bin/sh -
 #
 #
+# Copyright (c) 1991 The Regents of the University of California.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+#    must display the following acknowledgement:
+#      This product includes software developed by the University of
+#      California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+#    may be used to endorse or promote products derived from this software
+#    without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+#      @(#)MAKEDEV     5.12 (Berkeley) 4/8/91
+#
+
 # Device "make" file.  Valid arguments:
 #      std     standard devices
 #      local   configuration specific devices
 # Tapes:
 #      cy*     Cipher
 # Disks:
 # Device "make" file.  Valid arguments:
 #      std     standard devices
 #      local   configuration specific devices
 # Tapes:
 #      cy*     Cipher
 # Disks:
-#      dk*     VDDC or SMDE disk
+#      dk*     VDDC or SMDE disk on Versabus
+#      hd*     VDDC or SMDE disk on VME
 # Terminal multiplexors:
 #      vx*     VIOC
 # Terminal multiplexors:
 #      vx*     VIOC
+#      mp*     MPCC
 # Pseudo terminals:
 #      pty*    set of 32 master and slave pseudo terminals
 # Printers:
 # Pseudo terminals:
 #      pty*    set of 32 master and slave pseudo terminals
 # Printers:
 #      dr*     IKON DR-11W
 #      ik*     IKON DR-11W w/ E&S PS300
 #
 #      dr*     IKON DR-11W
 #      ik*     IKON DR-11W w/ E&S PS300
 #
+HOME=/; export HOME
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+export PATH
+
 umask 77
 for i
 do
 case $i in
 
 std)
 umask 77
 for i
 do
 case $i in
 
 std)
-       /etc/mknod CP           c 0 0
-       /etc/mknod console      c 0 1
-       /etc/mknod remote       c 0 2
-       /etc/mknod drum         c 8 0   ; chmod 640 drum ; chgrp kmem drum
-       /etc/mknod mem          c 3 0   ; chmod 640 mem ; chgrp kmem mem
-       /etc/mknod kmem         c 3 1   ; chmod 640 kmem ; chgrp kmem kmem
-       /etc/mknod null         c 3 2   ; chmod 666 null
-       /etc/mknod vmem         c 3 3   ; chmod 640 vmem ; chgrp kmem vmem
-       /etc/mknod tty          c 2 0   ; chmod 666 tty
-       /etc/mknod klog         c 15 0  ; chmod 400 klog
+       mknod CP        c 0 0
+       mknod console   c 0 1
+       mknod remote    c 0 2
+       mknod drum      c 8 0   ; chmod 640 drum ; chgrp kmem drum
+       mknod mem       c 3 0   ; chmod 640 mem ; chgrp kmem mem
+       mknod kmem      c 3 1   ; chmod 640 kmem ; chgrp kmem kmem
+       mknod null      c 3 2   ; chmod 666 null
+       mknod vmem      c 3 3   ; chmod 640 vmem ; chgrp kmem vmem
+       mknod tty       c 2 0   ; chmod 666 tty
+       mknod klog      c 15 0  ; chmod 400 klog
+       mknod stdin     c 21 0  ; chmod 666 stdin
+       mknod stdout    c 21 1  ; chmod 666 stdout
+       mknod stderr    c 21 2  ; chmod 666 stderr
+       mkdir fd > /dev/null 2>&1
+       (cd fd && eval `echo "" | awk ' BEGIN { \
+               for (i = 0; i < 64; i++) \
+                       printf("mknod %d c 21 %d;", i, i)}'`)
+       chown -R bin.bin fd
+       chmod 555 fd
+       chmod 666 fd/*
        ;;
 
 cy*)
        ;;
 
 cy*)
@@ -48,22 +97,22 @@ cy*)
                eight=`expr $unit + 8`
                twelve=`expr $unit + 12`
 #              twenty=`expr $unit + 20`
                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
+               mknod mt$unit           b $blk $unit
+               mknod mt$four           b $blk $four
+               mknod mt$eight          b $blk $eight
+               mknod mt$twelve         b $blk $twelve
                ln mt$four nmt$unit             ;: sanity
                ln mt$twelve nmt$eight          ;: ditto
                ln mt$four nmt$unit             ;: sanity
                ln mt$twelve nmt$eight          ;: 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
+               mknod rmt$unit          c $chr $unit
+               mknod rmt$four          c $chr $four
+               mknod rmt$eight         c $chr $eight
+               mknod rmt$twelve        c $chr $twelve
                ln rmt$four nrmt$unit           ;: sanity
                ln rmt$twelve nrmt$eight        ;: ditto
 #              if [ $i = ut ] 
 #              then
                ln rmt$four nrmt$unit           ;: sanity
                ln rmt$twelve nrmt$eight        ;: ditto
 #              if [ $i = ut ] 
 #              then
-#                      /etc/mknod mt$twenty    b $blk $twenty
-#                      /etc/mknod rmt$twenty   c $chr $twenty
+#                      mknod mt$twenty b $blk $twenty
+#                      mknod rmt$twenty        c $chr $twenty
 #              fi
                umask 77
                ;;
 #              fi
                umask 77
                ;;
@@ -73,13 +122,14 @@ cy*)
        esac
        ;;
 
        esac
        ;;
 
-dk*)
+hd*|dk*)
        unit=`expr $i : '..\(.*\)'`
        case $i in
        dk*) name=dk; blk=1; chr=5;;
        unit=`expr $i : '..\(.*\)'`
        case $i in
        dk*) name=dk; blk=1; chr=5;;
+       hd*) name=hd; blk=2; chr=6;;
        esac
        case $unit in
        esac
        case $unit in
-       0|1|2|3|4|5|6|7|8|9|a|b|c|d|e|f)
+       0|1|2|3|4|5|6|7|8|9|a|b|c|d|e|f|g|h)
                case $unit in
                a) u=10 ;;
                b) u=11 ;;
                case $unit in
                a) u=10 ;;
                b) u=11 ;;
@@ -87,26 +137,32 @@ dk*)
                d) u=13 ;;
                e) u=14 ;;
                f) u=15 ;;
                d) u=13 ;;
                e) u=14 ;;
                f) u=15 ;;
+               g) u=16 ;;
+               h) u=17 ;;
                *) u=$unit ;;
                esac
 
                *) u=$unit ;;
                esac
 
-               /etc/mknod ${name}${unit}a      b $blk `expr $u '*' 8 + 0`
-               /etc/mknod ${name}${unit}b      b $blk `expr $u '*' 8 + 1`
-               /etc/mknod ${name}${unit}c      b $blk `expr $u '*' 8 + 2`
-               /etc/mknod ${name}${unit}d      b $blk `expr $u '*' 8 + 3`
-               /etc/mknod ${name}${unit}e      b $blk `expr $u '*' 8 + 4`
-               /etc/mknod ${name}${unit}f      b $blk `expr $u '*' 8 + 5`
-               /etc/mknod r${name}${unit}a     c $chr `expr $u '*' 8 + 0`
-               /etc/mknod r${name}${unit}b     c $chr `expr $u '*' 8 + 1`
-               /etc/mknod r${name}${unit}c     c $chr `expr $u '*' 8 + 2`
-               /etc/mknod r${name}${unit}d     c $chr `expr $u '*' 8 + 3`
-               /etc/mknod r${name}${unit}e     c $chr `expr $u '*' 8 + 4`
-               /etc/mknod r${name}${unit}f     c $chr `expr $u '*' 8 + 5`
+               mknod ${name}${unit}a   b $blk `expr $u '*' 8 + 0`
+               mknod ${name}${unit}b   b $blk `expr $u '*' 8 + 1`
+               mknod ${name}${unit}c   b $blk `expr $u '*' 8 + 2`
+               mknod ${name}${unit}d   b $blk `expr $u '*' 8 + 3`
+               mknod ${name}${unit}e   b $blk `expr $u '*' 8 + 4`
+               mknod ${name}${unit}f   b $blk `expr $u '*' 8 + 5`
+               mknod ${name}${unit}g   b $blk `expr $u '*' 8 + 6`
+               mknod ${name}${unit}h   b $blk `expr $u '*' 8 + 7`
+               mknod r${name}${unit}a  c $chr `expr $u '*' 8 + 0`
+               mknod r${name}${unit}b  c $chr `expr $u '*' 8 + 1`
+               mknod r${name}${unit}c  c $chr `expr $u '*' 8 + 2`
+               mknod r${name}${unit}d  c $chr `expr $u '*' 8 + 3`
+               mknod r${name}${unit}e  c $chr `expr $u '*' 8 + 4`
+               mknod r${name}${unit}f  c $chr `expr $u '*' 8 + 5`
+               mknod r${name}${unit}g  c $chr `expr $u '*' 8 + 6`
+               mknod r${name}${unit}h  c $chr `expr $u '*' 8 + 7`
 
 
-               chmod 640 ${name}${unit}[a-f]
-               chgrp operator ${name}${unit}[a-f]
-               chmod 640 r${name}${unit}[a-f]
-               chgrp operator r${name}${unit}[a-f]
+               chmod 640 ${name}${unit}[a-h]
+               chgrp operator ${name}${unit}[a-h]
+               chmod 640 r${name}${unit}[a-h]
+               chgrp operator r${name}${unit}[a-h]
                ;;
        *)
                echo bad unit for disk in: $i
                ;;
        *)
                echo bad unit for disk in: $i
@@ -114,31 +170,43 @@ dk*)
        esac
        ;;
 
        esac
        ;;
 
-vx*)
-       unit=`expr $i : 'vx\(.*\)'`
-       case $unit in
-       0|1|2|3|4|5|6|7|8|9|a|b|c|d|e|f)
+vx*|mp*)
+       case $i in
+       vx*)    name=vx; major=1; count=16;
+               unit=`expr $i : "$name\(.*\)"`
                case $unit in
                case $unit in
-               a) un=10 ;;
-               b) un=11 ;;
-               c) un=12 ;;
-               d) un=13 ;;
-               e) un=14 ;;
-               f) un=15 ;;
-               *) un=$unit ;;
+               0|1|2|3|4|5|6|7|8|9|a|b|c|d|e|f) ch=$unit ;;
+               *) echo bad unit for $name in: $i ;;
                esac
                esac
-               eval `echo $un | awk ' { u = $1 } END {
-                   for (i = 0; i < 16; i++)
-                       printf("/etc/mknod tty%02x c 1 %d; ",u*16+i,u*16+i); }'`
-               ls -1 tty?? | grep [A-F] | while read x; do
-                       y=`echo $x | tr [A-F] [a-f]`
-                       mv $x $y
-               done
                ;;
                ;;
-       *)
-               echo bad unit for vx in: $i
+       mp*)    name=mp; major=12; count=16;
+               unit=`expr $i : "$name\(.*\)"`
+               case $unit in
+               0) ch=A ;; 1) ch=B ;; 2) ch=C ;; 3) ch=D ;;
+               4) ch=E ;; 5) ch=F ;; 6) ch=G ;; 7) ch=H ;;
+               8) ch=I ;; 9) ch=J ;; a) ch=K ;; b) ch=L ;;
+               c) ch=M ;; d) ch=N ;; e) ch=O ;; f) ch=P ;;
+               *) echo bad unit for $name in: $i ;;
+               esac
                ;;
        esac
                ;;
        esac
+
+       case $unit in
+       a) un=10 ;; b) un=11 ;; c) un=12 ;; d) un=13 ;;
+       e) un=14 ;; f) un=15 ;; *) un=$unit ;;
+       esac
+
+       umask 044
+       eval `echo $ch $major $count $un |
+         awk ' { ch = $1; u = $3 * $4; m = $2; cnt = $3; nd = $4 } END {
+           if (m == 12)
+               printf("mknod mpcc%d c 11 %d; /bin/chmod 0600 mpcc%d; ",nd,u,nd);
+           for (i = 0; i < cnt; i++)
+             if (i < 10)
+               printf("mknod tty%s%x c %d %d; ",ch,i,m,u+i);
+             else
+               printf("mknod tty%s%c c %d %d; ",ch,87+i,m,u+i); }'`
+       umask 77
        ;;
 
 pty*)
        ;;
 
 pty*)
@@ -147,25 +215,19 @@ pty*)
        0) offset=0 name=p;;
        1) offset=16 name=q;;
        2) offset=32 name=r;;
        0) offset=0 name=p;;
        1) offset=16 name=q;;
        2) offset=32 name=r;;
-       3) offset=32 name=s;;
+       3) offset=48 name=s;;
+       4) offset=64 name=s;;
+       5) offset=80 name=s;;
        *) echo bad unit for pty in: $i;;
        esac
        case $class in
        *) echo bad unit for pty in: $i;;
        esac
        case $class in
-       0|1|2|3)
+       0|1|2|3|4|5)
                umask 0
                eval `echo $offset $name | awk ' { b=$1; n=$2 } END {
                        for (i = 0; i < 16; i++)
                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 9 %d; \
-                                       /etc/mknod pty%s%x c 10 %d; ", \
+                               printf("mknod tty%s%x c 9 %d; \
+                                       mknod pty%s%x c 10 %d; ", \
                                        n, i, b+i, n, i, b+i); }'`
                                        n, i, b+i, n, i, b+i); }'`
-               ls -1 tty?? | grep [A-F] | while read x; do
-                       y=`echo $x | tr [A-F] [a-f]`
-                       mv $x $y
-               done
-               ls -1 pty?? | grep [A-F] | while read x; do
-                       y=`echo $x | tr [A-F] [a-f]`
-                       mv $x $y
-               done
                umask 77
                ;;
        esac
                umask 77
                ;;
        esac
@@ -175,7 +237,7 @@ enp*)
        unit=`expr $i : 'enp\(.*\)'`
        case $unit in
        [0-6])
        unit=`expr $i : 'enp\(.*\)'`
        case $unit in
        [0-6])
-               /etc/mknod enp${unit}ram c 16 $unit; chmod 644 enp${unit}ram
+               mknod enp${unit}ram c 16 $unit; chmod 644 enp${unit}ram
                ;;
        *)
                echo bad unit for enp in: $i
                ;;
        *)
                echo bad unit for enp in: $i
@@ -187,7 +249,7 @@ dr*)
        unit=`expr $i : 'dr\(.*\)'`
        case $unit in
        [0-6])
        unit=`expr $i : 'dr\(.*\)'`
        case $unit in
        [0-6])
-               /etc/mknod dr${unit} c 18 $unit; chmod 644 dr${unit}
+               mknod dr${unit} c 18 $unit; chmod 644 dr${unit}
                ;;
        *)
                echo bad unit for dr in: $i
                ;;
        *)
                echo bad unit for dr in: $i
@@ -199,7 +261,7 @@ ik*)
        unit=`expr $i : 'ik\(.*\)'`
        case $unit in
        [0-9])
        unit=`expr $i : 'ik\(.*\)'`
        case $unit in
        [0-9])
-               /etc/mknod ik${unit} c 20 $unit; chmod 644 ik${unit}
+               mknod ik${unit} c 20 $unit; chmod 644 ik${unit}
                ;;
        *)
                echo bad unit for ik in: $i
                ;;
        *)
                echo bad unit for ik in: $i