fix various mistakes, such as using hardcoded majors or typos/pastos

add some more necessary device entries
introduce makedisk_minimal() and use it to create the CD-ROM & md entries;
this procedure only creates 'a' and RAW_PART device entries
remove pf from 'all' target - it's not part of tree, so shouldn't be
created by default
This commit is contained in:
jdolecek 2003-10-24 08:29:57 +00:00
parent 53d9446257
commit 3b5469b94c

View File

@ -1,5 +1,5 @@
#!/bin/sh -
# $NetBSD: MAKEDEV.tmpl,v 1.3 2003/10/17 19:06:33 jdolecek Exp $
# $NetBSD: MAKEDEV.tmpl,v 1.4 2003/10/24 08:29:57 jdolecek Exp $
#
# Copyright (c) 2003 The NetBSD Foundation, Inc.
# All rights reserved.
@ -326,7 +326,7 @@ all)
makedev vnd0 vnd1 vnd2 vnd3
makedev bpf0 bpf1 bpf2 bpf3 bpf4 bpf5 bpf6 bpf7
makedev tun0 tun1 tun2 tun3
makedev ipl pf crypto random systrace
makedev ipl crypto random systrace
makedev lkm clockctl
makedev local
;;
@ -479,13 +479,13 @@ wscons)
wsmouse)
rm -f wsmouse
mknod wsmouse c %wsmouse_chr% 0
mknod wsmouse c %wsmux_chr% 0
chmod 600 wsmouse
;;
wskbd)
rm -f wskbd
mknod wskbd c %wskbd_chr% 1
mknod wskbd c %wsmux_chr% 1
chmod 600 wskbd
;;
@ -546,7 +546,7 @@ fd)
mkdir fd 2>/dev/null
n=0
while [ $n -lt 64 ]; do
mknod fd/$n c 22 $n
mknod fd/$n c %filedesc_chr% $n
n=$(($n + 1))
done
chmod 755 fd
@ -571,14 +571,7 @@ wt*)
;;
md*)
unit=${i#md}; blk=%md_blk%; chr=%md_chr%
rm -f md${unit}? rmd${unit}?
mknod md${unit}a b $blk $(($unit * 8 + 0))
mknod md${unit}d b $blk $(($unit * 8 + 3))
# mknod rmd${unit}a c $chr $(($unit * 8 + 0))
# mknod rmd${unit}d c $chr $(($unit * 8 + 3))
chgrp operator md${unit}? #rmd${unit}?
chmod 640 md${unit}? #rmd${unit}?
makedisk_minimal md ${i#md} %md_blk% %md_chr%
;;
ss*)
@ -675,6 +668,18 @@ ttyCY*)
done
;;
tty[0-9]|tty0[0-9])
# some archs have built-in zstty (major %zstty_chr%) instead
# of NS16550; create ttyZ* and hardlink as [dt]ty0*; this
# needs to be before com entry, for archs which have both
unit=${i#tty}
unit=$(($unit + 0))
makedev ttyZ${unit}
rm -f tty0$unit dty0$unit
ln ttyZ$unit tty0${unit}
ln dtyZ$unit dty0${unit}
;;
tty0*|tty1*|tty[0-9])
ounit=${i#tty}
ounit=$(($ounit + 0))
@ -768,6 +773,13 @@ pty*)
unset names
;;
stic*)
unit=${i#stic}
rm -f stic$unit
mknod stic$unit c %stic_chr% $unit
chmod 600 stic$unit
;;
st*)
case $i in
st*) name=st; unit=${i#st}; chr=%st_chr%; blk=%st_blk%;;
@ -800,31 +812,16 @@ ses*|ch*|uk*)
chmod 640 $name$unit
;;
cd*|mcd*)
case $i in
cd*) name=cd; unit=${i#cd}; chr=%cd_chr%; blk=%cd_chr%;;
mcd*) name=mcd; unit=${i#mcd}; chr=%mcd_chr%; blk=%mcd_chr%;;
esac
rm -f $name$unit? r$name$unit?
mknod ${name}${unit}a b $blk $(($unit * 8 + 0))
mknod ${name}${unit}d b $blk $(($unit * 8 + 3))
mknod r${name}${unit}a c $chr $(($unit * 8 + 0))
mknod r${name}${unit}d c $chr $(($unit * 8 + 3))
chgrp operator $name$unit? r$name$unit?
chmod 640 $name$unit? r$name$unit?
cd*)
makedisk_minimal cd ${i#cd} %cd_blk% %cd_chr% %
;;
mcd*)
makedisk_minimal mcd ${i#mcd} %mcd_blk% %mcd_chr%
;;
gdrom*)
case $i in
gdrom*) name=gdrom; unit=${i#gdrom}; chr=%gdrom_chr%; blk=%gdrom_blk%;;
esac
rm -f $name$unit? r$name$unit?
mknod ${name}${unit}a b $blk $(($unit * 16 + 0))
mknod ${name}${unit}c b $blk $(($unit * 16 + 2))
mknod r${name}${unit}a c $chr $(($unit * 16 + 0))
mknod r${name}${unit}c c $chr $(($unit * 16 + 2))
chgrp operator $name$unit? r$name$unit?
chmod 640 $name$unit? r$name$unit?
makedisk_minimal gdrom ${i#gdrom} %gdrom_blk% %gdrom_chr%
;;
lpt*|lpa*)
@ -940,6 +937,13 @@ apm*)
chmod 644 apm apmctl
;;
apm*)
rm -f apm apmctl
mknod apm c %apmdev_chr% 0
mknod apmctl c %apmdev_chr% 8
chmod 644 apm apmctl
;;
satlink*)
unit=${i#satlink}
rm -f satlink$unit
@ -1182,7 +1186,7 @@ nvram)
;;
rtc)
mknod rtc c %rtc_chr% 3
mknod rtc c %rtc_chr% 0
chmod 644 rtc
;;
@ -1236,9 +1240,15 @@ ttyv*)
mknod ttyv$unit c $chr $unit
;;
ttyv*)
chr=%physcon_chr%; unit=${i#ttyv}
rm -f ttyv$unit
mknod ttyv$unit c $chr $unit
;;
arcpp*)
chr=%arcpp_chr%; unit=${i#arcpp}
mkdev arcpp c $chr $unit
mkdev arcpp$unit c $chr $unit
;;
par*)
@ -1255,20 +1265,25 @@ par*)
;;
ite*|ttye*)
unit=${i#ttye}; chr=%ite_chr%
rm -f ttye$unit
rm -f ite*
case $i in
ite*) unit=${i#ite};;
ttye*) unit=${i#ttye};;
esac
chr=%ite_chr%
rm -f ttye$unit ite*
mknod ttye$unit c $chr $unit
;;
pms*)
major=%pms_chr%
unit=${i#qms}
name=pms
major=%opms_chr%
unit=${i#pms}
rm -f $name$unit
mknod $name$unit c $major $unit
;;
qms*)
name=qms
major=%qms_chr%
unit=${i#qms}
rm -f $name$unit
@ -1276,6 +1291,7 @@ qms*)
;;
lms*)
name=lms
major=%lms_chr%
unit=${i#lms}
rm -f $name$unit
@ -1302,6 +1318,16 @@ kbd)
mknod kbd c %kbd_chr% 0
;;
kbdctl)
rm -f kbdctl
mknod kbdctl c %kbd_chr% 1
;;
vidcconsole0)
mknod vidcconsole0 c %vidcconsole_chr% 0
chmod 640 vidcconsole0
;;
view*)
unit=${i#view}; chr=%view_chr%
rm -f view$unit
@ -1346,13 +1372,13 @@ grf*)
major=%grf_chr%
unit=${i#grf}
rm -f grf${unit}
mknod grf${unit} c 11 ${unit}
mknod grf${unit} c ${major} ${unit}
chmod 666 grf${unit}
;;
etvme)
rm -f etvme
mknod etvme c %etvme_chr% 0
mknod etvme c %et_chr% 0
chmod 600 etvme
;;
@ -1372,7 +1398,7 @@ scif*)
;;
sci*)
chr=%scif_chr%; unit=${i#scif}
chr=%sci_chr%; unit=${i#sci}
name=sci
rm -f $name$unit
mknod $name$unit c $chr $unit
@ -1486,7 +1512,7 @@ cgfour*)
cgsix*)
unit=${i#cgsix}
rm -f cgsix$unit
mknod cgsix$unit c %cgfix_chr% $unit
mknod cgsix$unit c %cgsix_chr% $unit
chmod 666 cgsix$unit
;;
@ -1740,4 +1766,20 @@ makedisk_p16high() {
chmod 640 $name$unit? r$name$unit?
}
# make only the very few basic disk device nodes - 'a' partition
# and raw partition
makedisk_minimal() {
name=$1; unit=$2; blk=$3; chr=$4
doff=%DISKMINOROFFSET%
ro=%RAWDISK_OFF%; rn=%RAWDISK_NAME%
rm -f $name$unit? r$name$unit?
mknod ${name}${unit}a b $blk $(($unit * $doff + 0))
mknod ${name}${unit}$rn b $blk $(($unit * $doff + $ro))
mknod r${name}${unit}a c $chr $(($unit * $doff + 0))
mknod r${name}${unit}$rn c $chr $(($unit * $doff + $ro))
chgrp operator $name$unit? r$name$unit?
chmod 640 $name$unit? r$name$unit?
}
makedev $*