Sat Jan 3 08:49:03 2009 UTC ()
* When testing whether the fdesc file system is mounted, parse the
  output from mount(8) rather than df(1), because mount is more likely
  to be available on install media.  mount is invoked in a way that
  always prints an error message, and the content of the error message
  tells us whether fdesc is mounted.
* Don't use negative variable names.  Instead of nofdesc=false, use
  fdesc_mounted=true.
* Add a comment explaining that MAKEDEV may be executed in an environment
  that is missing some common commands.


(apb)
diff -r1.118 -r1.119 src/etc/MAKEDEV.tmpl

cvs diff -r1.118 -r1.119 src/etc/MAKEDEV.tmpl (switch to unified diff)

--- src/etc/MAKEDEV.tmpl 2008/11/28 16:04:31 1.118
+++ src/etc/MAKEDEV.tmpl 2009/01/03 08:49:03 1.119
@@ -1,1910 +1,1935 @@ @@ -1,1910 +1,1935 @@
1#!/bin/sh - 1#!/bin/sh -
2# $NetBSD: MAKEDEV.tmpl,v 1.118 2008/11/28 16:04:31 joerg Exp $ 2# $NetBSD: MAKEDEV.tmpl,v 1.119 2009/01/03 08:49:03 apb Exp $
3# 3#
4# Copyright (c) 2003,2007,2008 The NetBSD Foundation, Inc. 4# Copyright (c) 2003,2007,2008 The NetBSD Foundation, Inc.
5# All rights reserved. 5# All rights reserved.
6# 6#
7# Redistribution and use in source and binary forms, with or without 7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions 8# modification, are permitted provided that the following conditions
9# are met: 9# are met:
10# 1. Redistributions of source code must retain the above copyright 10# 1. Redistributions of source code must retain the above copyright
11# notice, this list of conditions and the following disclaimer. 11# notice, this list of conditions and the following disclaimer.
12# 2. Redistributions in binary form must reproduce the above copyright 12# 2. Redistributions in binary form must reproduce the above copyright
13# notice, this list of conditions and the following disclaimer in the 13# notice, this list of conditions and the following disclaimer in the
14# documentation and/or other materials provided with the distribution. 14# documentation and/or other materials provided with the distribution.
15# 15#
16# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 16# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
17# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 19# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26# POSSIBILITY OF SUCH DAMAGE. 26# POSSIBILITY OF SUCH DAMAGE.
27# 27#
28# 28#
29########################################################################### 29###########################################################################
30# 30#
31# PLEASE RUN "cd ../share/man/man8 ; make makedevs" 31# PLEASE RUN "cd ../share/man/man8 ; make makedevs"
32# AFTER CHANGING THIS FILE, AND COMMIT THE UPDATED MANPAGE! 32# AFTER CHANGING THIS FILE, AND COMMIT THE UPDATED MANPAGE!
33# 33#
34########################################################################### 34###########################################################################
35# 35#
36# Device "make" file. Valid special arguments: 36# Device "make" file. Valid special arguments:
37# all makes all known devices, including local devices. 37# all makes all known devices, including local devices.
38# Tries to make the 'standard' number of each type. 38# Tries to make the 'standard' number of each type.
39# init A set of devices that is used for MFS /dev by init. 39# init A set of devices that is used for MFS /dev by init.
40# May be equal to "all". 40# May be equal to "all".
41# floppy devices to be put on install floppies 41# floppy devices to be put on install floppies
42# ramdisk devices to be put into INSTALL kernel ramdisks. 42# ramdisk devices to be put into INSTALL kernel ramdisks.
43# std standard devices 43# std standard devices
44# local configuration specific devices 44# local configuration specific devices
45# wscons make wscons devices 45# wscons make wscons devices
46# usbs make USB devices 46# usbs make USB devices
47# isdns make ISDN devices 47# isdns make ISDN devices
48# 48#
49# Tapes: 49# Tapes:
50# st* SCSI tapes 50# st* SCSI tapes
51# wt* QIC-interfaced (e.g. not SCSI) 3M cartridge tape 51# wt* QIC-interfaced (e.g. not SCSI) 3M cartridge tape
52# ht* MASSBUS TM03 and TU?? 52# ht* MASSBUS TM03 and TU??
53# mt* MSCP tapes (e.g. TU81, TK50) 53# mt* MSCP tapes (e.g. TU81, TK50)
54# tm* UNIBUS TM11 and TE10 emulations (e.g. Emulex TC-11) 54# tm* UNIBUS TM11 and TE10 emulations (e.g. Emulex TC-11)
55# ts* UNIBUS TS11 55# ts* UNIBUS TS11
56# ut* UNIBUS TU45 emulations (e.g. si 9700) 56# ut* UNIBUS TU45 emulations (e.g. si 9700)
57# uu* TU58 cassettes on DL11 controller 57# uu* TU58 cassettes on DL11 controller
58# 58#
59# Disks: 59# Disks:
60# ccd* concatenated disk devices 60# ccd* concatenated disk devices
61# cd* SCSI or ATAPI CD-ROM 61# cd* SCSI or ATAPI CD-ROM
62# cgd* cryptographic disk devices 62# cgd* cryptographic disk devices
63# raid* RAIDframe disk devices 63# raid* RAIDframe disk devices
64# sd* SCSI disks 64# sd* SCSI disks
65# wd* "winchester" disk drives (ST506,IDE,ESDI,RLL,...) 65# wd* "winchester" disk drives (ST506,IDE,ESDI,RLL,...)
66# bmd* Nereid bank memory disks 66# bmd* Nereid bank memory disks
67# ed* IBM PS/2 ESDI disk devices 67# ed* IBM PS/2 ESDI disk devices
68# fd* "floppy" disk drives (3 1/2", 5 1/4") 68# fd* "floppy" disk drives (3 1/2", 5 1/4")
69# fss* Files system snapshot devices 69# fss* Files system snapshot devices
70# gdrom* Dreamcast "gigadisc" CD-ROM drive 70# gdrom* Dreamcast "gigadisc" CD-ROM drive
71# hk* UNIBUS RK06 and RK07 71# hk* UNIBUS RK06 and RK07
72# hp* MASSBUS RM?? 72# hp* MASSBUS RM??
73# ld* Logical disk devices (e.g., hardware RAID) 73# ld* Logical disk devices (e.g., hardware RAID)
74# mcd* Mitsumi CD-ROM 74# mcd* Mitsumi CD-ROM
75# md* memory pseudo-disk devices 75# md* memory pseudo-disk devices
76# ofdisk* OpenFirmware disk devices 76# ofdisk* OpenFirmware disk devices
77# ra* MSCP disks (RA??, RD??) 77# ra* MSCP disks (RA??, RD??)
78# rb* 730 IDC w/ RB80 and/or RB02 78# rb* 730 IDC w/ RB80 and/or RB02
79# rd* HDC9224 RD disks on VS2000 79# rd* HDC9224 RD disks on VS2000
80# rl* UNIBUS RL02 80# rl* UNIBUS RL02
81# rx* MSCP floppy disk (RX33/50/...) 81# rx* MSCP floppy disk (RX33/50/...)
82# up* other UNIBUS devices (e.g. on Emulex SC-21V controller) 82# up* other UNIBUS devices (e.g. on Emulex SC-21V controller)
83# vnd* "file" pseudo-disks 83# vnd* "file" pseudo-disks
84# xbd* Xen virtual disks 84# xbd* Xen virtual disks
85# xd* Xylogic 753/7053 disks 85# xd* Xylogic 753/7053 disks
86# xy* Xylogic 450/451 disks 86# xy* Xylogic 450/451 disks
87# 87#
88# Pointing devices: 88# Pointing devices:
89# wsmouse* wscons mouse events 89# wsmouse* wscons mouse events
90# lms* Logitech bus mouse 90# lms* Logitech bus mouse
91# mms* Microsoft bus mouse 91# mms* Microsoft bus mouse
92# qms* "quadrature mouse" 92# qms* "quadrature mouse"
93# pms* PS/2 mouse 93# pms* PS/2 mouse
94# mouse mouse (provides events, for X11) 94# mouse mouse (provides events, for X11)
95# 95#
96# Keyboard devices: 96# Keyboard devices:
97# wskbd* wscons keyboard events 97# wskbd* wscons keyboard events
98# kbd raw keyboard (provides events, for X11) 98# kbd raw keyboard (provides events, for X11)
99# kbdctl keyboard control 99# kbdctl keyboard control
100# 100#
101# Terminals/Console ports: 101# Terminals/Console ports:
102# tty[01]* standard serial ports 102# tty[01]* standard serial ports
103# tty0* SB1250 ("sbscn") serial ports (sbmips) 103# tty0* SB1250 ("sbscn") serial ports (sbmips)
104# ttyE* wscons - Workstation console ("wscons") glass-tty emulators 104# ttyE* wscons - Workstation console ("wscons") glass-tty emulators
105# ttyCZ? Cyclades-Z multiport serial boards. Each "unit" 105# ttyCZ? Cyclades-Z multiport serial boards. Each "unit"
106# makes 64 ports. 106# makes 64 ports.
107# ttyCY? Cyclom-Y multiport serial boards. Each "unit" makes 107# ttyCY? Cyclom-Y multiport serial boards. Each "unit" makes
108# 32 ports. 108# 32 ports.
109# ttye* ITE bitmapped consoles 109# ttye* ITE bitmapped consoles
110# ttyv0 pccons 110# ttyv0 pccons
111# ttyC? NS16550 ("com") serial ports 111# ttyC? NS16550 ("com") serial ports
112# ttyS* SA1110 serial port (hpcarm) 112# ttyS* SA1110 serial port (hpcarm)
113# ttyTX? TX39 internal serial ports (hpcmips) 113# ttyTX? TX39 internal serial ports (hpcmips)
114# ttyB? DEC 3000 ZS8530 ("scc") serial ports (alpha) 114# ttyB? DEC 3000 ZS8530 ("scc") serial ports (alpha)
115# ttyA* mfc serial ports (amiga) 115# ttyA* mfc serial ports (amiga)
116# ttyB* msc serial ports (amiga) 116# ttyB* msc serial ports (amiga)
117# ttyC* com style serial ports (DraCo, HyperCom) (amiga) 117# ttyC* com style serial ports (DraCo, HyperCom) (amiga)
118# On the DraCo, units 0 and 1 are the built-in "modem" and 118# On the DraCo, units 0 and 1 are the built-in "modem" and
119# "mouse" ports, if configured. 119# "mouse" ports, if configured.
120# ttyA0 8530 Channel A (formerly ser02) (atari) 120# ttyA0 8530 Channel A (formerly ser02) (atari)
121# ttyA1 8530 Channel B (formerly mdm02) (atari) 121# ttyA1 8530 Channel B (formerly mdm02) (atari)
122# ttyB0 UART on first 68901 (formerly mdm01) (atari) 122# ttyB0 UART on first 68901 (formerly mdm01) (atari)
123# ixpcom IXP12x0 COM ports 123# ixpcom IXP12x0 COM ports
124# epcom EP93xx COM ports 124# epcom EP93xx COM ports
125# ttyM? HP200/300 4 port serial mux interface (hp300) 125# ttyM? HP200/300 4 port serial mux interface (hp300)
126# ttya "ttya" system console (luna68k) 126# ttya "ttya" system console (luna68k)
127# ttyb second system serial port (luna68k) 127# ttyb second system serial port (luna68k)
128# tty* Onboard serial ports (mvme68k) 128# tty* Onboard serial ports (mvme68k)
129# On the mvme147 these are: ttyZ1, ttyZ2 and ttyZ3. 129# On the mvme147 these are: ttyZ1, ttyZ2 and ttyZ3.
130# On the mvme167, and '177: ttyC1, ttyC2 and ttyC3. 130# On the mvme167, and '177: ttyC1, ttyC2 and ttyC3.
131# Note that tty[CZ]0 is grabbed by the console device 131# Note that tty[CZ]0 is grabbed by the console device
132# so is not created by default 132# so is not created by default
133# dc* PMAX 4 channel serial interface (kbd, mouse, modem, printer) 133# dc* PMAX 4 channel serial interface (kbd, mouse, modem, printer)
134# scc* 82530 serial interface (pmax) 134# scc* 82530 serial interface (pmax)
135# ttyZ* Zilog 8530 ("zstty") serial ports 135# ttyZ* Zilog 8530 ("zstty") serial ports
136# tty[abcd] Built-in serial ports (sparc) 136# tty[abcd] Built-in serial ports (sparc)
137# tty* Z88530 serial controllers (sparc64) 137# tty* Z88530 serial controllers (sparc64)
138# ttyh* SAB82532 serial controllers (sparc64) 138# ttyh* SAB82532 serial controllers (sparc64)
139# tty[a-j] Built-in serial ports (sun2, sun3) 139# tty[a-j] Built-in serial ports (sun2, sun3)
140# ttyC? pccons (arc) 140# ttyC? pccons (arc)
141# dz* UNIBUS DZ11 and DZ32 (vax) 141# dz* UNIBUS DZ11 and DZ32 (vax)
142# dh* UNIBUS DH11 and emulations (e.g. Able DMAX, Emulex CS-11) (vax) 142# dh* UNIBUS DH11 and emulations (e.g. Able DMAX, Emulex CS-11) (vax)
143# dmf* UNIBUS DMF32 (vax) 143# dmf* UNIBUS DMF32 (vax)
144# dhu* UNIBUS DHU11 (vax) 144# dhu* UNIBUS DHU11 (vax)
145# dmz* UNIBUS DMZ32 (vax) 145# dmz* UNIBUS DMZ32 (vax)
146# dl* UNIBUS DL11 (vax) 146# dl* UNIBUS DL11 (vax)
147# xencons Xen virtual console 147# xencons Xen virtual console
148# 148#
149# Terminal multiplexors: 149# Terminal multiplexors:
150# dc* 4 channel serial interface (keyboard, mouse, modem, printer) 150# dc* 4 channel serial interface (keyboard, mouse, modem, printer)
151# dh* UNIBUS DH11 and emulations (e.g. Able DMAX, Emulex CS-11) 151# dh* UNIBUS DH11 and emulations (e.g. Able DMAX, Emulex CS-11)
152# dhu* UNIBUS DHU11 152# dhu* UNIBUS DHU11
153# dl* UNIBUS DL11 153# dl* UNIBUS DL11
154# dmf* UNIBUS DMF32 154# dmf* UNIBUS DMF32
155# dmz* UNIBUS DMZ32 155# dmz* UNIBUS DMZ32
156# dz* UNIBUS DZ11 and DZ32 156# dz* UNIBUS DZ11 and DZ32
157# scc* 82530 serial interface 157# scc* 82530 serial interface
158# 158#
159# Call units: 159# Call units:
160# dn* UNIBUS DN11 and emulations (e.g. Able Quadracall) 160# dn* UNIBUS DN11 and emulations (e.g. Able Quadracall)
161# 161#
162# Pseudo terminals: 162# Pseudo terminals:
163# ptm pty multiplexor device, and pts directory 163# ptm pty multiplexor device, and pts directory
164# pty* set of 16 master and slave pseudo terminals 164# pty* set of 16 master and slave pseudo terminals
165# opty first 16 ptys, to save inodes on install media 165# opty first 16 ptys, to save inodes on install media
166# ipty first 2 ptys, for install media use only 166# ipty first 2 ptys, for install media use only
167# 167#
168# Printers: 168# Printers:
169# arcpp* Archimedes parallel port 169# arcpp* Archimedes parallel port
170# lpt* stock lp 170# lpt* stock lp
171# lpa* interruptless lp 171# lpa* interruptless lp
172# par* Amiga motherboard parallel port 172# par* Amiga motherboard parallel port
173# cpi* Macintosh Nubus CSI parallel printer card 173# cpi* Macintosh Nubus CSI parallel printer card
174# 174#
175# USB devices: 175# USB devices:
176# usb* USB control devices 176# usb* USB control devices
177# uhid* USB generic HID devices 177# uhid* USB generic HID devices
178# ulpt* USB printer devices 178# ulpt* USB printer devices
179# ugen* USB generic devices 179# ugen* USB generic devices
180# urio* USB Diamond Rio 500 devices 180# urio* USB Diamond Rio 500 devices
181# uscanner* USB scanners 181# uscanner* USB scanners
182# ttyU* USB modems 182# ttyU* USB modems
183# ttyY* USB serial adapters 183# ttyY* USB serial adapters
184# 184#
185# ISDN devices: 185# ISDN devices:
186# isdn communication between userland isdnd and kernel 186# isdn communication between userland isdnd and kernel
187# isdnctl control device 187# isdnctl control device
188# isdnbchan* raw b-channel access 188# isdnbchan* raw b-channel access
189# isdntel* telephony device 189# isdntel* telephony device
190# isdnteld* telephony dialout device 190# isdnteld* telephony dialout device
191# isdntrc* trace device 191# isdntrc* trace device
192# 192#
193# Video devices: 193# Video devices:
194# bwtwo* monochromatic frame buffer 194# bwtwo* monochromatic frame buffer
195# cgtwo* 8-bit color frame buffer 195# cgtwo* 8-bit color frame buffer
196# cgthree* 8-bit color frame buffer 196# cgthree* 8-bit color frame buffer
197# cgfour* 8-bit color frame buffer 197# cgfour* 8-bit color frame buffer
198# cgsix* accelerated 8-bit color frame buffer 198# cgsix* accelerated 8-bit color frame buffer
199# cgeight* 24-bit color frame buffer 199# cgeight* 24-bit color frame buffer
200# etvme Tseng et-compatible cards on VME (atari) 200# etvme Tseng et-compatible cards on VME (atari)
201# ik* UNIBUS interface to Ikonas frame buffer 201# ik* UNIBUS interface to Ikonas frame buffer
202# leo Circad Leonardo VME-bus true color (atari) 202# leo Circad Leonardo VME-bus true color (atari)
203# ps* UNIBUS interface to Picture System 2 203# ps* UNIBUS interface to Picture System 2
204# qv* QVSS (MicroVAX) display 204# qv* QVSS (MicroVAX) display
205# tcx* accelerated 8/24-bit color frame buffer 205# tcx* accelerated 8/24-bit color frame buffer
206# 206#
207# Maple bus devices: 207# Maple bus devices:
208# maple Maple bus control devices 208# maple Maple bus control devices
209# mlcd* Maple bus LCD devices 209# mlcd* Maple bus LCD devices
210# mmem* Maple bus storage devices 210# mmem* Maple bus storage devices
211# 211#
212# IEEE1394 bus devices: 212# IEEE1394 bus devices:
213# fw* IEEE1394 bus generic node access devices 213# fw* IEEE1394 bus generic node access devices
214# fwmem* IEEE1394 bus physical memory of the remote node access devices 214# fwmem* IEEE1394 bus physical memory of the remote node access devices
215# 215#
216# Special purpose devices: 216# Special purpose devices:
217# ad* UNIBUS interface to Data Translation A/D converter 217# ad* UNIBUS interface to Data Translation A/D converter
218# agp* AGP GART devices 218# agp* AGP GART devices
219# altq ALTQ control interface 219# altq ALTQ control interface
220# amr* AMI MegaRaid control device 220# amr* AMI MegaRaid control device
221# apm power management device 221# apm power management device
222# audio* audio devices 222# audio* audio devices
223# bell* OPM bell device (x68k) 223# bell* OPM bell device (x68k)
224# bktr Brooktree 848/849/878/879 based TV cards 224# bktr Brooktree 848/849/878/879 based TV cards
225# bpf packet filter 225# bpf packet filter
226# bthub Bluetooth Device Hub control interface 226# bthub Bluetooth Device Hub control interface
227# cfs* Coda file system device 227# cfs* Coda file system device
228# ch* SCSI media changer 228# ch* SCSI media changer
229# cir* Consumer IR 229# cir* Consumer IR
230# clockctl clock control for non root users 230# clockctl clock control for non root users
231# cpuctl CPU control 231# cpuctl CPU control
232# crypto hardware crypto access driver 232# crypto hardware crypto access driver
233# dmoverio hardware-assisted data movers 233# dmoverio hardware-assisted data movers
234# dpt* DPT/Adaptec EATA RAID management interface 234# dpt* DPT/Adaptec EATA RAID management interface
235# dpti* DPT/Adaptec I2O RAID management interface 235# dpti* DPT/Adaptec I2O RAID management interface
236# fb* PMAX generic framebuffer pseudo-device 236# fb* PMAX generic framebuffer pseudo-device
237# fd file descriptors 237# fd file descriptors
238# grf* graphics frame buffer device 238# grf* graphics frame buffer device
239# hil HP300 HIL input devices 239# hil HP300 HIL input devices
240# icp ICP-Vortex/Intel RAID control interface 240# icp ICP-Vortex/Intel RAID control interface
241# iic* IIC bus device 241# iic* IIC bus device
242# io x86 IOPL access for COMPAT_10, COMPAT_FREEBSD 242# io x86 IOPL access for COMPAT_10, COMPAT_FREEBSD
243# iop* I2O IOP control interface 243# iop* I2O IOP control interface
244# ipl IP Filter 244# ipl IP Filter
245# irframe* IrDA physical frame 245# irframe* IrDA physical frame
246# ite* terminal emulator interface to HP300 graphics devices 246# ite* terminal emulator interface to HP300 graphics devices
247# joy* joystick device 247# joy* joystick device
248# kttcp kernel ttcp helper device 248# kttcp kernel ttcp helper device
249# lockstat kernel locking statistics 249# lockstat kernel locking statistics
250# magma* Magma multiport serial/parallel cards 250# magma* Magma multiport serial/parallel cards
251# midi* MIDI 251# midi* MIDI
252# mlx* Mylex DAC960 control interface 252# mlx* Mylex DAC960 control interface
253# mly* Mylex AcceleRAID/eXtremeRAID control interface 253# mly* Mylex AcceleRAID/eXtremeRAID control interface
254# np* UNIBUS Ethernet co-processor interface, for downloading. 254# np* UNIBUS Ethernet co-processor interface, for downloading.
255# nsmb* SMB requester 255# nsmb* SMB requester
256# openfirm OpenFirmware accessor 256# openfirm OpenFirmware accessor
257# pad* Pseudo-audio device driver 257# pad* Pseudo-audio device driver
258# pci* PCI bus access devices 258# pci* PCI bus access devices
259# pf PF packet filter 259# pf PF packet filter
260# pow* power management device (x68k) 260# pow* power management device (x68k)
261# putter Pass-to-Userspace Transporter 261# putter Pass-to-Userspace Transporter
262# px* PixelStamp Xserver access 262# px* PixelStamp Xserver access
263# radio* radio devices 263# radio* radio devices
264# random Random number generator 264# random Random number generator
265# rtc* RealTimeClock 265# rtc* RealTimeClock
266# satlink* PlanetConnect satellite receiver driver 266# satlink* PlanetConnect satellite receiver driver
267# scsibus* SCSI busses 267# scsibus* SCSI busses
268# se* SCSI Ethernet 268# se* SCSI Ethernet
269# ses* SES/SAF-TE SCSI Devices 269# ses* SES/SAF-TE SCSI Devices
270# speaker PC speaker (XXX - installed) 270# speaker PC speaker (XXX - installed)
271# sram battery backuped memory (x68k) 271# sram battery backuped memory (x68k)
272# ss* SCSI scanner 272# ss* SCSI scanner
273# stic* PixelStamp interface chip 273# stic* PixelStamp interface chip
274# sysmon System Monitoring hardware 274# sysmon System Monitoring hardware
275# tap* virtual Ethernet device 275# tap* virtual Ethernet device
276# tun* network tunnel driver 276# tun* network tunnel driver
277# twa 3ware Apache control interface 277# twa 3ware Apache control interface
278# twe 3ware Escalade control interface 278# twe 3ware Escalade control interface
279# uk* unknown SCSI device 279# uk* unknown SCSI device
280# veriexec verified executable fingerprint loader 280# veriexec verified executable fingerprint loader
281# video* video capture devices 281# video* video capture devices
282# view* generic interface to graphic displays (Amiga) 282# view* generic interface to graphic displays (Amiga)
283# vmegen* generic VME access 283# vmegen* generic VME access
284# wsfont* console font control 284# wsfont* console font control
285# wsmux* wscons event multiplexor 285# wsmux* wscons event multiplexor
286# xenevt Xen event interface 286# xenevt Xen event interface
287 287
288 288
289# 289#
290# Apart from a few lines right at the end, this file should consist 290# NOTE:
291# entirely of function definitions. 
292# 291#
293# This file is used both as a standalone script (via "sh ./MAKEDEV all" 292# * MAKEDEV is used both as a standalone script (via "sh ./MAKEDEV
294# or similar), and as a function library (via "MAKEDEV_AS_LIBRARY=1 . 293# all" or similar), and as a function library for MAKEDEV.local (via
295# MAKEDEV" from MAKEDEV.local). 294# "MAKEDEV_AS_LIBRARY=1 . MAKEDEV"). Because of this, the script
 295# should consist almost entirely of function definitions, apart from a
 296# few lines right at the end.
 297#
 298# * MAKEDEV may be executed in an environment that is missing some
 299# common commands. For example, it may be executed from a minimal
 300# system used during installation, or it may be executed early in the
 301# boot sequence before most file systems have been mounted. It may
 302# also be executed in a cross-build environment on a non-NetBSD host.
