* use $0 instead of MAKEDEV

* use $((...)) instead of `eval ...`
* st* and md* are now root.operator 640
* reset the umask after running MAKEDEV.local
This commit is contained in:
lukem 1997-08-22 15:02:12 +00:00
parent e9aa93e046
commit 96f44170dc

View File

@ -1,6 +1,6 @@
#!/bin/sh -
#
# $NetBSD: MAKEDEV,v 1.15 1997/08/01 19:38:48 leo Exp $
# $NetBSD: MAKEDEV,v 1.16 1997/08/22 15:02:12 lukem Exp $
#
# Copyright (c) 1990 The Regents of the University of California.
# All rights reserved.
@ -39,7 +39,7 @@
# std standard devices
# local configuration specific devices
# Tapes:
# st* ? tape
# st* SCSI tape
# Disks:
# sd* Sun SCSI disks
# fd* Floppies
@ -67,6 +67,7 @@ eo=
# mk name b/c major minor [mode] [group]
mk() {
$eo rm -f $1
$eo mknod $1 $2 $3 $4
$eo chmod ${5-666} $1
test -n "$6" && $eo chgrp $6 $1
@ -82,15 +83,15 @@ unit=`expr $arg : '[a-z][a-z]*\([0-9][0-9]*\)'`
case $arg in
all)
sh MAKEDEV std fd pty0
sh MAKEDEV bwtwo0 cgtwo0 cgfour0
sh MAKEDEV sd0 sd1 sd2 sd3 sd4 sd5 sd6
sh MAKEDEV cd0 cd1 st0 st1 st2
sh MAKEDEV xd0 xd1 xd2 xd3
sh MAKEDEV xy0 xy1 xy2 xy3
sh MAKEDEV bpf0 bpf1 bpf2 bpf3
sh MAKEDEV tun0 tun1
sh MAKEDEV local
sh $0 std fd pty0
sh $0 bwtwo0 cgtwo0 cgfour0
sh $0 sd0 sd1 sd2 sd3 sd4 sd5 sd6
sh $0 cd0 cd1 st0 st1 st2
sh $0 xd0 xd1 xd2 xd3
sh $0 xy0 xy1 xy2 xy3
sh $0 bpf0 bpf1 bpf2 bpf3
sh $0 tun0 tun1
sh $0 local
;;
std)
@ -188,7 +189,7 @@ cd*|sd*|xd*|xy*|vnd*|ccd*)
ccd*) name=ccd; blk=9; chr=33;;
esac
case $unit in
0|1|2|3|4|5|6|7) offset=`expr $unit \* 8`;;
[0-7]) offset=$(($unit * 8));;
*) echo bad unit for $name in: $arg;;
esac
for part in a.0 b.1 c.2 d.3 e.4 f.5 g.6 h.7
@ -197,7 +198,7 @@ cd*|sd*|xd*|xy*|vnd*|ccd*)
tmp="$IFS" ; IFS="$IFS."
set -- $part
IFS="$tmp" ; unset tmp
minor=`expr $offset + $2`
minor=$(($offset + $2))
mk $name$unit$1 b $blk $minor 640 operator
mk r$name$unit$1 c $chr $minor 640 operator
)
@ -206,11 +207,10 @@ cd*|sd*|xd*|xy*|vnd*|ccd*)
st*)
name=st; blk=11; chr=18;
offset=`expr $unit \* 16`;
mk r$name$unit c $chr `expr $offset + 0`
mk nr$name$unit c $chr `expr $offset + 1`
mk er$name$unit c $chr `expr $offset + 2`
mk enr$name$unit c $chr `expr $offset + 3`
mk r$name$unit c $chr $(($unit * 16 + 0)) 660 operator
mk nr$name$unit c $chr $(($unit * 16 + 1)) 660 operator
mk er$name$unit c $chr $(($unit * 16 + 2)) 660 operator
mk enr$name$unit c $chr $(($unit * 16 + 3)) 660 operator
;;
bwtwo*)
@ -226,14 +226,18 @@ cgfour*)
;;
md*)
rm -f md${unit} md{$unit}c
mknod md${unit} b 13 $(($unit * 8))
# mknod rmd${unit} b 13 $((($unit + 16) * 8))
mknod md${unit}c b 13 $((($unit + 16) * 8))
chgrp operator md${unit} md{$unit}c
chmod 640 md${unit} md{$unit}c
;;
local)
umask 0
sh MAKEDEV.local all
sh $0.local all
umask 77
;;
*)
echo $arg: unknown device