home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OpenStep 3.3J
/
os33j.iso
/
usr
/
etc
/
MAKEDEV
< prev
next >
Wrap
Text File
|
1995-05-03
|
6KB
|
265 lines
#!/bin/sh -
umask 77
PATH=/bin:/usr/bin:/usr/etc:/etc:/usr/ucb:$PATH
export PATH
for i
do
case $i in
NeXT)
$0 std hd0 hd1 oc od0 od1 sd0 sd1 sd2 sd3 sd4 sd5 sd6 sd7 sd8 sd9 sd10 sd11 sd12 sd13 sd14 sd15 sc sg0 sg1 sg2 sg3 st0 st1 fd0 fd1 fc vol pty0 pty1 vid0 ev0 evs0 np0 nps0 pp
;;
std)
mknod console c 0 0 ; chmod 622 console
mknod drum c 7 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 dsp c 3 3 ; chmod 666 dsp
mknod tty c 2 0 ; chmod 666 tty
mknod ttya c 11 0 ; chmod 666 ttya
mknod ttyb c 11 1 ; chmod 666 ttyb
mknod ttyfa c 11 32 ; chmod 666 ttyfa
mknod ttyfb c 11 33 ; chmod 666 ttyfb
mknod ttyda c 11 64 ; chmod 666 ttyda
mknod ttydb c 11 65 ; chmod 666 ttydb
mknod ttydfa c 11 96 ; chmod 666 ttydfa
mknod ttydfb c 11 97 ; chmod 666 ttydfb
mknod cua c 11 192; chmod 600 cua ; chown uucp cua
mknod cub c 11 193; chmod 600 cub ; chown uucp cub
mknod cufa c 11 224; chmod 600 cufa ; chown uucp cufa
mknod cufb c 11 225; chmod 600 cufb ; chown uucp cufb
mknod klog c 6 0 ; chmod 600 klog
mknod sound c 36 0 ; chmod 600 sound
mknod dialup0 c 16 0 ; chmod 600 dialup0
mknod dialup1 c 16 1 ; chmod 600 dialup1
;;
od*|rd*|sd*|hd*)
umask 2 ; unit=`expr $i : '..\(.*\)'`
case $i in
od*) name=od; blk=2; chr=9;;
rd*) name=rd; blk=5; chr=15;;
sd*) name=sd; blk=6; chr=14;;
hd*) name=hd; blk=3; chr=15;;
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)
mknod ${name}${unit}a b $blk `expr $unit '*' 8 + 0`
mknod ${name}${unit}b b $blk `expr $unit '*' 8 + 1`
mknod ${name}${unit}c b $blk `expr $unit '*' 8 + 2`
mknod ${name}${unit}g b $blk `expr $unit '*' 8 + 6`
mknod r${name}${unit}a c $chr `expr $unit '*' 8 + 0`
mknod r${name}${unit}b c $chr `expr $unit '*' 8 + 1`
mknod r${name}${unit}c c $chr `expr $unit '*' 8 + 2`
mknod r${name}${unit}g c $chr `expr $unit '*' 8 + 6`
mknod ${name}${unit}d b $blk `expr $unit '*' 8 + 3`
mknod ${name}${unit}e b $blk `expr $unit '*' 8 + 4`
mknod ${name}${unit}f b $blk `expr $unit '*' 8 + 5`
mknod ${name}${unit}h b $blk `expr $unit '*' 8 + 7`
mknod r${name}${unit}d c $chr `expr $unit '*' 8 + 3`
mknod r${name}${unit}e c $chr `expr $unit '*' 8 + 4`
mknod r${name}${unit}f c $chr `expr $unit '*' 8 + 5`
mknod r${name}${unit}h c $chr `expr $unit '*' 8 + 7`
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
;;
fd*)
umask 2 ; unit=`expr $i : '..\(.*\)'`
name=fd; blk=1; chr=41;
case $unit in
0|1|2|3|4|5|6|7)
mknod ${name}${unit}a b $blk `expr $unit '*' 8 + 0`
mknod r${name}${unit}a c $chr `expr $unit '*' 8 + 0`
mknod r${name}${unit}b c $chr `expr $unit '*' 8 + 1`
chgrp operator ${name}${unit}[a-b] r${name}${unit}[a-b]
chmod 660 ${name}${unit}[a-b] r${name}${unit}[a-b]
;;
*)
echo bad unit for disk in: $i
;;
esac
umask 77
;;
oc)
mknod odc0 c 9 255 ; chmod 644 odc0
;;
fc)
mknod fdc0 c 41 64 ; chmod 644 fdc0
;;
sc)
mknod sdc0 c 14 128 ; chmod 644 sdc0
;;
vol)
mknod vol0 c 42 0 ; chmod 644 vol0
;;
pp)
mknod pp0 c 40 0 ; chmod 666 pp0
;;
sg*)
umask 2 ; unit=`expr $i : '..\(.*\)'`
case $i in
sg*) chr=33;;
esac
case $unit in
0|1|2|3)
mknod $i c $chr $unit
chgrp operator $i
chmod 666 $i
;;
*)
echo bad unit for device in: $i
;;
esac
umask 77
;;
st*)
umask 2 ; unit=`expr $i : '..\(.*\)'`
case $i in
st*) chr=34;;
esac
case $unit in
0|1)
one=`expr $unit '*' 8 + 1`
two=`expr $unit '*' 8 + 2`
three=`expr $unit '*' 8 + 3`
mknod rst$unit c $chr `expr $unit '*' 8`
mknod nrst$unit c $chr $one
mknod rxt$unit c $chr $two
mknod nrxt$unit c $chr $three
chgrp operator rst$unit
chgrp operator nrst$unit
chgrp operator rxt$unit
chgrp operator nrxt$unit
chmod 666 rst$unit
chmod 666 nrst$unit
chmod 666 rxt$unit
chmod 666 nrxt$unit
;;
*)
echo bad unit for device in: $i
;;
esac
umask 77
;;
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("mknod tty%s%x c 4 %d; \
mknod pty%s%x c 5 %d; ", \
n, i, b+i, n, i, b+i); }'`
umask 77
;;
esac
;;
vid*)
name=vid; chr=13;
unit=`expr $i : 'vid\(.*\)'`
case $unit in
0|1|2|3|4|5|6|7)
umask 0
mknod ${name}${unit} c ${chr} ${unit}
chmod 600 vid${unit}
umask 77
;;
*)
echo bad unit for ${name} in: $i
;;
esac
;;
ev*|evs*|np*|nps*|midi*|ipl*)
case $i in
nps*)
name=nps; chr=39;
unit=`expr $i : 'nps\(.*\)'`
;;
np*)
name=np; chr=8;
unit=`expr $i : 'np\(.*\)'`
;;
ev?)
name=ev; chr=10;
unit=`expr $i : 'ev\(.*\)'`
;;
evs?)
name=evs; chr=40;
unit=`expr $i : 'evs\(.*\)'`
;;
ipl*)
name=ipl; chr=35;
unit=`expr $i : 'ipl\(.*\)'`
;;
esac
case $unit in
0|1|2|3|4|5|6|7)
umask 0
mknod ${name}${unit} c ${chr} ${unit}
umask 77
;;
*)
echo bad unit for ${name} in: $i
;;
esac
;;
tty?)
case $i in
tty?)
name=tty; chr=11;
unit=`expr $i : 'tty\(.*\)'`
;;
esac
case $unit in
a|b)
numunit=`echo $unit | tr ab 01`
umask 0
mknod ${name}${unit} c ${chr} ${numunit}
umask 77
;;
*)
echo bad unit for ${name} in: $i
;;
esac
;;
local)
sh /private/dev/MAKEDEV.local
;;
esac
done