296# 303#
297 304
298usage() 305usage()
299{ 306{
300 cat 1>&2 << _USAGE_ 307 cat 1>&2 << _USAGE_
301Usage: ${0##*/} [-fMs] [-m mknod] [-p pax] [-t mtree] special [...] 308Usage: ${0##*/} [-fMs] [-m mknod] [-p pax] [-t mtree] special [...]
302 Create listed special devices. Options: 309 Create listed special devices. Options:
303 -f Force permissions to be updated on existing devices. 310 -f Force permissions to be updated on existing devices.
304 -M Create memory file system. 311 -M Create memory file system.
305 -m mknod Name of mknod(8) program. [\$TOOL_MKNOD or mknod] 312 -m mknod Name of mknod(8) program. [\$TOOL_MKNOD or mknod]
306 -p pax Name of pax(1) program. [\$TOOL_PAX or pax] 313 -p pax Name of pax(1) program. [\$TOOL_PAX or pax]
307 -s Generate mtree(8) specfile instead of creating devices. 314 -s Generate mtree(8) specfile instead of creating devices.
308 -t mtree Name of mtree(8) program. [\$TOOL_MTREE or mtree] 315 -t mtree Name of mtree(8) program. [\$TOOL_MTREE or mtree]
309 316
310_USAGE_ 317_USAGE_
311 exit 1 318 exit 1
312} 319}
313 320
314# zeropad width number 321# zeropad width number
315# display number with a zero (`0') padding of width digits. 322# display number with a zero (`0') padding of width digits.
316# 323#
317zeropad() 324zeropad()
318{ 325{
319 case $(($1 - ${#2})) in 326 case $(($1 - ${#2})) in
320 5) echo 00000$2;; 327 5) echo 00000$2;;
321 4) echo 0000$2;; 328 4) echo 0000$2;;
322 3) echo 000$2;; 329 3) echo 000$2;;
323 2) echo 00$2;; 330 2) echo 00$2;;
324 1) echo 0$2;; 331 1) echo 0$2;;
325 0) echo $2;; 332 0) echo $2;;
326 *) die "bad padding" ;; 333 *) die "bad padding" ;;
327 esac 334 esac
328} 335}
329 336
330# hexprint number 337# hexprint number
331# display (base10) number as hexadecimal 338# display (base10) number as hexadecimal
332# 339#
333hexprint() 340hexprint()
334{ 341{
335 val="$(($1 + 0))" 342 val="$(($1 + 0))"
336 hex= 343 hex=
337 set -- 0 1 2 3 4 5 6 7 8 9 a b c d e f 344 set -- 0 1 2 3 4 5 6 7 8 9 a b c d e f
338 while [ "$val" -gt 0 ]; do 345 while [ "$val" -gt 0 ]; do
339 eval hex=\$$(($val % 16 + 1))\$hex 346 eval hex=\$$(($val % 16 + 1))\$hex
340 val="$(($val / 16))" 347 val="$(($val / 16))"
341 done 348 done
342 echo "${hex:-0}" 349 echo "${hex:-0}"
343} 350}
344 351
345# linecount multiline_string 352# linecount multiline_string
346# count the number of lines in the string 353# count the number of lines in the string
347# 354#
348linecount() 355linecount()
349{ 356{
350 local IFS=' 357 local IFS='
351' # just a newline, no other white space between the quotes 358' # just a newline, no other white space between the quotes
352 set -- $1 359 set -- $1
353 echo $# 360 echo $#
354} 361}
355 362
356# nooutput -12 cmd [args...] 363# nooutput -12 cmd [args...]
357# run a command with stdout and/or stderr ignored. 364# run a command with stdout and/or stderr ignored.
358# "nooutput -1 cmd" is like "cmd >/dev/null"; 365# "nooutput -1 cmd" is like "cmd >/dev/null";
359# "nooutput -2 cmd" is like "{ cmd ; } 2>/dev/null"; 366# "nooutput -2 cmd" is like "{ cmd ; } 2>/dev/null";
360# "nooutput -12 cmd" is like "{ cmd ; } >/dev/null 2>&1"; 367# "nooutput -12 cmd" is like "{ cmd ; } >/dev/null 2>&1";
361# except they should work even if /dev/null doesn't [yet] exist. 368# except they should work even if /dev/null doesn't [yet] exist.
362# 369#
363# The "{...}" wrapper used in cases where stderr is redirected 370# The "{...}" wrapper used in cases where stderr is redirected
364# serves to capture shell error messages such as "cmd: not found". 371# serves to capture shell error messages such as "cmd: not found".
365# 372#
366nooutput() 373nooutput()
367{ 374{
368 local flags="$1" ; shift 375 local flags="$1" ; shift
369 local junk 376 local junk
370 case "$flags" in 377 case "$flags" in
371 "-1") junk="$( "$@" )" ;; 378 "-1") junk="$( "$@" )" ;;
372 "-2") exec 4>&1 ; junk="$( { "$@" ; } 2>&1 1>&4 )" ; exec 4>&- ;; 379 "-2") exec 4>&1 ; junk="$( { "$@" ; } 2>&1 1>&4 )" ; exec 4>&- ;;
373 "-12") junk="$( { "$@" ; } 2>&1 )" ;; 380 "-12") junk="$( { "$@" ; } 2>&1 )" ;;
374 *) warn "Incorrect use of nooutput" ;; 381 *) warn "Incorrect use of nooutput" ;;
375 esac 382 esac
376} 383}
377 384
378# check_pax path_to_pax 385# check_pax path_to_pax
379# Check whether pax exists and supports the command line options 386# Check whether pax exists and supports the command line options
380# and input format that we will want to use. 387# and input format that we will want to use.
381# 388#
382check_pax() 389check_pax()
383{ 390{
384 local pax="$1" 391 local pax="$1"
385 echo ". type=dir optional" | nooutput -12 "${pax}" -r -w -M -pe . 392 echo ". type=dir optional" | nooutput -12 "${pax}" -r -w -M -pe .
386} 393}
387 394
388# check_mtree path_to_mtree 395# check_mtree path_to_mtree
389# Check whether mtree exists and supports the command line options 396# Check whether mtree exists and supports the command line options
390# and input format that we will want to use. 397# and input format that we will want to use.
391# 398#
392check_mtree() 399check_mtree()
393{ 400{
394 local mtree="$1" 401 local mtree="$1"
395 echo ". type=dir optional" | nooutput -12 "${mtree}" -e -U 402 echo ". type=dir optional" | nooutput -12 "${mtree}" -e -U
396} 403}
397 404
398# setup args... 405# setup args...
399# Parse command line arguments, exit on error. 406# Parse command line arguments, exit on error.
400# Callers should shift $((OPTIND - 1)) afterwards. 407# Callers should shift $((OPTIND - 1)) afterwards.
401# 408#
402setup() 409setup()
403{ 410{
404 PATH=/sbin:/usr/sbin:/bin:/usr/bin:/rescue 411 PATH=/sbin:/usr/sbin:/bin:/usr/bin:/rescue
405 412
406 : ${TOOL_MKNOD:=mknod} 413 : ${TOOL_MKNOD:=mknod}
407 : ${TOOL_MTREE:=mtree} 414 : ${TOOL_MTREE:=mtree}
408 : ${TOOL_PAX:=pax} 415 : ${TOOL_PAX:=pax}
409 do_create_mfs=false 416 do_create_mfs=false
410 do_force=false 417 do_force=false
411 do_mknod=false 418 do_mknod=false
412 do_pax=false 419 do_pax=false
413 do_mtree=false 420 do_mtree=false
414 do_redirect=false 421 do_redirect=false
415 do_specfile=false 422 do_specfile=false
416 opts= 423 opts=
417 while getopts Mfm:p:st: ch; do 424 while getopts Mfm:p:st: ch; do
418 # Note that $opts is only for options pased through to 425 # Note that $opts is only for options pased through to
419 # MAKEDEV.local, not for all options. 426 # MAKEDEV.local, not for all options.
420 case ${ch} in 427 case ${ch} in
421 M) 428 M)
422 # "-M" sets do_create_mfs; 429 # "-M" sets do_create_mfs;
423 # "-M -M" is for use from init(8), and sets do_redirect 430 # "-M -M" is for use from init(8), and sets do_redirect
424 do_redirect=$do_create_mfs 431 do_redirect=$do_create_mfs
425 do_create_mfs=true 432 do_create_mfs=true
426 ;; 433 ;;
427 f) do_force=true 434 f) do_force=true
428 opts="${opts} -f" 435 opts="${opts} -f"
429 ;; 436 ;;
430 m) TOOL_MKNOD=${OPTARG} 437 m) TOOL_MKNOD=${OPTARG}
431 do_mknod=true 438 do_mknod=true
432 opts="${opts} -m ${OPTARG}" 439 opts="${opts} -m ${OPTARG}"
433 ;; 440 ;;
434 p) TOOL_PAX="${OPTARG}" 441 p) TOOL_PAX="${OPTARG}"
435 if check_pax "${TOOL_PAX}"; then 442 if check_pax "${TOOL_PAX}"; then
436 do_pax=true 443 do_pax=true
437 # do not add this to $opts; we will later 444 # do not add this to $opts; we will later
438 # add "-s" instead. 445 # add "-s" instead.
439 else 446 else
440 warn "Ignored -p option:" \ 447 warn "Ignored -p option:" \
441 "${TOOL_PAX} is missing or broken" 448 "${TOOL_PAX} is missing or broken"
442 do_mknod=true 449 do_mknod=true
443 fi 450 fi
444 ;; 451 ;;
445 s) do_specfile=true 452 s) do_specfile=true
446 opts="${opts} -s" 453 opts="${opts} -s"
447 ;; 454 ;;
448 t) TOOL_MTREE="${OPTARG}" 455 t) TOOL_MTREE="${OPTARG}"
449 if check_mtree "${TOOL_MTREE}"; then 456 if check_mtree "${TOOL_MTREE}"; then
450 do_mtree=true 457 do_mtree=true
451 # do not add this to $opts; we will later 458 # do not add this to $opts; we will later
452 # add "-s" instead. 459 # add "-s" instead.
453 else 460 else
454 warn "Ignored -t option:" \ 461 warn "Ignored -t option:" \
455 "${TOOL_MTREE} is missing or broken" 462 "${TOOL_MTREE} is missing or broken"
456 do_mknod=true 463 do_mknod=true
457 fi 464 fi
458 ;; 465 ;;
459 *) usage ;; 466 *) usage ;;
460 esac 467 esac
461 done 468 done
462 469
463 shift $((${OPTIND} - 1)) 470 shift $((${OPTIND} - 1))
464 [ $# -gt 0 ] || usage 471 [ $# -gt 0 ] || usage
465 472
466 u_root="%uid_root%" 473 u_root="%uid_root%"
467 u_uucp="%uid_uucp%" 474 u_uucp="%uid_uucp%"
468 g_kmem="%gid_kmem%" 475 g_kmem="%gid_kmem%"
469 g_ntpd="%gid_ntpd%" 476 g_ntpd="%gid_ntpd%"
470 g_operator="%gid_operator%" 477 g_operator="%gid_operator%"
471 g_wheel="%gid_wheel%" 478 g_wheel="%gid_wheel%"
472 dialin=0 479 dialin=0
473 dialout=524288 480 dialout=524288
474 callunit=262144 481 callunit=262144
475 482
476 # only allow read&write for owner by default 483 # only allow read&write for owner by default
477 umask 077 484 umask 077
478 485
479 # Check if we have fdesc mounted 486 # Set fdesc_mounted=true if the fdesc file system is mounted
 487 # on the current directory (typically "/dev").
 488 # Later, this will be used to suppress creation of device nodes
 489 # that are supplied by the fdesc file system.
 490 #
 491 fdesc_mounted=false
480 if [ -d fd ]; then 492 if [ -d fd ]; then
481 case "$(df fd)" in 493 # Parse the output from "mount -u -o nosuchoption .".
482 *fdesc*) nofdesc=false;; 494 # We don't parse the output from df(1) because that's
483 *) nofdesc=true;; 495 # less likely to be available on install media.
 496 #
 497 # If the current directory is a mount point for the
 498 # fdesc file system, then the expected output (whether
 499 # or not the current user is root) is:
 500 # mount_fdesc: -o suchoption: option not supported.
 501 #
 502 # If the current directory is not a mount point, then
 503 # the expected output is:
 504 # mount: .: unknown special file or file system.
 505 #
 506 # If we are not running on NetBSD, or mount(8) is not
 507 # found, then we should get some other error message.
 508 #
 509 case "$({ LC_ALL=C mount -u -o nosuchoption . ; } 2>&1)" in
 510 *mount_fdesc*) fdesc_mounted=true ;;
