BSD 4_3_Net_2 release
[unix-history] / usr / src / etc / etc.tahoe / MAKEDEV
index 0f1646e..8b27256 100644 (file)
@@ -1,22 +1,39 @@
 #!/bin/sh -
 #
 #!/bin/sh -
 #
-# Copyright (c) 1988 Regents of the University of California.
+# Copyright (c) 1991 The Regents of the University of California.
 # All rights reserved.
 #
 # All rights reserved.
 #
-# Redistribution and use in source and binary forms are permitted
-# provided that the above copyright notice and this paragraph are
-# duplicated in all such forms and that any documentation,
-# advertising materials, and other materials related to such
-# distribution and use acknowledge that the software was developed
-# by the University of California, Berkeley.  The name of the
-# University may not be used to endorse or promote products derived
-# from this software without specific prior written permission.
-# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+# 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.
 #
 #
-#      @(#)MAKEDEV     5.8 (Berkeley) %G%
+# 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
 # Device "make" file.  Valid arguments:
 #      std     standard devices
 #      local   configuration specific devices
 #      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*)
@@ -66,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
                ;;
@@ -111,22 +142,22 @@ hd*|dk*)
                *) 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 ${name}${unit}g      b $blk `expr $u '*' 8 + 6`
-               /etc/mknod ${name}${unit}h      b $blk `expr $u '*' 8 + 7`
-               /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`
-               /etc/mknod r${name}${unit}g     c $chr `expr $u '*' 8 + 6`
-               /etc/mknod r${name}${unit}h     c $chr `expr $u '*' 8 + 7`
+               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-h]
                chgrp operator ${name}${unit}[a-h]
 
                chmod 640 ${name}${unit}[a-h]
                chgrp operator ${name}${unit}[a-h]
@@ -169,12 +200,12 @@ vx*|mp*)
        eval `echo $ch $major $count $un |
          awk ' { ch = $1; u = $3 * $4; m = $2; cnt = $3; nd = $4 } END {
            if (m == 12)
        eval `echo $ch $major $count $un |
          awk ' { ch = $1; u = $3 * $4; m = $2; cnt = $3; nd = $4 } END {
            if (m == 12)
-               printf("/etc/mknod mpcc%d c 11 %d; /bin/chmod 0600 mpcc%d; ",nd,u,nd);
+               printf("mknod mpcc%d c 11 %d; /bin/chmod 0600 mpcc%d; ",nd,u,nd);
            for (i = 0; i < cnt; i++)
              if (i < 10)
            for (i = 0; i < cnt; i++)
              if (i < 10)
-               printf("/etc/mknod tty%s%x c %d %d; ",ch,i,m,u+i);
+               printf("mknod tty%s%x c %d %d; ",ch,i,m,u+i);
              else
              else
-               printf("/etc/mknod tty%s%c c %d %d; ",ch,87+i,m,u+i); }'`
+               printf("mknod tty%s%c c %d %d; ",ch,87+i,m,u+i); }'`
        umask 77
        ;;
 
        umask 77
        ;;
 
@@ -194,8 +225,8 @@ pty*)
                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); }'`
                umask 77
                ;;
                                        n, i, b+i, n, i, b+i); }'`
                umask 77
                ;;
@@ -206,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
@@ -218,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
@@ -230,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