1995-08-26 01:25:09 +04:00
|
|
|
#!/bin/sh -
|
2003-07-27 18:17:57 +04:00
|
|
|
# $NetBSD: MAKEDEV,v 1.58 2003/07/27 14:18:14 itojun Exp $
|
1995-08-26 01:25:09 +04:00
|
|
|
#
|
|
|
|
# @(#)MAKEDEV 8.1 (Berkeley) 6/9/93
|
|
|
|
#
|
1999-09-18 04:23:35 +04:00
|
|
|
###########################################################################
|
|
|
|
#
|
2002-06-18 17:40:14 +04:00
|
|
|
# PLEASE RUN "cd ../share/man/man8 ; make makedevs"
|
1999-09-18 04:23:35 +04:00
|
|
|
# AFTER CHANGING THIS FILE, AND COMMIT THE UPDATED MANPAGE!
|
|
|
|
#
|
|
|
|
###########################################################################
|
|
|
|
#
|
1995-08-26 01:25:09 +04:00
|
|
|
# Device "make" file. Valid arguments:
|
|
|
|
# std standard devices
|
|
|
|
# local configuration specific devices
|
1996-01-07 19:53:15 +03:00
|
|
|
# all create a reasonable amount of all files
|
2003-04-17 22:03:10 +04:00
|
|
|
# init A set of devices that is used for MFS /dev by init.
|
|
|
|
# May be equal to "all".
|
1995-08-26 01:25:09 +04:00
|
|
|
# Tapes:
|
2003-04-24 03:25:02 +04:00
|
|
|
# ht* MASSBUS TM03 and TU??
|
|
|
|
# tm* UNIBUS TM11 and TE10 emulations (e.g. Emulex TC-11)
|
1996-07-14 17:58:38 +04:00
|
|
|
# mt* MSCP tapes (e.g. TU81, TK50)
|
2003-04-24 03:25:02 +04:00
|
|
|
# ts* UNIBUS TS11
|
|
|
|
# ut* UNIBUS TU45 emulations (e.g. si 9700)
|
|
|
|
# uu* TU58 cassettes on DL11 controller
|
1997-01-05 21:49:12 +03:00
|
|
|
# st* SCSI tapes
|
1995-08-26 01:25:09 +04:00
|
|
|
# Disks:
|
2003-04-24 03:25:02 +04:00
|
|
|
# hp* MASSBUS RM??
|
|
|
|
# hk* UNIBUS RK06 and RK07
|
|
|
|
# up* other UNIBUS devices (e.g. on Emulex SC-21V controller)
|
|
|
|
# ra* MSCP disks (RA??, RD??)
|
|
|
|
# rx* MSCP floppy disk (RX33/50/...)
|
|
|
|
# rl* UNIBUS RL02
|
|
|
|
# rb* 730 IDC w/ RB80 and/or RB02
|
1995-08-26 01:25:09 +04:00
|
|
|
# ccd* "concatenated" pseudo-disks
|
2002-10-04 22:53:22 +04:00
|
|
|
# cgd* cryptographic pseudo-disks
|
1998-11-22 02:41:13 +03:00
|
|
|
# raid* RAIDframe disk driver
|
1995-08-26 01:25:09 +04:00
|
|
|
# vnd* "file" pseudo-disks
|
2003-04-24 03:25:02 +04:00
|
|
|
# rd* HDC9224 RD disks on VS2000
|
1997-01-05 21:49:12 +03:00
|
|
|
# sd* SCSI disks
|
|
|
|
# cd* SCSI CD-ROM
|
1999-12-18 06:09:44 +03:00
|
|
|
# md* memory pseudo-disk devices
|
1995-08-26 01:25:09 +04:00
|
|
|
# Terminal multiplexors:
|
2003-04-24 03:25:02 +04:00
|
|
|
# dz* UNIBUS DZ11 and DZ32
|
|
|
|
# dh* UNIBUS DH11 and emulations (e.g. Able DMAX, Emulex CS-11)
|
|
|
|
# dmf* UNIBUS DMF32
|
|
|
|
# dhu* UNIBUS DHU11
|
|
|
|
# dmz* UNIBUS DMZ32
|
|
|
|
# dl* UNIBUS DL11
|
1995-08-26 01:25:09 +04:00
|
|
|
# Pseudo terminals:
|
2002-02-02 10:04:44 +03:00
|
|
|
# pty* set of 62 master and slave pseudo terminals
|
|
|
|
# opty first 16 ptys, to save inodes on install media
|
1995-08-26 01:25:09 +04:00
|
|
|
# Printers:
|
2003-04-24 03:25:02 +04:00
|
|
|
# ct* UNIBUS parallel interface to CAT typesetter
|
|
|
|
# lp* UNIBUS LP11 parallel interface
|
|
|
|
# va* UNIBUS Varian parallel interface
|
|
|
|
# vp* UNIBUS Versatec parallel interface
|
1995-08-26 01:25:09 +04:00
|
|
|
# Call units:
|
2003-04-24 03:25:02 +04:00
|
|
|
# dn* UNIBUS DN11 and emulations (e.g. Able Quadracall)
|
1995-08-26 01:25:09 +04:00
|
|
|
# Special purpose devices:
|
2002-03-03 17:15:58 +03:00
|
|
|
# clockctl clock control for non root users
|
2003-04-24 03:25:02 +04:00
|
|
|
# ik* UNIBUS interface to Ikonas frame buffer
|
|
|
|
# ps* UNIBUS interface to Picture System 2
|
|
|
|
# ad* UNIBUS interface to Data Translation A/D converter
|
|
|
|
# np* UNIBUS Ethernet co-processor interface, for downloading.
|
|
|
|
# qv* QVSS (MicroVAX) display
|
1995-08-26 01:25:09 +04:00
|
|
|
# lkm loadable kernel modules
|
1996-07-14 17:58:38 +04:00
|
|
|
# bpf* berkeley packet filter
|
|
|
|
# tun* network tunnel device
|
2001-12-19 20:58:05 +03:00
|
|
|
# scsibus* SCSI busses, see scsi(4), scsictl(8)
|
1997-01-05 21:49:12 +03:00
|
|
|
# ss* SCSI scanner
|
2001-12-19 21:29:56 +03:00
|
|
|
# uk* unknown SCSI device
|
|
|
|
# ch* SCSI media changer
|
1997-11-20 08:57:38 +03:00
|
|
|
# random Random number generator
|
2002-06-17 20:21:03 +04:00
|
|
|
# systrace syscall tracer
|
2003-07-27 18:17:57 +04:00
|
|
|
# pf PF packet filter
|
1997-01-05 21:49:12 +03:00
|
|
|
#
|
1996-01-07 19:53:15 +03:00
|
|
|
PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
1995-08-26 01:25:09 +04:00
|
|
|
umask 77
|
2002-03-04 17:02:29 +03:00
|
|
|
|
|
|
|
# Check if we have fdesc mounted
|
|
|
|
if [ -d fd ]; then
|
|
|
|
case "`df fd`" in
|
|
|
|
*fdesc*) nofdesc=false;;
|
|
|
|
*) nofdesc=true;;
|
|
|
|
esac
|
|
|
|
else
|
|
|
|
nofdesc=true
|
|
|
|
fi
|
|
|
|
|
|
|
|
makedev()
|
|
|
|
{
|
|
|
|
|
1995-08-26 01:25:09 +04:00
|
|
|
for i
|
|
|
|
do
|
|
|
|
case $i in
|
|
|
|
|
2003-04-17 22:03:10 +04:00
|
|
|
init|all)
|
2002-03-04 17:02:29 +03:00
|
|
|
makedev std fd vnd0 ccd0 pty0 lkm random
|
2002-10-04 22:53:22 +04:00
|
|
|
makedev cgd0 cgd1 cgd2 cgd3
|
2002-03-04 17:02:29 +03:00
|
|
|
makedev bpf0 bpf1 bpf2 bpf3 bpf4 bpf5 bpf6 bpf7
|
|
|
|
makedev mt0 mt1 ts0 ts1 st0 st1 uk0 ss0 cd0 vt0
|
|
|
|
makedev ra0 ra1 ra2 ra3 hp0 hp1 hp2 hp3 sd0 sd1 sd2 sd3 rd0 rd1 rd2
|
|
|
|
makedev dz0 dl0 dhu0 rx0 rx1 md0 md1
|
|
|
|
makedev raid0 raid1 raid2 raid3 raid4 raid5 raid6 raid7
|
|
|
|
makedev scsibus0 scsibus1 scsibus2 scsibus3
|
|
|
|
makedev clockctl
|
2002-06-17 20:21:03 +04:00
|
|
|
makedev systrace
|
1996-01-07 19:53:15 +03:00
|
|
|
;;
|
|
|
|
|
1995-08-26 01:25:09 +04:00
|
|
|
std)
|
1998-08-31 22:52:10 +04:00
|
|
|
rm -f console drum floppy crl csa1 cas2 tu0 tu1 g0 g1 g2 g3
|
2003-04-27 17:15:28 +04:00
|
|
|
rm -f kUmem kmem mem null leds zero klog ksyms
|
2002-03-04 17:02:29 +03:00
|
|
|
rm -f ipl ipnat ipstate ipauth
|
1995-08-26 01:25:09 +04:00
|
|
|
mknod console c 0 0
|
1998-08-31 22:52:10 +04:00
|
|
|
mknod ttyg0 c 25 0
|
|
|
|
mknod ttyg1 c 25 1
|
|
|
|
mknod ttyg2 c 25 2
|
|
|
|
mknod ttyg3 c 25 3
|
1995-08-26 01:25:09 +04:00
|
|
|
mknod drum c 7 0 ; chmod 640 drum ; chgrp kmem drum
|
|
|
|
mknod floppy c 8 0
|
|
|
|
mknod crl c 35 0
|
|
|
|
mknod csa1 c 51 0
|
|
|
|
mknod csa2 c 51 1
|
|
|
|
mknod tu0 b 8 0
|
|
|
|
mknod tu1 b 8 1
|
|
|
|
mknod kUmem c 3 3 ; chmod 600 kUmem
|
|
|
|
mknod kmem c 3 1 ; chmod 640 kmem ; chgrp kmem kmem
|
|
|
|
mknod mem c 3 0 ; chmod 640 mem ; chgrp kmem mem
|
|
|
|
mknod null c 3 2 ; chmod 666 null
|
2002-10-21 08:14:47 +04:00
|
|
|
mknod zero c 3 12 ; chmod 666 zero
|
2001-02-18 13:50:45 +03:00
|
|
|
mknod leds c 3 13 ; chmod 666 leds
|
1995-08-26 01:25:09 +04:00
|
|
|
mknod klog c 33 0 ; chmod 600 klog
|
2003-04-27 17:15:28 +04:00
|
|
|
mknod ksyms c 79 0 ; chmod 444 ksyms
|
2002-03-04 17:02:29 +03:00
|
|
|
if $nofdesc; then
|
|
|
|
rm -f tty stdin stdout stderr
|
|
|
|
mknod tty c 2 0 ; chmod 666 tty
|
|
|
|
mknod stdin c 53 0 ; chmod 666 stdin
|
|
|
|
mknod stdout c 53 1 ; chmod 666 stdout
|
|
|
|
mknod stderr c 53 2 ; chmod 666 stderr
|
|
|
|
fi
|
|
|
|
mknod ipl c 42 0 ; chmod 600 ipl
|
1997-06-01 03:52:55 +04:00
|
|
|
mknod ipnat c 42 1 ; chmod 600 ipnat
|
|
|
|
mknod ipstate c 42 2 ; chmod 600 ipstate
|
1997-07-08 02:26:51 +04:00
|
|
|
mknod ipauth c 42 3 ; chmod 600 ipauth
|
1997-07-23 03:13:05 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
fd)
|
2002-03-04 17:02:29 +03:00
|
|
|
if $nofdesc; then
|
|
|
|
rm -f fd/*
|
|
|
|
mkdir fd 2>/dev/null
|
|
|
|
n=0
|
|
|
|
while [ $n -lt 64 ]; do
|
|
|
|
mknod fd/$n c 53 $n
|
|
|
|
n=$(($n + 1))
|
|
|
|
done
|
|
|
|
chmod 755 fd
|
|
|
|
chmod 666 fd/*
|
|
|
|
fi
|
1995-08-26 01:25:09 +04:00
|
|
|
;;
|
|
|
|
|
2000-08-11 23:19:03 +04:00
|
|
|
st*)
|
|
|
|
case $i in
|
|
|
|
st*) name=st; unit=${i#st}; blk=21; chr=60;;
|
|
|
|
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 $(($unit * 16+ 0))
|
|
|
|
mknod n${name}${unit} b $blk $(($unit * 16+ 1))
|
|
|
|
mknod e${name}${unit} b $blk $(($unit * 16+ 2))
|
|
|
|
mknod en${name}${unit} b $blk $(($unit * 16+ 3))
|
|
|
|
mknod r${name}${unit} c $chr $(($unit * 16+ 0))
|
|
|
|
mknod nr${name}${unit} c $chr $(($unit * 16+ 1))
|
|
|
|
mknod er${name}${unit} c $chr $(($unit * 16+ 2))
|
|
|
|
mknod enr${name}${unit} c $chr $(($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}
|
|
|
|
;;
|
|
|
|
|
|
|
|
ht*|tm*|mt*|ts*|ut*)
|
1995-08-26 01:25:09 +04:00
|
|
|
case $i in
|
1997-01-05 21:49:12 +03:00
|
|
|
ht*) name=ht; unit=${i#ht}; blk=1; chr=5 ;;
|
|
|
|
mt*) name=mt; unit=${i#mt}; blk=15; chr=38;;
|
|
|
|
tm*) name=tm; unit=${i#tm}; blk=5; chr=14;;
|
|
|
|
ts*) name=ts; unit=${i#ts}; blk=6; chr=16;;
|
|
|
|
ut*) name=ut; unit=${i#ut}; blk=10; chr=17;;
|
1995-08-26 01:25:09 +04:00
|
|
|
esac
|
|
|
|
case $unit in
|
1997-08-22 19:30:49 +04:00
|
|
|
[0-7])
|
1997-01-05 21:49:12 +03:00
|
|
|
four=$(($unit + 4)) ; eight=$(($unit + 8))
|
|
|
|
twelve=$(($unit + 12)) ; twenty=$(($unit + 20))
|
1997-08-22 19:30:49 +04:00
|
|
|
rm -f $name$unit $name$four $name$eight $name$twelve \
|
|
|
|
n$name$unit n$name$eight nr$name$unit nr$name$eight \
|
|
|
|
r$name$unit r$name$four r$name$eight r$name$twelve
|
1996-01-07 19:53:15 +03:00
|
|
|
mknod $name$unit b $blk $unit
|
|
|
|
mknod $name$four b $blk $four
|
|
|
|
mknod $name$eight b $blk $eight
|
|
|
|
mknod $name$twelve b $blk $twelve
|
|
|
|
mknod n$name$unit b $blk $four ;: sanity w/pdp11 v7
|
|
|
|
mknod n$name$eight b $blk $twelve ;: ditto
|
|
|
|
mknod nr$name$unit c $chr $four ;: sanity w/pdp11 v7
|
|
|
|
mknod nr$name$eight c $chr $twelve ;: ditto
|
|
|
|
mknod r$name$unit c $chr $unit
|
|
|
|
mknod r$name$four c $chr $four
|
|
|
|
mknod r$name$eight c $chr $eight
|
|
|
|
mknod r$name$twelve c $chr $twelve
|
1997-08-22 19:30:49 +04:00
|
|
|
chgrp operator $name$unit $name$four $name$eight $name$twelve \
|
|
|
|
n$name$unit n$name$eight nr$name$unit nr$name$eight \
|
|
|
|
r$name$unit r$name$four r$name$eight r$name$twelve
|
|
|
|
chmod 660 $name$unit $name$four $name$eight $name$twelve \
|
|
|
|
n$name$unit n$name$eight nr$name$unit nr$name$eight \
|
|
|
|
r$name$unit r$name$four r$name$eight r$name$twelve
|
2002-03-13 04:26:54 +03:00
|
|
|
if [ $i = ut ]
|
1995-08-26 01:25:09 +04:00
|
|
|
then
|
1997-08-22 19:30:49 +04:00
|
|
|
rm -f $name$twenty r$name$twenty
|
|
|
|
mknod $name$twenty b $blk $twenty
|
|
|
|
mknod r$name$twenty c $chr $twenty
|
|
|
|
chgrp operator $name$twenty r$name$twenty
|
|
|
|
chmod 660 $name$twenty r$name$twenty
|
1996-01-07 19:53:15 +03:00
|
|
|
fi
|
|
|
|
if [ ! -e rmt$eight ] # compatibility stuff
|
|
|
|
then
|
2002-03-04 17:02:29 +03:00
|
|
|
ln -fs $name$unit mt$unit
|
|
|
|
ln -fs $name$four mt$four
|
|
|
|
ln -fs $name$eight mt$eight
|
|
|
|
ln -fs $name$twelve mt$twelve
|
|
|
|
ln -fs n$name$unit nmt$unit
|
|
|
|
ln -fs n$name$eight nmt$eight
|
|
|
|
ln -fs nr$name$unit nrmt$unit
|
|
|
|
ln -fs nr$name$eight nrmt$eight
|
|
|
|
ln -fs r$name$unit rmt$unit
|
|
|
|
ln -fs r$name$four rmt$four
|
|
|
|
ln -fs r$name$eight rmt$eight
|
|
|
|
ln -fs r$name$twelve rmt$twelve
|
1995-08-26 01:25:09 +04:00
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo bad unit for tape in: $1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
|
1999-06-28 00:06:48 +04:00
|
|
|
random)
|
|
|
|
rm -f random urandom
|
|
|
|
mknod random c 67 0
|
|
|
|
mknod urandom c 67 1
|
|
|
|
chmod 444 random
|
|
|
|
chmod 644 urandom
|
|
|
|
;;
|
|
|
|
|
2002-10-04 22:53:22 +04:00
|
|
|
hp*|hk*|up*|ra*|rl*|rb*|ccd*|cgd*|vnd*|rd*|sd*|rx*|raid*)
|
1997-01-05 21:49:12 +03:00
|
|
|
umask 2
|
1995-08-26 01:25:09 +04:00
|
|
|
case $i in
|
1997-01-05 21:49:12 +03:00
|
|
|
hp*) name=hp; unit=${i#hp}; blk=0; chr=4;;
|
|
|
|
hk*) name=hk; unit=${i#hk}; blk=3; chr=11;;
|
|
|
|
up*) name=up; unit=${i#up}; blk=2; chr=13;;
|
1999-06-28 00:01:49 +04:00
|
|
|
raid*) name=raid; unit=${i#raid}; blk=25; chr=73;;
|
1997-01-05 21:49:12 +03:00
|
|
|
ra*) name=ra; unit=${i#ra}; blk=9; chr=9;;
|
|
|
|
rb*) name=rb; unit=${i#rb}; blk=11; chr=23;;
|
1998-02-08 17:15:18 +03:00
|
|
|
rx*) name=rx; unit=${i#rx}; blk=12; chr=30;;
|
1997-01-05 21:49:12 +03:00
|
|
|
rl*) name=rl; unit=${i#rl}; blk=14; chr=32;;
|
|
|
|
ccd*) name=ccd; unit=${i#ccd}; blk=17; chr=54;;
|
2002-10-04 22:53:22 +04:00
|
|
|
cgd*) name=cgd; unit=${i#cgd}; blk=26; chr=77;;
|
1997-01-05 21:49:12 +03:00
|
|
|
vnd*) name=vnd; unit=${i#vnd}; blk=18; chr=55;;
|
|
|
|
rd*) name=rd; unit=${i#rd}; blk=19; chr=58;;
|
|
|
|
sd*) name=sd; unit=${i#sd}; blk=20; chr=59;;
|
1995-08-26 01:25:09 +04:00
|
|
|
esac
|
|
|
|
case $unit in
|
1997-08-22 19:30:49 +04:00
|
|
|
[0-9]|[12][0-9]|3[01])
|
|
|
|
rm -f ${name}${unit}[a-h] r${name}${unit}[a-h]
|
1997-01-05 21:49:12 +03:00
|
|
|
mknod ${name}${unit}a b $blk $(($unit * 8 + 0))
|
|
|
|
mknod ${name}${unit}b b $blk $(($unit * 8 + 1))
|
|
|
|
mknod ${name}${unit}c b $blk $(($unit * 8 + 2))
|
|
|
|
mknod ${name}${unit}d b $blk $(($unit * 8 + 3))
|
|
|
|
mknod ${name}${unit}e b $blk $(($unit * 8 + 4))
|
|
|
|
mknod ${name}${unit}f b $blk $(($unit * 8 + 5))
|
|
|
|
mknod ${name}${unit}g b $blk $(($unit * 8 + 6))
|
|
|
|
mknod ${name}${unit}h b $blk $(($unit * 8 + 7))
|
|
|
|
mknod r${name}${unit}a c $chr $(($unit * 8 + 0))
|
|
|
|
mknod r${name}${unit}b c $chr $(($unit * 8 + 1))
|
|
|
|
mknod r${name}${unit}c c $chr $(($unit * 8 + 2))
|
|
|
|
mknod r${name}${unit}d c $chr $(($unit * 8 + 3))
|
|
|
|
mknod r${name}${unit}e c $chr $(($unit * 8 + 4))
|
|
|
|
mknod r${name}${unit}f c $chr $(($unit * 8 + 5))
|
|
|
|
mknod r${name}${unit}g c $chr $(($unit * 8 + 6))
|
|
|
|
mknod r${name}${unit}h c $chr $(($unit * 8 + 7))
|
1995-08-26 01:25:09 +04:00
|
|
|
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
|
|
|
|
;;
|
|
|
|
|
1997-01-05 21:49:12 +03:00
|
|
|
cd*)
|
|
|
|
case $i in
|
|
|
|
cd*) name=cd; unit=${i#cd}; chr=61; blk=22;;
|
|
|
|
esac
|
|
|
|
rm -f $name$unit? r$name$unit?
|
|
|
|
mknod ${name}${unit}a b $blk $(($unit * 8 + 0))
|
2000-11-08 02:17:41 +03:00
|
|
|
mknod ${name}${unit}c b $blk $(($unit * 8 + 2))
|
1997-01-05 21:49:12 +03:00
|
|
|
mknod r${name}${unit}a c $chr $(($unit * 8 + 0))
|
2000-11-08 02:17:41 +03:00
|
|
|
mknod r${name}${unit}c c $chr $(($unit * 8 + 2))
|
1997-01-05 21:49:12 +03:00
|
|
|
chgrp operator $name$unit? r$name$unit?
|
|
|
|
chmod 640 $name$unit? r$name$unit?
|
|
|
|
;;
|
|
|
|
|
|
|
|
ss*)
|
|
|
|
case $i in
|
|
|
|
ss*) name=ss; unit=${i#ss}; chr=64;;
|
|
|
|
esac
|
1997-08-22 19:30:49 +04:00
|
|
|
rm -f $name$unit n$name$unit en$name$unit
|
|
|
|
mknod $name$unit c $chr $(($unit * 16 + 0))
|
|
|
|
mknod n$name$unit c $chr $(($unit * 16 + 1))
|
|
|
|
mknod en$name$unit c $chr $(($unit * 16 + 3))
|
|
|
|
chgrp operator $name$unit n$name$unit en$name$unit
|
|
|
|
chmod 640 $name$unit n$name$unit en$name$unit
|
1997-01-05 21:49:12 +03:00
|
|
|
;;
|
|
|
|
|
|
|
|
ch*|uk*)
|
|
|
|
case $i in
|
|
|
|
ch*) name=ch; unit=${i#ch}; chr=63;;
|
|
|
|
uk*) name=uk; unit=${i#uk}; chr=65;;
|
|
|
|
esac
|
|
|
|
rm -f $name$unit
|
2002-10-21 08:14:47 +04:00
|
|
|
mknod $name$unit c $chr $unit
|
1997-01-05 21:49:12 +03:00
|
|
|
chgrp operator $name$unit
|
|
|
|
chmod 640 $name$unit
|
|
|
|
;;
|
|
|
|
|
|
|
|
md*)
|
2002-03-13 04:26:54 +03:00
|
|
|
unit=${i#md}; blk=23; chr=62
|
2000-01-21 15:28:22 +03:00
|
|
|
rm -f md${unit}? rmd${unit}?
|
2002-03-13 04:26:54 +03:00
|
|
|
mknod md${unit}a b $blk $(($unit * 8 + 0))
|
|
|
|
mknod md${unit}c b $blk $(($unit * 8 + 2))
|
|
|
|
# mknod rmd${unit}a c $chr $(($unit * 8 + 0))
|
|
|
|
# mknod rmd${unit}c c $chr $(($unit * 8 + 2))
|
2000-01-21 15:28:22 +03:00
|
|
|
chgrp operator md${unit}? #rmd${unit}?
|
|
|
|
chmod 640 md${unit}? #rmd${unit}?
|
1997-01-05 21:49:12 +03:00
|
|
|
;;
|
|
|
|
|
1995-08-26 01:25:09 +04:00
|
|
|
uu*)
|
1997-08-22 19:30:49 +04:00
|
|
|
unit=${i#uu}
|
2002-03-13 04:26:54 +03:00
|
|
|
name=uu; blk=13
|
1995-08-26 01:25:09 +04:00
|
|
|
case $unit in
|
1997-08-22 19:30:49 +04:00
|
|
|
[0-3])
|
|
|
|
mknod ${name}${unit} b $blk $(($unit * 2 + 0))
|
|
|
|
mknod ${name}${unit}a b $blk $(($unit * 2 + 1))
|
1995-08-26 01:25:09 +04:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo bad unit for uu cassette in: $i
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
|
|
|
|
dz*)
|
2002-03-13 04:26:54 +03:00
|
|
|
unit=${i#dz}
|
1995-08-26 01:25:09 +04:00
|
|
|
case $unit in
|
1997-08-22 19:30:49 +04:00
|
|
|
[0-7])
|
1998-12-09 00:43:06 +03:00
|
|
|
i=0
|
|
|
|
while [ $i -lt 8 ]; do
|
|
|
|
no=$(($unit * 8 + $i))
|
|
|
|
`printf "mknod tty%02d c 1 %d\n" $no $no`
|
|
|
|
i=$(($i + 1))
|
|
|
|
done
|
1995-08-26 01:25:09 +04:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo bad unit for dz in: $i
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
|
1998-06-06 02:31:43 +04:00
|
|
|
dhu*|dh*|dmf*|dmz*|vt*)
|
1995-08-26 01:25:09 +04:00
|
|
|
case $i in
|
2002-03-13 04:26:54 +03:00
|
|
|
vt*) name=vt; major=68; count=8
|
1998-06-06 02:31:43 +04:00
|
|
|
unit=${i#vt}
|
|
|
|
case $unit in
|
|
|
|
0) ch=w ;;
|
|
|
|
*) echo bad unit for $name in: $i ;;
|
|
|
|
esac;;
|
2002-03-13 04:26:54 +03:00
|
|
|
dmz*) name=dmz; major=37; count=24
|
1997-08-22 19:30:49 +04:00
|
|
|
unit=${i#dmz}
|
1995-08-26 01:25:09 +04:00
|
|
|
case $unit in
|
1998-08-31 22:52:10 +04:00
|
|
|
0) ch=a ;; 1) ch=b ;; 2) ch=c ;; 3) ch=e ;; 4) ch=f ;;
|
1995-08-26 01:25:09 +04:00
|
|
|
*) echo bad unit for $name in: $i ;;
|
|
|
|
esac;;
|
2002-03-13 04:26:54 +03:00
|
|
|
dmf*) name=dmf; major=22; count=8
|
1997-08-22 19:30:49 +04:00
|
|
|
unit=${i#dmf}
|
1995-08-26 01:25:09 +04:00
|
|
|
case $unit in
|
|
|
|
0) ch=A ;; 1) ch=B ;; 2) ch=C ;; 3) ch=E ;;
|
|
|
|
4) ch=F ;; 5) ch=G ;; 6) ch=H ;; 7) ch=I ;;
|
|
|
|
*) echo bad unit for $name in: $i ;;
|
|
|
|
esac;;
|
2002-03-13 04:26:54 +03:00
|
|
|
dhu*) name=dhu; major=34; count=16
|
1997-08-22 19:30:49 +04:00
|
|
|
unit=${i#dhu}
|
1995-08-26 01:25:09 +04:00
|
|
|
case $unit in
|
|
|
|
0) ch=S ;; 1) ch=T ;; 2) ch=U ;; 3) ch=V ;;
|
|
|
|
4) ch=W ;; 5) ch=X ;; 6) ch=Y ;; 7) ch=Z ;;
|
|
|
|
*) echo bad unit for $name in: $i ;;
|
|
|
|
esac;;
|
2002-03-13 04:26:54 +03:00
|
|
|
dh*) name=dh; major=12; count=16
|
1997-08-22 19:30:49 +04:00
|
|
|
unit=${i#dh}
|
1995-08-26 01:25:09 +04:00
|
|
|
case $unit in
|
|
|
|
0) ch=h ;; 1) ch=i ;; 2) ch=j ;; 3) ch=k ;;
|
|
|
|
4) ch=l ;; 5) ch=m ;; 6) ch=n ;; 7) ch=o ;;
|
|
|
|
*) echo bad unit for $name in: $i ;;
|
|
|
|
esac;;
|
|
|
|
esac
|
1998-12-09 00:43:06 +03:00
|
|
|
i=0
|
|
|
|
while [ $i -lt $count ]; do
|
2002-10-21 08:14:47 +04:00
|
|
|
`printf "mknod tty%s%x c %d %d\n" \
|
|
|
|
$ch $i $major $(($unit * $count + $i))`
|
|
|
|
i=$(($i + 1))
|
1998-12-09 00:43:06 +03:00
|
|
|
done
|
|
|
|
|
1995-08-26 01:25:09 +04:00
|
|
|
;;
|
|
|
|
|
1997-02-04 22:24:36 +03:00
|
|
|
dl*)
|
|
|
|
unit=${i#dl}
|
|
|
|
major=66
|
1998-12-09 00:43:06 +03:00
|
|
|
`printf "mknod ttyJ%x c %d %d\n" $unit $major $unit`
|
1997-02-04 22:24:36 +03:00
|
|
|
;;
|
|
|
|
|
1995-08-26 01:25:09 +04:00
|
|
|
lp*|va*|vp*)
|
|
|
|
case $i in
|
1997-08-22 19:30:49 +04:00
|
|
|
lp*) name=lp; unit=${i#lp}; major=15;;
|
|
|
|
va*) name=va; unit=${i#va}; major=10;;
|
|
|
|
vp*) name=vp; unit=${i#vp}; major=6;;
|
1995-08-26 01:25:09 +04:00
|
|
|
esac
|
|
|
|
case $unit in
|
1997-08-22 19:30:49 +04:00
|
|
|
[0-7])
|
2002-03-13 04:26:54 +03:00
|
|
|
mknod $i c $major $unit
|
1995-08-26 01:25:09 +04:00
|
|
|
chmod 666 $i
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo bad unit for $name in: $i
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
|
2002-02-02 10:04:44 +03:00
|
|
|
opty)
|
|
|
|
rm -f ttyp[0-9a-f] ptyp[0-9a-f]
|
|
|
|
for j in 0 1 2 3 4 5 6 7 8 9 a b c d e f
|
|
|
|
do
|
|
|
|
case $j in
|
|
|
|
[0-9]) jn=$j ;;
|
|
|
|
a) jn=10 ;;
|
|
|
|
b) jn=11 ;;
|
|
|
|
c) jn=12 ;;
|
|
|
|
d) jn=13 ;;
|
|
|
|
e) jn=14 ;;
|
|
|
|
f) jn=15 ;;
|
|
|
|
esac
|
|
|
|
mknod ttyp$j c 20 $jn
|
|
|
|
mknod ptyp$j c 21 $jn
|
|
|
|
done
|
2002-03-13 04:26:54 +03:00
|
|
|
chmod 666 ttyp[0-9a-f] ptyp[0-9a-f]
|
2002-02-02 10:04:44 +03:00
|
|
|
;;
|
|
|
|
|
1995-08-26 01:25:09 +04:00
|
|
|
pty*)
|
2002-02-02 10:04:44 +03:00
|
|
|
class=${i#pty}
|
|
|
|
name=`echo pqrstuvwxyzPQRST | dd bs=1 count=1 skip=$class 2>/dev/null`
|
|
|
|
case $name in
|
2002-02-02 14:23:16 +03:00
|
|
|
w) echo "$0: $i: pty unit conflicts with console ttyw0 device."
|
|
|
|
continue;;
|
2003-04-24 03:25:02 +04:00
|
|
|
S|T) echo "$0: $i: pty unit conflicts with DHU11 device."
|
2002-02-02 10:04:44 +03:00
|
|
|
continue;;
|
2002-10-21 08:14:47 +04:00
|
|
|
?) ;;
|
|
|
|
*) echo "$0: $i: pty unit must be between 0 and 15"
|
|
|
|
continue ;;
|
1995-08-26 01:25:09 +04:00
|
|
|
esac
|
2002-02-02 10:04:44 +03:00
|
|
|
rm -f tty$name[0-9a-zA-Z] pty$name[0-9a-zA-Z]
|
|
|
|
jn=0
|
|
|
|
while [ $jn -lt 62 ]
|
1997-07-23 05:29:36 +04:00
|
|
|
do
|
2002-02-02 10:04:44 +03:00
|
|
|
j=`echo 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ | dd bs=1 count=1 skip=$jn 2>/dev/null`
|
|
|
|
skip=0
|
|
|
|
if [ $jn -ge 16 ]; then
|
|
|
|
skip=$(($class * 30 + 256 - 16))
|
|
|
|
fi
|
2002-02-25 10:34:55 +03:00
|
|
|
unit=$(($class * 16 + $jn + $skip))
|
1997-07-23 05:29:36 +04:00
|
|
|
mknod tty$name$j c 20 $unit
|
|
|
|
mknod pty$name$j c 21 $unit
|
2002-02-02 10:04:44 +03:00
|
|
|
jn=$(($jn + 1))
|
1997-07-23 05:29:36 +04:00
|
|
|
done
|
2002-03-04 17:02:29 +03:00
|
|
|
chmod 666 tty$name[0-9a-zA-Z] pty$name[0-9a-zA-Z]
|
1995-08-26 01:25:09 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
np*)
|
1997-08-22 19:30:49 +04:00
|
|
|
class=${i#np}
|
1995-08-26 01:25:09 +04:00
|
|
|
case $class in
|
|
|
|
0) offset=0 name=0;;
|
|
|
|
1) offset=16 name=1;;
|
|
|
|
2) offset=32 name=2;;
|
|
|
|
*) echo bad unit for np in: $i;;
|
|
|
|
esac
|
|
|
|
case $class in
|
|
|
|
0|1|2)
|
1998-12-09 00:43:06 +03:00
|
|
|
i=0
|
|
|
|
while [ $i -lt 4 ]; do
|
|
|
|
`printf "mknod np%02d c 39 %d\n" $(($offset + $i)) $(($offset + $i))`
|
|
|
|
i=$(($i + 1))
|
|
|
|
done
|
1995-08-26 01:25:09 +04:00
|
|
|
esac
|
|
|
|
;;
|
|
|
|
|
|
|
|
dn*|ik*|ps*|ad*|ct*)
|
|
|
|
case $i in
|
1997-08-22 19:30:49 +04:00
|
|
|
ct*) name=ct; unit=${i#ct}; chr=18;;
|
|
|
|
dn*) name=cu; unit=${i#dn}; chr=24;;
|
|
|
|
ps*) name=ps; unit=${i#ps}; chr=27;;
|
|
|
|
ad*) name=ad; unit=${i#ad}; chr=29;;
|
|
|
|
ik*) name=ik; unit=${i#ik}; chr=31;;
|
1995-08-26 01:25:09 +04:00
|
|
|
esac
|
|
|
|
case $unit in
|
1997-08-22 19:30:49 +04:00
|
|
|
[0-7])
|
1995-08-26 01:25:09 +04:00
|
|
|
umask 0
|
|
|
|
mknod ${name}${unit} c ${chr} ${unit}
|
|
|
|
umask 77
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo bad unit for ${name} in: $i
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
|
1996-07-14 17:58:38 +04:00
|
|
|
bpf*)
|
2002-03-13 04:26:54 +03:00
|
|
|
unit=${i#bpf}
|
1996-07-14 17:58:38 +04:00
|
|
|
rm -f bpf$unit
|
|
|
|
mknod bpf$unit c 56 $unit
|
|
|
|
chmod 600 bpf$unit
|
|
|
|
;;
|
|
|
|
|
1998-03-20 21:23:57 +03:00
|
|
|
qd*)
|
|
|
|
unit=${i#qd}
|
|
|
|
rm -f qd$unit
|
|
|
|
mknod qc$unit c 40 $(($unit * 4))
|
|
|
|
mknod qd$unit c 40 $(($unit * 4 + 2))
|
|
|
|
;;
|
|
|
|
|
1996-07-14 17:58:38 +04:00
|
|
|
tun*)
|
1997-08-22 19:30:49 +04:00
|
|
|
unit=${i#tun}
|
1996-07-14 17:58:38 +04:00
|
|
|
rm -f tun$unit
|
|
|
|
mknod tun$unit c 57 $unit
|
|
|
|
chmod 600 tun$unit
|
|
|
|
;;
|
|
|
|
|
1995-08-26 01:25:09 +04:00
|
|
|
lkm)
|
|
|
|
mknod lkm c 28 0
|
2002-03-04 17:02:29 +03:00
|
|
|
chgrp kmem lkm
|
1995-08-26 01:25:09 +04:00
|
|
|
chmod 640 lkm
|
|
|
|
;;
|
|
|
|
|
|
|
|
qv0)
|
|
|
|
mknod qv0 c 40 0
|
|
|
|
mknod qvcons c 40 1
|
|
|
|
mknod mouse c 40 2
|
|
|
|
;;
|
|
|
|
|
1998-10-16 01:22:51 +04:00
|
|
|
scsibus*)
|
2002-03-13 04:26:54 +03:00
|
|
|
unit=${i#scsibus}
|
1998-10-16 01:22:51 +04:00
|
|
|
rm -f scsibus$unit
|
|
|
|
mknod scsibus$unit c 72 $unit
|
|
|
|
chmod 644 scsibus$unit
|
|
|
|
;;
|
|
|
|
|
2002-01-13 17:21:26 +03:00
|
|
|
clockctl)
|
|
|
|
rm -f clockctl
|
|
|
|
mknod clockctl c 75 0
|
2002-03-04 17:02:29 +03:00
|
|
|
chgrp ntpd clockctl
|
2002-01-13 17:21:26 +03:00
|
|
|
chmod 660 clockctl
|
|
|
|
;;
|
|
|
|
|
2002-06-17 20:21:03 +04:00
|
|
|
systrace)
|
|
|
|
rm -f systrace
|
|
|
|
mknod systrace c 76 0
|
|
|
|
chmod 644 systrace
|
|
|
|
;;
|
|
|
|
|
2003-07-27 18:17:57 +04:00
|
|
|
pf)
|
|
|
|
rm -f pf
|
|
|
|
mknod pf c 80 0
|
|
|
|
chmod 600 pf
|
|
|
|
;;
|
|
|
|
|
1995-08-26 01:25:09 +04:00
|
|
|
local)
|
2002-08-09 06:39:15 +04:00
|
|
|
if [ -f "$0.local" ]; then
|
|
|
|
umask 0
|
|
|
|
sh $0.local all
|
|
|
|
umask 77
|
|
|
|
fi
|
1995-08-26 01:25:09 +04:00
|
|
|
;;
|
1997-08-22 19:30:49 +04:00
|
|
|
*)
|
|
|
|
echo $i: invalid device
|
|
|
|
;;
|
|
|
|
|
1995-08-26 01:25:09 +04:00
|
|
|
esac
|
|
|
|
done
|
2002-03-04 17:02:29 +03:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
makedev $*
|