484 esac 511 esac
485 else 
486 nofdesc=true 
487 fi 512 fi
488 513
489 # do_force requires mknod 514 # do_force requires mknod
490 if $do_force; then 515 if $do_force; then
491 if $do_mtree || $do_pax || $do_specfile; then 516 if $do_mtree || $do_pax || $do_specfile; then
492 die "-f option works only with mknod" 517 die "-f option works only with mknod"
493 fi 518 fi
494 do_mknod=true 519 do_mknod=true
495 fi 520 fi
496 521
497 # If no explicit method was specified on the command line or 522 # If no explicit method was specified on the command line or
498 # forced above, then use one of mtree, pax, or mknod, in that 523 # forced above, then use one of mtree, pax, or mknod, in that
499 # order of preference. 524 # order of preference.
500 # 525 #
501 # mtree is preferred because it's fast and designed for the 526 # mtree is preferred because it's fast and designed for the
502 # purpose. However, it's unlikely to be available early in the 527 # purpose. However, it's unlikely to be available early in the
503 # boot sequence, when init(8) may invoke MAKEDEV(8). 528 # boot sequence, when init(8) may invoke MAKEDEV(8).
504 # 529 #
505 # pax is usually acceptable, and it's likely to be available 530 # pax is usually acceptable, and it's likely to be available
506 # early in the boot sequence. However, it's much slower than mtree. 531 # early in the boot sequence. However, it's much slower than mtree.
507 # 532 #
508 # mknod is just very slow, because the shell has to fork for 533 # mknod is just very slow, because the shell has to fork for
509 # each device node. 534 # each device node.
510 # 535 #
511 if ! ( $do_mtree || $do_pax || $do_mknod || $do_specfile ); then 536 if ! ( $do_mtree || $do_pax || $do_mknod || $do_specfile ); then
512 if check_mtree "${TOOL_MTREE}"; then 537 if check_mtree "${TOOL_MTREE}"; then
513 do_mtree=true 538 do_mtree=true
514 elif check_pax "${TOOL_PAX}"; then 539 elif check_pax "${TOOL_PAX}"; then
515 do_pax=true 540 do_pax=true
516 else 541 else
517 do_mknod=true 542 do_mknod=true
518 fi 543 fi
519 fi 544 fi
520 545
521 # Now we need exactly one node-creation method. 546 # Now we need exactly one node-creation method.
522 case $(( $($do_mtree && echo 1 || echo 0) + \ 547 case $(( $($do_mtree && echo 1 || echo 0) + \
523 $($do_pax && echo 1 || echo 0) + \ 548 $($do_pax && echo 1 || echo 0) + \
524 $($do_mknod && echo 1 || echo 0) + \ 549 $($do_mknod && echo 1 || echo 0) + \
525 $($do_specfile && echo 1 || echo 0) )) 550 $($do_specfile && echo 1 || echo 0) ))
526 in 551 in
527 1) : OK ;; 552 1) : OK ;;
528 *) die "-m, -p, -s, and -t options are mutually exclusive" ;; 553 *) die "-m, -p, -s, and -t options are mutually exclusive" ;;
529 esac 554 esac
530 555
531 # If we are using mknod, then decide what options to pass it. 556 # If we are using mknod, then decide what options to pass it.
532 if $do_mknod; then 557 if $do_mknod; then
533 MKNOD="${TOOL_MKNOD:-mknod} -F netbsd" 558 MKNOD="${TOOL_MKNOD:-mknod} -F netbsd"
534 if $do_force; then 559 if $do_force; then
535 MKNOD="${MKNOD} -R" 560 MKNOD="${MKNOD} -R"
536 else 561 else
537 MKNOD="${MKNOD} -r" 562 MKNOD="${MKNOD} -r"
538 fi 563 fi
539 fi 564 fi
540 565
541 # do_mtree or do_pax internally implies do_specfile. 566 # do_mtree or do_pax internally implies do_specfile.
542 # This happens after checking for mutually-exclusive options. 567 # This happens after checking for mutually-exclusive options.
543 if ($do_mtree || $do_pax) && ! $do_specfile; then 568 if ($do_mtree || $do_pax) && ! $do_specfile; then
544 do_specfile=true 569 do_specfile=true
545 opts="${opts} -s" 570 opts="${opts} -s"
546 fi 571 fi
547} 572}
548 573
549# wrap_makedev makedev_name ... 574# wrap_makedev makedev_name ...
550# Invoke a makedev-like function, with additional processing 575# Invoke a makedev-like function, with additional processing
551# as appropriate for use from the outer level. 576# as appropriate for use from the outer level.
552# 577#
553wrap_makedev() 578wrap_makedev()
554{ 579{
555 if $do_specfile; then 580 if $do_specfile; then
556 # "." must appear as the first line of the specfile. 581 # "." must appear as the first line of the specfile.
557 # "optional" means do not create the directory itself. 582 # "optional" means do not create the directory itself.
558 echo ". type=dir optional" 583 echo ". type=dir optional"
559 fi 584 fi
560 "$@" 585 "$@"
561} 586}
562 587
563# makedev_main makedev_name args... 588# makedev_main makedev_name args...
564# Perform most of the work of the main program. makedev_name 589# Perform most of the work of the main program. makedev_name
565# is typically "makedev", but may be the name of some other 590# is typically "makedev", but may be the name of some other
566# makedev-like function (if we are invoked from MAKEDEV.local or 591# makedev-like function (if we are invoked from MAKEDEV.local or
567# some other script). The other args to this function are the 592# some other script). The other args to this function are the
568# command line args with which the MAKEDEV (or MAKEDEV.local) 593# command line args with which the MAKEDEV (or MAKEDEV.local)
569# script was invoked. 594# script was invoked.
570# 595#
571makedev_main() 596makedev_main()
572{ 597{
573 local makedev="$1" ; shift 598 local makedev="$1" ; shift
574 599
575 # Parse command line args 600 # Parse command line args
576 setup ${1+"$@"} 601 setup ${1+"$@"}
577 shift $((${OPTIND}-1)) 602 shift $((${OPTIND}-1))
578 603
579 if $do_create_mfs; then 604 if $do_create_mfs; then
580 # Count inodes and create mfs file system. 605 # Count inodes and create mfs file system.
581 # The makedev call merely updates $count_nodes. 606 # The makedev call merely updates $count_nodes.
582 count_nodes=0 607 count_nodes=0
583 $makedev ${1+"$@"} 608 $makedev ${1+"$@"}
584 create_mfs_dev $count_nodes 609 create_mfs_dev $count_nodes
585 unset count_nodes 610 unset count_nodes
586 fi 611 fi
587 612
588 # If using mtree or pax, then wrap_makedev should print an mtree 613 # If using mtree or pax, then wrap_makedev should print an mtree
589 # specification, which we postprocess to create the device nodes. 614 # specification, which we postprocess to create the device nodes.
590 # Otherwise, wrap_makedev should do all the work itself. 615 # Otherwise, wrap_makedev should do all the work itself.
591 if $do_mtree ; then 616 if $do_mtree ; then
592 wrap_makedev $makedev ${1+"$@"} \ 617 wrap_makedev $makedev ${1+"$@"} \
593 | nooutput -1 "${TOOL_MTREE}" -e -U 618 | nooutput -1 "${TOOL_MTREE}" -e -U
594 elif $do_pax ; then 619 elif $do_pax ; then
595 wrap_makedev $makedev ${1+"$@"} \ 620 wrap_makedev $makedev ${1+"$@"} \
596 | ( 621 | (
597 # Run pax in an empty directory, so it pays 622 # Run pax in an empty directory, so it pays
598 # attention only to the specfile, without being 623 # attention only to the specfile, without being
599 # confused by the existing contents of the target 624 # confused by the existing contents of the target
600 # directory. Without this, pax would complain "file 625 # directory. Without this, pax would complain "file
601 # would overwrite itself" for already-existing 626 # would overwrite itself" for already-existing
602 # device nodes. 627 # device nodes.
603 tmpdir=./tmp.$$ 628 tmpdir=./tmp.$$
604 mkdir "${tmpdir}" || die "can't create temporary directory" 629 mkdir "${tmpdir}" || die "can't create temporary directory"
605 cd "${tmpdir}" || die "can't cd to temporary directory" 630 cd "${tmpdir}" || die "can't cd to temporary directory"
606 "${TOOL_PAX}" -r -w -M -pe .. 631 "${TOOL_PAX}" -r -w -M -pe ..
607 status=$? 632 status=$?
608 cd .. # back to where we started 633 cd .. # back to where we started
609 rmdir "${tmpdir}" 634 rmdir "${tmpdir}"
610 exit $status 635 exit $status
611 ) 636 )
612 else 637 else
613 wrap_makedev $makedev ${1+"$@"} 638 wrap_makedev $makedev ${1+"$@"}
614 fi 639 fi
615} 640}
616 641
617# 642#
618# functions available to create nodes: 643# functions available to create nodes:
619# 644#
620# mkdev name [b|c] major minor [mode{=600} [gid{=0} [uid{=0}]]] 645# mkdev name [b|c] major minor [mode{=600} [gid{=0} [uid{=0}]]]
621# create device node `name' with the appropriate permissions 646# create device node `name' with the appropriate permissions
622# 647#
623# lndev src target 648# lndev src target
624# create a symlink from src to target 649# create a symlink from src to target
625# 650#
626# makedir dir mode 651# makedir dir mode
627# create directory with appropriate mode 652# create directory with appropriate mode
628# 653#
629 654
630mkdev() 655mkdev()
631{ 656{
632 if [ -n "$count_nodes" ]; then 657 if [ -n "$count_nodes" ]; then
633 count_nodes=$((count_nodes + 1)) 658 count_nodes=$((count_nodes + 1))
634 return 659 return
635 fi 660 fi
636 if $do_specfile; then 661 if $do_specfile; then
637 case $2 in 662 case $2 in
638 b) type=block ;; 663 b) type=block ;;
639 c) type=char ;; 664 c) type=char ;;
640 esac 665 esac
641 echo "./$1 type=${type} device=netbsd,$3,$4 mode=${5:-600} gid=${6:-$g_wheel} uid=${7:-$u_root}" 666 echo "./$1 type=${type} device=netbsd,$3,$4 mode=${5:-600} gid=${6:-$g_wheel} uid=${7:-$u_root}"
642 else 667 else
643 ${MKNOD} -m ${5:-600} -g \#${6:-$g_wheel} -u \#${7:-$u_root} $1 $2 $3 $4 668 ${MKNOD} -m ${5:-600} -g \#${6:-$g_wheel} -u \#${7:-$u_root} $1 $2 $3 $4
644 fi 669 fi
645} 670}
646 671
647lndev() 672lndev()
648{ 673{
649 if [ -n "$count_nodes" ]; then 674 if [ -n "$count_nodes" ]; then
650 count_nodes=$((count_nodes + 1)) 675 count_nodes=$((count_nodes + 1))
651 return 676 return
652 fi 677 fi
653 if $do_specfile; then 678 if $do_specfile; then
654 echo "./$2 type=link link=$1 mode=0700 gid=$g_wheel uid=$u_root" 679 echo "./$2 type=link link=$1 mode=0700 gid=$g_wheel uid=$u_root"
655 else 680 else
656 ln -f -s $1 $2 681 ln -f -s $1 $2
657 fi 682 fi
658} 683}
659 684
660makedir() 685makedir()
661{ 686{
662 if [ -n "$count_nodes" ]; then 687 if [ -n "$count_nodes" ]; then
663 count_nodes=$((count_nodes + 1)) 688 count_nodes=$((count_nodes + 1))
664 return 689 return
665 fi 690 fi
666 if $do_specfile; then 691 if $do_specfile; then
667 echo "./$1 type=dir mode=$2 gid=$g_wheel uid=$u_root" 692 echo "./$1 type=dir mode=$2 gid=$g_wheel uid=$u_root"
668 else 693 else
669 nooutput -2 mkdir $1 694 nooutput -2 mkdir $1
670 chmod $2 $1 695 chmod $2 $1
671 fi 696 fi
672} 697}
673 698
674warn() 699warn()
675{ 700{
676 echo 1>&2 "$0: $*" 701 echo 1>&2 "$0: $*"
677} 702}
678 703
679die() 704die()
680{ 705{
681 echo 1>&2 "$0: $*" 706 echo 1>&2 "$0: $*"
682 exit 1 707 exit 1
683} 708}
684 709
685# makedev special [...] 710# makedev special [...]
686# the main loop 711# the main loop
687# 712#
688makedev() 713makedev()
689{ 714{
690 715
691for i 716for i
692do 717do
693 718
694case $i in 719case $i in
695 720
696%MD_DEVICES% 721%MD_DEVICES%
697 722
698all) 723all)
699 makedev all_md 724 makedev all_md
700 makedev std fd ptm pty0 pty1 pty2 pty3 725 makedev std fd ptm pty0 pty1 pty2 pty3
701 makedev ccd0 ccd1 ccd2 ccd3 726 makedev ccd0 ccd1 ccd2 ccd3
702 makedev cgd0 cgd1 cgd2 cgd3 727 makedev cgd0 cgd1 cgd2 cgd3
703 makedev fss0 fss1 fss2 fss3 728 makedev fss0 fss1 fss2 fss3
704 makedev md0 md1 729 makedev md0 md1
705 makedev raid0 raid1 raid2 raid3 raid4 raid5 raid6 raid7 730 makedev raid0 raid1 raid2 raid3 raid4 raid5 raid6 raid7
706 makedev vnd0 vnd1 vnd2 vnd3 731 makedev vnd0 vnd1 vnd2 vnd3
707 makedev bpf 732 makedev bpf
708 makedev tun0 tun1 tun2 tun3 733 makedev tun0 tun1 tun2 tun3
709 makedev ipl pf crypto random 734 makedev ipl pf crypto random
710 makedev lockstat clockctl cpuctl 735 makedev lockstat clockctl cpuctl
711 makedev atabus0 atabus1 atabus2 atabus3 736 makedev atabus0 atabus1 atabus2 atabus3
712 makedev tap tap0 tap1 tap2 tap3 737 makedev tap tap0 tap1 tap2 tap3
713 makedev gpio gpio0 gpio1 gpio2 gpio3 gpio4 gpio5 gpio6 gpio7 738 makedev gpio gpio0 gpio1 gpio2 gpio3 gpio4 gpio5 gpio6 gpio7
714 makedev pad pad0 pad1 pad2 pad3 739 makedev pad pad0 pad1 pad2 pad3
715 makedev bthub 740 makedev bthub
716 makedev putter 741 makedev putter
717 makedev drvctl 742 makedev drvctl
718 makedev video 743 makedev video
719 makedev local # do this last 744 makedev local # do this last
720 ;; 745 ;;
721 746
722init) 747init)
723 # unless overridden by MD entry, this is equal to 'all' 748 # unless overridden by MD entry, this is equal to 'all'
724 makedev all 749 makedev all
725 ;; 750 ;;
726 751
727%MI_DEVICES_BEGIN% 752%MI_DEVICES_BEGIN%
728audio) 753audio)
729 makedev audio0 audio1 audio2 audio3 754 makedev audio0 audio1 audio2 audio3
730 lndev sound0 sound 755 lndev sound0 sound
731 lndev audio0 audio 756 lndev audio0 audio
732 lndev mixer0 mixer 757 lndev mixer0 mixer
733 lndev audioctl0 audioctl 758 lndev audioctl0 audioctl
734 ;; 759 ;;
735 760
736gpio) 761gpio)
737 makedev gpio0 gpio1 gpio2 gpio3 gpio4 gpio5 gpio6 gpio7 762 makedev gpio0 gpio1 gpio2 gpio3 gpio4 gpio5 gpio6 gpio7
738 lndev gpio0 gpio 763 lndev gpio0 gpio
739 ;; 764 ;;
740 765
741pad) 766pad)
742 makedev pad0 pad1 pad2 pad3 767 makedev pad0 pad1 pad2 pad3
743 lndev pad0 pad 768 lndev pad0 pad
744 ;; 769 ;;
745 770
746radio) 771radio)
747 makedev radio0 radio1 772 makedev radio0 radio1
748 lndev radio0 radio 773 lndev radio0 radio
749 ;; 774 ;;
750 775
751video) 776video)
752 makedev video0 video1 video2 video3 777 makedev video0 video1 video2 video3
753 ;; 778 ;;
754 779
755ramdisk) 780ramdisk)
756 makedev floppy md0 781 makedev floppy md0
757 ;; 782 ;;
758 783
759usbs) 784usbs)
760 makedev usb usb0 usb1 usb2 usb3 usb4 usb5 usb6 usb7 785 makedev usb usb0 usb1 usb2 usb3 usb4 usb5 usb6 usb7
761 makedev uhid0 uhid1 uhid2 uhid3 786 makedev uhid0 uhid1 uhid2 uhid3
762 makedev ulpt0 ulpt1 787 makedev ulpt0 ulpt1
763 makedev ttyU0 ttyU1 788 makedev ttyU0 ttyU1
764 makedev ttyY0 ttyY1 789 makedev ttyY0 ttyY1
765 makedev urio0 790 makedev urio0
766 makedev uscanner0 uscanner1 791 makedev uscanner0 uscanner1
767 makedev utoppy0 utoppy1 792 makedev utoppy0 utoppy1
768 makedev ugen0 793 makedev ugen0
769 ;; 794 ;;
770 795
771isdns) 796isdns)
772 makedev isdn isdnctl isdnbchan0 isdnbchan1 isdntel0 isdntel1 isdnteld0 isdnteld1 isdntrc0 isdntrc1 797 makedev isdn isdnctl isdnbchan0 isdnbchan1 isdntel0 isdntel1 isdnteld0 isdnteld1 isdntrc0 isdntrc1
773 ;; 798 ;;
774 799
775std) 800std)
776 mkdev console c %cons_chr% 0 600 801 mkdev console c %cons_chr% 0 600
777 mkdev constty c %cons_chr% 1 600 802 mkdev constty c %cons_chr% 1 600
778 mkdev drum c %swap_chr% 0 640 $g_kmem 803 mkdev drum c %swap_chr% 0 640 $g_kmem
779 mkdev kmem c %mem_chr% 1 640 $g_kmem 804 mkdev kmem c %mem_chr% 1 640 $g_kmem
780 mkdev mem c %mem_chr% 0 640 $g_kmem 805 mkdev mem c %mem_chr% 0 640 $g_kmem
781 mkdev null c %mem_chr% 2 666 806 mkdev null c %mem_chr% 2 666
782 mkdev zero c %mem_chr% 12 666 807 mkdev zero c %mem_chr% 12 666
783 mkdev klog c %log_chr% 0 600 808 mkdev klog c %log_chr% 0 600
784 mkdev ksyms c %ksyms_chr% 0 444 809 mkdev ksyms c %ksyms_chr% 0 444
785 if $nofdesc; then 810 if ! $fdesc_mounted; then
786 mkdev tty c %ctty_chr% 0 666 811 mkdev tty c %ctty_chr% 0 666
787 mkdev stdin c %filedesc_chr% 0 666 812 mkdev stdin c %filedesc_chr% 0 666
788 mkdev stdout c %filedesc_chr% 1 666 813 mkdev stdout c %filedesc_chr% 1 666
789 mkdev stderr c %filedesc_chr% 2 666 814 mkdev stderr c %filedesc_chr% 2 666
790 fi 815 fi
791 ;; 816 ;;
792 817
793usb) 818usb)
794 mkdev usb c %usb_chr% 255 444 819 mkdev usb c %usb_chr% 255 444
795 ;; 820 ;;
796 821
797usb*) 822usb*)
798 unit=${i#usb} 823 unit=${i#usb}
799 usb=usb$unit 824 usb=usb$unit
800 mkdev usb$unit c %usb_chr% $unit 825 mkdev usb$unit c %usb_chr% $unit
801 ;; 826 ;;
802 827
803uhid*) 828uhid*)
804 unit=${i#uhid} 829 unit=${i#uhid}
805 mkdev uhid$unit c %uhid_chr% $unit 666 830 mkdev uhid$unit c %uhid_chr% $unit 666
806 ;; 831 ;;
807 832
808ulpt*) 833ulpt*)
809 unit=${i#ulpt} 834 unit=${i#ulpt}
810 mkdev ulpt$unit c %ulpt_chr% $unit 835 mkdev ulpt$unit c %ulpt_chr% $unit
811 mkdev ulpn$unit c %ulpt_chr% $(($unit + 64)) 836 mkdev ulpn$unit c %ulpt_chr% $(($unit + 64))
812 ;; 837 ;;
813 838
814urio*) 839urio*)
815 unit=${i#urio} 840 unit=${i#urio}
816 mkdev urio$unit c %urio_chr% $unit 666 841 mkdev urio$unit c %urio_chr% $unit 666
817 ;; 842 ;;
818 843
819uscanner*) 844uscanner*)
820 unit=${i#uscanner} 845 unit=${i#uscanner}
821 mkdev uscanner$unit c %uscanner_chr% $unit 846 mkdev uscanner$unit c %uscanner_chr% $unit
822 ;; 847 ;;
823 848
824utoppy*) 849utoppy*)
825 unit=${i#utoppy} 850 unit=${i#utoppy}
826 mkdev utoppy$unit c %utoppy_chr% $unit 851 mkdev utoppy$unit c %utoppy_chr% $unit
827 ;; 852 ;;
828 853
829ttyY*) 854ttyY*)
830 unit=${i#ttyY} 855 unit=${i#ttyY}
831 mkdev ttyY$unit c %ucycom_chr% $(($unit + $dialin )) "" "" $u_uucp 856 mkdev ttyY$unit c %ucycom_chr% $(($unit + $dialin )) "" "" $u_uucp
832 mkdev dtyY$unit c %ucycom_chr% $(($unit + $dialout )) "" "" $u_uucp 857 mkdev dtyY$unit c %ucycom_chr% $(($unit + $dialout )) "" "" $u_uucp
833 mkdev ctyY$unit c %ucycom_chr% $(($unit + $callunit)) "" "" $u_uucp 858 mkdev ctyY$unit c %ucycom_chr% $(($unit + $callunit)) "" "" $u_uucp
834 ;; 859 ;;
835 860
836ttyU*) 861ttyU*)
837 unit=${i#ttyU} 862 unit=${i#ttyU}
838 mkdev ttyU$unit c %ucom_chr% $(($unit + $dialin )) "" "" $u_uucp 863 mkdev ttyU$unit c %ucom_chr% $(($unit + $dialin )) "" "" $u_uucp
839 mkdev dtyU$unit c %ucom_chr% $(($unit + $dialout )) "" "" $u_uucp 864 mkdev dtyU$unit c %ucom_chr% $(($unit + $dialout )) "" "" $u_uucp
840 mkdev ctyU$unit c %ucom_chr% $(($unit + $callunit)) "" "" $u_uucp 865 mkdev ctyU$unit c %ucom_chr% $(($unit + $callunit)) "" "" $u_uucp
841 ;; 866 ;;
842 867
843ugen*) 868ugen*)
844 unit=${i#ugen} 869 unit=${i#ugen}
845 for j in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 870 for j in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
846 do 871 do
847 mkdev ugen$unit.$j c %ugen_chr% $(($unit * 16 + ${j#0})) 872 mkdev ugen$unit.$j c %ugen_chr% $(($unit * 16 + ${j#0}))
848 done 873 done
849 ;; 874 ;;
850 875
851wscons) 876wscons)
852 makedev ttyE0 ttyE1 ttyE2 ttyE3 ttyE4 ttyE5 ttyE6 ttyE7 877 makedev ttyE0 ttyE1 ttyE2 ttyE3 ttyE4 ttyE5 ttyE6 ttyE7
853 makedev wsmouse0 wsmouse1 wsmouse2 wsmouse3 878 makedev wsmouse0 wsmouse1 wsmouse2 wsmouse3
854 makedev wskbd0 wskbd1 wskbd2 wskbd3 879 makedev wskbd0 wskbd1 wskbd2 wskbd3
855 makedev wsmux0 wsmux1 wsmux2 wsmux3 880 makedev wsmux0 wsmux1 wsmux2 wsmux3
856 makedev wsmouse wskbd 881 makedev wsmouse wskbd
857 makedev ttyEcfg ttyEstat 882 makedev ttyEcfg ttyEstat
858 makedev wsfont 883 makedev wsfont
859 ;; 884 ;;
860 885
861wsmouse) 886wsmouse)
862 mkdev wsmouse c %wsmux_chr% 0 887 mkdev wsmouse c %wsmux_chr% 0
863 ;; 888 ;;
864 889
865wskbd) 890wskbd)
866 mkdev wskbd c %wsmux_chr% 1 891 mkdev wskbd c %wsmux_chr% 1
867 ;; 892 ;;
868 893
869wsmux*) 894wsmux*)
870 unit=${i#wsmux} 895 unit=${i#wsmux}
871 mkdev wsmux$unit c %wsmux_chr% $unit 896 mkdev wsmux$unit c %wsmux_chr% $unit
872 mkdev wsmuxctl$unit c %wsmux_chr% $(($unit + 128)) 200 897 mkdev wsmuxctl$unit c %wsmux_chr% $(($unit + 128)) 200
873 ;; 898 ;;
874 899
875xenevt) 900xenevt)
876 mkdev xenevt c %xenevt_chr% 0 901 mkdev xenevt c %xenevt_chr% 0
877 ;; 902 ;;
878 903
879xsd_kva) 904xsd_kva)
880 mkdev xsd_kva c %xenevt_chr% 1 905 mkdev xsd_kva c %xenevt_chr% 1
881 ;; 906 ;;
882 907
883xencons) 908xencons)
884 mkdev xencons c %xencons_chr% 0 909 mkdev xencons c %xencons_chr% 0
885 ;; 910 ;;
886 911
887ttyEstat) 912ttyEstat)
888 mkdev ttyEstat c %wsdisplay_chr% 254 913 mkdev ttyEstat c %wsdisplay_chr% 254
889 ;; 914 ;;
890 915
891ttyEcfg) 916ttyEcfg)
892 mkdev ttyEcfg c %wsdisplay_chr% 255 917 mkdev ttyEcfg c %wsdisplay_chr% 255
893 ;; 918 ;;
894 919
895ttyE*) 920ttyE*)
896 unit=${i#ttyE} 921 unit=${i#ttyE}
897 mkdev ttyE$unit c %wsdisplay_chr% $unit 922 mkdev ttyE$unit c %wsdisplay_chr% $unit
898 ;; 923 ;;
899 924
900wsmouse*) 925wsmouse*)
901 unit=${i#wsmouse} 926 unit=${i#wsmouse}
902 mkdev wsmouse$unit c %wsmouse_chr% $unit 927 mkdev wsmouse$unit c %wsmouse_chr% $unit
903 ;; 928 ;;
904 929
905wskbd*) 930wskbd*)
906 unit=${i#wskbd} 931 unit=${i#wskbd}
907 mkdev wskbd$unit c %wskbd_chr% $unit 932 mkdev wskbd$unit c %wskbd_chr% $unit
908 ;; 933 ;;
909 934
910fd) 935fd)
911 if $nofdesc; then 936 if ! $fdesc_mounted; then
912 makedir fd 755 937 makedir fd 755
913 n=0 938 n=0
914 while [ $n -lt 64 ] 939 while [ $n -lt 64 ]
915 do 940 do
916 mkdev fd/$n c %filedesc_chr% $n 666 941 mkdev fd/$n c %filedesc_chr% $n 666
917 n=$(($n + 1)) 942 n=$(($n + 1))
918 done 943 done
919 fi 944 fi
920 ;; 945 ;;
921 946
922wt*) 947wt*)
923 case $i in 948 case $i in
924 wt*) name=wt; unit=${i#wt}; chr=%wt_chr%; blk=%wt_blk%;; 949 wt*) name=wt; unit=${i#wt}; chr=%wt_chr%; blk=%wt_blk%;;
925 esac 950 esac
926 for sub in $unit $(($unit+8)) $(($unit+16)) 951 for sub in $unit $(($unit+8)) $(($unit+16))
927 do 952 do
928 mkdev $name$sub b $blk $(($sub + 0)) 660 $g_operator 953 mkdev $name$sub b $blk $(($sub + 0)) 660 $g_operator
929 mkdev n$name$sub b $blk $(($sub + 4)) 660 $g_operator 954 mkdev n$name$sub b $blk $(($sub + 4)) 660 $g_operator
930 mkdev r$name$sub c $chr $(($sub + 0)) 660 $g_operator 955 mkdev r$name$sub c $chr $(($sub + 0)) 660 $g_operator
931 mkdev nr$name$sub c $chr $(($sub + 4)) 660 $g_operator 956 mkdev nr$name$sub c $chr $(($sub + 4)) 660 $g_operator
932 done 957 done
933 ;; 958 ;;
934 959
935md*) 960md*)
936 makedisk_minimal md ${i#md} %md_blk% %md_chr% 961 makedisk_minimal md ${i#md} %md_blk% %md_chr%
937 ;; 962 ;;
938 963
939fss*) 964fss*)
940 case $i in 965 case $i in
941 fss*) name=fss; unit=${i#fss}; blk=%fss_blk%; chr=%fss_chr% 966 fss*) name=fss; unit=${i#fss}; blk=%fss_blk%; chr=%fss_chr%
942 esac 967 esac
943 mkdev $name$unit b $blk $unit 660 $g_operator 968 mkdev $name$unit b $blk $unit 660 $g_operator
944 mkdev r$name$unit c $chr $unit 660 $g_operator 969 mkdev r$name$unit c $chr $unit 660 $g_operator
945 ;; 970 ;;
946 971
947ss*) 972ss*)
948 case $i in 973 case $i in
949 ss*) name=ss; unit=${i#ss}; chr=%ss_chr%;; 974 ss*) name=ss; unit=${i#ss}; chr=%ss_chr%;;
950 esac 975 esac
951 mkdev $name$unit c $chr $(($unit * 16 + 0)) 640 $g_operator 976 mkdev $name$unit c $chr $(($unit * 16 + 0)) 640 $g_operator
952 mkdev n$name$unit c $chr $(($unit * 16 + 1)) 640 $g_operator 977 mkdev n$name$unit c $chr $(($unit * 16 + 1)) 640 $g_operator
953 mkdev en$name$unit c $chr $(($unit * 16 + 3)) 640 $g_operator 978 mkdev en$name$unit c $chr $(($unit * 16 + 3)) 640 $g_operator
954 ;; 979 ;;
955 980
956ccd*|cgd*|raid*|vnd*) 981ccd*|cgd*|raid*|vnd*)
957 case $i in 982 case $i in
958 ccd*) name=ccd; unit=${i#ccd}; blk=%ccd_blk%; chr=%ccd_chr%;; 983 ccd*) name=ccd; unit=${i#ccd}; blk=%ccd_blk%; chr=%ccd_chr%;;
959 cgd*) name=cgd; unit=${i#cgd}; blk=%cgd_blk%; chr=%cgd_chr%;; 984 cgd*) name=cgd; unit=${i#cgd}; blk=%cgd_blk%; chr=%cgd_chr%;;
960 raid*) name=raid; unit=${i#raid}; blk=%raid_blk%; chr=%raid_chr%;; 985 raid*) name=raid; unit=${i#raid}; blk=%raid_blk%; chr=%raid_chr%;;
961 vnd*) name=vnd; unit=${i#vnd}; blk=%vnd_blk%; chr=%vnd_chr%;; 986 vnd*) name=vnd; unit=${i#vnd}; blk=%vnd_blk%; chr=%vnd_chr%;;
962 esac 987 esac
963 %MKDISK% $name $unit $blk $chr 988 %MKDISK% $name $unit $blk $chr
964 ;; 989 ;;
965 990
966sd*) 991sd*)
967 name=sd; unit=${i#sd}; blk=%sd_blk%; chr=%sd_chr% 992 name=sd; unit=${i#sd}; blk=%sd_blk%; chr=%sd_chr%
968 %MKDISK% $name $unit $blk $chr 993 %MKDISK% $name $unit $blk $chr
969 ;; 994 ;;
970 995
971wd*) 996wd*)
972 name=wd; unit=${i#wd}; blk=%wd_blk%; chr=%wd_chr% 997 name=wd; unit=${i#wd}; blk=%wd_blk%; chr=%wd_chr%
973 %MKDISK% $name $unit $blk $chr 998 %MKDISK% $name $unit $blk $chr
974 ;; 999 ;;
975 1000
976fd*) 1001fd*)
977 name=fd; unit=${i#fd}; blk=%fd_blk%; chr=%fd_chr% 1002 name=fd; unit=${i#fd}; blk=%fd_blk%; chr=%fd_chr%
978 %MKDISK% $name $unit $blk $chr 1003 %MKDISK% $name $unit $blk $chr
979 ;; 1004 ;;
980 1005
981ld*) 1006ld*)
982 name=ld; unit=${i#ld}; blk=%ld_blk%; chr=%ld_chr% 1007 name=ld; unit=${i#ld}; blk=%ld_blk%; chr=%ld_chr%
983 %MKDISK% $name $unit $blk $chr 1008 %MKDISK% $name $unit $blk $chr
984 ;; 1009 ;;
985 1010
986bio) 1011bio)
987 mkdev bio c %bio_chr% 0 1012 mkdev bio c %bio_chr% 0
988 ;; 1013 ;;
989 1014
990ed*) 1015ed*)
991 name=ed; unit=${i#ed}; blk=%ed_blk%; chr=%ed_chr% 1016 name=ed; unit=${i#ed}; blk=%ed_blk%; chr=%ed_chr%
992 %MKDISK% $name $unit $blk $chr 1017 %MKDISK% $name $unit $blk $chr
993 ;; 1018 ;;
994 1019
995ofdisk*) 1020ofdisk*)
996 name=ofdisk; unit=${i#ofdisk}; blk=%ofdisk_blk%; chr=%ofdisk_chr% 1021 name=ofdisk; unit=${i#ofdisk}; blk=%ofdisk_blk%; chr=%ofdisk_chr%
997 %MKDISK% $name $unit $blk $chr 1022 %MKDISK% $name $unit $blk $chr
998 ;; 1023 ;;
999 1024
1000xbd*) 1025xbd*)
1001 name=xbd; unit=${i#xbd}; blk=%xbd_blk%; chr=%xbd_chr% 1026 name=xbd; unit=${i#xbd}; blk=%xbd_blk%; chr=%xbd_chr%
1002 %MKDISK% $name $unit $blk $chr 1027 %MKDISK% $name $unit $blk $chr
1003 ;; 1028 ;;
1004 1029
1005dk*) 1030dk*)
1006 name=dk; unit=${i#dk}; blk=%dk_blk%; chr=%dk_chr% 1031 name=dk; unit=${i#dk}; blk=%dk_blk%; chr=%dk_chr%
1007 minor=0 1032 minor=0
1008 while [ $minor -le ${i#dk} ] 1033 while [ $minor -le ${i#dk} ]
1009 do 1034 do
1010 mkdev r$name$minor c $chr $minor 0640 $g_operator 1035 mkdev r$name$minor c $chr $minor 0640 $g_operator
1011 mkdev $name$minor b $blk $minor 0640 $g_operator 1036 mkdev $name$minor b $blk $minor 0640 $g_operator
1012 minor=$(($minor + 1)) 1037 minor=$(($minor + 1))
1013 done 1038 done
1014 ;; 1039 ;;
1015 1040
1016ttyCY*) 1041ttyCY*)
1017 name=tyCY; chr=%cy_chr%; off=32 1042 name=tyCY; chr=%cy_chr%; off=32
1018 unit=${i#t${name}} 1043 unit=${i#t${name}}
1019 minor=$(($unit * $off)) 1044 minor=$(($unit * $off))
1020 eminor=$(($minor + $off)) 1045 eminor=$(($minor + $off))
1021 while [ $minor -lt $eminor ] 1046 while [ $minor -lt $eminor ]
1022 do 1047 do
1023 nminor=000$minor 1048 nminor=000$minor
1024 nminor=${nminor#${nminor%???}} 1049 nminor=${nminor#${nminor%???}}
1025 mkdev t$name$nminor c $chr $(($minor + $dialin )) "" "" $u_uucp 1050 mkdev t$name$nminor c $chr $(($minor + $dialin )) "" "" $u_uucp
1026 mkdev d$name$nminor c $chr $(($minor + $dialout)) "" "" $u_uucp 1051 mkdev d$name$nminor c $chr $(($minor + $dialout)) "" "" $u_uucp
1027 minor=$(($minor + 1)) 1052 minor=$(($minor + 1))
1028 done 1053 done
1029 ;; 1054 ;;
1030 1055
1031ttyCZ*) 1056ttyCZ*)
1032 name=tyCZ; chr=%cz_chr%; off=64 1057 name=tyCZ; chr=%cz_chr%; off=64
1033 unit=${i#t${name}} 1058 unit=${i#t${name}}
1034 minor=$(($unit * $off)) 1059 minor=$(($unit * $off))
1035 eminor=$(($minor + $off)) 1060 eminor=$(($minor + $off))
1036 while [ $minor -lt $eminor ] 1061 while [ $minor -lt $eminor ]
1037 do 1062 do
1038 nminor=0000$minor 1063 nminor=0000$minor
1039 nminor=${nminor#${nminor%????}} 1064 nminor=${nminor#${nminor%????}}
1040 mkdev t$name$nminor c $chr $(($minor + $dialin )) "" "" $u_uucp 1065 mkdev t$name$nminor c $chr $(($minor + $dialin )) "" "" $u_uucp
1041 mkdev d$name$nminor c $chr $(($minor + $dialout)) "" "" $u_uucp 1066 mkdev d$name$nminor c $chr $(($minor + $dialout)) "" "" $u_uucp
1042 minor=$(($minor + 1)) 1067 minor=$(($minor + 1))
1043 done 1068 done
1044 ;; 1069 ;;
1045 1070
1046 1071
1047tty[0-9]|tty0[0-9]) 1072tty[0-9]|tty0[0-9])
1048 # some archs have built-in zstty (major %zstty_chr%) instead 1073 # some archs have built-in zstty (major %zstty_chr%) instead
1049 # of NS16550; create ttyZ* and hardlink as [dt]ty0*; this 1074 # of NS16550; create ttyZ* and hardlink as [dt]ty0*; this
1050 # needs to be before com entry, for archs which have both 1075 # needs to be before com entry, for archs which have both
1051 unit=${i#tty} 1076 unit=${i#tty}
1052 unit=$(($unit + 0)) 1077 unit=$(($unit + 0))
1053 makedev ttyZ${unit} 1078 makedev ttyZ${unit}
1054 lndev ttyZ$unit tty0${unit} 1079 lndev ttyZ$unit tty0${unit}
1055 lndev dtyZ$unit dty0${unit} 1080 lndev dtyZ$unit dty0${unit}
1056 ;; 1081 ;;
1057 1082
1058tty0*|tty1*|tty[0-9]) 1083tty0*|tty1*|tty[0-9])
1059 unit=${i#tty} 1084 unit=${i#tty}
1060 ounit=00$unit 1085 ounit=00$unit
1061 ounit=${ounit#${ounit%??}} 1086 ounit=${ounit#${ounit%??}}
1062 mkdev tty$ounit c %com_chr% $(($unit + $dialin )) "" "" $u_uucp 1087 mkdev tty$ounit c %com_chr% $(($unit + $dialin )) "" "" $u_uucp
1063 mkdev dty$ounit c %com_chr% $(($unit + $dialout)) "" "" $u_uucp 1088 mkdev dty$ounit c %com_chr% $(($unit + $dialout)) "" "" $u_uucp
1064 ;; 1089 ;;
1065 1090
1066ttyC*) 1091ttyC*)
1067 # some archs call com_chr ttyC traditionally 1092 # some archs call com_chr ttyC traditionally
1068 unit=${i#ttyC}; name=ttyC; dname=dtyC; chr=%com_chr% 1093 unit=${i#ttyC}; name=ttyC; dname=dtyC; chr=%com_chr%
1069 mkdev $name$unit c $chr $(($unit + $dialin )) "" "" $u_uucp 1094 mkdev $name$unit c $chr $(($unit + $dialin )) "" "" $u_uucp
1070 mkdev $dname$unit c $chr $(($unit + $dialout)) "" "" $u_uucp 1095 mkdev $dname$unit c $chr $(($unit + $dialout)) "" "" $u_uucp
1071 ;; 1096 ;;
1072 1097
1073ttyh*) 1098ttyh*)
1074 unit=${i#ttyh}; name=ttyh; dname=dtyh; chr=%sabtty_chr% 1099 unit=${i#ttyh}; name=ttyh; dname=dtyh; chr=%sabtty_chr%
1075 mkdev $name$unit c $chr $(($unit + $dialin )) "" "" $u_uucp 1100 mkdev $name$unit c $chr $(($unit + $dialin )) "" "" $u_uucp
1076 mkdev $dname$unit c $chr $(($unit + $dialout)) "" "" $u_uucp 1101 mkdev $dname$unit c $chr $(($unit + $dialout)) "" "" $u_uucp
1077 ;; 1102 ;;
1078 1103
1079ttyTX*) 1104ttyTX*)
1080 unit=${i#ttyTX}; name=ttyTX0; dname=dtyTX0; chr=%txcom_chr% 1105 unit=${i#ttyTX}; name=ttyTX0; dname=dtyTX0; chr=%txcom_chr%
1081 mkdev $name$unit c $chr $(($unit + $dialin )) "" "" $u_uucp 1106 mkdev $name$unit c $chr $(($unit + $dialin )) "" "" $u_uucp
1082 mkdev $dname$unit c $chr $(($unit + $dialout)) "" "" $u_uucp 1107 mkdev $dname$unit c $chr $(($unit + $dialout)) "" "" $u_uucp
1083 ;; 1108 ;;
1084 1109
1085ttyZ*) 1110ttyZ*)
1086 unit=${i#ttyZ}; name=ttyZ; dname=dtyZ; chr=%zstty_chr% 1111 unit=${i#ttyZ}; name=ttyZ; dname=dtyZ; chr=%zstty_chr%
1087 mkdev $name$unit c $chr $(($unit + $dialin )) "" "" $u_uucp 1112 mkdev $name$unit c $chr $(($unit + $dialin )) "" "" $u_uucp
1088 mkdev $dname$unit c $chr $(($unit + $dialout)) "" "" $u_uucp 1113 mkdev $dname$unit c $chr $(($unit + $dialout)) "" "" $u_uucp
1089 ;; 1114 ;;
1090 1115
1091opty) 1116opty)
1092 for j in 0 1 2 3 4 5 6 7 8 9 a b c d e f 1117 for j in 0 1 2 3 4 5 6 7 8 9 a b c d e f
1093 do 1118 do
1094 case $j in 1119 case $j in
1095 [0-9]) jn=$j ;; 1120 [0-9]) jn=$j ;;
1096 a) jn=10 ;; 1121 a) jn=10 ;;
1097 b) jn=11 ;; 1122 b) jn=11 ;;
1098 c) jn=12 ;; 1123 c) jn=12 ;;
1099 d) jn=13 ;; 1124 d) jn=13 ;;
1100 e) jn=14 ;; 1125 e) jn=14 ;;
1101 f) jn=15 ;; 1126 f) jn=15 ;;
1102 esac 1127 esac
1103 mkdev ttyp$j c %pts_chr% $jn 666 1128 mkdev ttyp$j c %pts_chr% $jn 666
1104 mkdev ptyp$j c %ptc_chr% $jn 666 1129 mkdev ptyp$j c %ptc_chr% $jn 666
1105 done 1130 done
1106 ;; 1131 ;;
1107 1132
1108pty*) 1133pty*)
1109 class=${i#pty} 1134 class=${i#pty}
1110 d1="p q r s t u v w x y z P Q R S T" 1135 d1="p q r s t u v w x y z P Q R S T"
1111 if [ "$class" -ge 64 ] 1136 if [ "$class" -ge 64 ]
1112 then 1137 then
1113 warn "$i: pty unit must be between 0 and 63" 1138 warn "$i: pty unit must be between 0 and 63"
1114 continue 1139 continue
1115 elif [ "$class" -lt 16 ] 1140 elif [ "$class" -lt 16 ]
1116 then 1141 then
1117 offset=0 1142 offset=0
1118 mult=0 1143 mult=0
1119 d2="0 1 2 3 4 5 6 7 8 9 a b c d e f" 1144 d2="0 1 2 3 4 5 6 7 8 9 a b c d e f"
1120 else 1145 else
1121 class=$(($class - 16)) 1146 class=$(($class - 16))
1122 offset=256 1147 offset=256
1123 mult=2 1148 mult=2
1124 d2="g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z" 1149 d2="g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z"
1125 fi 1150 fi
1126 start=$(($class * 16)) 1151 start=$(($class * 16))
1127 set -- $d2 1152 set -- $d2
1128 nt=$# 1153 nt=$#
1129 s1=$(($start / $nt)) 1154 s1=$(($start / $nt))
1130 set -- $d1 1155 set -- $d1
1131 shift $s1 1156 shift $s1
1132 t1=$1 1157 t1=$1
1133 if [ "$t1" = v ]; then 1158 if [ "$t1" = v ]; then
1134 warn "$i: pty unit conflicts with console ttyv0 device" 1159 warn "$i: pty unit conflicts with console ttyv0 device"
1135 continue 1160 continue
1136 fi 1161 fi
1137 s2=$(($start % ($nt - $s1 * $mult))) 1162 s2=$(($start % ($nt - $s1 * $mult)))
1138 set -- $d2 1163 set -- $d2
1139 shift $s2 1164 shift $s2
1140 t2=$1 1165 t2=$1
1141 unit=$(($start + $offset - $s1 * $mult)) 1166 unit=$(($start + $offset - $s1 * $mult))
1142 end=$(($unit + 16)) 1167 end=$(($unit + 16))
1143 while [ "$unit" -lt "$end" ] 1168 while [ "$unit" -lt "$end" ]
1144 do 1169 do
1145 mkdev tty$t1$t2 c %pts_chr% $unit 666 1170 mkdev tty$t1$t2 c %pts_chr% $unit 666
1146 mkdev pty$t1$t2 c %ptc_chr% $unit 666 1171 mkdev pty$t1$t2 c %ptc_chr% $unit 666
1147 shift 1172 shift
1148 t2=$1 1173 t2=$1
1149 if [ -z "$t2" ] 1174 if [ -z "$t2" ]
1150 then 1175 then
1151 break 1176 break
1152 fi 1177 fi
1153 unit=$(($unit + 1)) 1178 unit=$(($unit + 1))
1154 done 1179 done
1155 ;; 1180 ;;
1156 1181
1157stic*) 1182stic*)
1158 unit=${i#stic} 1183 unit=${i#stic}
1159 mkdev stic$unit c %stic_chr% $unit 1184 mkdev stic$unit c %stic_chr% $unit
1160 ;; 1185 ;;
1161 1186
1162st*) 1187st*)
1163 case $i in 1188 case $i in
1164 st*) name=st; unit=${i#st}; chr=%st_chr%; blk=%st_blk%;; 1189 st*) name=st; unit=${i#st}; chr=%st_chr%; blk=%st_blk%;;
1165 esac 1190 esac
1166 mkdev $name$unit b $blk $(($unit * 16 + 0)) 660 $g_operator 1191 mkdev $name$unit b $blk $(($unit * 16 + 0)) 660 $g_operator
1167 mkdev n$name$unit b $blk $(($unit * 16 + 1)) 660 $g_operator 1192 mkdev n$name$unit b $blk $(($unit * 16 + 1)) 660 $g_operator
1168 mkdev e$name$unit b $blk $(($unit * 16 + 2)) 660 $g_operator 1193 mkdev e$name$unit b $blk $(($unit * 16 + 2)) 660 $g_operator
1169 mkdev en$name$unit b $blk $(($unit * 16 + 3)) 660 $g_operator 1194 mkdev en$name$unit b $blk $(($unit * 16 + 3)) 660 $g_operator
1170 mkdev r$name$unit c $chr $(($unit * 16 + 0)) 660 $g_operator 1195 mkdev r$name$unit c $chr $(($unit * 16 + 0)) 660 $g_operator
1171 mkdev nr$name$unit c $chr $(($unit * 16 + 1)) 660 $g_operator 1196 mkdev nr$name$unit c $chr $(($unit * 16 + 1)) 660 $g_operator
1172 mkdev er$name$unit c $chr $(($unit * 16 + 2)) 660 $g_operator 1197 mkdev er$name$unit c $chr $(($unit * 16 + 2)) 660 $g_operator
1173 mkdev enr$name$unit c $chr $(($unit * 16 + 3)) 660 $g_operator 1198 mkdev enr$name$unit c $chr $(($unit * 16 + 3)) 660 $g_operator
1174 ;; 1199 ;;
1175 1200
1176ses*|ch*|uk*) 1201ses*|ch*|uk*)
1177 case $i in 1202 case $i in
1178 ch*) name=ch; unit=${i#ch}; chr=%ch_chr%;; 1203 ch*) name=ch; unit=${i#ch}; chr=%ch_chr%;;
1179 uk*) name=uk; unit=${i#uk}; chr=%uk_chr%;; 1204 uk*) name=uk; unit=${i#uk}; chr=%uk_chr%;;
1180 ses*) name=ses; unit=${i#ses}; chr=%ses_chr%;; 1205 ses*) name=ses; unit=${i#ses}; chr=%ses_chr%;;
1181 esac 1206 esac
1182 mkdev $name$unit c $chr $unit 640 $g_operator 1207 mkdev $name$unit c $chr $unit 640 $g_operator
1183 ;; 1208 ;;
1184 1209
1185cd*) 1210cd*)
1186 makedisk_minimal cd ${i#cd} %cd_blk% %cd_chr% 1211 makedisk_minimal cd ${i#cd} %cd_blk% %cd_chr%
1187 ;; 1212 ;;
1188 1213
1189mcd*) 1214mcd*)
1190 makedisk_minimal mcd ${i#mcd} %mcd_blk% %mcd_chr% 1215 makedisk_minimal mcd ${i#mcd} %mcd_blk% %mcd_chr%
1191 ;; 1216 ;;
1192 1217
1193gdrom*) 1218gdrom*)
1194 makedisk_minimal gdrom ${i#gdrom} %gdrom_blk% %gdrom_chr% 1219 makedisk_minimal gdrom ${i#gdrom} %gdrom_blk% %gdrom_chr%
1195 ;; 1220 ;;
1196 1221
1197lpt*|lpa*) 1222lpt*|lpa*)
1198 case $i in 1223 case $i in
1199 lpt*) name=lpt; unit=${i#lpt}; chr=%lpt_chr%; flags=0;; 1224 lpt*) name=lpt; unit=${i#lpt}; chr=%lpt_chr%; flags=0;;
1200 lpa*) name=lpa; unit=${i#lpa}; chr=%lpt_chr%; flags=128;; 1225 lpa*) name=lpa; unit=${i#lpa}; chr=%lpt_chr%; flags=128;;
1201 esac 1226 esac
1202 mkdev $name$unit c $chr $(($unit + $flags)) 1227 mkdev $name$unit c $chr $(($unit + $flags))
1203 mkdev lpt${unit}ctl c $chr $(($unit + 256)) 1228 mkdev lpt${unit}ctl c $chr $(($unit + 256))
1204 ;; 1229 ;;
1205 1230
1206bpf) 1231bpf)
1207 mkdev bpf c %bpf_chr% 0 1232 mkdev bpf c %bpf_chr% 0
1208 lndev bpf bpf0 1233 lndev bpf bpf0
1209 ;; 1234 ;;
1210 1235
1211bthub) 1236bthub)
1212 mkdev bthub c %bthub_chr% 0 1237 mkdev bthub c %bthub_chr% 0
1213 ;; 1238 ;;
1214 1239
1215tun*) 1240tun*)
1216 unit=${i#tun} 1241 unit=${i#tun}
1217 mkdev tun$unit c %tun_chr% $unit 1242 mkdev tun$unit c %tun_chr% $unit
1218 ;; 1243 ;;
1219 1244
1220joy*) 1245joy*)
1221 unit=${i#joy} 1246 unit=${i#joy}
1222 mkdev joy$unit c %joy_chr% $unit 1247 mkdev joy$unit c %joy_chr% $unit
1223 ;; 1248 ;;
1224 1249
1225ipl) 1250ipl)
1226 mkdev ipl c %ipl_chr% 0 1251 mkdev ipl c %ipl_chr% 0
1227 mkdev ipnat c %ipl_chr% 1 1252 mkdev ipnat c %ipl_chr% 1
1228 mkdev ipstate c %ipl_chr% 2 1253 mkdev ipstate c %ipl_chr% 2
1229 mkdev ipauth c %ipl_chr% 3 1254 mkdev ipauth c %ipl_chr% 3
1230 mkdev ipsync c %ipl_chr% 4 1255 mkdev ipsync c %ipl_chr% 4
1231 mkdev ipscan c %ipl_chr% 5 1256 mkdev ipscan c %ipl_chr% 5
1232 mkdev iplookup c %ipl_chr% 6 1257 mkdev iplookup c %ipl_chr% 6
1233 ;; 1258 ;;
1234 1259
1235pf) 1260pf)
1236 mkdev pf c %pf_chr% 0 1261 mkdev pf c %pf_chr% 0
1237 ;; 1262 ;;
1238 1263
1239crypto) 1264crypto)
1240 mkdev crypto c %crypto_chr% 0 666 1265 mkdev crypto c %crypto_chr% 0 666
1241 ;; 1266 ;;
1242 1267
1243cmos) 1268cmos)
1244 mkdev cmos c %cmos_chr% 0 644 1269 mkdev cmos c %cmos_chr% 0 644
1245 ;; 1270 ;;
1246 1271
1247speaker) 1272speaker)
1248 mkdev speaker c %spkr_chr% 0 1273 mkdev speaker c %spkr_chr% 0
1249 ;; 1274 ;;
1250 1275
1251lockstat) 1276lockstat)
1252 mkdev lockstat c %lockstat_chr% 0 1277 mkdev lockstat c %lockstat_chr% 0
1253 ;; 1278 ;;
1254 1279
1255cpuctl) 1280cpuctl)
1256 mkdev cpuctl c %cpuctl_chr% 0 666 1281 mkdev cpuctl c %cpuctl_chr% 0 666
1257 ;; 1282 ;;
1258 1283
1259audio*) 1284audio*)
1260 unit=${i#audio} 1285 unit=${i#audio}
1261 audio=audio$unit 1286 audio=audio$unit
1262 sound=sound$unit 1287 sound=sound$unit
1263 mixer=mixer$unit 1288 mixer=mixer$unit
1264 audioctl=audioctl$unit 1289 audioctl=audioctl$unit
1265 : ${unit:-0} 1290 : ${unit:-0}
1266 mkdev $sound c %audio_chr% $(($unit + 0)) 666 1291 mkdev $sound c %audio_chr% $(($unit + 0)) 666
1267 mkdev $audio c %audio_chr% $(($unit + 128)) 666 1292 mkdev $audio c %audio_chr% $(($unit + 128)) 666
1268 mkdev $mixer c %audio_chr% $(($unit + 16)) 666 1293 mkdev $mixer c %audio_chr% $(($unit + 16)) 666
1269 mkdev $audioctl c %audio_chr% $(($unit + 192)) 666 1294 mkdev $audioctl c %audio_chr% $(($unit + 192)) 666
1270 ;; 1295 ;;
1271 1296
1272gpio*) 1297gpio*)
1273 unit=${i#gpio} 1298 unit=${i#gpio}
1274 mkdev gpio$unit c %gpio_chr% $unit 644 1299 mkdev gpio$unit c %gpio_chr% $unit 644
1275 ;; 1300 ;;
1276 1301
1277rmidi*) 1302rmidi*)
1278 unit=${i#rmidi} 1303 unit=${i#rmidi}
1279 mkdev rmidi$unit c %midi_chr% $unit 666 1304 mkdev rmidi$unit c %midi_chr% $unit 666
1280 ;; 1305 ;;
1281 1306
1282music*) 1307music*)
1283 unit=${i#music} 1308 unit=${i#music}
1284 : ${unit:-0} 1309 : ${unit:-0}
1285 mkdev music$unit c %sequencer_chr% $(($unit + 0)) 666 1310 mkdev music$unit c %sequencer_chr% $(($unit + 0)) 666
1286 mkdev sequencer$unit c %sequencer_chr% $(($unit + 128)) 666 1311 mkdev sequencer$unit c %sequencer_chr% $(($unit + 128)) 666
1287 ;; 1312 ;;
1288 1313
1289radio*) 1314radio*)
1290 unit=${i#radio} 1315 unit=${i#radio}
1291 : ${unit:-0} 1316 : ${unit:-0}
1292 mkdev radio$unit c %radio_chr% $unit 666 1317 mkdev radio$unit c %radio_chr% $unit 666
1293 ;; 1318 ;;
1294 1319
1295video*) 1320video*)
1296 unit=${i#video} 1321 unit=${i#video}
1297 : ${unit:-0} 1322 : ${unit:-0}
1298 mkdev video$unit c %video_chr% $unit 666 1323 mkdev video$unit c %video_chr% $unit 666
1299 ;; 1324 ;;
1300 1325
1301amr*) 1326amr*)
1302 unit=${i#amr} 1327 unit=${i#amr}
1303 mkdev amr$unit c %amr_chr% $unit 1328 mkdev amr$unit c %amr_chr% $unit
1304 ;; 1329 ;;
1305 1330
1306apm) 1331apm)
1307 mkdev apm c %apm_chr% 0 644 1332 mkdev apm c %apm_chr% 0 644
1308 mkdev apmctl c %apm_chr% 8 644 1333 mkdev apmctl c %apm_chr% 8 644
1309 ;; 1334 ;;
1310 1335
1311apm) 1336apm)
1312 # hpcmips uses `apmdev_chr' instead of `apm_chr' 1337 # hpcmips uses `apmdev_chr' instead of `apm_chr'
1313 mkdev apm c %apmdev_chr% 0 644 1338 mkdev apm c %apmdev_chr% 0 644
1314 mkdev apmctl c %apmdev_chr% 8 644 1339 mkdev apmctl c %apmdev_chr% 8 644
1315 ;; 1340 ;;
1316 1341
1317satlink*) 1342satlink*)
1318 unit=${i#satlink} 1343 unit=${i#satlink}
1319 mkdev satlink$unit c %satlink_chr% $unit 444 1344 mkdev satlink$unit c %satlink_chr% $unit 444
1320 ;; 1345 ;;
1321 1346
1322random) 1347random)
1323 mkdev random c %rnd_chr% 0 444 1348 mkdev random c %rnd_chr% 0 444
1324 mkdev urandom c %rnd_chr% 1 644 1349 mkdev urandom c %rnd_chr% 1 644
1325 ;; 1350 ;;
1326 1351
1327cfs) 1352cfs)
1328 makedev cfs0 1353 makedev cfs0
1329 ;; 1354 ;;
1330 1355
1331cfs*) 1356cfs*)
1332 unit=${i#cfs} 1357 unit=${i#cfs}
1333 mkdev cfs$unit c %vcoda_chr% $unit 1358 mkdev cfs$unit c %vcoda_chr% $unit
1334 ;; 1359 ;;
1335 1360
1336sysmon) 1361sysmon)
1337 mkdev sysmon c %sysmon_chr% 0 644 1362 mkdev sysmon c %sysmon_chr% 0 644
1338 mkdev watchdog c %sysmon_chr% 1 644 1363 mkdev watchdog c %sysmon_chr% 1 644
1339 mkdev power c %sysmon_chr% 2 640 1364 mkdev power c %sysmon_chr% 2 640
1340 ;; 1365 ;;
1341 1366
1342scsibus*) 1367scsibus*)
1343 unit=${i#scsibus} 1368 unit=${i#scsibus}
1344 mkdev scsibus$unit c %scsibus_chr% $unit 644 1369 mkdev scsibus$unit c %scsibus_chr% $unit 644
1345 ;; 1370 ;;
1346 1371
1347bktr) 1372bktr)
1348 makedev bktr0 bktr1 1373 makedev bktr0 bktr1
1349 lndev bktr0 bktr 1374 lndev bktr0 bktr
1350 lndev tuner0 tuner 1375 lndev tuner0 tuner
1351 lndev vbi0 vbi 1376 lndev vbi0 vbi
1352 ;; 1377 ;;
1353 1378
1354bktr*) 1379bktr*)
1355 unit=${i#bktr} 1380 unit=${i#bktr}
1356 mkdev bktr$unit c %bktr_chr% $(($unit + 0)) 444 1381 mkdev bktr$unit c %bktr_chr% $(($unit + 0)) 444
1357 mkdev tuner$unit c %bktr_chr% $(($unit + 16)) 444 1382 mkdev tuner$unit c %bktr_chr% $(($unit + 16)) 444
1358 mkdev vbi$unit c %bktr_chr% $(($unit + 32)) 444 1383 mkdev vbi$unit c %bktr_chr% $(($unit + 32)) 444
1359 ;; 1384 ;;
1360 1385
1361io) 1386io)
1362 mkdev io c %mem_chr% 14 600 1387 mkdev io c %mem_chr% 14 600
1363 ;; 1388 ;;
1364 1389
1365iop*) 1390iop*)
1366 unit=${i#iop} 1391 unit=${i#iop}
1367 mkdev iop$unit c %iop_chr% $unit 1392 mkdev iop$unit c %iop_chr% $unit
1368 ;; 1393 ;;
1369 1394
1370mlx*) 1395mlx*)
1371 unit=${i#mlx} 1396 unit=${i#mlx}
1372 mkdev mlx$unit c %mlx_chr% $unit 1397 mkdev mlx$unit c %mlx_chr% $unit
1373 ;; 1398 ;;
1374 1399
1375mly*) 1400mly*)
1376 unit=${i#mly} 1401 unit=${i#mly}
1377 mkdev mly$unit c %mly_chr% $unit 1402 mkdev mly$unit c %mly_chr% $unit
1378 ;; 1403 ;;
1379 1404
1380twa*) 1405twa*)
1381 unit=${i#twa} 1406 unit=${i#twa}
1382 mkdev twa$unit c %twa_chr% $unit 1407 mkdev twa$unit c %twa_chr% $unit
1383 ;; 1408 ;;
1384 1409
1385twe*) 1410twe*)
1386 unit=${i#twe} 1411 unit=${i#twe}
1387 mkdev twe$unit c %twe_chr% $unit 1412 mkdev twe$unit c %twe_chr% $unit
1388 ;; 1413 ;;
1389 1414
1390icp*) 1415icp*)
1391 unit=${i#icp} 1416 unit=${i#icp}
1392 mkdev icp$unit c %icp_chr% $unit 1417 mkdev icp$unit c %icp_chr% $unit
1393 ;; 1418 ;;
1394 1419
1395agp*) 1420agp*)
1396 unit=${i#agp} 1421 unit=${i#agp}
1397 mkdev agp$unit c %agp_chr% $unit 644 1422 mkdev agp$unit c %agp_chr% $unit 644
1398 if [ "$unit" = "0" ]; then 1423 if [ "$unit" = "0" ]; then
1399 lndev agp$unit agpgart 1424 lndev agp$unit agpgart
1400 fi 1425 fi
1401 ;; 1426 ;;
1402 1427
1403pci*) 1428pci*)
1404 unit=${i#pci} 1429 unit=${i#pci}
1405 mkdev pci$unit c %pci_chr% $unit 644 1430 mkdev pci$unit c %pci_chr% $unit 644
1406 ;; 1431 ;;
1407 1432
1408dpti*) 1433dpti*)
1409 unit=${i#dpti} 1434 unit=${i#dpti}
1410 mkdev dpti$unit c %dpti_chr% $unit 1435 mkdev dpti$unit c %dpti_chr% $unit
1411 ;; 1436 ;;
1412 1437
1413dpt*) 1438dpt*)
1414 unit=${i#dpt} 1439 unit=${i#dpt}
1415 mkdev dpt$unit c %dpt_chr% $unit 1440 mkdev dpt$unit c %dpt_chr% $unit
1416 ;; 1441 ;;
1417 1442
1418altq) 1443altq)
1419 makedir altq 755 1444 makedir altq 755
1420 unit=0 1445 unit=0
1421 for dev in altq cbq wfq afm fifoq red rio localq hfsc cdnr blue priq 1446 for dev in altq cbq wfq afm fifoq red rio localq hfsc cdnr blue priq
1422 do 1447 do
1423 mkdev altq/$dev c %altq_chr% $unit 644 1448 mkdev altq/$dev c %altq_chr% $unit 644
1424 unit=$(($unit + 1)) 1449 unit=$(($unit + 1))
1425 done 1450 done
1426 ;; 1451 ;;
1427 1452
1428isdn) 1453isdn)
1429 mkdev isdn c %isdn_chr% 0 1454 mkdev isdn c %isdn_chr% 0
1430 ;; 1455 ;;
1431 1456
1432isdnctl) 1457isdnctl)
1433 mkdev isdnctl c %isdnctl_chr% 0 1458 mkdev isdnctl c %isdnctl_chr% 0
1434 ;; 1459 ;;
1435 1460
1436isdnbchan*) 1461isdnbchan*)
1437 unit=${i#isdnbchan} 1462 unit=${i#isdnbchan}
1438 mkdev isdnbchan$unit c %isdnbchan_chr% $unit 1463 mkdev isdnbchan$unit c %isdnbchan_chr% $unit
1439 ;; 1464 ;;
1440 1465
1441isdnteld*) 1466isdnteld*)
1442 unit=${i#isdnteld} 1467 unit=${i#isdnteld}
1443 mkdev isdnteld$unit c %isdntel_chr% $(($unit + 64)) 1468 mkdev isdnteld$unit c %isdntel_chr% $(($unit + 64))
1444 ;; 1469 ;;
1445 1470
1446isdntel*) 1471isdntel*)
1447 unit=${i#isdntel} 1472 unit=${i#isdntel}
1448 mkdev isdntel$unit c %isdntel_chr% $unit 1473 mkdev isdntel$unit c %isdntel_chr% $unit
1449 ;; 1474 ;;
1450 1475
1451isdntrc*) 1476isdntrc*)
1452 unit=${i#isdntrc} 1477 unit=${i#isdntrc}
1453 mkdev isdntrc$unit c %isdntrc_chr% $unit 1478 mkdev isdntrc$unit c %isdntrc_chr% $unit
1454 ;; 1479 ;;
1455 1480
1456vmegen) 1481vmegen)
1457 makedev vmegen0 vmegen1 vmegen2 vmegen3 1482 makedev vmegen0 vmegen1 vmegen2 vmegen3
1458 ;; 1483 ;;
1459 1484
1460vmegen*) 1485vmegen*)
1461 unit=${i#vmegen} 1486 unit=${i#vmegen}
1462 mkdev vmegen$unit c %vmegeneric_chr% $(($unit * 16 + 0)) 1487 mkdev vmegen$unit c %vmegeneric_chr% $(($unit * 16 + 0))
1463 ;; 1488 ;;
1464 1489
1465wsfont) 1490wsfont)
1466 mkdev wsfont c %wsfont_chr% 0 1491 mkdev wsfont c %wsfont_chr% 0
1467 ;; 1492 ;;
1468 1493
1469cir*) 1494cir*)
1470 unit=${i#cir} 1495 unit=${i#cir}
1471 mkdev cir$unit c %cir_chr% $unit 666 1496 mkdev cir$unit c %cir_chr% $unit 666
1472 ;; 1497 ;;
1473 1498
1474irframe*) 1499irframe*)
1475 unit=${i#irframe} 1500 unit=${i#irframe}
1476 mkdev irframe$unit c %irframe_chr% $unit 1501 mkdev irframe$unit c %irframe_chr% $unit
1477 ;; 1502 ;;
1478 1503
1479fcom*) 1504fcom*)
1480 unit=${i#fcom} 1505 unit=${i#fcom}
1481 mkdev fcom$unit c %fcom_chr% $unit "" "" $u_uucp 1506 mkdev fcom$unit c %fcom_chr% $unit "" "" $u_uucp
1482 ;; 1507 ;;
1483 1508
1484openfirm) 1509openfirm)
1485 mkdev openfirm c %openfirm_chr% 0 444 1510 mkdev openfirm c %openfirm_chr% 0 444
1486 ;; 1511 ;;
1487 1512
1488pad*) 1513pad*)
1489 unit=${i#pad} 1514 unit=${i#pad}
1490 mkdev pad$unit c %pad_chr% $unit 444 1515 mkdev pad$unit c %pad_chr% $unit 444
1491 ;; 1516 ;;
1492 1517
1493nvram) 1518nvram)
1494 mkdev nvram c %nvram_chr% 0 644 1519 mkdev nvram c %nvram_chr% 0 644
1495 ;; 1520 ;;
1496 1521
1497rtc) 1522rtc)
1498 mkdev rtc c %rtc_chr% 0 644 1523 mkdev rtc c %rtc_chr% 0 644
1499 ;; 1524 ;;
1500 1525
1501clockctl) 1526clockctl)
1502 mkdev clockctl c %clockctl_chr% 0 660 $g_ntpd 1527 mkdev clockctl c %clockctl_chr% 0 660 $g_ntpd
1503 ;; 1528 ;;
1504 1529
1505nsmb) 1530nsmb)
1506 makedev nsmb0 nsmb1 nsmb2 nsmb3 1531 makedev nsmb0 nsmb1 nsmb2 nsmb3
1507 ;; 1532 ;;
1508 1533
1509nsmb*) 1534nsmb*)
1510 unit=${i#nsmb} 1535 unit=${i#nsmb}
1511 mkdev nsmb$unit c %nsmb_chr% $unit 644 1536 mkdev nsmb$unit c %nsmb_chr% $unit 644
1512 ;; 1537 ;;
1513 1538
1514kttcp) 1539kttcp)
1515 mkdev kttcp c %kttcp_chr% 0 1540 mkdev kttcp c %kttcp_chr% 0
1516 ;; 1541 ;;
1517 1542
1518dmoverio) 1543dmoverio)
1519 mkdev dmoverio c %dmoverio_chr% 0 644 1544 mkdev dmoverio c %dmoverio_chr% 0 644
1520 ;; 1545 ;;
1521 1546
1522veriexec) 1547veriexec)
1523 mkdev veriexec c %veriexec_chr% 0 600 1548 mkdev veriexec c %veriexec_chr% 0 600
1524 ;; 1549 ;;
1525 1550
1526ttyv*) 1551ttyv*)
1527 unit=${i#ttyv} 1552 unit=${i#ttyv}
1528 mkdev ttyv$unit c %pc_chr% $unit 1553 mkdev ttyv$unit c %pc_chr% $unit
1529 ;; 1554 ;;
1530 1555
1531# arm, acorn32 1556# arm, acorn32
1532ttyv*) 1557ttyv*)
1533 unit=${i#ttyv} 1558 unit=${i#ttyv}
1534 mkdev ttyv$unit c %physcon_chr% $unit 1559 mkdev ttyv$unit c %physcon_chr% $unit
1535 ;; 1560 ;;
1536 1561
1537arcpp*) 1562arcpp*)
1538 unit=${i#arcpp} 1563 unit=${i#arcpp}
1539 mkdev arcpp$unit c %arcpp_chr% $unit 1564 mkdev arcpp$unit c %arcpp_chr% $unit
1540 ;; 1565 ;;
1541 1566
1542par*) 1567par*)
1543 unit=${i#par} 1568 unit=${i#par}
1544 case $unit in 1569 case $unit in
1545 0) 1570 0)
1546 mkdev par$unit c %par_chr% $unit 1571 mkdev par$unit c %par_chr% $unit
1547 ;; 1572 ;;
1548 *) 1573 *)
1549 warn "bad unit for par in: $i" 1574 warn "bad unit for par in: $i"
1550 ;; 1575 ;;
1551 esac 1576 esac
1552 ;; 1577 ;;
1553 1578
1554cpi*) 1579cpi*)
1555 unit=${i#cpi} 1580 unit=${i#cpi}
1556 mkdev cpi$unit c %cpi_chr% $unit 1581 mkdev cpi$unit c %cpi_chr% $unit
1557 ;; 1582 ;;
1558 1583
1559ite*|ttye*) 1584ite*|ttye*)
1560 case $i in 1585 case $i in
1561 ite*) unit=${i#ite};; 1586 ite*) unit=${i#ite};;
1562 ttye*) unit=${i#ttye};; 1587 ttye*) unit=${i#ttye};;
1563 esac 1588 esac
1564 mkdev ttye$unit c %ite_chr% $unit 1589 mkdev ttye$unit c %ite_chr% $unit
1565 ;; 1590 ;;
1566 1591
1567pms*) 1592pms*)
1568 unit=${i#pms} 1593 unit=${i#pms}
1569 mkdev pms$unit c %opms_chr% $unit 1594 mkdev pms$unit c %opms_chr% $unit
1570 ;; 1595 ;;
1571 1596
1572qms*) 1597qms*)
1573 unit=${i#qms} 1598 unit=${i#qms}
1574 mkdev qms$unit c %qms_chr% $unit 1599 mkdev qms$unit c %qms_chr% $unit
1575 ;; 1600 ;;
1576 1601
1577lms*) 1602lms*)
1578 unit=${i#lms} 1603 unit=${i#lms}
1579 mkdev lms$unit c %lms_chr% $unit 1604 mkdev lms$unit c %lms_chr% $unit
1580 ;; 1605 ;;
1581 1606
1582mms*) 1607mms*)
1583 unit=${i#mms} 1608 unit=${i#mms}
1584 mkdev mms$unit c %mms_chr% $unit 1609 mkdev mms$unit c %mms_chr% $unit
1585 ;; 1610 ;;
1586 1611
1587mouse-*) 1612mouse-*)
1588 case $i in 1613 case $i in
1589 mouse-pms*) name=pms ;; 1614 mouse-pms*) name=pms ;;
1590 mouse-qms*) name=qms ;; 1615 mouse-qms*) name=qms ;;
1591 esac 1616 esac
1592 unit=${i#mouse-${name}} 1617 unit=${i#mouse-${name}}
1593 lndev $name$unit mouse 1618 lndev $name$unit mouse
1594 ;; 1619 ;;
1595 1620
1596kbd) 1621kbd)
1597 mkdev kbd c %kbd_chr% 0 1622 mkdev kbd c %kbd_chr% 0
1598 ;; 1623 ;;
1599 1624
1600kbdctl) 1625kbdctl)
1601 mkdev kbdctl c %kbd_chr% 1 1626 mkdev kbdctl c %kbd_chr% 1
1602 ;; 1627 ;;
1603 1628
1604vidcconsole0) 1629vidcconsole0)
1605 mkdev vidcconsole0 c %vidcconsole_chr% 0 640 1630 mkdev vidcconsole0 c %vidcconsole_chr% 0 640
1606 ;; 1631 ;;
1607 1632
1608view*) 1633view*)
1609 unit=${i#view} 1634 unit=${i#view}
1610 mkdev view$unit c %view_chr% $unit 666 1635 mkdev view$unit c %view_chr% $unit 666
1611 ;; 1636 ;;
1612 1637
1613mouse*) 1638mouse*)
1614 unit=${i#mouse} 1639 unit=${i#mouse}
1615 case $unit in 1640 case $unit in
1616 0|1) 1641 0|1)
1617 mkdev mouse$unit c %ms_chr% $unit 666 1642 mkdev mouse$unit c %ms_chr% $unit 666
1618 if [ $unit = 0 ]; then 1643 if [ $unit = 0 ]; then
1619 lndev mouse$unit mouse 1644 lndev mouse$unit mouse
1620 fi 1645 fi
1621 ;; 1646 ;;
1622 *) 1647 *)
1623 warn "bad unit for mouse in: $i" 1648 warn "bad unit for mouse in: $i"
1624 ;; 1649 ;;
1625 esac 1650 esac
1626 ;; 1651 ;;
1627 1652
1628panel) 1653panel)
1629 mkdev panel0 c %panel_chr% 0 660 1654 mkdev panel0 c %panel_chr% 0 660
1630 ;; 1655 ;;
1631 1656
1632tslcd) 1657tslcd)
1633 mkdev tslcd0 c %tslcd_chr% 0 660 1658 mkdev tslcd0 c %tslcd_chr% 0 660
1634 ;; 1659 ;;
1635 1660
1636ipty) 1661ipty)
1637 mkdev ttyp0 c %pts_chr% 0 666 1662 mkdev ttyp0 c %pts_chr% 0 666
1638 mkdev ttyp1 c %pts_chr% 1 666 1663 mkdev ttyp1 c %pts_chr% 1 666
1639 mkdev ptyp0 c %ptc_chr% 0 666 1664 mkdev ptyp0 c %ptc_chr% 0 666
1640 mkdev ptyp1 c %ptc_chr% 1 666 1665 mkdev ptyp1 c %ptc_chr% 1 666
1641 ;; 1666 ;;
1642 1667
1643ptm) 1668ptm)
1644 makedir pts 755 1669 makedir pts 755
1645 mkdev ptmx c %ptm_chr% 0 666 1670 mkdev ptmx c %ptm_chr% 0 666
1646 mkdev ptm c %ptm_chr% 1 666 1671 mkdev ptm c %ptm_chr% 1 666
1647 ;; 1672 ;;
1648 1673
1649grf*) 1674grf*)
1650 unit=${i#grf} 1675 unit=${i#grf}
1651 mkdev grf$unit c %grf_chr% $unit 666 1676 mkdev grf$unit c %grf_chr% $unit 666
1652 ;; 1677 ;;
1653 1678
1654etvme) 1679etvme)
1655 mkdev etvme c %et_chr% 0 1680 mkdev etvme c %et_chr% 0
1656 ;; 1681 ;;
1657 1682
1658leo*) 1683leo*)
1659 unit=${i#leo} 1684 unit=${i#leo}
1660 mkdev leo$unit c %leo_chr% $unit 1685 mkdev leo$unit c %leo_chr% $unit
1661 ;; 1686 ;;
1662 1687
1663scif*) 1688scif*)
1664 unit=${i#scif} 1689 unit=${i#scif}
1665 mkdev scif$unit c %scif_chr% $(($unit + $dialin )) "" "" $u_uucp 1690 mkdev scif$unit c %scif_chr% $(($unit + $dialin )) "" "" $u_uucp
1666 mkdev dscif$unit c %scif_chr% $(($unit + $dialout)) "" "" $u_uucp 1691 mkdev dscif$unit c %scif_chr% $(($unit + $dialout)) "" "" $u_uucp
1667 ;; 1692 ;;
1668 1693
1669sci*) 1694sci*)
1670 unit=${i#sci} 1695 unit=${i#sci}
1671 mkdev sci$unit c %sci_chr% $(($unit + $dialin )) "" "" $u_uucp 1696 mkdev sci$unit c %sci_chr% $(($unit + $dialin )) "" "" $u_uucp
1672 mkdev dsci$unit c %sci_chr% $(($unit + $dialout)) "" "" $u_uucp 1697 mkdev dsci$unit c %sci_chr% $(($unit + $dialout)) "" "" $u_uucp
1673 ;; 1698 ;;
1674 1699
1675maple*) 1700maple*)
1676 case $i in 1701 case $i in
1677 mapleA*) name="mapleA"; unit=0;; 1702 mapleA*) name="mapleA"; unit=0;;
1678 mapleB*) name="mapleB"; unit=1;; 1703 mapleB*) name="mapleB"; unit=1;;
1679 mapleC*) name="mapleC"; unit=2;; 1704 mapleC*) name="mapleC"; unit=2;;
1680 mapleD*) name="mapleD"; unit=3;; 1705 mapleD*) name="mapleD"; unit=3;;
1681 esac 1706 esac
1682 subunit=${i#$name} 1707 subunit=${i#$name}
1683 mkdev $name$subunit c %maple_chr% $(($unit * 8 + 0$subunit)) 1708 mkdev $name$subunit c %maple_chr% $(($unit * 8 + 0$subunit))
1684 ;; 1709 ;;
1685 1710
1686mmem*) 1711mmem*)
1687 unit=${i#mmem} 1712 unit=${i#mmem}
1688 for pt in 0 # 1 2 3 4 ... 255 1713 for pt in 0 # 1 2 3 4 ... 255
1689 do 1714 do
1690# mkdev mmem${unit}.${pt}a b %mmem_blk% $(($unit * 4096 + $pt * 16 + 0)) 640 $g_operator 1715# mkdev mmem${unit}.${pt}a b %mmem_blk% $(($unit * 4096 + $pt * 16 + 0)) 640 $g_operator
1691 mkdev mmem${unit}.${pt}c b %mmem_blk% $(($unit * 4096 + $pt * 16 + 2)) 640 $g_operator 1716 mkdev mmem${unit}.${pt}c b %mmem_blk% $(($unit * 4096 + $pt * 16 + 2)) 640 $g_operator
1692# mkdev rmmem${unit}.${pt}a c %mmem_chr% $(($unit * 4096 + $pt * 16 + 0)) 640 $g_operator 1717# mkdev rmmem${unit}.${pt}a c %mmem_chr% $(($unit * 4096 + $pt * 16 + 0)) 640 $g_operator
1693 mkdev rmmem${unit}.${pt}c c %mmem_chr% $(($unit * 4096 + $pt * 16 + 2)) 640 $g_operator 1718 mkdev rmmem${unit}.${pt}c c %mmem_chr% $(($unit * 4096 + $pt * 16 + 2)) 640 $g_operator
1694 done 1719 done
1695 ;; 1720 ;;
1696 1721
1697mlcd*) 1722mlcd*)
1698 unit=${i#mlcd} 1723 unit=${i#mlcd}
1699 for pt in 0 # 1 2 3 4 ... 255 1724 for pt in 0 # 1 2 3 4 ... 255
1700 do 1725 do
1701 mkdev mlcd${unit}.${pt} c %mlcd_chr% $(($unit * 256 + $pt)) 640 $g_operator 1726 mkdev mlcd${unit}.${pt} c %mlcd_chr% $(($unit * 256 + $pt)) 640 $g_operator
1702 done 1727 done
1703 ;; 1728 ;;
1704 1729
1705ixpcom*) 1730ixpcom*)
1706 unit=${i#ixpcom} 1731 unit=${i#ixpcom}
1707 mkdev ixpcom$unit c %ixpcom_chr% $unit "" "" $u_uucp 1732 mkdev ixpcom$unit c %ixpcom_chr% $unit "" "" $u_uucp
1708 ;; 1733 ;;
1709 1734
1710epcom*) 1735epcom*)
1711 unit=${i#epcom} 1736 unit=${i#epcom}
1712 mkdev epcom$unit c %epcom_chr% $unit "" "" $u_uucp 1737 mkdev epcom$unit c %epcom_chr% $unit "" "" $u_uucp
1713 ;; 1738 ;;
1714 1739
1715ucbsnd) 1740ucbsnd)
1716 mkdev ucbsnd c %ucbsnd_chr% 0 666 1741 mkdev ucbsnd c %ucbsnd_chr% 0 666
1717 ;; 1742 ;;
1718 1743
1719adb) 1744adb)
1720 mkdev adb c %aed_chr% 0 666 1745 mkdev adb c %aed_chr% 0 666
1721 ;; 1746 ;;
1722 1747
1723asc*) 1748asc*)
1724 unit=${i#asc} 1749 unit=${i#asc}
1725 mkdev asc$unit c %asc_chr% $unit 666 1750 mkdev asc$unit c %asc_chr% $unit 666
1726 ;; 1751 ;;
1727 1752
1728bwtwo*) 1753bwtwo*)
1729 unit=${i#bwtwo} 1754 unit=${i#bwtwo}
1730 mkdev bwtwo$unit c %bwtwo_chr% $unit 666 1755 mkdev bwtwo$unit c %bwtwo_chr% $unit 666
1731 ;; 1756 ;;
1732 1757
1733cgtwo*) 1758cgtwo*)
1734 unit=${i#cgtwo} 1759 unit=${i#cgtwo}
1735 mkdev cgtwo$unit c %cgtwo_chr% $unit 666 1760 mkdev cgtwo$unit c %cgtwo_chr% $unit 666
1736 ;; 1761 ;;
1737 1762
1738cgthree*) 1763cgthree*)
1739 unit=${i#cgthree} 1764 unit=${i#cgthree}
1740 mkdev cgthree$unit c %cgthree_chr% $unit 666 1765 mkdev cgthree$unit c %cgthree_chr% $unit 666
1741 ;; 1766 ;;
1742 1767
1743cgfour*) 1768cgfour*)
1744 unit=${i#cgfour} 1769 unit=${i#cgfour}
1745 mkdev cgfour$unit c %cgfour_chr% $unit 666 1770 mkdev cgfour$unit c %cgfour_chr% $unit 666
1746 ;; 1771 ;;
1747 1772
1748cgsix*) 1773cgsix*)
1749 unit=${i#cgsix} 1774 unit=${i#cgsix}
1750 mkdev cgsix$unit c %cgsix_chr% $unit 666 1775 mkdev cgsix$unit c %cgsix_chr% $unit 666
1751 ;; 1776 ;;
1752 1777
1753cgeight*) 1778cgeight*)
1754 unit=${i#cgeight} 1779 unit=${i#cgeight}
1755 mkdev cgeight$unit c %cgeight_chr% $unit 666 1780 mkdev cgeight$unit c %cgeight_chr% $unit 666
1756 ;; 1781 ;;
1757 1782
1758tcx*) 1783tcx*)
1759 unit=${i#tcx} 1784 unit=${i#tcx}
1760 mkdev tcx$unit c %tcx_chr% $unit 666 1785 mkdev tcx$unit c %tcx_chr% $unit 666
1761 ;; 1786 ;;
1762 1787
1763xd*|xy*) 1788xd*|xy*)
1764 case $i in 1789 case $i in
1765 xd*) name=xd; unit=${i#xd}; blk=%xd_blk%; chr=%xd_chr%;; 1790 xd*) name=xd; unit=${i#xd}; blk=%xd_blk%; chr=%xd_chr%;;
1766 xy*) name=xy; unit=${i#xy}; blk=%xy_blk%; chr=%xy_chr%;; 1791 xy*) name=xy; unit=${i#xy}; blk=%xy_blk%; chr=%xy_chr%;;
1767 esac 1792 esac
1768 %MKDISK% $name $unit $blk $chr 1793 %MKDISK% $name $unit $blk $chr
1769 ;; 1794 ;;
1770 1795
1771magma*) 1796magma*)
1772 unit=${i#magma} 1797 unit=${i#magma}
1773 if [ 0$unit -gt 3 ]; then 1798 if [ 0$unit -gt 3 ]; then
1774 warn "bad unit for $i: $unit" 1799 warn "bad unit for $i: $unit"
1775 break 1800 break
1776 fi 1801 fi
1777 for j in 0 1 2 3 4 5 6 7 8 9 a b c d e f 1802 for j in 0 1 2 3 4 5 6 7 8 9 a b c d e f
1778 do 1803 do
1779 case $j in 1804 case $j in
1780 [0-9]) jn=$j ;; 1805 [0-9]) jn=$j ;;
1781 a) jn=10 ;; 1806 a) jn=10 ;;
1782 b) jn=11 ;; 1807 b) jn=11 ;;
1783 c) jn=12 ;; 1808 c) jn=12 ;;
1784 d) jn=13 ;; 1809 d) jn=13 ;;
1785 e) jn=14 ;; 1810 e) jn=14 ;;
1786 f) jn=15 ;; 1811 f) jn=15 ;;
1787 esac 1812 esac
1788 mkdev tty$unit$j c %mtty_chr% $(($unit * 64 + $jn)) 1813 mkdev tty$unit$j c %mtty_chr% $(($unit * 64 + $jn))
1789 done 1814 done
1790 mkdev bpp${unit}0 c %mbpp_chr% $(($unit * 64 + 0)) 1815 mkdev bpp${unit}0 c %mbpp_chr% $(($unit * 64 + 0))
1791 mkdev bpp${unit}1 c %mbpp_chr% $(($unit * 64 + 1)) 1816 mkdev bpp${unit}1 c %mbpp_chr% $(($unit * 64 + 1))
1792 ;; 1817 ;;
1793 1818
1794clcd*) 1819clcd*)
1795 unit=${i#clcd} 1820 unit=${i#clcd}
1796 if [ 0$unit -gt 7 ]; then 1821 if [ 0$unit -gt 7 ]; then
1797 warn "bad unit for $i: $unit" 1822 warn "bad unit for $i: $unit"
1798 break 1823 break
1799 fi 1824 fi
1800 for j in 0 1 2 3 4 5 6 7 1825 for j in 0 1 2 3 4 5 6 7
1801 do 1826 do
1802 mkdev ttyA$unit$j c %clcd_chr% $(($unit * 8 + $j + $dialin)) "" "" $u_uucp 1827 mkdev ttyA$unit$j c %clcd_chr% $(($unit * 8 + $j + $dialin)) "" "" $u_uucp
1803 mkdev dtyA$unit$j c %clcd_chr% $(($unit * 8 + $j + $dialout)) "" "" $u_uucp 1828 mkdev dtyA$unit$j c %clcd_chr% $(($unit * 8 + $j + $dialout)) "" "" $u_uucp
1804 done 1829 done
1805 ;; 1830 ;;
1806 1831
1807spif*) 1832spif*)
1808 unit=${i#spif} 1833 unit=${i#spif}
1809 if [ 0$unit -gt 3 ]; then 1834 if [ 0$unit -gt 3 ]; then
1810 warn "bad unit for $i: $unit" 1835 warn "bad unit for $i: $unit"
1811 break 1836 break
1812 fi 1837 fi
1813 for j in 0 1 2 3 4 5 6 7; do 1838 for j in 0 1 2 3 4 5 6 7; do
1814 mkdev ttyS$unit$j c 102 $(($unit * 64 + $j)) "" "" $u_uucp 1839 mkdev ttyS$unit$j c 102 $(($unit * 64 + $j)) "" "" $u_uucp
1815 done 1840 done
1816 mkdev bppS${unit}0 c 103 $(($unit * 64 + 0)) 1841 mkdev bppS${unit}0 c 103 $(($unit * 64 + 0))
1817 mkdev bppS${unit}1 c 103 $(($unit * 64 + 1)) 1842 mkdev bppS${unit}1 c 103 $(($unit * 64 + 1))
1818 ;; 1843 ;;
1819 1844
1820bpp*) 1845bpp*)
1821 unit=${i#bpp} 1846 unit=${i#bpp}
1822 mkdev bpp$unit c %bpp_chr% $(($unit + 0)) 1847 mkdev bpp$unit c %bpp_chr% $(($unit + 0))
1823 ;; 1848 ;;
1824 1849
1825tctrl*) 1850tctrl*)
1826 unit=${i#tctrl} 1851 unit=${i#tctrl}
1827 mkdev tctrl$unit c %tctrl_chr% $unit 666 1852 mkdev tctrl$unit c %tctrl_chr% $unit 666
1828 ;; 1853 ;;
1829 1854
1830bmd*) 1855bmd*)
1831 unit=${i#bmd} 1856 unit=${i#bmd}
1832 mkdev bmd${unit}a b %bmd_blk% $(($unit * 8 + 0)) 640 $g_operator 1857 mkdev bmd${unit}a b %bmd_blk% $(($unit * 8 + 0)) 640 $g_operator
1833 mkdev bmd${unit}c b %bmd_blk% $(($unit * 8 + 2)) 640 $g_operator 1858 mkdev bmd${unit}c b %bmd_blk% $(($unit * 8 + 2)) 640 $g_operator
1834 mkdev rbmd${unit}a c %bmd_chr% $(($unit * 8 + 0)) 640 $g_operator 1859 mkdev rbmd${unit}a c %bmd_chr% $(($unit * 8 + 0)) 640 $g_operator
1835 mkdev rbmd${unit}c c %bmd_chr% $(($unit * 8 + 2)) 640 $g_operator 1860 mkdev rbmd${unit}c c %bmd_chr% $(($unit * 8 + 2)) 640 $g_operator
1836 ;; 1861 ;;
1837 1862
1838sram) 1863sram)
1839 mkdev sram c %sram_chr% 0 644 1864 mkdev sram c %sram_chr% 0 644
1840 ;; 1865 ;;
1841 1866
1842pow*) 1867pow*)
1843 unit=${i#pow} 1868 unit=${i#pow}
1844 case $unit in 1869 case $unit in
1845 0|1) 1870 0|1)
1846 mkdev pow${unit} c %pow_chr% ${unit} 644 1871 mkdev pow${unit} c %pow_chr% ${unit} 644
1847 if [ $unit = 0 ]; then 1872 if [ $unit = 0 ]; then
1848 lndev pow${unit} pow 1873 lndev pow${unit} pow
1849 fi 1874 fi
1850 ;; 1875 ;;
1851 *) 1876 *)
1852 warn "bad unit for pow in: $i" 1877 warn "bad unit for pow in: $i"
1853 ;; 1878 ;;
1854 esac 1879 esac
1855 ;; 1880 ;;
1856 1881
1857ttyS*) 1882ttyS*)
1858 unit=${i#ttyS} 1883 unit=${i#ttyS}
1859 mkdev ttyS$unit c %sacom_chr% $(($unit + $dialin )) "" "" $u_uucp 1884 mkdev ttyS$unit c %sacom_chr% $(($unit + $dialin )) "" "" $u_uucp
1860 mkdev dtyS$unit c %sacom_chr% $(($unit + $dialout)) "" "" $u_uucp 1885 mkdev dtyS$unit c %sacom_chr% $(($unit + $dialout)) "" "" $u_uucp
1861 ;; 1886 ;;
1862 1887
1863atabus*) 1888atabus*)
1864 unit=${i#atabus} 1889 unit=${i#atabus}
1865 mkdev atabus$unit c %atabus_chr% $unit 644 1890 mkdev atabus$unit c %atabus_chr% $unit 644
1866 ;; 1891 ;;
1867 1892
1868drvctl) 1893drvctl)
1869 mkdev drvctl c %drvctl_chr% 0 644 1894 mkdev drvctl c %drvctl_chr% 0 644
1870 ;; 1895 ;;
1871 1896
1872isv) 1897isv)
1873 mkdev isv c %isv_chr% 0 644 1898 mkdev isv c %isv_chr% 0 644
1874 ;; 1899 ;;
1875 1900
1876tap*) 1901tap*)
1877 unit=${i#tap} 1902 unit=${i#tap}
1878 case "$unit" in 1903 case "$unit" in
1879 [0-9]*) 1904 [0-9]*)
1880 mkdev tap${unit} c %tap_chr% ${unit} 600 1905 mkdev tap${unit} c %tap_chr% ${unit} 600
1881 ;; 1906 ;;
1882 *) 1907 *)
1883 mkdev tap c %tap_chr% 0xfffff 600 1908 mkdev tap c %tap_chr% 0xfffff 600
1884 ;; 1909 ;;
1885 esac 1910 esac
1886 ;; 1911 ;;
1887 1912
1888fw*) 1913fw*)
1889 unit=${i#fw} 1914 unit=${i#fw}
1890 for j in 0 1 2 3 1915 for j in 0 1 2 3
1891 do 1916 do
1892 mkdev fw${unit}.${j} c %fw_chr% $((${unit} * 256 + ${j})) 660 ${g_operator} 1917 mkdev fw${unit}.${j} c %fw_chr% $((${unit} * 256 + ${j})) 660 ${g_operator}
1893 mkdev fwmem${unit}.${j} c %fw_chr% $((65536 + ${unit} * 256 + ${j})) 660 ${g_operator} 1918 mkdev fwmem${unit}.${j} c %fw_chr% $((65536 + ${unit} * 256 + ${j})) 660 ${g_operator}
1894 done 1919 done
1895 ;; 1920 ;;
1896 1921
1897# create putter device and symlinks for all subsystems using it 1922# create putter device and symlinks for all subsystems using it
1898putter) 1923putter)
1899 mkdev putter c %putter_chr% 0 600 1924 mkdev putter c %putter_chr% 0 600
1900 mkdev pud c %putter_chr% 1 600 1925 mkdev pud c %putter_chr% 1 600
1901 lndev putter puffs 1926 lndev putter puffs
1902 ;; 1927 ;;
1903 1928
1904midevend) 1929midevend)
1905%MI_DEVICES_END% 1930%MI_DEVICES_END%
1906local) 1931local)
1907 if [ -f "$0.local" ]; then 1932 if [ -f "$0.local" ]; then
1908 umask 0 1933 umask 0
1909 if [ -n "$count_nodes" ]; then 1934 if [ -n "$count_nodes" ]; then
1910 count_nodes=$((count_nodes + \ 1935 count_nodes=$((count_nodes + \