|
|
@ -1,361 +1,396 @@ |
|
|
|
#!/bin/sh - |
|
|
|
# |
|
|
|
# $OpenBSD: MAKEDEV,v 1.18 2002/02/14 04:58:36 todd Exp $ |
|
|
|
# $NetBSD: MAKEDEV,v 1.5 1997/01/01 23:46:23 pk Exp $ |
|
|
|
# THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. |
|
|
|
# generated from: |
|
|
|
# |
|
|
|
# Copyright (c) 1990 The Regents of the University of California. |
|
|
|
# All rights reserved. |
|
|
|
# OpenBSD: etc.mvme88k/MAKEDEV.md,v 1.3 2002/04/28 14:56:40 miod Exp |
|
|
|
# OpenBSD: MAKEDEV.mi,v 1.45 2002/04/21 23:37:02 miod Exp |
|
|
|
# OpenBSD: MAKEDEV.sub,v 1.7 2002/02/16 01:19:52 deraadt Exp |
|
|
|
# |
|
|
|
# $OpenBSD: MAKEDEV,v 1.19 2002/04/28 14:56:56 miod Exp $ |
|
|
|
# |
|
|
|
# Written and contributed by W. Jolitz 12/90 |
|
|
|
# Copyright (c) 2001,2002 Todd T. Fries <todd@OpenBSD.org> |
|
|
|
# All rights reserved. |
|
|
|
# |
|
|
|
# Redistribution and use in source and binary forms are permitted provided |
|
|
|
# that: (1) source distributions retain this entire copyright notice and |
|
|
|
# comment, and (2) distributions including binaries display the following |
|
|
|
# acknowledgement: ``This product includes software developed by the |
|
|
|
# University of California, Berkeley and its contributors'' in the |
|
|
|
# documentation or other materials provided with the distribution and in |
|
|
|
# all advertising materials mentioning features or use of this software. |
|
|
|
# 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 ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED |
|
|
|
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF |
|
|
|
# MERCHANTABILITY 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. The name of the author may not be used to endorse or promote products |
|
|
|
# derived from this software without specific prior written permission. |
|
|
|
# |
|
|
|
# @(#)MAKEDEV 5.2 (Berkeley) 6/22/90 |
|
|
|
# THIS SOFTWARE IS PROVIDED ``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 AUTHOR 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. |
|
|
|
# |
|
|
|
# Device "make" file. Valid arguments: |
|
|
|
# all makes all known devices, including local devices. |
|
|
|
# Tries to make the 'standard' number of each type. |
|
|
|
# Tries to make the ``standard'' number of each type. |
|
|
|
# ramdisk makes all devices for a ramdisk kernel |
|
|
|
# std standard devices |
|
|
|
# local configuration specific devices |
|
|
|
# |
|
|
|
# Tapes: |
|
|
|
# st* SCSI tapes |
|
|
|
# |
|
|
|
# Disks: |
|
|
|
# sd* SCSI disks |
|
|
|
# cd* SCSI CD-ROM |
|
|
|
# rd* "ramdisk" pseudo-disks |
|
|
|
# cd* SCSI cdrom drives |
|
|
|
# ccd* concatenated disk devices |
|
|
|
# vnd* "file" pseudo-disks |
|
|
|
# ccd* contatenated disk devices |
|
|
|
# |
|
|
|
# rd* "rd" pseudo-disks |
|
|
|
# Terminal ports: |
|
|
|
# ttya-d MVME188 standard serial ports |
|
|
|
# tty0* MVME1x7 CL-CD2400 serial ports |
|
|
|
# ttyv* MVME332XT serial ports |
|
|
|
# Pseudo terminals: |
|
|
|
# pty* set of 16 master and slave pseudo terminals |
|
|
|
# |
|
|
|
# Printers: |
|
|
|
# lpt* stock lp |
|
|
|
# lpa* interruptless lp |
|
|
|
# |
|
|
|
# Call units: |
|
|
|
# |
|
|
|
# tty* set of 16 slave psuedo terminals |
|
|
|
# pty* set of 16 master pseudo terminals |
|
|
|
# Special purpose devices: |
|
|
|
# bpf* packet filter |
|
|
|
# lkm loadable kernel modules interface |
|
|
|
# fd makes fd/* for the fdescfs |
|
|
|
# bpf* Berkeley Packet Filter |
|
|
|
# tun* network tunnel driver |
|
|
|
# ss* SCSI scanner |
|
|
|
# uk* SCSI unknown |
|
|
|
# ch* SCSI changer |
|
|
|
# altq ALTQ control interface |
|
|
|
# |
|
|
|
# Machine specific devices: |
|
|
|
# sram static ram available on some models. |
|
|
|
# nvram non-volatile ram |
|
|
|
# flash flash ram available on some models. |
|
|
|
# bugtty (depricated) |
|
|
|
# vmel 32-bit vme interface |
|
|
|
# vmes 16-bit vme interface |
|
|
|
|
|
|
|
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/etc |
|
|
|
this=$0 |
|
|
|
umask 77 |
|
|
|
for i |
|
|
|
# pf* Packet Filter |
|
|
|
# lkm loadable kernel modules interface |
|
|
|
# *random inkernel random data source |
|
|
|
# altq/ ALTQ control interface |
|
|
|
# xfs* XFS filesystem devices |
|
|
|
# sram0 static memory access |
|
|
|
# nvram0 non-volatile memory access |
|
|
|
# vmes0 VMEbus access |
|
|
|
# vmel0 VMEbus access |
|
|
|
PATH=/sbin:/usr/sbin:/bin:/usr/bin |
|
|
|
T=$0 |
|
|
|
|
|
|
|
# set this to echo for Echo-Only debugging |
|
|
|
[ "$eo" ] || eo= |
|
|
|
|
|
|
|
hex() |
|
|
|
{ |
|
|
|
case $1 in |
|
|
|
[0-9]) echo -n $1;; |
|
|
|
10) echo -n a;; |
|
|
|
11) echo -n b;; |
|
|
|
12) echo -n c;; |
|
|
|
13) echo -n d;; |
|
|
|
14) echo -n e;; |
|
|
|
15) echo -n f;; |
|
|
|
esac |
|
|
|
} |
|
|
|
|
|
|
|
trunc() |
|
|
|
{ |
|
|
|
# XXX pdksh can't seem to deal with locally scoped variables |
|
|
|
# in ${foo#$bar} expansions |
|
|
|
arg1="$1" |
|
|
|
arg2="$2" |
|
|
|
case $3 in |
|
|
|
l) echo ${arg2#$arg1} ;; |
|
|
|
r|*) echo ${arg1#$arg2} ;; |
|
|
|
esac |
|
|
|
} |
|
|
|
|
|
|
|
unt() |
|
|
|
{ |
|
|
|
# XXX pdksh can't seem to deal with locally scoped variables |
|
|
|
# in ${foo#$bar} expansions |
|
|
|
arg="$1" |
|
|
|
tmp="${arg#[a-zA-Z]*}" |
|
|
|
tmp="${tmp%*[a-zA-Z]}" |
|
|
|
while [ "$tmp" != "$arg" ] |
|
|
|
do |
|
|
|
arg=$tmp |
|
|
|
tmp="${arg#[a-zA-Z]*}" |
|
|
|
tmp="${tmp%*[a-zA-Z]}" |
|
|
|
done |
|
|
|
echo $arg |
|
|
|
} |
|
|
|
|
|
|
|
dodisk() |
|
|
|
{ |
|
|
|
[ "$DEBUG" ] && set -x |
|
|
|
n=$(($((${5}*${7:-16}))+${6})) count=0 |
|
|
|
RMlist="$RMlist $1$2? r$1$2?" |
|
|
|
[ 0$7 -ne 8 ] && l="i j k l m n o p" |
|
|
|
for d in a b c d e f g h $l |
|
|
|
do |
|
|
|
M $1$2$d b $3 $(($n+$count)) 640 |
|
|
|
M r$1$2$d c $4 $(($n+$count)) 640 |
|
|
|
let count=count+1 |
|
|
|
done |
|
|
|
MKlist="$MKlist;chown root.operator $1$2? r$1$2?" |
|
|
|
} |
|
|
|
|
|
|
|
dodisk2() |
|
|
|
{ |
|
|
|
n=$(($(($5*${7:-16}))+$6)) |
|
|
|
M $1$2a b $3 $n 640 operator |
|
|
|
M r$1$2a c $4 $n 640 operator |
|
|
|
n=$(($n+2)) |
|
|
|
M $1$2c b $3 $n 640 operator |
|
|
|
M r$1$2c c $4 $n 640 operator |
|
|
|
} |
|
|
|
|
|
|
|
# M name b/c major minor [mode] [group] |
|
|
|
RMlist="rm -f" |
|
|
|
MKlist=":" |
|
|
|
|
|
|
|
mkl() { |
|
|
|
[ "${mklist[$1]}" ] && { |
|
|
|
mklist[$1]="${mklist[$1]};mknod -m $1 $2 $3 $4 $5" |
|
|
|
} || { |
|
|
|
mklist[$1]="mknod -m $1 $2 $3 $4 $5" |
|
|
|
modes="$modes $1" |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
M() { |
|
|
|
RMlist="$RMlist $1" |
|
|
|
mkl ${5-666} $1 $2 $3 $4 |
|
|
|
mklist="$mklist $1" |
|
|
|
G=${6:-wheel} |
|
|
|
[ "$7" ] && { |
|
|
|
MKlist="$MKlist;chown $7.$G $1" |
|
|
|
} || { |
|
|
|
case $G in |
|
|
|
wheel)g=0;;kmem)g=2;;operator)g=5;;tty)g=4;;dialer)g=117;; |
|
|
|
esac |
|
|
|
[ "${grplist[$g]}" ] && { |
|
|
|
grplist[$g]="${grplist[$g]} $1" |
|
|
|
} || { |
|
|
|
groups="$groups $g" |
|
|
|
grplist[$g]="chgrp $G $1" |
|
|
|
} |
|
|
|
} |
|
|
|
return 0 |
|
|
|
} |
|
|
|
|
|
|
|
R() { |
|
|
|
[ "$DEBUG" ] && set -x |
|
|
|
for i in "$@" |
|
|
|
do |
|
|
|
U=`unt $i` |
|
|
|
[ "$U" ] || U=0 |
|
|
|
|
|
|
|
case $i in |
|
|
|
std) |
|
|
|
M console c 0 0 600 |
|
|
|
M tty c 1 0 |
|
|
|
M mem c 2 0 640 kmem |
|
|
|
M kmem c 2 1 640 kmem |
|
|
|
M null c 2 2 |
|
|
|
M zero c 2 12 |
|
|
|
M stdin c 21 0 |
|
|
|
M stdout c 21 1 |
|
|
|
M stderr c 21 2 |
|
|
|
M ksyms c 43 0 640 kmem |
|
|
|
M drum c 3 0 640 kmem |
|
|
|
M klog c 6 0 600 |
|
|
|
;; |
|
|
|
|
|
|
|
all) |
|
|
|
sh $this std fd st0 ttya ttyb ttyc ttyd |
|
|
|
sh $this tty00 tty01 tty02 tty03 |
|
|
|
sh $this ttyw0 |
|
|
|
sh $this sd0 sd1 sd2 sd3 sd4 sd5 sd6 sd7 sd8 sd9 |
|
|
|
sh $this vnd0 vnd1 pty0 cd0 |
|
|
|
sh $this bpf0 bpf1 bpf2 bpf3 bpf4 bpf5 bpf6 bpf7 bpf8 bpf9 |
|
|
|
#sh $this ccd0 ccd1 ccd2 ccd3 |
|
|
|
sh $this pf tun0 tun1 lkm local |
|
|
|
sh $this sram0 nvram0 flash0 vmel0 vmes0 |
|
|
|
#sh $this lp0 lptwo0 |
|
|
|
sh $this random |
|
|
|
sh $this uk0 uk1 |
|
|
|
sh $this ss0 altq |
|
|
|
|
|
|
|
vmel0) |
|
|
|
M vmel0 c 31 0 640 kmem |
|
|
|
;; |
|
|
|
|
|
|
|
std) |
|
|
|
rm -f console drum mem kmem null zero tty |
|
|
|
rm -f klog stdin stdout stderr ksyms |
|
|
|
mknod console c 0 0 |
|
|
|
mknod drum c 3 0 ; chmod 640 drum ; chgrp kmem drum |
|
|
|
mknod kmem c 2 1 ; chmod 640 kmem ; chgrp kmem kmem |
|
|
|
mknod mem c 2 0 ; chmod 640 mem ; chgrp kmem mem |
|
|
|
mknod null c 2 2 ; chmod 666 null |
|
|
|
mknod zero c 2 12 ; chmod 666 zero |
|
|
|
mknod tty c 1 0 ; chmod 666 tty |
|
|
|
mknod klog c 6 0 ; chmod 600 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 |
|
|
|
mknod ksyms c 43 0 ; chmod 640 ksyms ; chown root.kmem ksyms |
|
|
|
vmes0) |
|
|
|
M vmes0 c 32 0 640 kmem |
|
|
|
;; |
|
|
|
|
|
|
|
ramdisk) |
|
|
|
sh $this std fd st0 ttya rd0 |
|
|
|
sh $this tty00 tty01 tty02 tty03 |
|
|
|
sh $this sd0 sd1 sd2 sd3 |
|
|
|
sh $this pty0 |
|
|
|
#sh $this ccd0 ccd1 ccd2 ccd3 |
|
|
|
sh $this tun0 tun1 lkm local |
|
|
|
sh $this sram0 nvram0 flash0 vmel0 vmes0 |
|
|
|
#sh $this lp0 lptwo0 |
|
|
|
sh $this random |
|
|
|
sh $this uk0 uk1 |
|
|
|
sh $this ss0 |
|
|
|
nvram0) |
|
|
|
M nvram0 c 10 0 640 kmem |
|
|
|
;; |
|
|
|
|
|
|
|
fd) |
|
|
|
rm -f fd/* |
|
|
|
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/* |
|
|
|
sram0) |
|
|
|
M sram0 c 7 0 640 kmem |
|
|
|
;; |
|
|
|
|
|
|
|
ss*) |
|
|
|
case $i in |
|
|
|
ss*) name=ss; unit=${i#ss}; chr=33;; |
|
|
|
esac |
|
|
|
rm -f $name$unit n$name$unit |
|
|
|
mknod $name$unit c $chr `expr $unit '*' 16 + 0` |
|
|
|
mknod n$name$unit c $chr `expr $unit '*' 16 + 1` |
|
|
|
chgrp operator $name$unit n$name$unit |
|
|
|
chmod 640 $name$unit n$name$unit |
|
|
|
xfs*) |
|
|
|
M xfs$U c 51 $U 600 |
|
|
|
;; |
|
|
|
|
|
|
|
ccd*|sd*) |
|
|
|
case $i in |
|
|
|
ccd*) name=ccd; unit=${i#ccd}; blk=5; chr=17;; |
|
|
|
sd*) name=sd; unit=${i#sd}; blk=4; chr=8;; |
|
|
|
esac |
|
|
|
rm -f $name$unit? r$name$unit? |
|
|
|
minor=`expr $unit '*' 16` |
|
|
|
for slice in a b c d e f g h i j k l m n o p |
|
|
|
do |
|
|
|
dev=${name}${unit}${slice} |
|
|
|
mknod $dev b $blk $minor |
|
|
|
mknod r$dev c $chr $minor |
|
|
|
minor=$(( $minor + 1 )) |
|
|
|
altq) |
|
|
|
RMlist="mkdir -p altq;$RMlist" |
|
|
|
for d in altq cbq wfq afm fifoq red rio localq hfsc cdnr blue priq; do |
|
|
|
M altq/$d c 52 $U 644 |
|
|
|
U=$(($U+1)) |
|
|
|
done |
|
|
|
chown root.operator $name$unit? r$name$unit? |
|
|
|
chmod 640 $name$unit? r$name$unit? |
|
|
|
;; |
|
|
|
|
|
|
|
vnd*) |
|
|
|
unit=${i#vnd} |
|
|
|
for name in vnd svnd; do |
|
|
|
blk=8; chr=19; |
|
|
|
case $name in |
|
|
|
vnd) off=0;; |
|
|
|
svnd) off=128;; |
|
|
|
esac |
|
|
|
rm -f $name$unit? r$name$unit? |
|
|
|
minor=`expr $unit '*' 16 '+' $off` |
|
|
|
for slice in a b c d e f g h i j k l m n o p |
|
|
|
do |
|
|
|
dev=${name}${unit}${slice} |
|
|
|
mknod $dev b $blk $minor |
|
|
|
mknod r$dev c $chr $minor |
|
|
|
minor=$(( $minor + 1 )) |
|
|
|
done |
|
|
|
chown root.operator ${name}${unit}? r${name}${unit}? |
|
|
|
chmod 640 ${name}${unit}? r${name}${unit}? |
|
|
|
*random) |
|
|
|
n=0 |
|
|
|
for pre in " " s u p a |
|
|
|
do |
|
|
|
M ${pre}random c 40 $n 644 |
|
|
|
n=$(($n+1)) |
|
|
|
done |
|
|
|
;; |
|
|
|
|
|
|
|
pty*) |
|
|
|
class=${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;; |
|
|
|
6) offset=96 name=v;; |
|
|
|
7) offset=112 name=w;; |
|
|
|
8) offset=128 name=x;; |
|
|
|
9) offset=144 name=y;; |
|
|
|
10) offset=160 name=z;; |
|
|
|
11) offset=176 name=P;; |
|
|
|
12) offset=192 name=Q;; |
|
|
|
13) offset=208 name=R;; |
|
|
|
14) offset=224 name=S;; |
|
|
|
15) offset=240 name=T;; |
|
|
|
*) echo bad unit for pty in: $i;; |
|
|
|
esac |
|
|
|
case $class in |
|
|
|
0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15) |
|
|
|
umask 0 |
|
|
|
eval `echo $offset $name | awk ' { b=$1; n=$2 } END { |
|
|
|
for (i = 0; i < 16; i++) |
|
|
|
printf("rm -f tty%s%x; mknod tty%s%x c 4 %d; \ |
|
|
|
rm -f pty%s%x; mknod pty%s%x c 5 %d; ", \ |
|
|
|
n, i, n, i, b+i, n, i, n, i, b+i); }'` |
|
|
|
umask 77 |
|
|
|
;; |
|
|
|
esac |
|
|
|
lkm) |
|
|
|
M lkm c 24 0 640 kmem |
|
|
|
;; |
|
|
|
|
|
|
|
st*) |
|
|
|
case $i in |
|
|
|
st*) name=st; unit=${i#st}; chr=20; blk=7;; |
|
|
|
esac |
|
|
|
rm -f $name$unit n$name$unit e$name$unit en$name$unit \ |
|
|
|
r$name$unit nr$name$unit er$name$unit enr$name$unit |
|
|
|
mknod $name$unit b $blk `expr $unit '*' 16 + 0` |
|
|
|
mknod n$name$unit b $blk `expr $unit '*' 16 + 1` |
|
|
|
mknod e$name$unit b $blk `expr $unit '*' 16 + 2` |
|
|
|
mknod en$name$unit b $blk `expr $unit '*' 16 + 3` |
|
|
|
mknod r$name$unit c $chr `expr $unit '*' 16 + 0` |
|
|
|
mknod nr$name$unit c $chr `expr $unit '*' 16 + 1` |
|
|
|
mknod er$name$unit c $chr `expr $unit '*' 16 + 2` |
|
|
|
mknod enr$name$unit c $chr `expr $unit '*' 16 + 3` |
|
|
|
chgrp operator $name$unit n$name$unit e$name$unit en$name$unit \ |
|
|
|
r$name$unit nr$name$unit er$name$unit enr$name$unit |
|
|
|
chmod 660 $name$unit n$name$unit e$name$unit en$name$unit \ |
|
|
|
r$name$unit nr$name$unit er$name$unit enr$name$unit |
|
|
|
pf*) |
|
|
|
M pf c 39 0 600 |
|
|
|
;; |
|
|
|
|
|
|
|
ch*) |
|
|
|
case $i in |
|
|
|
ch*) name=ch; unit=${i#ch}; chr=31;; |
|
|
|
esac |
|
|
|
rm -f $name$unit |
|
|
|
mknod $name$unit c $chr $unit |
|
|
|
chown root.operator $name$unit |
|
|
|
chmod 660 $name$unit |
|
|
|
tun*) |
|
|
|
M tun$U c 23 $U 600 |
|
|
|
;; |
|
|
|
|
|
|
|
uk*) |
|
|
|
case $i in |
|
|
|
uk*) name=uk; unit=${i#uk}; chr=34;; |
|
|
|
esac |
|
|
|
rm -f $name$unit |
|
|
|
mknod $name$unit c $chr $unit |
|
|
|
chown root.wheel $name$unit |
|
|
|
chmod 600 $name$unit |
|
|
|
bpf*) |
|
|
|
M bpf$U c 22 $U 600 |
|
|
|
;; |
|
|
|
|
|
|
|
cd*) |
|
|
|
case $i in |
|
|
|
cd*) name=cd; unit=${i#cd}; chr=9; blk=6;; |
|
|
|
esac |
|
|
|
rm -f $name$unit? r$name$unit? |
|
|
|
mknod ${name}${unit}a b $blk `expr $unit '*' 16 + 0` |
|
|
|
mknod ${name}${unit}c b $blk `expr $unit '*' 16 + 2` |
|
|
|
mknod r${name}${unit}a c $chr `expr $unit '*' 16 + 0` |
|
|
|
mknod r${name}${unit}c c $chr `expr $unit '*' 16 + 2` |
|
|
|
chgrp operator $name$unit? r$name$unit? |
|
|
|
chmod 640 $name$unit? r$name$unit? |
|
|
|
fd) |
|
|
|
RMlist="mkdir -p fd;$RMlist" n=0 |
|
|
|
while [ $n -lt 64 ];do M fd/$n c 21 $n;n=$(($n+1));done |
|
|
|
MKlist="$MKlist;chmod 555 fd" |
|
|
|
;; |
|
|
|
|
|
|
|
lpt*|lpa*) |
|
|
|
case $i in |
|
|
|
lpt*) name=lpt; unit=${i#lpt}; chr=11; flags=0;; |
|
|
|
lpa*) name=lpa; unit=${i#lpa}; chr=11; flags=128;; |
|
|
|
esac |
|
|
|
rm -f $name$unit |
|
|
|
mknod $name$unit c $chr `expr $unit + $flags` |
|
|
|
chown root.wheel $name$unit |
|
|
|
pty*) |
|
|
|
if [ $U -gt 15 ]; then |
|
|
|
echo bad unit for pty in: $i |
|
|
|
continue |
|
|
|
fi |
|
|
|
set -A tbl p q r s t u v w x y z P Q R S T |
|
|
|
name=${tbl[$U]} |
|
|
|
n=0 |
|
|
|
while [ $n -lt 16 ] |
|
|
|
do |
|
|
|
nam=$name$(hex $n) |
|
|
|
off=$(($U*16)) |
|
|
|
M tty$nam c 4 $(($off+$n)) |
|
|
|
M pty$nam c 5 $(($off+$n)) |
|
|
|
n=$(($n+1)) |
|
|
|
done |
|
|
|
;; |
|
|
|
|
|
|
|
pf) |
|
|
|
rm -f pf |
|
|
|
mknod pf c 39 0 |
|
|
|
chown root.wheel pf |
|
|
|
chmod 600 pf |
|
|
|
ttyv*) |
|
|
|
u=${i#ttyv*} |
|
|
|
case $u in |
|
|
|
0|1|2|3|4|5|6|7) |
|
|
|
M ttyv$u c 15 $u 660 dialer uucp |
|
|
|
M cuav$u c 15 $(($u+128)) 660 dialer uucp |
|
|
|
;; |
|
|
|
*) echo unknown tty device $i ;; |
|
|
|
esac |
|
|
|
;; |
|
|
|
|
|
|
|
bpf*|tun*) |
|
|
|
case $i in |
|
|
|
bpf*) name=bpf; unit=${i#bpf}; chr=22;; |
|
|
|
tun*) name=tun; unit=${i#tun}; chr=23;; |
|
|
|
tty0*) |
|
|
|
u=${i#tty0*} |
|
|
|
case $u in |
|
|
|
0|1|2|3) |
|
|
|
M tty0$u c 13 $u 660 dialer uucp |
|
|
|
M cua0$u c 13 $(($u+128)) 660 dialer uucp |
|
|
|
;; |
|
|
|
*) echo unknown tty device $i ;; |
|
|
|
esac |
|
|
|
rm -f $name$unit |
|
|
|
mknod $name$unit c $chr $unit |
|
|
|
chown root.wheel $name$unit |
|
|
|
;; |
|
|
|
|
|
|
|
sram*|nvram*|flash*|vmel*|vmes*) |
|
|
|
rm -f $i |
|
|
|
case $i in |
|
|
|
sram*) maj=7;; |
|
|
|
nvram*) maj=10;; |
|
|
|
flash*) maj=11;; |
|
|
|
vmel*) maj=31;; |
|
|
|
vmes*) maj=32;; |
|
|
|
tty[a-z]) |
|
|
|
u=${i#tty*} |
|
|
|
case $u in |
|
|
|
a) n=0 ;; |
|
|
|
b) n=1 ;; |
|
|
|
c) n=2 ;; |
|
|
|
d) n=3 ;; |
|
|
|
*) echo unknown tty device $i ;; |
|
|
|
esac |
|
|
|
case $u in |
|
|
|
a|b|c|d) |
|
|
|
M tty$u c 12 $n 660 dialer uucp |
|
|
|
M cua$u c 12 $(($n+128)) 660 dialer uucp |
|
|
|
;; |
|
|
|
esac |
|
|
|
mknod $i c ${maj} 0 |
|
|
|
chown root.kmem $i |
|
|
|
chmod 640 $i |
|
|
|
;; |
|
|
|
|
|
|
|
random|srandom|urandom|prandom|arandom) |
|
|
|
rm -f random urandom srandom prandom arandom |
|
|
|
mknod random c 40 0 |
|
|
|
mknod srandom c 40 1 |
|
|
|
mknod urandom c 40 2 |
|
|
|
mknod prandom c 40 3 |
|
|
|
mknod arandom c 40 4 |
|
|
|
chown root.wheel random srandom urandom prandom arandom |
|
|
|
chmod 644 random srandom urandom prandom arandom |
|
|
|
rd*) |
|
|
|
dodisk2 rd $U 7 18 $U 0 |
|
|
|
;; |
|
|
|
|
|
|
|
rd*) |
|
|
|
umask 2 ; unit=`expr $i : '.*d\(.*\)'` |
|
|
|
mknod rd${unit}a b 7 `expr $unit '*' 16 + 0` |
|
|
|
mknod rd${unit}c b 7 `expr $unit '*' 16 + 2` |
|
|
|
mknod rrd${unit}a c 18 `expr $unit '*' 16 + 0` |
|
|
|
mknod rrd${unit}c c 18 `expr $unit '*' 16 + 2` |
|
|
|
chown root.operator rd${unit}[ac] rrd${unit}[ac] |
|
|
|
chmod 640 rd${unit}[ac] rrd${unit}[ac] |
|
|
|
umask 77 |
|
|
|
vnd*) |
|
|
|
dodisk vnd $U 8 19 $U 0 |
|
|
|
dodisk svnd $U 8 19 $U 128 |
|
|
|
;; |
|
|
|
|
|
|
|
lkm) |
|
|
|
rm -f lkm |
|
|
|
mknod lkm c 24 0 |
|
|
|
chown root.kmem lkm |
|
|
|
chmod 640 lkm |
|
|
|
cd*) |
|
|
|
dodisk2 cd $U 6 9 $U 0 |
|
|
|
;; |
|
|
|
|
|
|
|
altq) |
|
|
|
mkdir -p altq |
|
|
|
chmod 755 altq |
|
|
|
unit=0 |
|
|
|
for dev in altq cbq wfq afm fifoq red rio localq hfsc \ |
|
|
|
cdnr blue priq; do |
|
|
|
rm -f altq/$dev |
|
|
|
mknod altq/$dev c 52 $unit |
|
|
|
chmod 644 altq/$dev |
|
|
|
unit=$(($unit + 1)) |
|
|
|
st*) |
|
|
|
n=$(($U*16)) |
|
|
|
for pre in " " n e en |
|
|
|
do |
|
|
|
M ${pre}st$U b 5 $n 660 operator |
|
|
|
M ${pre}rst$U c 20 $n 660 operator |
|
|
|
n=$(($n+1)) |
|
|
|
done |
|
|
|
;; |
|
|
|
|
|
|
|
local) |
|
|
|
umask 0 |
|
|
|
test -s MAKEDEV.local && sh MAKEDEV.local |
|
|
|
test -s $T.local && sh $T.local |
|
|
|
;; |
|
|
|
|
|
|
|
ramdisk) |
|
|
|
R pty0 ttya rd0 cd0 cd1 st0 st1 sd0 sd1 sd2 sd3 sd4 bpf0 std |
|
|
|
;; |
|
|
|
|
|
|
|
all) |
|
|
|
R ttyv0 ttyv1 ttyv2 ttyv3 ttyv4 ttyv5 ttyv6 ttyv7 tty00 tty01 |
|
|
|
R tty02 tty03 ttya ttyb ttyc ttyd ccd0 ccd1 ccd2 ccd3 vnd0 |
|
|
|
R vnd1 vnd2 vnd3 sd0 sd1 sd2 sd3 sd4 cd0 cd1 rd0 tun0 tun1 |
|
|
|
R tun2 tun3 bpf0 bpf1 bpf2 bpf3 bpf4 bpf5 bpf6 bpf7 bpf8 bpf9 |
|
|
|
R pty0 pty1 pty2 xfs0 vmel0 vmes0 nvram0 sram0 random lkm pf |
|
|
|
R altq std st0 st1 fd |
|
|
|
;; |
|
|
|
|
|
|
|
sd*|ccd*) |
|
|
|
case $i in |
|
|
|
sd*) dodisk sd $U 4 8 $U 0;; |
|
|
|
ccd*) dodisk ccd $U 9 17 $U 0;; |
|
|
|
esac |
|
|
|
;; |
|
|
|
|
|
|
|
*) |
|
|
|
echo $i: unknown device |
|
|
|
;; |
|
|
|
esac |
|
|
|
done |
|
|
|
} |
|
|
|
R "$@" |
|
|
|
if [ "$os" = "SunOS" ]; then |
|
|
|
eo=transform |
|
|
|
transform() { |
|
|
|
case $mode in |
|
|
|
600) mask=077;; |
|
|
|
640) mask=027;; |
|
|
|
660) mask=007;; |
|
|
|
644) mask=022;; |
|
|
|
666) mask=0;; |
|
|
|
440) mask=227;; |
|
|
|
esac |
|
|
|
echo `echo "$@"|sed \ |
|
|
|
's/mknod -m \([0-9]*\) /umask '$mask';mknod /;s/-m [0-9]* //g;\ |
|
|
|
s/operator/5/g;s/root.kmem/root.2/g;s/root\./root:/g'` |
|
|
|
} |
|
|
|
fi |
|
|
|
list="$RMlist" |
|
|
|
for mode in $modes; do |
|
|
|
list="$list;${mklist[$mode]}" |
|
|
|
done |
|
|
|
for group in $groups; do |
|
|
|
list="$list;${grplist[$group]}" |
|
|
|
done |
|
|
|
list="$list;$MKlist" |
|
|
|
if [ "$eo" = "echo" -o "$eo" = "transform" ]; then |
|
|
|
$eo "$list" |
|
|
|
else |
|
|
|
echo "$list" | sh |
|
|
|
fi |