2003-10-13 13:37:45 +04:00
|
|
|
#!/bin/sh -
|
2021-12-07 20:39:53 +03:00
|
|
|
# $NetBSD: MAKEDEV.tmpl,v 1.228 2021/12/07 17:39:53 brad Exp $
|
2003-10-13 13:37:45 +04:00
|
|
|
#
|
2008-04-10 00:19:15 +04:00
|
|
|
# Copyright (c) 2003,2007,2008 The NetBSD Foundation, Inc.
|
2003-10-13 13:37:45 +04:00
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions
|
|
|
|
# are met:
|
|
|
|
# 1. Redistributions of source code must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
# 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer in the
|
|
|
|
# documentation and/or other materials provided with the distribution.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
|
|
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
|
|
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
# POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
###########################################################################
|
|
|
|
#
|
|
|
|
# PLEASE RUN "cd ../share/man/man8 ; make makedevs"
|
|
|
|
# AFTER CHANGING THIS FILE, AND COMMIT THE UPDATED MANPAGE!
|
|
|
|
#
|
|
|
|
###########################################################################
|
|
|
|
#
|
2004-01-14 23:41:59 +03:00
|
|
|
# Device "make" file. Valid special arguments:
|
2003-10-13 13:37:45 +04:00
|
|
|
# all makes all known devices, including local devices.
|
|
|
|
# Tries to make the 'standard' number of each type.
|
|
|
|
# init A set of devices that is used for MFS /dev by init.
|
|
|
|
# May be equal to "all".
|
|
|
|
# floppy devices to be put on install floppies
|
|
|
|
# ramdisk devices to be put into INSTALL kernel ramdisks.
|
|
|
|
# std standard devices
|
|
|
|
# local configuration specific devices
|
2013-10-28 22:33:20 +04:00
|
|
|
# lua Lua device
|
2004-01-14 23:41:59 +03:00
|
|
|
# wscons make wscons devices
|
2003-10-13 13:37:45 +04:00
|
|
|
# usbs make USB devices
|
|
|
|
#
|
|
|
|
# Tapes:
|
|
|
|
# st* SCSI tapes
|
|
|
|
# wt* QIC-interfaced (e.g. not SCSI) 3M cartridge tape
|
|
|
|
# ht* MASSBUS TM03 and TU??
|
|
|
|
# mt* MSCP tapes (e.g. TU81, TK50)
|
|
|
|
# tm* UNIBUS TM11 and TE10 emulations (e.g. Emulex TC-11)
|
|
|
|
# ts* UNIBUS TS11
|
|
|
|
# ut* UNIBUS TU45 emulations (e.g. si 9700)
|
|
|
|
# uu* TU58 cassettes on DL11 controller
|
|
|
|
#
|
|
|
|
# Disks:
|
2012-04-07 21:22:10 +04:00
|
|
|
# dk* wedge disk slices
|
2003-10-13 13:37:45 +04:00
|
|
|
# ccd* concatenated disk devices
|
|
|
|
# cd* SCSI or ATAPI CD-ROM
|
|
|
|
# cgd* cryptographic disk devices
|
|
|
|
# raid* RAIDframe disk devices
|
|
|
|
# sd* SCSI disks
|
|
|
|
# wd* "winchester" disk drives (ST506,IDE,ESDI,RLL,...)
|
|
|
|
# bmd* Nereid bank memory disks
|
|
|
|
# ed* IBM PS/2 ESDI disk devices
|
|
|
|
# fd* "floppy" disk drives (3 1/2", 5 1/4")
|
2003-12-10 14:40:11 +03:00
|
|
|
# fss* Files system snapshot devices
|
2003-10-13 13:37:45 +04:00
|
|
|
# gdrom* Dreamcast "gigadisc" CD-ROM drive
|
|
|
|
# hk* UNIBUS RK06 and RK07
|
|
|
|
# hp* MASSBUS RM??
|
|
|
|
# ld* Logical disk devices (e.g., hardware RAID)
|
|
|
|
# mcd* Mitsumi CD-ROM
|
|
|
|
# md* memory pseudo-disk devices
|
|
|
|
# ofdisk* OpenFirmware disk devices
|
|
|
|
# ra* MSCP disks (RA??, RD??)
|
|
|
|
# rb* 730 IDC w/ RB80 and/or RB02
|
|
|
|
# rd* HDC9224 RD disks on VS2000
|
|
|
|
# rl* UNIBUS RL02
|
|
|
|
# rx* MSCP floppy disk (RX33/50/...)
|
|
|
|
# up* other UNIBUS devices (e.g. on Emulex SC-21V controller)
|
|
|
|
# vnd* "file" pseudo-disks
|
2005-03-11 23:55:10 +03:00
|
|
|
# xbd* Xen virtual disks
|
2003-10-13 13:37:45 +04:00
|
|
|
# xd* Xylogic 753/7053 disks
|
|
|
|
# xy* Xylogic 450/451 disks
|
|
|
|
#
|
|
|
|
# Pointing devices:
|
|
|
|
# wsmouse* wscons mouse events
|
|
|
|
# lms* Logitech bus mouse
|
|
|
|
# mms* Microsoft bus mouse
|
|
|
|
# qms* "quadrature mouse"
|
|
|
|
# pms* PS/2 mouse
|
|
|
|
# mouse mouse (provides events, for X11)
|
|
|
|
#
|
|
|
|
# Keyboard devices:
|
|
|
|
# wskbd* wscons keyboard events
|
|
|
|
# kbd raw keyboard (provides events, for X11)
|
|
|
|
# kbdctl keyboard control
|
|
|
|
#
|
|
|
|
# Terminals/Console ports:
|
|
|
|
# tty[01]* standard serial ports
|
|
|
|
# tty0* SB1250 ("sbscn") serial ports (sbmips)
|
|
|
|
# ttyE* wscons - Workstation console ("wscons") glass-tty emulators
|
|
|
|
# ttyCZ? Cyclades-Z multiport serial boards. Each "unit"
|
|
|
|
# makes 64 ports.
|
|
|
|
# ttyCY? Cyclom-Y multiport serial boards. Each "unit" makes
|
|
|
|
# 32 ports.
|
|
|
|
# ttye* ITE bitmapped consoles
|
|
|
|
# ttyv0 pccons
|
|
|
|
# ttyC? NS16550 ("com") serial ports
|
|
|
|
# ttyS* SA1110 serial port (hpcarm)
|
|
|
|
# ttyTX? TX39 internal serial ports (hpcmips)
|
|
|
|
# ttyB? DEC 3000 ZS8530 ("scc") serial ports (alpha)
|
|
|
|
# ttyA* mfc serial ports (amiga)
|
|
|
|
# ttyB* msc serial ports (amiga)
|
|
|
|
# ttyC* com style serial ports (DraCo, HyperCom) (amiga)
|
|
|
|
# On the DraCo, units 0 and 1 are the built-in "modem" and
|
|
|
|
# "mouse" ports, if configured.
|
|
|
|
# ttyA0 8530 Channel A (formerly ser02) (atari)
|
|
|
|
# ttyA1 8530 Channel B (formerly mdm02) (atari)
|
|
|
|
# ttyB0 UART on first 68901 (formerly mdm01) (atari)
|
|
|
|
# ixpcom IXP12x0 COM ports
|
2004-12-29 09:36:46 +03:00
|
|
|
# epcom EP93xx COM ports
|
2013-01-10 17:38:37 +04:00
|
|
|
# plcom ARM PL01[01] serial ports
|
2013-05-01 17:11:59 +04:00
|
|
|
# wmcom EPOC Windermere COM ports
|
2003-11-22 20:26:45 +03:00
|
|
|
# ttyM? HP200/300 4 port serial mux interface (hp300)
|
2003-10-25 03:39:42 +04:00
|
|
|
# ttya "ttya" system console (luna68k)
|
2003-10-13 13:37:45 +04:00
|
|
|
# ttyb second system serial port (luna68k)
|
|
|
|
# tty* Onboard serial ports (mvme68k)
|
|
|
|
# On the mvme147 these are: ttyZ1, ttyZ2 and ttyZ3.
|
|
|
|
# On the mvme167, and '177: ttyC1, ttyC2 and ttyC3.
|
|
|
|
# Note that tty[CZ]0 is grabbed by the console device
|
|
|
|
# so is not created by default
|
|
|
|
# dc* PMAX 4 channel serial interface (kbd, mouse, modem, printer)
|
|
|
|
# scc* 82530 serial interface (pmax)
|
|
|
|
# ttyZ* Zilog 8530 ("zstty") serial ports
|
|
|
|
# tty[abcd] Built-in serial ports (sparc)
|
|
|
|
# tty* Z88530 serial controllers (sparc64)
|
|
|
|
# ttyh* SAB82532 serial controllers (sparc64)
|
|
|
|
# tty[a-j] Built-in serial ports (sun2, sun3)
|
|
|
|
# ttyC? pccons (arc)
|
|
|
|
# dz* UNIBUS DZ11 and DZ32 (vax)
|
|
|
|
# dh* UNIBUS DH11 and emulations (e.g. Able DMAX, Emulex CS-11) (vax)
|
|
|
|
# dmf* UNIBUS DMF32 (vax)
|
|
|
|
# dhu* UNIBUS DHU11 (vax)
|
|
|
|
# dmz* UNIBUS DMZ32 (vax)
|
|
|
|
# dl* UNIBUS DL11 (vax)
|
2005-03-11 23:55:10 +03:00
|
|
|
# xencons Xen virtual console
|
2003-10-13 13:37:45 +04:00
|
|
|
#
|
|
|
|
# Terminal multiplexors:
|
|
|
|
# dc* 4 channel serial interface (keyboard, mouse, modem, printer)
|
|
|
|
# dh* UNIBUS DH11 and emulations (e.g. Able DMAX, Emulex CS-11)
|
|
|
|
# dhu* UNIBUS DHU11
|
|
|
|
# dl* UNIBUS DL11
|
|
|
|
# dmf* UNIBUS DMF32
|
|
|
|
# dmz* UNIBUS DMZ32
|
|
|
|
# dz* UNIBUS DZ11 and DZ32
|
|
|
|
# scc* 82530 serial interface
|
|
|
|
#
|
|
|
|
# Call units:
|
|
|
|
# dn* UNIBUS DN11 and emulations (e.g. Able Quadracall)
|
|
|
|
#
|
|
|
|
# Pseudo terminals:
|
2008-07-13 19:22:39 +04:00
|
|
|
# ptm pty multiplexor device, and pts directory
|
2004-06-19 09:31:50 +04:00
|
|
|
# pty* set of 16 master and slave pseudo terminals
|
2003-10-13 13:37:45 +04:00
|
|
|
# opty first 16 ptys, to save inodes on install media
|
|
|
|
# ipty first 2 ptys, for install media use only
|
|
|
|
#
|
|
|
|
# Printers:
|
|
|
|
# arcpp* Archimedes parallel port
|
|
|
|
# lpt* stock lp
|
|
|
|
# lpa* interruptless lp
|
|
|
|
# par* Amiga motherboard parallel port
|
2008-05-22 23:49:43 +04:00
|
|
|
# cpi* Macintosh Nubus CSI parallel printer card
|
2003-10-13 13:37:45 +04:00
|
|
|
#
|
|
|
|
# USB devices:
|
|
|
|
# usb* USB control devices
|
|
|
|
# uhid* USB generic HID devices
|
|
|
|
# ulpt* USB printer devices
|
|
|
|
# ugen* USB generic devices
|
2010-03-07 00:05:36 +03:00
|
|
|
# ttyHS* USB Option N.V. modems
|
2003-10-13 13:37:45 +04:00
|
|
|
# ttyU* USB modems
|
2005-07-30 10:14:49 +04:00
|
|
|
# ttyY* USB serial adapters
|
2003-10-13 13:37:45 +04:00
|
|
|
#
|
|
|
|
# Video devices:
|
|
|
|
# bwtwo* monochromatic frame buffer
|
|
|
|
# cgtwo* 8-bit color frame buffer
|
|
|
|
# cgthree* 8-bit color frame buffer
|
|
|
|
# cgfour* 8-bit color frame buffer
|
|
|
|
# cgsix* accelerated 8-bit color frame buffer
|
|
|
|
# cgeight* 24-bit color frame buffer
|
2003-10-25 03:39:42 +04:00
|
|
|
# etvme Tseng et-compatible cards on VME (atari)
|
2003-10-13 13:37:45 +04:00
|
|
|
# ik* UNIBUS interface to Ikonas frame buffer
|
2003-10-25 03:39:42 +04:00
|
|
|
# leo Circad Leonardo VME-bus true color (atari)
|
2003-10-13 13:37:45 +04:00
|
|
|
# ps* UNIBUS interface to Picture System 2
|
|
|
|
# qv* QVSS (MicroVAX) display
|
|
|
|
# tcx* accelerated 8/24-bit color frame buffer
|
|
|
|
#
|
|
|
|
# Maple bus devices:
|
|
|
|
# maple Maple bus control devices
|
|
|
|
# mlcd* Maple bus LCD devices
|
|
|
|
# mmem* Maple bus storage devices
|
|
|
|
#
|
2005-07-11 19:29:05 +04:00
|
|
|
# IEEE1394 bus devices:
|
|
|
|
# fw* IEEE1394 bus generic node access devices
|
|
|
|
# fwmem* IEEE1394 bus physical memory of the remote node access devices
|
|
|
|
#
|
2003-10-13 13:37:45 +04:00
|
|
|
# Special purpose devices:
|
|
|
|
# ad* UNIBUS interface to Data Translation A/D converter
|
|
|
|
# agp* AGP GART devices
|
|
|
|
# altq ALTQ control interface
|
2006-07-23 16:01:25 +04:00
|
|
|
# amr* AMI MegaRaid control device
|
2003-10-13 13:37:45 +04:00
|
|
|
# apm power management device
|
|
|
|
# audio* audio devices
|
2003-11-24 09:31:44 +03:00
|
|
|
# bell* OPM bell device (x68k)
|
2003-10-13 13:37:45 +04:00
|
|
|
# bktr Brooktree 848/849/878/879 based TV cards
|
2004-12-02 02:06:57 +03:00
|
|
|
# bpf packet filter
|
2006-09-10 19:45:55 +04:00
|
|
|
# bthub Bluetooth Device Hub control interface
|
2003-10-13 13:37:45 +04:00
|
|
|
# cfs* Coda file system device
|
|
|
|
# ch* SCSI media changer
|
|
|
|
# cir* Consumer IR
|
|
|
|
# clockctl clock control for non root users
|
2007-08-04 15:02:56 +04:00
|
|
|
# cpuctl CPU control
|
2003-10-13 13:37:45 +04:00
|
|
|
# crypto hardware crypto access driver
|
|
|
|
# dmoverio hardware-assisted data movers
|
|
|
|
# dpt* DPT/Adaptec EATA RAID management interface
|
|
|
|
# dpti* DPT/Adaptec I2O RAID management interface
|
2009-09-25 10:06:04 +04:00
|
|
|
# drm* Direct Rendering Manager interface
|
2011-07-09 18:49:28 +04:00
|
|
|
# dtv* Digital TV interface
|
2003-10-25 03:39:42 +04:00
|
|
|
# fb* PMAX generic framebuffer pseudo-device
|
2003-10-13 13:37:45 +04:00
|
|
|
# fd file descriptors
|
2018-05-20 17:08:32 +03:00
|
|
|
# gpiopps* 1PPS signals on GPIO pins
|
2003-10-13 13:37:45 +04:00
|
|
|
# grf* graphics frame buffer device
|
2009-09-06 21:25:55 +04:00
|
|
|
# hdaudio* High Definition audio control device
|
2015-08-02 00:30:09 +03:00
|
|
|
# hdmicec* HDMI CEC devices
|
2003-10-13 13:37:45 +04:00
|
|
|
# hil HP300 HIL input devices
|
|
|
|
# icp ICP-Vortex/Intel RAID control interface
|
|
|
|
# iic* IIC bus device
|
2006-12-29 22:16:30 +03:00
|
|
|
# io x86 IOPL access for COMPAT_10, COMPAT_FREEBSD
|
2003-10-13 13:37:45 +04:00
|
|
|
# iop* I2O IOP control interface
|
2019-05-18 11:38:00 +03:00
|
|
|
# ipmi* OpenIPMI compatible interface
|
2003-10-13 13:37:45 +04:00
|
|
|
# ipl IP Filter
|
|
|
|
# irframe* IrDA physical frame
|
|
|
|
# ite* terminal emulator interface to HP300 graphics devices
|
|
|
|
# joy* joystick device
|
|
|
|
# kttcp kernel ttcp helper device
|
2006-09-07 05:18:01 +04:00
|
|
|
# lockstat kernel locking statistics
|
2003-10-13 13:37:45 +04:00
|
|
|
# magma* Magma multiport serial/parallel cards
|
|
|
|
# midi* MIDI
|
2012-09-20 01:24:28 +04:00
|
|
|
# mfi* LSI MegaRAID/MegaSAS control interface
|
2003-10-13 13:37:45 +04:00
|
|
|
# mlx* Mylex DAC960 control interface
|
|
|
|
# mly* Mylex AcceleRAID/eXtremeRAID control interface
|
|
|
|
# np* UNIBUS Ethernet co-processor interface, for downloading.
|
2010-08-22 22:56:18 +04:00
|
|
|
# npf NPF packet filter
|
2016-06-04 19:11:50 +03:00
|
|
|
# nvme* Non-Volatile Memory Host Controller Interface device driver
|
|
|
|
# nvme*ns* Non-Volatile Memory namespace
|
2018-11-07 10:43:07 +03:00
|
|
|
# nvmm NetBSD Virtual Machine Monitor
|
2003-10-13 13:37:45 +04:00
|
|
|
# openfirm OpenFirmware accessor
|
2007-11-11 20:54:47 +03:00
|
|
|
# pad* Pseudo-audio device driver
|
2003-10-13 13:37:45 +04:00
|
|
|
# pci* PCI bus access devices
|
2004-10-22 18:08:22 +04:00
|
|
|
# pf PF packet filter
|
2007-11-13 16:14:25 +03:00
|
|
|
# putter Pass-to-Userspace Transporter
|
2003-10-13 13:37:45 +04:00
|
|
|
# px* PixelStamp Xserver access
|
2020-04-01 18:32:21 +03:00
|
|
|
# qemufwcfg* QEMU Firmware Configuration
|
2003-10-13 13:37:45 +04:00
|
|
|
# radio* radio devices
|
2003-10-27 00:21:50 +03:00
|
|
|
# random Random number generator
|
2003-10-25 03:39:42 +04:00
|
|
|
# rtc* RealTimeClock
|
2021-12-07 20:39:53 +03:00
|
|
|
# scmd* Sparkfun Serial Controlled Motor Driver
|
2003-10-27 00:21:50 +03:00
|
|
|
# scsibus* SCSI busses
|
2003-10-13 13:37:45 +04:00
|
|
|
# se* SCSI Ethernet
|
|
|
|
# ses* SES/SAF-TE SCSI Devices
|
2021-11-06 16:34:39 +03:00
|
|
|
# sht3xtemp* Sensirion SHT3X temperature and humidity device driver
|
2003-10-13 13:37:45 +04:00
|
|
|
# speaker PC speaker (XXX - installed)
|
2019-02-23 13:43:25 +03:00
|
|
|
# spi* SPI bus device
|
2003-11-24 09:31:44 +03:00
|
|
|
# sram battery backuped memory (x68k)
|
2019-03-26 12:13:55 +03:00
|
|
|
# srt* source-address based routing
|
2003-10-13 13:37:45 +04:00
|
|
|
# ss* SCSI scanner
|
|
|
|
# stic* PixelStamp interface chip
|
|
|
|
# sysmon System Monitoring hardware
|
2005-01-09 01:31:28 +03:00
|
|
|
# tap* virtual Ethernet device
|
2018-11-07 10:43:07 +03:00
|
|
|
# tprof task profiler
|
2003-10-13 13:37:45 +04:00
|
|
|
# tun* network tunnel driver
|
2006-09-24 12:23:36 +04:00
|
|
|
# twa 3ware Apache control interface
|
2003-10-13 13:37:45 +04:00
|
|
|
# twe 3ware Escalade control interface
|
|
|
|
# uk* unknown SCSI device
|
2009-05-10 18:19:28 +04:00
|
|
|
# veriexec Veriexec fingerprint loader
|
2019-09-14 09:57:51 +03:00
|
|
|
# vhci virtual host controller interface
|
2008-09-06 23:21:21 +04:00
|
|
|
# video* video capture devices
|
2003-10-13 13:37:45 +04:00
|
|
|
# view* generic interface to graphic displays (Amiga)
|
|
|
|
# wsfont* console font control
|
|
|
|
# wsmux* wscons event multiplexor
|
2005-03-11 23:55:10 +03:00
|
|
|
# xenevt Xen event interface
|
2011-11-19 20:41:55 +04:00
|
|
|
#
|
|
|
|
# iSCSI communication devices
|
|
|
|
# iscsi* iSCSI driver and /sbin/iscsid communication
|
2012-01-22 10:44:28 +04:00
|
|
|
#
|
|
|
|
# Trusted Computing devices
|
|
|
|
# tpm Trusted Platform Module
|
2013-02-28 06:00:27 +04:00
|
|
|
#
|
|
|
|
# Debugging and tracing
|
2013-02-28 07:04:12 +04:00
|
|
|
# dtrace Dynamic tracing framework
|
2003-10-13 13:37:45 +04:00
|
|
|
|
2003-12-21 20:37:26 +03:00
|
|
|
|
2007-03-03 09:36:00 +03:00
|
|
|
#
|
2009-01-03 11:49:03 +03:00
|
|
|
# NOTE:
|
2007-03-03 09:36:00 +03:00
|
|
|
#
|
2009-01-03 11:49:03 +03:00
|
|
|
# * MAKEDEV is used both as a standalone script (via "sh ./MAKEDEV
|
|
|
|
# all" or similar), and as a function library for MAKEDEV.local (via
|
|
|
|
# "MAKEDEV_AS_LIBRARY=1 . MAKEDEV"). Because of this, the script
|
|
|
|
# should consist almost entirely of function definitions, apart from a
|
|
|
|
# few lines right at the end.
|
|
|
|
#
|
|
|
|
# * MAKEDEV may be executed in an environment that is missing some
|
|
|
|
# common commands. For example, it may be executed from a minimal
|
|
|
|
# system used during installation, or it may be executed early in the
|
|
|
|
# boot sequence before most file systems have been mounted. It may
|
|
|
|
# also be executed in a cross-build environment on a non-NetBSD host.
|
2007-03-03 09:36:00 +03:00
|
|
|
#
|
|
|
|
|
|
|
|
usage()
|
|
|
|
{
|
|
|
|
cat 1>&2 << _USAGE_
|
2011-08-06 16:29:39 +04:00
|
|
|
Usage: ${0##*/} [-fMsu] [-m mknod] [-p pax] [-t mtree] special [...]
|
2007-03-03 09:36:00 +03:00
|
|
|
Create listed special devices. Options:
|
|
|
|
-f Force permissions to be updated on existing devices.
|
2007-12-09 11:46:16 +03:00
|
|
|
-M Create memory file system.
|
2007-03-03 09:36:00 +03:00
|
|
|
-m mknod Name of mknod(8) program. [\$TOOL_MKNOD or mknod]
|
2008-04-10 00:19:15 +04:00
|
|
|
-p pax Name of pax(1) program. [\$TOOL_PAX or pax]
|
2007-03-03 09:36:00 +03:00
|
|
|
-s Generate mtree(8) specfile instead of creating devices.
|
2008-04-10 00:19:15 +04:00
|
|
|
-t mtree Name of mtree(8) program. [\$TOOL_MTREE or mtree]
|
2011-08-06 16:29:39 +04:00
|
|
|
-u Don't re-create devices that already exist.
|
2007-03-03 09:36:00 +03:00
|
|
|
|
|
|
|
_USAGE_
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
# zeropad width number
|
|
|
|
# display number with a zero (`0') padding of width digits.
|
|
|
|
#
|
|
|
|
zeropad()
|
|
|
|
{
|
|
|
|
case $(($1 - ${#2})) in
|
|
|
|
5) echo 00000$2;;
|
|
|
|
4) echo 0000$2;;
|
|
|
|
3) echo 000$2;;
|
|
|
|
2) echo 00$2;;
|
|
|
|
1) echo 0$2;;
|
|
|
|
0) echo $2;;
|
2008-04-10 00:19:15 +04:00
|
|
|
*) die "bad padding" ;;
|
2007-03-03 09:36:00 +03:00
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
# hexprint number
|
|
|
|
# display (base10) number as hexadecimal
|
|
|
|
#
|
|
|
|
hexprint()
|
|
|
|
{
|
2007-03-09 22:16:47 +03:00
|
|
|
val="$(($1 + 0))"
|
|
|
|
hex=
|
|
|
|
set -- 0 1 2 3 4 5 6 7 8 9 a b c d e f
|
|
|
|
while [ "$val" -gt 0 ]; do
|
|
|
|
eval hex=\$$(($val % 16 + 1))\$hex
|
|
|
|
val="$(($val / 16))"
|
|
|
|
done
|
|
|
|
echo "${hex:-0}"
|
2007-03-03 09:36:00 +03:00
|
|
|
}
|
|
|
|
|
2007-12-08 20:31:12 +03:00
|
|
|
# linecount multiline_string
|
|
|
|
# count the number of lines in the string
|
|
|
|
#
|
|
|
|
linecount()
|
|
|
|
{
|
|
|
|
local IFS='
|
|
|
|
' # just a newline, no other white space between the quotes
|
|
|
|
set -- $1
|
|
|
|
echo $#
|
|
|
|
}
|
|
|
|
|
2007-12-15 20:28:09 +03:00
|
|
|
# nooutput -12 cmd [args...]
|
|
|
|
# run a command with stdout and/or stderr ignored.
|
2008-04-15 13:52:41 +04:00
|
|
|
# "nooutput -1 cmd" is like "cmd >/dev/null";
|
|
|
|
# "nooutput -2 cmd" is like "{ cmd ; } 2>/dev/null";
|
|
|
|
# "nooutput -12 cmd" is like "{ cmd ; } >/dev/null 2>&1";
|
|
|
|
# except they should work even if /dev/null doesn't [yet] exist.
|
|
|
|
#
|
|
|
|
# The "{...}" wrapper used in cases where stderr is redirected
|
|
|
|
# serves to capture shell error messages such as "cmd: not found".
|
2007-12-15 20:28:09 +03:00
|
|
|
#
|
|
|
|
nooutput()
|
|
|
|
{
|
|
|
|
local flags="$1" ; shift
|
|
|
|
local junk
|
|
|
|
case "$flags" in
|
|
|
|
"-1") junk="$( "$@" )" ;;
|
2011-11-08 23:36:30 +04:00
|
|
|
"-2") ( exec 4>&1 ; junk="$( { "$@" ; } 2>&1 1>&4 )" ) ;;
|
2008-04-15 13:52:41 +04:00
|
|
|
"-12") junk="$( { "$@" ; } 2>&1 )" ;;
|
2007-12-15 20:28:09 +03:00
|
|
|
*) warn "Incorrect use of nooutput" ;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
2007-12-11 14:51:19 +03:00
|
|
|
# check_pax path_to_pax
|
2008-04-10 00:19:15 +04:00
|
|
|
# Check whether pax exists and supports the command line options
|
|
|
|
# and input format that we will want to use.
|
2007-12-11 14:51:19 +03:00
|
|
|
#
|
|
|
|
check_pax()
|
|
|
|
{
|
|
|
|
local pax="$1"
|
2007-12-15 20:28:09 +03:00
|
|
|
echo ". type=dir optional" | nooutput -12 "${pax}" -r -w -M -pe .
|
2007-12-11 14:51:19 +03:00
|
|
|
}
|
|
|
|
|
2008-04-10 00:19:15 +04:00
|
|
|
# check_mtree path_to_mtree
|
|
|
|
# Check whether mtree exists and supports the command line options
|
|
|
|
# and input format that we will want to use.
|
|
|
|
#
|
|
|
|
check_mtree()
|
|
|
|
{
|
|
|
|
local mtree="$1"
|
|
|
|
echo ". type=dir optional" | nooutput -12 "${mtree}" -e -U
|
|
|
|
}
|
|
|
|
|
2007-12-11 14:51:19 +03:00
|
|
|
# setup args...
|
|
|
|
# Parse command line arguments, exit on error.
|
|
|
|
# Callers should shift $((OPTIND - 1)) afterwards.
|
|
|
|
#
|
2007-03-03 09:36:00 +03:00
|
|
|
setup()
|
|
|
|
{
|
|
|
|
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/rescue
|
|
|
|
|
2012-06-05 17:20:01 +04:00
|
|
|
: ${HOST_SH:=sh}
|
2008-04-10 00:19:15 +04:00
|
|
|
: ${TOOL_MKNOD:=mknod}
|
|
|
|
: ${TOOL_MTREE:=mtree}
|
|
|
|
: ${TOOL_PAX:=pax}
|
2011-10-13 00:57:55 +04:00
|
|
|
status=0
|
2007-03-11 18:52:30 +03:00
|
|
|
do_create_mfs=false
|
2007-03-03 09:36:00 +03:00
|
|
|
do_force=false
|
2007-12-09 11:46:16 +03:00
|
|
|
do_mknod=false
|
2007-03-11 18:52:30 +03:00
|
|
|
do_pax=false
|
2008-04-10 00:19:15 +04:00
|
|
|
do_mtree=false
|
2007-03-11 18:52:30 +03:00
|
|
|
do_redirect=false
|
2007-03-03 09:36:00 +03:00
|
|
|
do_specfile=false
|
2011-08-06 16:29:39 +04:00
|
|
|
do_update=false
|
2007-03-11 18:52:30 +03:00
|
|
|
opts=
|
2011-08-06 16:29:39 +04:00
|
|
|
while getopts Mfm:p:st:u ch; do
|
2008-04-10 00:19:15 +04:00
|
|
|
# Note that $opts is only for options pased through to
|
|
|
|
# MAKEDEV.local, not for all options.
|
2007-03-03 09:36:00 +03:00
|
|
|
case ${ch} in
|
2007-03-21 06:39:41 +03:00
|
|
|
M)
|
2007-03-11 18:52:30 +03:00
|
|
|
# "-M" sets do_create_mfs;
|
2007-12-09 11:46:16 +03:00
|
|
|
# "-M -M" is for use from init(8), and sets do_redirect
|
2007-03-11 18:52:30 +03:00
|
|
|
do_redirect=$do_create_mfs
|
|
|
|
do_create_mfs=true
|
|
|
|
;;
|
|
|
|
f) do_force=true
|
|
|
|
opts="${opts} -f"
|
|
|
|
;;
|
|
|
|
m) TOOL_MKNOD=${OPTARG}
|
2007-12-09 11:46:16 +03:00
|
|
|
do_mknod=true
|
2007-03-11 18:52:30 +03:00
|
|
|
opts="${opts} -m ${OPTARG}"
|
|
|
|
;;
|
|
|
|
p) TOOL_PAX="${OPTARG}"
|
2007-12-11 14:51:19 +03:00
|
|
|
if check_pax "${TOOL_PAX}"; then
|
2007-03-11 19:08:11 +03:00
|
|
|
do_pax=true
|
2007-12-09 11:46:16 +03:00
|
|
|
# do not add this to $opts; we will later
|
|
|
|
# add "-s" instead.
|
2007-03-11 19:08:11 +03:00
|
|
|
else
|
|
|
|
warn "Ignored -p option:" \
|
|
|
|
"${TOOL_PAX} is missing or broken"
|
2007-12-09 11:46:16 +03:00
|
|
|
do_mknod=true
|
2007-03-11 19:08:11 +03:00
|
|
|
fi
|
2007-03-11 18:52:30 +03:00
|
|
|
;;
|
|
|
|
s) do_specfile=true
|
|
|
|
opts="${opts} -s"
|
|
|
|
;;
|
2008-04-10 00:19:15 +04:00
|
|
|
t) TOOL_MTREE="${OPTARG}"
|
|
|
|
if check_mtree "${TOOL_MTREE}"; then
|
|
|
|
do_mtree=true
|
|
|
|
# do not add this to $opts; we will later
|
|
|
|
# add "-s" instead.
|
|
|
|
else
|
|
|
|
warn "Ignored -t option:" \
|
|
|
|
"${TOOL_MTREE} is missing or broken"
|
|
|
|
do_mknod=true
|
|
|
|
fi
|
|
|
|
;;
|
2011-08-06 16:29:39 +04:00
|
|
|
u)
|
|
|
|
do_update=true
|
|
|
|
opts="${opts} -u"
|
|
|
|
;;
|
2007-03-03 09:36:00 +03:00
|
|
|
*) usage ;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
shift $((${OPTIND} - 1))
|
|
|
|
[ $# -gt 0 ] || usage
|
|
|
|
|
|
|
|
u_root="%uid_root%"
|
|
|
|
u_uucp="%uid_uucp%"
|
2013-05-20 15:37:02 +04:00
|
|
|
g_gpio="%gid__gpio%"
|
2007-03-03 09:36:00 +03:00
|
|
|
g_kmem="%gid_kmem%"
|
|
|
|
g_ntpd="%gid_ntpd%"
|
2019-10-27 10:08:15 +03:00
|
|
|
g_nvmm="%gid_nvmm%"
|
2007-03-03 09:36:00 +03:00
|
|
|
g_operator="%gid_operator%"
|
|
|
|
g_wheel="%gid_wheel%"
|
|
|
|
dialin=0
|
|
|
|
dialout=524288
|
|
|
|
callunit=262144
|
|
|
|
|
|
|
|
# only allow read&write for owner by default
|
|
|
|
umask 077
|
|
|
|
|
2009-01-03 11:49:03 +03:00
|
|
|
# Set fdesc_mounted=true if the fdesc file system is mounted
|
|
|
|
# on the current directory (typically "/dev").
|
|
|
|
# Later, this will be used to suppress creation of device nodes
|
|
|
|
# that are supplied by the fdesc file system.
|
|
|
|
#
|
|
|
|
fdesc_mounted=false
|
2007-03-03 09:36:00 +03:00
|
|
|
if [ -d fd ]; then
|
2009-01-03 11:49:03 +03:00
|
|
|
# Parse the output from "mount -u -o nosuchoption .".
|
|
|
|
# We don't parse the output from df(1) because that's
|
|
|
|
# less likely to be available on install media.
|
|
|
|
#
|
|
|
|
# If the current directory is a mount point for the
|
|
|
|
# fdesc file system, then the expected output (whether
|
|
|
|
# or not the current user is root) is:
|
|
|
|
# mount_fdesc: -o suchoption: option not supported.
|
|
|
|
#
|
|
|
|
# If the current directory is not a mount point, then
|
|
|
|
# the expected output is:
|
|
|
|
# mount: .: unknown special file or file system.
|
|
|
|
#
|
|
|
|
# If we are not running on NetBSD, or mount(8) is not
|
|
|
|
# found, then we should get some other error message.
|
|
|
|
#
|
|
|
|
case "$({ LC_ALL=C mount -u -o nosuchoption . ; } 2>&1)" in
|
|
|
|
*mount_fdesc*) fdesc_mounted=true ;;
|
2007-03-03 09:36:00 +03:00
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2007-12-09 11:46:16 +03:00
|
|
|
# do_force requires mknod
|
|
|
|
if $do_force; then
|
2008-04-10 00:19:15 +04:00
|
|
|
if $do_mtree || $do_pax || $do_specfile; then
|
|
|
|
die "-f option works only with mknod"
|
2007-12-09 11:46:16 +03:00
|
|
|
fi
|
|
|
|
do_mknod=true
|
|
|
|
fi
|
|
|
|
|
2011-08-06 16:29:39 +04:00
|
|
|
# do_force and do_update do not work together
|
|
|
|
if $do_force && $do_update; then
|
|
|
|
die "-f and -u options do not work together"
|
|
|
|
fi
|
|
|
|
|
2008-04-10 00:19:15 +04:00
|
|
|
# If no explicit method was specified on the command line or
|
|
|
|
# forced above, then use one of mtree, pax, or mknod, in that
|
|
|
|
# order of preference.
|
|
|
|
#
|
|
|
|
# mtree is preferred because it's fast and designed for the
|
|
|
|
# purpose. However, it's unlikely to be available early in the
|
|
|
|
# boot sequence, when init(8) may invoke MAKEDEV(8).
|
|
|
|
#
|
|
|
|
# pax is usually acceptable, and it's likely to be available
|
|
|
|
# early in the boot sequence. However, it's much slower than mtree.
|
|
|
|
#
|
|
|
|
# mknod is just very slow, because the shell has to fork for
|
|
|
|
# each device node.
|
|
|
|
#
|
2017-06-08 06:42:37 +03:00
|
|
|
|
|
|
|
case ",${do_mtree},,${do_pax},,${do_mknod},,${do_specfile}," in
|
|
|
|
( ,false,,false,,false,,false, )
|
2008-04-10 00:19:15 +04:00
|
|
|
if check_mtree "${TOOL_MTREE}"; then
|
|
|
|
do_mtree=true
|
|
|
|
elif check_pax "${TOOL_PAX}"; then
|
2007-12-09 11:46:16 +03:00
|
|
|
do_pax=true
|
|
|
|
else
|
|
|
|
do_mknod=true
|
|
|
|
fi
|
2017-06-08 06:42:37 +03:00
|
|
|
;;
|
|
|
|
( *,true,*,true,* )
|
|
|
|
die "-m, -p, -s, and -t options are mutually exclusive"
|
|
|
|
;;
|
2007-12-09 11:46:16 +03:00
|
|
|
esac
|
|
|
|
|
|
|
|
# If we are using mknod, then decide what options to pass it.
|
2016-07-23 09:48:27 +03:00
|
|
|
MKNOD="${TOOL_MKNOD:-mknod} -F netbsd"
|
2007-12-09 11:46:16 +03:00
|
|
|
if $do_mknod; then
|
|
|
|
if $do_force; then
|
|
|
|
MKNOD="${MKNOD} -R"
|
|
|
|
else
|
|
|
|
MKNOD="${MKNOD} -r"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2008-04-10 00:19:15 +04:00
|
|
|
# do_mtree or do_pax internally implies do_specfile.
|
|
|
|
# This happens after checking for mutually-exclusive options.
|
2017-06-08 06:42:37 +03:00
|
|
|
if $do_mtree || $do_pax && ! $do_specfile; then
|
2007-03-11 18:52:30 +03:00
|
|
|
do_specfile=true
|
|
|
|
opts="${opts} -s"
|
2007-03-03 09:36:00 +03:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2011-10-13 00:57:55 +04:00
|
|
|
# specfile_before
|
|
|
|
# This is called before the bulk of the makedev processing,
|
|
|
|
# if do_specfile is set.
|
2007-12-15 20:28:09 +03:00
|
|
|
#
|
2011-10-13 00:57:55 +04:00
|
|
|
# It simply prints ". type=dir optional", which must be the
|
|
|
|
# first line of the specfile.
|
|
|
|
#
|
|
|
|
specfile_before()
|
2007-12-15 20:28:09 +03:00
|
|
|
{
|
2011-10-13 00:57:55 +04:00
|
|
|
echo ". type=dir optional"
|
|
|
|
}
|
|
|
|
|
|
|
|
# mtree_after
|
|
|
|
# Output in specfile format is piped into this function.
|
|
|
|
#
|
|
|
|
# It uses mtree to create the devices defined in the specfile.
|
|
|
|
#
|
|
|
|
mtree_after()
|
|
|
|
{
|
|
|
|
nooutput -1 "${TOOL_MTREE}" -e -U
|
|
|
|
}
|
|
|
|
|
|
|
|
# pax_after
|
|
|
|
# Output in specfile format is piped into this function.
|
|
|
|
#
|
|
|
|
# It uses pax to create the devices defined in the specfile.
|
|
|
|
#
|
|
|
|
pax_after()
|
|
|
|
{
|
|
|
|
# Run pax in an empty directory, so it pays
|
|
|
|
# attention only to the specfile, without being
|
|
|
|
# confused by the existing contents of the target
|
|
|
|
# directory. Without this, pax would complain "file
|
|
|
|
# would overwrite itself" for already-existing
|
|
|
|
# device nodes.
|
|
|
|
tmpdir=./tmp.$$
|
|
|
|
mkdir "${tmpdir}" || die "can't create temporary directory"
|
|
|
|
cd "${tmpdir}" || die "can't cd to temporary directory"
|
|
|
|
"${TOOL_PAX}" -r -w -M -pe ..
|
|
|
|
pax_status=$?
|
|
|
|
cd .. # back to where we started
|
|
|
|
rmdir "${tmpdir}"
|
|
|
|
return $pax_status
|
2007-12-15 20:28:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
# makedev_main makedev_name args...
|
2008-04-10 00:19:15 +04:00
|
|
|
# Perform most of the work of the main program. makedev_name
|
|
|
|
# is typically "makedev", but may be the name of some other
|
|
|
|
# makedev-like function (if we are invoked from MAKEDEV.local or
|
|
|
|
# some other script). The other args to this function are the
|
2007-12-15 20:28:09 +03:00
|
|
|
# command line args with which the MAKEDEV (or MAKEDEV.local)
|
|
|
|
# script was invoked.
|
|
|
|
#
|
|
|
|
makedev_main()
|
|
|
|
{
|
|
|
|
local makedev="$1" ; shift
|
|
|
|
|
|
|
|
# Parse command line args
|
|
|
|
setup ${1+"$@"}
|
|
|
|
shift $((${OPTIND}-1))
|
|
|
|
|
|
|
|
if $do_create_mfs; then
|
|
|
|
# Count inodes and create mfs file system.
|
|
|
|
# The makedev call merely updates $count_nodes.
|
|
|
|
count_nodes=0
|
|
|
|
$makedev ${1+"$@"}
|
|
|
|
create_mfs_dev $count_nodes
|
|
|
|
unset count_nodes
|
|
|
|
fi
|
|
|
|
|
2011-10-13 00:57:55 +04:00
|
|
|
# Set before, middle, and after variables, so we can do
|
|
|
|
# something like "( $before && $middle ) | $after",
|
|
|
|
# except it will have to be more complex so we can capture
|
|
|
|
# the exit status from both sides of the pipe.
|
|
|
|
#
|
|
|
|
if $do_specfile; then
|
|
|
|
before=specfile_before
|
|
|
|
else
|
|
|
|
before=:
|
|
|
|
fi
|
|
|
|
middle='$makedev ${1+"$@"} && (exit $status)'
|
|
|
|
if $do_mtree; then
|
|
|
|
after=mtree_after
|
2008-04-10 00:19:15 +04:00
|
|
|
elif $do_pax ; then
|
2011-10-13 00:57:55 +04:00
|
|
|
after=pax_after
|
2007-12-15 20:28:09 +03:00
|
|
|
else
|
2011-10-13 00:57:55 +04:00
|
|
|
after=cat
|
2007-12-15 20:28:09 +03:00
|
|
|
fi
|
2011-10-13 00:57:55 +04:00
|
|
|
|
|
|
|
# Actually perform the "{ $before && $middle } | $after" commands.
|
|
|
|
#
|
|
|
|
# We go to some trouble to ensure that, if any of
|
|
|
|
# $before, $middle, or $after fails, then we also
|
|
|
|
# exit with a non-zero status.
|
|
|
|
#
|
|
|
|
# In the block below, fd 3 is a copy of the original stdout,
|
|
|
|
# and fd 4 goes to a subshell that analyses the exit status
|
|
|
|
# status from the other commands.
|
|
|
|
#
|
|
|
|
{
|
|
|
|
exec 3>&1;
|
|
|
|
{
|
|
|
|
{ eval "$before" && eval "$middle"; echo $? >&4; } \
|
|
|
|
| { eval "$after"; echo $? >&4; } \
|
|
|
|
} 4>&1 1>&3 \
|
|
|
|
| (
|
|
|
|
read status1;
|
|
|
|
read status2;
|
|
|
|
case "$status1,$status2" in
|
|
|
|
0,0) exit 0;;
|
|
|
|
0,*) exit $status2;;
|
|
|
|
*,*) exit $status1;;
|
|
|
|
esac
|
|
|
|
)
|
|
|
|
}
|
2007-12-15 20:28:09 +03:00
|
|
|
}
|
|
|
|
|
2007-03-03 09:36:00 +03:00
|
|
|
#
|
|
|
|
# functions available to create nodes:
|
|
|
|
#
|
|
|
|
# mkdev name [b|c] major minor [mode{=600} [gid{=0} [uid{=0}]]]
|
|
|
|
# create device node `name' with the appropriate permissions
|
|
|
|
#
|
|
|
|
# lndev src target
|
|
|
|
# create a symlink from src to target
|
|
|
|
#
|
|
|
|
# makedir dir mode
|
|
|
|
# create directory with appropriate mode
|
|
|
|
#
|
|
|
|
|
|
|
|
mkdev()
|
|
|
|
{
|
|
|
|
if [ -n "$count_nodes" ]; then
|
|
|
|
count_nodes=$((count_nodes + 1))
|
|
|
|
return
|
|
|
|
fi
|
2011-08-06 16:29:39 +04:00
|
|
|
if $do_update && test -e $1; then
|
|
|
|
return
|
|
|
|
fi
|
2007-03-03 09:36:00 +03:00
|
|
|
if $do_specfile; then
|
|
|
|
case $2 in
|
|
|
|
b) type=block ;;
|
|
|
|
c) type=char ;;
|
|
|
|
esac
|
|
|
|
echo "./$1 type=${type} device=netbsd,$3,$4 mode=${5:-600} gid=${6:-$g_wheel} uid=${7:-$u_root}"
|
|
|
|
else
|
|
|
|
${MKNOD} -m ${5:-600} -g \#${6:-$g_wheel} -u \#${7:-$u_root} $1 $2 $3 $4
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
lndev()
|
|
|
|
{
|
|
|
|
if [ -n "$count_nodes" ]; then
|
|
|
|
count_nodes=$((count_nodes + 1))
|
|
|
|
return
|
|
|
|
fi
|
2011-08-06 16:29:39 +04:00
|
|
|
if $do_update && test -e $2; then
|
|
|
|
return
|
|
|
|
fi
|
2007-03-03 09:36:00 +03:00
|
|
|
if $do_specfile; then
|
|
|
|
echo "./$2 type=link link=$1 mode=0700 gid=$g_wheel uid=$u_root"
|
|
|
|
else
|
|
|
|
ln -f -s $1 $2
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
makedir()
|
|
|
|
{
|
|
|
|
if [ -n "$count_nodes" ]; then
|
|
|
|
count_nodes=$((count_nodes + 1))
|
|
|
|
return
|
|
|
|
fi
|
2011-08-06 16:29:39 +04:00
|
|
|
if $do_update && test -e $1; then
|
|
|
|
return
|
|
|
|
fi
|
2007-03-03 09:36:00 +03:00
|
|
|
if $do_specfile; then
|
2008-04-10 00:19:15 +04:00
|
|
|
echo "./$1 type=dir mode=$2 gid=$g_wheel uid=$u_root"
|
2007-03-03 09:36:00 +03:00
|
|
|
else
|
2007-12-15 20:28:09 +03:00
|
|
|
nooutput -2 mkdir $1
|
2007-03-03 09:36:00 +03:00
|
|
|
chmod $2 $1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
warn()
|
|
|
|
{
|
|
|
|
echo 1>&2 "$0: $*"
|
2011-10-13 00:57:55 +04:00
|
|
|
status=1
|
2007-03-03 09:36:00 +03:00
|
|
|
}
|
2003-12-23 01:26:32 +03:00
|
|
|
|
2008-04-10 00:19:15 +04:00
|
|
|
die()
|
|
|
|
{
|
|
|
|
echo 1>&2 "$0: $*"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2003-12-21 20:37:26 +03:00
|
|
|
# makedev special [...]
|
|
|
|
# the main loop
|
|
|
|
#
|
2003-10-13 13:37:45 +04:00
|
|
|
makedev()
|
|
|
|
{
|
|
|
|
|
|
|
|
for i
|
|
|
|
do
|
|
|
|
|
|
|
|
case $i in
|
|
|
|
|
|
|
|
%MD_DEVICES%
|
|
|
|
|
2003-10-15 23:16:01 +04:00
|
|
|
all)
|
|
|
|
makedev all_md
|
2012-08-13 12:30:51 +04:00
|
|
|
makedev std fd ptm
|
2012-04-07 21:22:10 +04:00
|
|
|
makedev dk0 dk1 dk2 dk3 dk4 dk5 dk6 dk7
|
|
|
|
makedev dk8 dk9 dk10 dk11 dk12 dk13 dk14 dk15
|
2019-04-01 16:08:24 +03:00
|
|
|
makedev dk16 dk17 dk18 dk19 dk20 dk21 dk22 dk23
|
|
|
|
makedev dk24 dk25 dk26 dk27 dk28 dk29 dk30 dk31
|
2003-10-15 23:16:01 +04:00
|
|
|
makedev ccd0 ccd1 ccd2 ccd3
|
2020-02-27 19:59:23 +03:00
|
|
|
makedev cgd0 cgd1 cgd2 cgd3 cgd4 cgd5 cgd6 cgd7
|
2003-12-10 14:40:11 +03:00
|
|
|
makedev fss0 fss1 fss2 fss3
|
2003-10-15 23:16:01 +04:00
|
|
|
makedev md0 md1
|
|
|
|
makedev raid0 raid1 raid2 raid3 raid4 raid5 raid6 raid7
|
|
|
|
makedev vnd0 vnd1 vnd2 vnd3
|
2012-05-26 04:36:15 +04:00
|
|
|
makedev iscsi0
|
2010-08-22 22:56:18 +04:00
|
|
|
makedev bpf npf
|
2003-10-15 23:16:01 +04:00
|
|
|
makedev tun0 tun1 tun2 tun3
|
2007-12-31 18:31:24 +03:00
|
|
|
makedev ipl pf crypto random
|
2008-11-12 15:35:50 +03:00
|
|
|
makedev lockstat clockctl cpuctl
|
2012-02-25 13:19:30 +04:00
|
|
|
makedev atabus0 atabus1 atabus2 atabus3 atabus4 atabus5 atabus6 atabus7
|
2019-03-26 12:13:55 +03:00
|
|
|
makedev srt0 srt1 srt2 srt3
|
2005-01-09 01:31:28 +03:00
|
|
|
makedev tap tap0 tap1 tap2 tap3
|
2006-02-06 16:12:41 +03:00
|
|
|
makedev gpio gpio0 gpio1 gpio2 gpio3 gpio4 gpio5 gpio6 gpio7
|
2018-05-20 17:08:32 +03:00
|
|
|
makedev gpiopps0
|
2007-11-11 20:54:47 +03:00
|
|
|
makedev pad pad0 pad1 pad2 pad3
|
2006-09-10 19:45:55 +04:00
|
|
|
makedev bthub
|
2007-11-13 16:14:25 +03:00
|
|
|
makedev putter
|
2007-12-17 07:29:50 +03:00
|
|
|
makedev drvctl
|
2008-11-12 16:14:28 +03:00
|
|
|
makedev video
|
2011-07-09 18:49:28 +04:00
|
|
|
makedev dtv
|
2017-12-05 22:17:11 +03:00
|
|
|
makedev drm0 drm1 drm2 drm3
|
2009-03-12 03:19:36 +03:00
|
|
|
makedev altmem
|
2009-05-24 02:29:14 +04:00
|
|
|
makedev zfs
|
2013-10-28 22:33:20 +04:00
|
|
|
makedev lua
|
2015-08-02 00:30:09 +03:00
|
|
|
makedev hdmicec0
|
2016-01-28 22:06:39 +03:00
|
|
|
makedev dtrace
|
2017-08-28 04:34:52 +03:00
|
|
|
makedev veriexec
|
2018-01-09 06:31:12 +03:00
|
|
|
makedev autofs
|
2018-07-28 17:13:13 +03:00
|
|
|
makedev fw0 fw1 fw2 fw3
|
2020-03-02 18:49:30 +03:00
|
|
|
makedev ipmi0
|
2020-04-01 18:32:21 +03:00
|
|
|
makedev qemufwcfg
|
2021-11-06 16:34:39 +03:00
|
|
|
makedev sht3xtemp0
|
2021-12-07 20:39:53 +03:00
|
|
|
makedev scmd0
|
2007-02-26 23:44:03 +03:00
|
|
|
makedev local # do this last
|
2003-10-15 23:16:01 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
init)
|
|
|
|
# unless overridden by MD entry, this is equal to 'all'
|
2012-09-05 12:25:53 +04:00
|
|
|
makedev all opty
|
2003-10-15 23:16:01 +04:00
|
|
|
;;
|
|
|
|
|
2003-10-13 13:37:45 +04:00
|
|
|
%MI_DEVICES_BEGIN%
|
|
|
|
audio)
|
|
|
|
makedev audio0 audio1 audio2 audio3
|
2009-09-06 21:25:55 +04:00
|
|
|
makedev hdaudio0 hdaudio1 hdaudio2 hdaudio3
|
2003-12-21 20:37:26 +03:00
|
|
|
lndev sound0 sound
|
|
|
|
lndev audio0 audio
|
|
|
|
lndev mixer0 mixer
|
|
|
|
lndev audioctl0 audioctl
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2005-09-27 06:44:12 +04:00
|
|
|
gpio)
|
2006-02-06 16:12:41 +03:00
|
|
|
makedev gpio0 gpio1 gpio2 gpio3 gpio4 gpio5 gpio6 gpio7
|
2005-09-27 06:44:12 +04:00
|
|
|
lndev gpio0 gpio
|
|
|
|
;;
|
|
|
|
|
2018-05-20 17:08:32 +03:00
|
|
|
gpiopps)
|
|
|
|
makedev gpiopps0
|
|
|
|
lndev gpiopps0 gpiopps
|
|
|
|
;;
|
|
|
|
|
2013-10-28 22:33:20 +04:00
|
|
|
lua)
|
|
|
|
makedev lua0
|
|
|
|
lndev lua0 lua
|
|
|
|
;;
|
|
|
|
|
2007-11-11 20:54:47 +03:00
|
|
|
pad)
|
|
|
|
makedev pad0 pad1 pad2 pad3
|
|
|
|
lndev pad0 pad
|
|
|
|
;;
|
|
|
|
|
2017-11-25 19:31:03 +03:00
|
|
|
qemufwcfg)
|
|
|
|
makedev qemufwcfg0
|
|
|
|
lndev qemufwcfg0 qemufwcfg
|
|
|
|
;;
|
|
|
|
|
2003-10-13 13:37:45 +04:00
|
|
|
radio)
|
|
|
|
makedev radio0 radio1
|
2003-12-21 20:37:26 +03:00
|
|
|
lndev radio0 radio
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2008-09-06 23:21:21 +04:00
|
|
|
video)
|
|
|
|
makedev video0 video1 video2 video3
|
|
|
|
;;
|
|
|
|
|
2011-07-09 18:49:28 +04:00
|
|
|
dtv)
|
|
|
|
makedev dtv0 dtv1 dtv2 dtv3
|
|
|
|
;;
|
|
|
|
|
2011-10-02 20:39:45 +04:00
|
|
|
iic)
|
|
|
|
makedev iic0 iic1 iic2 iic3
|
|
|
|
;;
|
|
|
|
|
2009-03-12 03:19:36 +03:00
|
|
|
altmem)
|
|
|
|
makedev altmem0 altmem1
|
|
|
|
;;
|
|
|
|
|
2003-10-13 13:37:45 +04:00
|
|
|
ramdisk)
|
|
|
|
makedev floppy md0
|
|
|
|
;;
|
|
|
|
|
2021-11-06 16:34:39 +03:00
|
|
|
sht3xtemp)
|
|
|
|
makedev sht3xtemp0
|
|
|
|
;;
|
|
|
|
|
2021-12-07 20:39:53 +03:00
|
|
|
scmd)
|
|
|
|
makedev scmd0
|
|
|
|
;;
|
|
|
|
|
2003-10-13 13:37:45 +04:00
|
|
|
usbs)
|
|
|
|
makedev usb usb0 usb1 usb2 usb3 usb4 usb5 usb6 usb7
|
2019-07-29 20:53:20 +03:00
|
|
|
makedev usb8 usb9 usb10 usb11 usb12 usb13 usb14 usb15
|
2019-05-31 16:15:00 +03:00
|
|
|
makedev uhid0 uhid1 uhid2 uhid3 uhid4 uhid5
|
|
|
|
makedev uhid6 uhid7 uhid8 uhid9 uhid10 uhid11
|
|
|
|
makedev uhid12 uhid13 uhid14 uhid15
|
2003-10-13 13:37:45 +04:00
|
|
|
makedev ulpt0 ulpt1
|
2013-08-03 20:07:35 +04:00
|
|
|
makedev ttyU0 ttyU1 ttyU2 ttyU3 ttyU4 ttyU5 ttyU6 ttyU7
|
2005-07-30 10:14:49 +04:00
|
|
|
makedev ttyY0 ttyY1
|
2010-03-07 00:33:20 +03:00
|
|
|
makedev ttyHS0
|
2006-04-03 12:15:48 +04:00
|
|
|
makedev utoppy0 utoppy1
|
2010-04-19 08:34:42 +04:00
|
|
|
makedev ugen0 ugen1 ugen2 ugen3
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
std)
|
2008-04-10 00:19:15 +04:00
|
|
|
mkdev console c %cons_chr% 0 600
|
|
|
|
mkdev constty c %cons_chr% 1 600
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev drum c %swap_chr% 0 640 $g_kmem
|
|
|
|
mkdev kmem c %mem_chr% 1 640 $g_kmem
|
|
|
|
mkdev mem c %mem_chr% 0 640 $g_kmem
|
|
|
|
mkdev null c %mem_chr% 2 666
|
2016-01-18 02:18:18 +03:00
|
|
|
mkdev full c %mem_chr% 11 666
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev zero c %mem_chr% 12 666
|
|
|
|
mkdev klog c %log_chr% 0 600
|
2018-07-21 10:46:56 +03:00
|
|
|
mkdev ksyms c %ksyms_chr% 0 440 $g_kmem
|
2014-09-19 13:00:23 +04:00
|
|
|
mkdev random c %rnd_chr% 0 444
|
|
|
|
mkdev urandom c %rnd_chr% 1 644
|
2009-01-03 11:49:03 +03:00
|
|
|
if ! $fdesc_mounted; then
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev tty c %ctty_chr% 0 666
|
|
|
|
mkdev stdin c %filedesc_chr% 0 666
|
|
|
|
mkdev stdout c %filedesc_chr% 1 666
|
|
|
|
mkdev stderr c %filedesc_chr% 2 666
|
2003-10-13 13:37:45 +04:00
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
2005-04-30 20:26:06 +04:00
|
|
|
usb)
|
|
|
|
mkdev usb c %usb_chr% 255 444
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
usb[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#usb}
|
2005-04-30 20:26:06 +04:00
|
|
|
usb=usb$unit
|
|
|
|
mkdev usb$unit c %usb_chr% $unit
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
uhid[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#uhid}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev uhid$unit c %uhid_chr% $unit 666
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
ulpt[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#ulpt}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev ulpt$unit c %ulpt_chr% $unit
|
|
|
|
mkdev ulpn$unit c %ulpt_chr% $(($unit + 64))
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
utoppy[0-9]*)
|
2006-04-03 12:15:48 +04:00
|
|
|
unit=${i#utoppy}
|
|
|
|
mkdev utoppy$unit c %utoppy_chr% $unit
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
ttyHS[0-9]*)
|
2010-03-07 00:05:36 +03:00
|
|
|
unit=${i#ttyHS}
|
|
|
|
for j in 00 01 02 03 04 05 06 07 08 09 10
|
|
|
|
do
|
|
|
|
base=$(($unit * 16 + ${j#0}))
|
|
|
|
mkdev ttyHS$unit.$j c %uhso_chr% $(($base + $dialin )) "" "" $u_uucp
|
|
|
|
mkdev dtyHS$unit.$j c %uhso_chr% $(($base + $dialout )) "" "" $u_uucp
|
|
|
|
mkdev ctyHS$unit.$j c %uhso_chr% $(($base + $callunit)) "" "" $u_uucp
|
|
|
|
done
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
ttyY[0-9]*)
|
2005-07-30 10:14:49 +04:00
|
|
|
unit=${i#ttyY}
|
|
|
|
mkdev ttyY$unit c %ucycom_chr% $(($unit + $dialin )) "" "" $u_uucp
|
|
|
|
mkdev dtyY$unit c %ucycom_chr% $(($unit + $dialout )) "" "" $u_uucp
|
|
|
|
mkdev ctyY$unit c %ucycom_chr% $(($unit + $callunit)) "" "" $u_uucp
|
|
|
|
;;
|
|
|
|
|
2015-11-09 02:23:30 +03:00
|
|
|
ucom[0-9]*)
|
|
|
|
makedev ttyU${i#ucom}
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
ttyU[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#ttyU}
|
2008-04-10 00:19:15 +04:00
|
|
|
mkdev ttyU$unit c %ucom_chr% $(($unit + $dialin )) "" "" $u_uucp
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev dtyU$unit c %ucom_chr% $(($unit + $dialout )) "" "" $u_uucp
|
|
|
|
mkdev ctyU$unit c %ucom_chr% $(($unit + $callunit)) "" "" $u_uucp
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
ugen[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#ugen}
|
|
|
|
for j in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
|
|
|
|
do
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev ugen$unit.$j c %ugen_chr% $(($unit * 16 + ${j#0}))
|
2003-10-13 13:37:45 +04:00
|
|
|
done
|
|
|
|
;;
|
|
|
|
|
|
|
|
wscons)
|
|
|
|
makedev ttyE0 ttyE1 ttyE2 ttyE3 ttyE4 ttyE5 ttyE6 ttyE7
|
2015-11-05 19:46:22 +03:00
|
|
|
makedev ttyF0 ttyF1 ttyF2 ttyF3 ttyF4 ttyF5 ttyF6 ttyF7
|
|
|
|
makedev ttyG0 ttyG1 ttyG2 ttyG3 ttyG4 ttyG5 ttyG6 ttyG7
|
|
|
|
makedev ttyH0 ttyH1 ttyH2 ttyH3 ttyH4 ttyH5 ttyH6 ttyH7
|
2003-10-13 13:37:45 +04:00
|
|
|
makedev wsmouse0 wsmouse1 wsmouse2 wsmouse3
|
|
|
|
makedev wskbd0 wskbd1 wskbd2 wskbd3
|
|
|
|
makedev wsmux0 wsmux1 wsmux2 wsmux3
|
|
|
|
makedev wsmouse wskbd
|
|
|
|
makedev ttyEcfg ttyEstat
|
2015-11-05 19:46:22 +03:00
|
|
|
makedev ttyFcfg ttyFstat
|
|
|
|
makedev ttyGcfg ttyGstat
|
|
|
|
makedev ttyHcfg ttyHstat
|
2003-10-13 13:37:45 +04:00
|
|
|
makedev wsfont
|
|
|
|
;;
|
|
|
|
|
|
|
|
wsmouse)
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev wsmouse c %wsmux_chr% 0
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
wskbd)
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev wskbd c %wsmux_chr% 1
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
wsmux[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#wsmux}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev wsmux$unit c %wsmux_chr% $unit
|
|
|
|
mkdev wsmuxctl$unit c %wsmux_chr% $(($unit + 128)) 200
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2005-03-11 23:55:10 +03:00
|
|
|
xenevt)
|
|
|
|
mkdev xenevt c %xenevt_chr% 0
|
|
|
|
;;
|
|
|
|
|
2006-07-05 01:39:55 +04:00
|
|
|
xsd_kva)
|
2006-07-07 21:21:19 +04:00
|
|
|
mkdev xsd_kva c %xenevt_chr% 1
|
2006-07-05 01:39:55 +04:00
|
|
|
;;
|
|
|
|
|
2005-03-11 23:55:10 +03:00
|
|
|
xencons)
|
|
|
|
mkdev xencons c %xencons_chr% 0
|
|
|
|
;;
|
|
|
|
|
2003-10-13 13:37:45 +04:00
|
|
|
ttyEstat)
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev ttyEstat c %wsdisplay_chr% 254
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
ttyEcfg)
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev ttyEcfg c %wsdisplay_chr% 255
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
ttyE[0-9]*)
|
2003-12-21 20:37:26 +03:00
|
|
|
unit=${i#ttyE}
|
|
|
|
mkdev ttyE$unit c %wsdisplay_chr% $unit
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2015-11-05 19:46:22 +03:00
|
|
|
ttyFstat)
|
|
|
|
mkdev ttyFstat c %wsdisplay_chr% 510
|
|
|
|
;;
|
|
|
|
|
|
|
|
ttyFcfg)
|
|
|
|
mkdev ttyFcfg c %wsdisplay_chr% 511
|
|
|
|
;;
|
|
|
|
|
|
|
|
ttyF[0-9]*)
|
|
|
|
unit=${i#ttyF}
|
|
|
|
mkdev ttyF$unit c %wsdisplay_chr% $(($unit + 256))
|
|
|
|
;;
|
|
|
|
|
|
|
|
ttyGstat)
|
|
|
|
mkdev ttyGstat c %wsdisplay_chr% 766
|
|
|
|
;;
|
|
|
|
|
|
|
|
ttyGcfg)
|
|
|
|
mkdev ttyGcfg c %wsdisplay_chr% 767
|
|
|
|
;;
|
|
|
|
|
|
|
|
ttyG[0-9]*)
|
|
|
|
unit=${i#ttyG}
|
|
|
|
mkdev ttyG$unit c %wsdisplay_chr% $(($unit + 512))
|
|
|
|
;;
|
|
|
|
|
|
|
|
ttyHstat)
|
|
|
|
mkdev ttyHstat c %wsdisplay_chr% 1022
|
|
|
|
;;
|
|
|
|
|
|
|
|
ttyHcfg)
|
|
|
|
mkdev ttyHcfg c %wsdisplay_chr% 1023
|
|
|
|
;;
|
|
|
|
|
|
|
|
ttyH[0-9]*)
|
|
|
|
unit=${i#ttyH}
|
|
|
|
mkdev ttyH$unit c %wsdisplay_chr% $(($unit + 768))
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
wsmouse[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#wsmouse}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev wsmouse$unit c %wsmouse_chr% $unit
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
wskbd[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#wskbd}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev wskbd$unit c %wskbd_chr% $unit
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
fd)
|
2009-01-03 11:49:03 +03:00
|
|
|
if ! $fdesc_mounted; then
|
2011-09-06 17:34:44 +04:00
|
|
|
# Create the "fd" subdirectory, and devices "fd/0" to "fd/63"
|
2003-12-21 20:37:26 +03:00
|
|
|
makedir fd 755
|
2003-10-13 13:37:45 +04:00
|
|
|
n=0
|
2003-12-21 20:37:26 +03:00
|
|
|
while [ $n -lt 64 ]
|
|
|
|
do
|
|
|
|
mkdev fd/$n c %filedesc_chr% $n 666
|
2003-10-13 13:37:45 +04:00
|
|
|
n=$(($n + 1))
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
wt[0-9]*)
|
|
|
|
name=wt; unit=${i#wt}; chr=%wt_chr%; blk=%wt_blk%
|
2003-10-13 13:37:45 +04:00
|
|
|
for sub in $unit $(($unit+8)) $(($unit+16))
|
|
|
|
do
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev $name$sub b $blk $(($sub + 0)) 660 $g_operator
|
|
|
|
mkdev n$name$sub b $blk $(($sub + 4)) 660 $g_operator
|
|
|
|
mkdev r$name$sub c $chr $(($sub + 0)) 660 $g_operator
|
|
|
|
mkdev nr$name$sub c $chr $(($sub + 4)) 660 $g_operator
|
2003-10-13 13:37:45 +04:00
|
|
|
done
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
md[0-9]*)
|
2003-10-24 12:29:57 +04:00
|
|
|
makedisk_minimal md ${i#md} %md_blk% %md_chr%
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
fss[0-9]*)
|
|
|
|
name=fss; unit=${i#fss}; blk=%fss_blk%; chr=%fss_chr%
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev $name$unit b $blk $unit 660 $g_operator
|
|
|
|
mkdev r$name$unit c $chr $unit 660 $g_operator
|
2003-12-10 14:40:11 +03:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
ss[0-9]*)
|
|
|
|
name=ss; unit=${i#ss}; chr=%ss_chr%
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev $name$unit c $chr $(($unit * 16 + 0)) 640 $g_operator
|
|
|
|
mkdev n$name$unit c $chr $(($unit * 16 + 1)) 640 $g_operator
|
|
|
|
mkdev en$name$unit c $chr $(($unit * 16 + 3)) 640 $g_operator
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
ccd[0-9]*|cgd[0-9]*|raid[0-9]*|vnd[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
case $i in
|
2003-12-21 20:37:26 +03:00
|
|
|
ccd*) name=ccd; unit=${i#ccd}; blk=%ccd_blk%; chr=%ccd_chr%;;
|
|
|
|
cgd*) name=cgd; unit=${i#cgd}; blk=%cgd_blk%; chr=%cgd_chr%;;
|
|
|
|
raid*) name=raid; unit=${i#raid}; blk=%raid_blk%; chr=%raid_chr%;;
|
|
|
|
vnd*) name=vnd; unit=${i#vnd}; blk=%vnd_blk%; chr=%vnd_chr%;;
|
2003-10-13 13:37:45 +04:00
|
|
|
esac
|
|
|
|
%MKDISK% $name $unit $blk $chr
|
2003-10-24 14:25:08 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
sd[0-9]*)
|
2003-10-24 14:25:08 +04:00
|
|
|
name=sd; unit=${i#sd}; blk=%sd_blk%; chr=%sd_chr%
|
|
|
|
%MKDISK% $name $unit $blk $chr
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
ace[0-9]*)
|
2011-01-26 04:18:43 +03:00
|
|
|
name=ace; unit=${i#ace}; blk=%ace_blk%; chr=%ace_chr%
|
|
|
|
%MKDISK% $name $unit $blk $chr
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
eflash[0-9]*)
|
2011-01-26 04:18:43 +03:00
|
|
|
name=eflash; unit=${i#eflash}; blk=%eflash_blk%; chr=%eflash_chr%
|
|
|
|
%MKDISK% $name $unit $blk $chr
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
wd[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
name=wd; unit=${i#wd}; blk=%wd_blk%; chr=%wd_chr%
|
|
|
|
%MKDISK% $name $unit $blk $chr
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
fd[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
name=fd; unit=${i#fd}; blk=%fd_blk%; chr=%fd_chr%
|
|
|
|
%MKDISK% $name $unit $blk $chr
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
ld[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
name=ld; unit=${i#ld}; blk=%ld_blk%; chr=%ld_chr%
|
|
|
|
%MKDISK% $name $unit $blk $chr
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
flash[0-9]*)
|
2011-02-26 21:07:13 +03:00
|
|
|
unit=${i#flash}
|
|
|
|
flash=flash$unit
|
|
|
|
mkdev flash$unit b %flash_blk% $unit
|
|
|
|
mkdev rflash$unit c %flash_chr% $unit
|
|
|
|
;;
|
|
|
|
|
2013-04-20 15:41:51 +04:00
|
|
|
spiflash[0-9]*)
|
|
|
|
unit=${i#spiflash}
|
|
|
|
spiflash=spiflash$unit
|
|
|
|
mkdev spiflash$unit b %spiflash_blk% $unit
|
2019-09-19 04:44:48 +03:00
|
|
|
mkdev rspiflash$unit c %spiflash_chr% $unit
|
2013-04-20 15:41:51 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
altmem[0-9]*)
|
2009-03-12 03:19:36 +03:00
|
|
|
name=altmem; unit=${i#altmem}; blk=%altmem_blk%; chr=%altmem_chr%
|
|
|
|
%MKDISK% $name $unit $blk $chr
|
|
|
|
;;
|
|
|
|
|
2007-05-16 17:06:03 +04:00
|
|
|
bio)
|
|
|
|
mkdev bio c %bio_chr% 0
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
ed[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
name=ed; unit=${i#ed}; blk=%ed_blk%; chr=%ed_chr%
|
|
|
|
%MKDISK% $name $unit $blk $chr
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
ofdisk[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
name=ofdisk; unit=${i#ofdisk}; blk=%ofdisk_blk%; chr=%ofdisk_chr%
|
|
|
|
%MKDISK% $name $unit $blk $chr
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
xbd[0-9]*)
|
2005-03-11 23:55:10 +03:00
|
|
|
name=xbd; unit=${i#xbd}; blk=%xbd_blk%; chr=%xbd_chr%
|
|
|
|
%MKDISK% $name $unit $blk $chr
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
dk[0-9]*)
|
2006-08-13 22:53:31 +04:00
|
|
|
name=dk; unit=${i#dk}; blk=%dk_blk%; chr=%dk_chr%
|
2011-09-06 17:34:44 +04:00
|
|
|
mkdev r$name$unit c $chr $unit 0640 $g_operator
|
|
|
|
mkdev $name$unit b $blk $unit 0640 $g_operator
|
2006-08-12 23:47:28 +04:00
|
|
|
;;
|
2007-03-21 06:39:41 +03:00
|
|
|
|
2018-11-04 15:48:01 +03:00
|
|
|
tprof)
|
|
|
|
mkdev tprof c %tprof_chr% 0
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
ttyCY[0-9]*)
|
2011-09-06 17:34:44 +04:00
|
|
|
# Each unit number creates 32 pairs of {tty,dty} device nodes:
|
|
|
|
# ttyCY0 => device nodes [td]tyCY000 to [td]tyCY031;
|
|
|
|
# ttyCY1 => device nodes [td]tyCY032 to [td]tyCY063;
|
2004-06-08 23:03:14 +04:00
|
|
|
name=tyCY; chr=%cy_chr%; off=32
|
2003-12-21 20:37:26 +03:00
|
|
|
unit=${i#t${name}}
|
|
|
|
minor=$(($unit * $off))
|
|
|
|
eminor=$(($minor + $off))
|
|
|
|
while [ $minor -lt $eminor ]
|
|
|
|
do
|
2006-02-16 00:59:08 +03:00
|
|
|
nminor=000$minor
|
|
|
|
nminor=${nminor#${nminor%???}}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev t$name$nminor c $chr $(($minor + $dialin )) "" "" $u_uucp
|
|
|
|
mkdev d$name$nminor c $chr $(($minor + $dialout)) "" "" $u_uucp
|
2003-10-13 13:37:45 +04:00
|
|
|
minor=$(($minor + 1))
|
|
|
|
done
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
ttyCZ[0-9]*)
|
2011-09-06 17:34:44 +04:00
|
|
|
# Each unit number creates 64 pairs of {tty,dty} device nodes:
|
|
|
|
# ttyCZ0 => device nodes [td]tyCZ0000 to [td]tyCZ0063;
|
|
|
|
# ttyCZ1 => device nodes [td]tyCZ0064 to [td]tyCZ0127;
|
2004-06-08 23:03:14 +04:00
|
|
|
name=tyCZ; chr=%cz_chr%; off=64
|
2003-12-21 20:37:26 +03:00
|
|
|
unit=${i#t${name}}
|
|
|
|
minor=$(($unit * $off))
|
|
|
|
eminor=$(($minor + $off))
|
|
|
|
while [ $minor -lt $eminor ]
|
|
|
|
do
|
2006-02-16 00:59:08 +03:00
|
|
|
nminor=0000$minor
|
|
|
|
nminor=${nminor#${nminor%????}}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev t$name$nminor c $chr $(($minor + $dialin )) "" "" $u_uucp
|
|
|
|
mkdev d$name$nminor c $chr $(($minor + $dialout)) "" "" $u_uucp
|
2003-10-13 13:37:45 +04:00
|
|
|
minor=$(($minor + 1))
|
|
|
|
done
|
|
|
|
;;
|
|
|
|
|
2003-12-21 20:37:26 +03:00
|
|
|
|
2003-10-24 12:29:57 +04:00
|
|
|
tty[0-9]|tty0[0-9])
|
|
|
|
# some archs have built-in zstty (major %zstty_chr%) instead
|
|
|
|
# of NS16550; create ttyZ* and hardlink as [dt]ty0*; this
|
|
|
|
# needs to be before com entry, for archs which have both
|
|
|
|
unit=${i#tty}
|
|
|
|
unit=$(($unit + 0))
|
|
|
|
makedev ttyZ${unit}
|
2003-12-21 20:37:26 +03:00
|
|
|
lndev ttyZ$unit tty0${unit}
|
|
|
|
lndev dtyZ$unit dty0${unit}
|
2003-10-24 12:29:57 +04:00
|
|
|
;;
|
|
|
|
|
2011-10-26 13:02:20 +04:00
|
|
|
tty[0-9]*)
|
2003-12-21 20:37:26 +03:00
|
|
|
unit=${i#tty}
|
2006-02-16 00:59:08 +03:00
|
|
|
ounit=00$unit
|
|
|
|
ounit=${ounit#${ounit%??}}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev tty$ounit c %com_chr% $(($unit + $dialin )) "" "" $u_uucp
|
|
|
|
mkdev dty$ounit c %com_chr% $(($unit + $dialout)) "" "" $u_uucp
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
ttyC[0-9]*)
|
2003-12-21 20:37:26 +03:00
|
|
|
# some archs call com_chr ttyC traditionally
|
|
|
|
unit=${i#ttyC}; name=ttyC; dname=dtyC; chr=%com_chr%
|
|
|
|
mkdev $name$unit c $chr $(($unit + $dialin )) "" "" $u_uucp
|
|
|
|
mkdev $dname$unit c $chr $(($unit + $dialout)) "" "" $u_uucp
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
ttyh[0-9]*)
|
2003-12-21 20:37:26 +03:00
|
|
|
unit=${i#ttyh}; name=ttyh; dname=dtyh; chr=%sabtty_chr%
|
|
|
|
mkdev $name$unit c $chr $(($unit + $dialin )) "" "" $u_uucp
|
|
|
|
mkdev $dname$unit c $chr $(($unit + $dialout)) "" "" $u_uucp
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
ttyTX[0-9]*)
|
2003-12-21 20:37:26 +03:00
|
|
|
unit=${i#ttyTX}; name=ttyTX0; dname=dtyTX0; chr=%txcom_chr%
|
|
|
|
mkdev $name$unit c $chr $(($unit + $dialin )) "" "" $u_uucp
|
|
|
|
mkdev $dname$unit c $chr $(($unit + $dialout)) "" "" $u_uucp
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
ttyZ[0-9]*)
|
2003-12-21 20:37:26 +03:00
|
|
|
unit=${i#ttyZ}; name=ttyZ; dname=dtyZ; chr=%zstty_chr%
|
|
|
|
mkdev $name$unit c $chr $(($unit + $dialin )) "" "" $u_uucp
|
|
|
|
mkdev $dname$unit c $chr $(($unit + $dialout)) "" "" $u_uucp
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
opty)
|
2011-09-06 17:34:44 +04:00
|
|
|
# Create 16 device nodes, [pt]typ0 to [pt]typf,
|
|
|
|
# same as "MAKEDEV pty0".
|
2003-10-13 13:37:45 +04:00
|
|
|
for j in 0 1 2 3 4 5 6 7 8 9 a b c d e f
|
|
|
|
do
|
|
|
|
case $j in
|
|
|
|
[0-9]) jn=$j ;;
|
|
|
|
a) jn=10 ;;
|
|
|
|
b) jn=11 ;;
|
|
|
|
c) jn=12 ;;
|
|
|
|
d) jn=13 ;;
|
|
|
|
e) jn=14 ;;
|
|
|
|
f) jn=15 ;;
|
|
|
|
esac
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev ttyp$j c %pts_chr% $jn 666
|
|
|
|
mkdev ptyp$j c %ptc_chr% $jn 666
|
2003-10-13 13:37:45 +04:00
|
|
|
done
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
pty[0-9]*)
|
2011-09-06 17:34:44 +04:00
|
|
|
# Each unit number creates up to 16 pairs of {tty,pty} device nodes:
|
|
|
|
# pty0 => 16 pairs, [tp]typ0 to [tp]typf
|
|
|
|
# pty1 => 16 pairs, [tp]tyq0 to [tp]tyqf
|
|
|
|
# pty16 => 16 pairs, [tp]typg to [tp]typv
|
|
|
|
# pty17 => 16 pairs, [tp]typw to [tp]typL
|
|
|
|
# pty18 => 14 pairs, [tp]typM to [tp]typZ
|
2012-08-13 12:30:51 +04:00
|
|
|
warn "$i: creating BSD style tty nodes with ptyfs is a security issue"
|
2003-10-13 13:37:45 +04:00
|
|
|
class=${i#pty}
|
2004-06-19 09:31:50 +04:00
|
|
|
d1="p q r s t u v w x y z P Q R S T"
|
|
|
|
if [ "$class" -ge 64 ]
|
|
|
|
then
|
|
|
|
warn "$i: pty unit must be between 0 and 63"
|
2003-10-13 13:37:45 +04:00
|
|
|
continue
|
2004-06-19 09:31:50 +04:00
|
|
|
elif [ "$class" -lt 16 ]
|
|
|
|
then
|
2011-09-06 17:34:44 +04:00
|
|
|
# pty[p-zP-T][0-9a-f]
|
2004-06-19 09:31:50 +04:00
|
|
|
offset=0
|
|
|
|
mult=0
|
|
|
|
d2="0 1 2 3 4 5 6 7 8 9 a b c d e f"
|
|
|
|
else
|
2011-09-06 17:34:44 +04:00
|
|
|
# pty[p-zP-T][g-zA-Z]
|
2004-06-19 09:31:50 +04:00
|
|
|
class=$(($class - 16))
|
|
|
|
offset=256
|
|
|
|
mult=2
|
|
|
|
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"
|
2003-10-13 13:37:45 +04:00
|
|
|
fi
|
2004-06-19 09:31:50 +04:00
|
|
|
start=$(($class * 16))
|
|
|
|
set -- $d2
|
|
|
|
nt=$#
|
|
|
|
s1=$(($start / $nt))
|
|
|
|
set -- $d1
|
|
|
|
shift $s1
|
|
|
|
t1=$1
|
|
|
|
if [ "$t1" = v ]; then
|
2003-12-23 01:26:32 +03:00
|
|
|
warn "$i: pty unit conflicts with console ttyv0 device"
|
2003-10-13 13:37:45 +04:00
|
|
|
continue
|
|
|
|
fi
|
2006-03-25 20:19:02 +03:00
|
|
|
s2=$(($start % ($nt - $s1 * $mult)))
|
2004-06-19 09:31:50 +04:00
|
|
|
set -- $d2
|
|
|
|
shift $s2
|
|
|
|
t2=$1
|
|
|
|
unit=$(($start + $offset - $s1 * $mult))
|
|
|
|
end=$(($unit + 16))
|
|
|
|
while [ "$unit" -lt "$end" ]
|
2003-10-13 13:37:45 +04:00
|
|
|
do
|
2004-06-19 09:31:50 +04:00
|
|
|
mkdev tty$t1$t2 c %pts_chr% $unit 666
|
|
|
|
mkdev pty$t1$t2 c %ptc_chr% $unit 666
|
|
|
|
shift
|
|
|
|
t2=$1
|
|
|
|
if [ -z "$t2" ]
|
|
|
|
then
|
|
|
|
break
|
2003-10-13 13:37:45 +04:00
|
|
|
fi
|
|
|
|
unit=$(($unit + 1))
|
|
|
|
done
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
stic[0-9]*)
|
2003-10-24 12:29:57 +04:00
|
|
|
unit=${i#stic}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev stic$unit c %stic_chr% $unit
|
2003-10-24 12:29:57 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
st[0-9]*)
|
|
|
|
name=st; unit=${i#st}; chr=%st_chr%; blk=%st_blk%
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev $name$unit b $blk $(($unit * 16 + 0)) 660 $g_operator
|
|
|
|
mkdev n$name$unit b $blk $(($unit * 16 + 1)) 660 $g_operator
|
|
|
|
mkdev e$name$unit b $blk $(($unit * 16 + 2)) 660 $g_operator
|
|
|
|
mkdev en$name$unit b $blk $(($unit * 16 + 3)) 660 $g_operator
|
|
|
|
mkdev r$name$unit c $chr $(($unit * 16 + 0)) 660 $g_operator
|
|
|
|
mkdev nr$name$unit c $chr $(($unit * 16 + 1)) 660 $g_operator
|
|
|
|
mkdev er$name$unit c $chr $(($unit * 16 + 2)) 660 $g_operator
|
|
|
|
mkdev enr$name$unit c $chr $(($unit * 16 + 3)) 660 $g_operator
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
ses[0-9]*|ch[0-9]*|uk[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
case $i in
|
2003-12-21 20:37:26 +03:00
|
|
|
ch*) name=ch; unit=${i#ch}; chr=%ch_chr%;;
|
|
|
|
uk*) name=uk; unit=${i#uk}; chr=%uk_chr%;;
|
|
|
|
ses*) name=ses; unit=${i#ses}; chr=%ses_chr%;;
|
2003-10-13 13:37:45 +04:00
|
|
|
esac
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev $name$unit c $chr $unit 640 $g_operator
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
cd[0-9]*)
|
2008-04-15 13:53:58 +04:00
|
|
|
makedisk_minimal cd ${i#cd} %cd_blk% %cd_chr%
|
2003-10-24 12:29:57 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
mcd[0-9]*)
|
2003-10-24 12:29:57 +04:00
|
|
|
makedisk_minimal mcd ${i#mcd} %mcd_blk% %mcd_chr%
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
gdrom[0-9]*)
|
2003-10-24 12:29:57 +04:00
|
|
|
makedisk_minimal gdrom ${i#gdrom} %gdrom_blk% %gdrom_chr%
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
lpt[0-9]*|lpa[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
case $i in
|
2008-04-10 00:19:15 +04:00
|
|
|
lpt*) name=lpt; unit=${i#lpt}; chr=%lpt_chr%; flags=0;;
|
|
|
|
lpa*) name=lpa; unit=${i#lpa}; chr=%lpt_chr%; flags=128;;
|
2003-10-13 13:37:45 +04:00
|
|
|
esac
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev $name$unit c $chr $(($unit + $flags))
|
2004-02-04 00:43:43 +03:00
|
|
|
mkdev lpt${unit}ctl c $chr $(($unit + 256))
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2004-12-02 02:06:57 +03:00
|
|
|
bpf)
|
|
|
|
mkdev bpf c %bpf_chr% 0
|
2005-01-04 18:06:24 +03:00
|
|
|
lndev bpf bpf0
|
2004-12-02 02:06:57 +03:00
|
|
|
;;
|
|
|
|
|
2010-08-22 22:56:18 +04:00
|
|
|
npf)
|
|
|
|
mkdev npf c %npf_chr% 0
|
|
|
|
;;
|
|
|
|
|
2006-09-10 19:45:55 +04:00
|
|
|
bthub)
|
|
|
|
mkdev bthub c %bthub_chr% 0
|
2006-06-19 19:44:33 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
tun[0-9]*)
|
2005-03-12 13:26:45 +03:00
|
|
|
unit=${i#tun}
|
|
|
|
mkdev tun$unit c %tun_chr% $unit
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
joy[0-9]*)
|
2005-03-12 13:26:45 +03:00
|
|
|
unit=${i#joy}
|
|
|
|
mkdev joy$unit c %joy_chr% $unit
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
ipl)
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev ipl c %ipl_chr% 0
|
|
|
|
mkdev ipnat c %ipl_chr% 1
|
|
|
|
mkdev ipstate c %ipl_chr% 2
|
|
|
|
mkdev ipauth c %ipl_chr% 3
|
2006-07-27 10:49:06 +04:00
|
|
|
mkdev ipsync c %ipl_chr% 4
|
|
|
|
mkdev ipscan c %ipl_chr% 5
|
|
|
|
mkdev iplookup c %ipl_chr% 6
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
pf)
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev pf c %pf_chr% 0
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
crypto)
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev crypto c %crypto_chr% 0 666
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2007-02-07 00:27:43 +03:00
|
|
|
cmos)
|
|
|
|
mkdev cmos c %cmos_chr% 0 644
|
|
|
|
;;
|
|
|
|
|
2003-10-13 13:37:45 +04:00
|
|
|
speaker)
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev speaker c %spkr_chr% 0
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2006-09-07 05:18:01 +04:00
|
|
|
lockstat)
|
|
|
|
mkdev lockstat c %lockstat_chr% 0
|
|
|
|
;;
|
|
|
|
|
2007-08-04 15:02:56 +04:00
|
|
|
cpuctl)
|
|
|
|
mkdev cpuctl c %cpuctl_chr% 0 666
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
audio|audio[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#audio}
|
|
|
|
audio=audio$unit
|
|
|
|
sound=sound$unit
|
|
|
|
mixer=mixer$unit
|
|
|
|
audioctl=audioctl$unit
|
2003-12-21 20:37:26 +03:00
|
|
|
: ${unit:-0}
|
2008-04-10 00:19:15 +04:00
|
|
|
mkdev $sound c %audio_chr% $(($unit + 0)) 666
|
|
|
|
mkdev $audio c %audio_chr% $(($unit + 128)) 666
|
|
|
|
mkdev $mixer c %audio_chr% $(($unit + 16)) 666
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev $audioctl c %audio_chr% $(($unit + 192)) 666
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
hdaudio[0-9]*)
|
2009-09-06 21:25:55 +04:00
|
|
|
unit=${i#hdaudio}
|
|
|
|
mkdev hdaudio$unit c %hdaudio_chr% $unit 644
|
|
|
|
;;
|
|
|
|
|
2015-08-02 00:30:09 +03:00
|
|
|
hdmicec[0-9]*)
|
|
|
|
uint=${i#hdmicec}
|
|
|
|
mkdev hdmicec$unit c %hdmicec_chr% $unit 644
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
gpio[0-9]*)
|
2005-09-27 06:44:12 +04:00
|
|
|
unit=${i#gpio}
|
2013-05-19 20:09:04 +04:00
|
|
|
mkdev gpio$unit c %gpio_chr% $unit 664 $g_gpio
|
2005-09-27 06:44:12 +04:00
|
|
|
;;
|
|
|
|
|
2018-05-20 17:08:32 +03:00
|
|
|
gpiopps[0-9]*)
|
|
|
|
unit=${i#gpiopps}
|
|
|
|
mkdev gpiopps$unit c %gpiopps_chr% $unit 664 $g_gpio
|
|
|
|
;;
|
|
|
|
|
2013-10-28 22:33:20 +04:00
|
|
|
lua[0-9]*)
|
|
|
|
unit=${i#lua}
|
|
|
|
mkdev lua$unit c %lua_chr% $unit 664
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
rmidi[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#rmidi}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev rmidi$unit c %midi_chr% $unit 666
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
music|music[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#music}
|
2003-12-21 20:37:26 +03:00
|
|
|
: ${unit:-0}
|
|
|
|
mkdev music$unit c %sequencer_chr% $(($unit + 0)) 666
|
2008-04-10 00:19:15 +04:00
|
|
|
mkdev sequencer$unit c %sequencer_chr% $(($unit + 128)) 666
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
radio|radio[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#radio}
|
2003-12-21 20:37:26 +03:00
|
|
|
: ${unit:-0}
|
|
|
|
mkdev radio$unit c %radio_chr% $unit 666
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
video|video[0-9]*)
|
2008-09-06 23:21:21 +04:00
|
|
|
unit=${i#video}
|
|
|
|
: ${unit:-0}
|
|
|
|
mkdev video$unit c %video_chr% $unit 666
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
dtv[0-9]*)
|
2011-07-09 18:49:28 +04:00
|
|
|
unit=${i#dtv}
|
|
|
|
makedir dvb 755
|
|
|
|
makedir dvb/adapter$unit 755
|
|
|
|
mkdev dvb/adapter$unit/frontend0 c %dtv_chr% $(($unit + 0)) 666
|
|
|
|
mkdev dvb/adapter$unit/demux0 c %dtv_chr% $(($unit + 16)) 666
|
|
|
|
mkdev dvb/adapter$unit/dvr0 c %dtv_chr% $(($unit + 32)) 666
|
|
|
|
;;
|
|
|
|
|
2011-10-02 20:39:45 +04:00
|
|
|
iic[0-9]*)
|
|
|
|
unit=${i#iic}
|
|
|
|
: ${unit:-0}
|
|
|
|
mkdev iic$unit c %iic_chr% $unit 600
|
|
|
|
;;
|
|
|
|
|
2019-02-23 13:43:25 +03:00
|
|
|
spi[0-9]*)
|
|
|
|
unit=${i#spi}
|
|
|
|
: ${unit:-0}
|
|
|
|
mkdev spi$unit c %spi_chr% $unit 600
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
amr[0-9]*)
|
2006-07-23 16:01:25 +04:00
|
|
|
unit=${i#amr}
|
|
|
|
mkdev amr$unit c %amr_chr% $unit
|
|
|
|
;;
|
|
|
|
|
2003-12-21 20:37:26 +03:00
|
|
|
apm)
|
|
|
|
mkdev apm c %apm_chr% 0 644
|
|
|
|
mkdev apmctl c %apm_chr% 8 644
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2003-12-21 20:37:26 +03:00
|
|
|
apm)
|
|
|
|
# hpcmips uses `apmdev_chr' instead of `apm_chr'
|
|
|
|
mkdev apm c %apmdev_chr% 0 644
|
|
|
|
mkdev apmctl c %apmdev_chr% 8 644
|
2003-10-24 12:29:57 +04:00
|
|
|
;;
|
|
|
|
|
2003-10-13 13:37:45 +04:00
|
|
|
random)
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev random c %rnd_chr% 0 444
|
|
|
|
mkdev urandom c %rnd_chr% 1 644
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2007-11-03 22:33:36 +03:00
|
|
|
cfs)
|
|
|
|
makedev cfs0
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
cfs[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#cfs}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev cfs$unit c %vcoda_chr% $unit
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
sysmon)
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev sysmon c %sysmon_chr% 0 644
|
|
|
|
mkdev watchdog c %sysmon_chr% 1 644
|
|
|
|
mkdev power c %sysmon_chr% 2 640
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
scsibus[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#scsibus}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev scsibus$unit c %scsibus_chr% $unit 644
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
bktr)
|
|
|
|
makedev bktr0 bktr1
|
2003-12-21 20:37:26 +03:00
|
|
|
lndev bktr0 bktr
|
|
|
|
lndev tuner0 tuner
|
|
|
|
lndev vbi0 vbi
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
bktr[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#bktr}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev bktr$unit c %bktr_chr% $(($unit + 0)) 444
|
|
|
|
mkdev tuner$unit c %bktr_chr% $(($unit + 16)) 444
|
|
|
|
mkdev vbi$unit c %bktr_chr% $(($unit + 32)) 444
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2006-12-29 22:16:30 +03:00
|
|
|
io)
|
|
|
|
mkdev io c %mem_chr% 14 600
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
iop[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#iop}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev iop$unit c %iop_chr% $unit
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2012-09-20 01:24:28 +04:00
|
|
|
mfi[0-9]*)
|
|
|
|
unit=${i#mfi}
|
|
|
|
mkdev mfi$unit c %mfi_chr% $unit
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
mlx[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#mlx}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev mlx$unit c %mlx_chr% $unit
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
mly[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#mly}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev mly$unit c %mly_chr% $unit
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
twa[0-9]*)
|
2006-09-24 12:23:36 +04:00
|
|
|
unit=${i#twa}
|
|
|
|
mkdev twa$unit c %twa_chr% $unit
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
twe[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#twe}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev twe$unit c %twe_chr% $unit
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
icp[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#icp}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev icp$unit c %icp_chr% $unit
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
agp[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#agp}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev agp$unit c %agp_chr% $unit 644
|
|
|
|
if [ "$unit" = "0" ]; then
|
|
|
|
lndev agp$unit agpgart
|
|
|
|
fi
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
pci[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#pci}
|
2010-09-20 00:52:23 +04:00
|
|
|
mkdev pci$unit c %pci_chr% $unit 640
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
dpti[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#dpti}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev dpti$unit c %dpti_chr% $unit
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
dpt[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#dpt}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev dpt$unit c %dpt_chr% $unit
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
altq)
|
2003-12-21 20:37:26 +03:00
|
|
|
makedir altq 755
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=0
|
2010-03-23 22:22:41 +03:00
|
|
|
for dev in altq cbq wfq afm fifoq red rio localq hfsc cdnr blue priq jobs
|
2003-12-21 20:37:26 +03:00
|
|
|
do
|
|
|
|
mkdev altq/$dev c %altq_chr% $unit 644
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=$(($unit + 1))
|
|
|
|
done
|
|
|
|
;;
|
|
|
|
|
|
|
|
wsfont)
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev wsfont c %wsfont_chr% 0
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
cir[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#cir}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev cir$unit c %cir_chr% $unit 666
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
irframe[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#irframe}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev irframe$unit c %irframe_chr% $unit
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
fcom[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#fcom}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev fcom$unit c %fcom_chr% $unit "" "" $u_uucp
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
openfirm)
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev openfirm c %openfirm_chr% 0 444
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
pad[0-9]*)
|
2007-11-11 20:54:47 +03:00
|
|
|
unit=${i#pad}
|
|
|
|
mkdev pad$unit c %pad_chr% $unit 444
|
|
|
|
;;
|
|
|
|
|
2017-11-25 19:31:03 +03:00
|
|
|
qemufwcfg[0-9]*)
|
|
|
|
unit=${i#qemufwcfg}
|
|
|
|
mkdev qemufwcfg$unit c %qemufwcfg_chr% $unit 660
|
|
|
|
;;
|
|
|
|
|
2019-11-01 05:58:50 +03:00
|
|
|
vio9p[0-9]*)
|
|
|
|
unit=${i#vio9p}
|
|
|
|
mkdev vio9p$unit c %vio9p_chr% $unit 660
|
|
|
|
;;
|
|
|
|
|
2020-06-07 12:45:19 +03:00
|
|
|
fault)
|
|
|
|
mkdev fault c %fault_chr% 0
|
|
|
|
;;
|
|
|
|
|
2003-10-13 13:37:45 +04:00
|
|
|
nvram)
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev nvram c %nvram_chr% 0 644
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
rtc)
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev rtc c %rtc_chr% 0 644
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
clockctl)
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev clockctl c %clockctl_chr% 0 660 $g_ntpd
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
kttcp)
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev kttcp c %kttcp_chr% 0
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
dmoverio)
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev dmoverio c %dmoverio_chr% 0 644
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
veriexec)
|
2005-06-16 19:31:21 +04:00
|
|
|
mkdev veriexec c %veriexec_chr% 0 600
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2020-06-05 20:20:56 +03:00
|
|
|
vhci[0-7]*)
|
|
|
|
unit=${i#vhci}
|
|
|
|
mkdev vhci$unit c %vhci_chr% $unit
|
2019-09-14 09:57:51 +03:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
ttyv[0-9]*)
|
2003-12-21 20:37:26 +03:00
|
|
|
unit=${i#ttyv}
|
|
|
|
mkdev ttyv$unit c %pc_chr% $unit
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2003-12-21 20:37:26 +03:00
|
|
|
# arm, acorn32
|
2011-09-06 14:54:03 +04:00
|
|
|
ttyv[0-9]*)
|
2003-12-21 20:37:26 +03:00
|
|
|
unit=${i#ttyv}
|
|
|
|
mkdev ttyv$unit c %physcon_chr% $unit
|
2003-10-24 12:29:57 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
arcpp[0-9]*)
|
2003-12-21 20:37:26 +03:00
|
|
|
unit=${i#arcpp}
|
|
|
|
mkdev arcpp$unit c %arcpp_chr% $unit
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
par[0-9]*)
|
2003-12-21 20:37:26 +03:00
|
|
|
unit=${i#par}
|
2003-10-13 13:37:45 +04:00
|
|
|
case $unit in
|
|
|
|
0)
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev par$unit c %par_chr% $unit
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
*)
|
2003-12-23 01:26:32 +03:00
|
|
|
warn "bad unit for par in: $i"
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
cpi[0-9]*)
|
2008-05-22 23:49:43 +04:00
|
|
|
unit=${i#cpi}
|
|
|
|
mkdev cpi$unit c %cpi_chr% $unit
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
ite[0-9]*|ttye[0-9]*)
|
2003-10-24 12:29:57 +04:00
|
|
|
case $i in
|
|
|
|
ite*) unit=${i#ite};;
|
|
|
|
ttye*) unit=${i#ttye};;
|
|
|
|
esac
|
2008-04-10 00:19:15 +04:00
|
|
|
mkdev ttye$unit c %ite_chr% $unit
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
pms[0-9]*)
|
2003-10-24 12:29:57 +04:00
|
|
|
unit=${i#pms}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev pms$unit c %opms_chr% $unit
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
qms[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#qms}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev qms$unit c %qms_chr% $unit
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
lms[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#lms}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev lms$unit c %lms_chr% $unit
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
mms[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#mms}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev mms$unit c %mms_chr% $unit
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
mouse-pms[0-9]*|mouse-qms[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
case $i in
|
2003-12-21 20:37:26 +03:00
|
|
|
mouse-pms*) name=pms ;;
|
|
|
|
mouse-qms*) name=qms ;;
|
2003-10-13 13:37:45 +04:00
|
|
|
esac
|
2003-12-21 20:37:26 +03:00
|
|
|
unit=${i#mouse-${name}}
|
|
|
|
lndev $name$unit mouse
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
kbd)
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev kbd c %kbd_chr% 0
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2003-10-24 12:29:57 +04:00
|
|
|
kbdctl)
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev kbdctl c %kbd_chr% 1
|
2003-10-24 12:29:57 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
vidcconsole0)
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev vidcconsole0 c %vidcconsole_chr% 0 640
|
2003-10-24 12:29:57 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
view[0-9]*)
|
2003-12-21 20:37:26 +03:00
|
|
|
unit=${i#view}
|
2008-04-10 00:19:15 +04:00
|
|
|
mkdev view$unit c %view_chr% $unit 666
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
mouse[0-9]*)
|
2003-12-21 20:37:26 +03:00
|
|
|
unit=${i#mouse}
|
2003-10-13 13:37:45 +04:00
|
|
|
case $unit in
|
|
|
|
0|1)
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev mouse$unit c %ms_chr% $unit 666
|
|
|
|
if [ $unit = 0 ]; then
|
|
|
|
lndev mouse$unit mouse
|
2003-10-13 13:37:45 +04:00
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*)
|
2003-12-23 01:26:32 +03:00
|
|
|
warn "bad unit for mouse in: $i"
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
|
|
|
|
panel)
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev panel0 c %panel_chr% 0 660
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2005-01-08 23:32:10 +03:00
|
|
|
tslcd)
|
|
|
|
mkdev tslcd0 c %tslcd_chr% 0 660
|
|
|
|
;;
|
|
|
|
|
2003-10-13 13:37:45 +04:00
|
|
|
ipty)
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev ttyp0 c %pts_chr% 0 666
|
|
|
|
mkdev ttyp1 c %pts_chr% 1 666
|
|
|
|
mkdev ptyp0 c %ptc_chr% 0 666
|
|
|
|
mkdev ptyp1 c %ptc_chr% 1 666
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2004-05-27 06:57:42 +04:00
|
|
|
ptm)
|
2008-07-13 19:22:39 +04:00
|
|
|
makedir pts 755
|
2004-05-27 06:57:42 +04:00
|
|
|
mkdev ptmx c %ptm_chr% 0 666
|
|
|
|
mkdev ptm c %ptm_chr% 1 666
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
grf[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#grf}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev grf$unit c %grf_chr% $unit 666
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
etvme)
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev etvme c %et_chr% 0
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
leo[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#leo}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev leo$unit c %leo_chr% $unit
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
scif[0-9]*)
|
2003-12-21 20:37:26 +03:00
|
|
|
unit=${i#scif}
|
2008-11-17 15:54:57 +03:00
|
|
|
mkdev scif$unit c %scif_chr% $(($unit + $dialin )) "" "" $u_uucp
|
|
|
|
mkdev dscif$unit c %scif_chr% $(($unit + $dialout)) "" "" $u_uucp
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
sci[0-9]*)
|
2003-12-21 20:37:26 +03:00
|
|
|
unit=${i#sci}
|
2008-11-17 15:54:57 +03:00
|
|
|
mkdev sci$unit c %sci_chr% $(($unit + $dialin )) "" "" $u_uucp
|
|
|
|
mkdev dsci$unit c %sci_chr% $(($unit + $dialout)) "" "" $u_uucp
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
maple[ABCD]|maple[ABCD][0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
case $i in
|
|
|
|
mapleA*) name="mapleA"; unit=0;;
|
|
|
|
mapleB*) name="mapleB"; unit=1;;
|
|
|
|
mapleC*) name="mapleC"; unit=2;;
|
|
|
|
mapleD*) name="mapleD"; unit=3;;
|
|
|
|
esac
|
|
|
|
subunit=${i#$name}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev $name$subunit c %maple_chr% $(($unit * 8 + 0$subunit))
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
mmem[0-9]*)
|
2003-12-21 20:37:26 +03:00
|
|
|
unit=${i#mmem}
|
2003-10-13 13:37:45 +04:00
|
|
|
for pt in 0 # 1 2 3 4 ... 255
|
|
|
|
do
|
2003-12-21 20:37:26 +03:00
|
|
|
# mkdev mmem${unit}.${pt}a b %mmem_blk% $(($unit * 4096 + $pt * 16 + 0)) 640 $g_operator
|
|
|
|
mkdev mmem${unit}.${pt}c b %mmem_blk% $(($unit * 4096 + $pt * 16 + 2)) 640 $g_operator
|
|
|
|
# mkdev rmmem${unit}.${pt}a c %mmem_chr% $(($unit * 4096 + $pt * 16 + 0)) 640 $g_operator
|
|
|
|
mkdev rmmem${unit}.${pt}c c %mmem_chr% $(($unit * 4096 + $pt * 16 + 2)) 640 $g_operator
|
2003-10-13 13:37:45 +04:00
|
|
|
done
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
mlcd[0-9]*)
|
2003-12-21 20:37:26 +03:00
|
|
|
unit=${i#mlcd}
|
2003-10-13 13:37:45 +04:00
|
|
|
for pt in 0 # 1 2 3 4 ... 255
|
|
|
|
do
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev mlcd${unit}.${pt} c %mlcd_chr% $(($unit * 256 + $pt)) 640 $g_operator
|
2003-10-13 13:37:45 +04:00
|
|
|
done
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
ixpcom[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#ixpcom}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev ixpcom$unit c %ixpcom_chr% $unit "" "" $u_uucp
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
epcom[0-9]*)
|
2004-12-29 09:36:46 +03:00
|
|
|
unit=${i#epcom}
|
|
|
|
mkdev epcom$unit c %epcom_chr% $unit "" "" $u_uucp
|
2013-01-10 17:38:37 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
plcom[0-9]*)
|
|
|
|
unit=${i#plcom}
|
|
|
|
mkdev plcom$unit c %plcom_chr% $unit "" "" $u_uucp
|
2017-08-12 14:41:21 +03:00
|
|
|
mkdev dplcom$unit c %plcom_chr% $(($unit + $dialout)) "" "" $u_uucp
|
2004-12-29 09:36:46 +03:00
|
|
|
;;
|
|
|
|
|
2013-05-01 17:11:59 +04:00
|
|
|
wmcom[0-9]*)
|
|
|
|
unit=${i#wmcom}
|
|
|
|
mkdev wmcom$unit c %wmcom_chr% $unit "" "" $u_uucp
|
|
|
|
;;
|
|
|
|
|
2003-10-13 13:37:45 +04:00
|
|
|
ucbsnd)
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev ucbsnd c %ucbsnd_chr% 0 666
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
adb)
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev adb c %aed_chr% 0 666
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
asc[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#asc}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev asc$unit c %asc_chr% $unit 666
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
bwtwo[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#bwtwo}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev bwtwo$unit c %bwtwo_chr% $unit 666
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
cgtwo[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#cgtwo}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev cgtwo$unit c %cgtwo_chr% $unit 666
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
cgthree[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#cgthree}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev cgthree$unit c %cgthree_chr% $unit 666
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
cgfour[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#cgfour}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev cgfour$unit c %cgfour_chr% $unit 666
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
cgsix[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#cgsix}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev cgsix$unit c %cgsix_chr% $unit 666
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
cgeight[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#cgeight}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev cgeight$unit c %cgeight_chr% $unit 666
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
tcx[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#tcx}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev tcx$unit c %tcx_chr% $unit 666
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
xd[0-9]*|xy[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
case $i in
|
|
|
|
xd*) name=xd; unit=${i#xd}; blk=%xd_blk%; chr=%xd_chr%;;
|
|
|
|
xy*) name=xy; unit=${i#xy}; blk=%xy_blk%; chr=%xy_chr%;;
|
|
|
|
esac
|
|
|
|
%MKDISK% $name $unit $blk $chr
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
magma[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#magma}
|
2003-12-21 20:37:26 +03:00
|
|
|
if [ 0$unit -gt 3 ]; then
|
2003-12-23 01:26:32 +03:00
|
|
|
warn "bad unit for $i: $unit"
|
2003-10-13 13:37:45 +04:00
|
|
|
break
|
|
|
|
fi
|
|
|
|
for j in 0 1 2 3 4 5 6 7 8 9 a b c d e f
|
|
|
|
do
|
|
|
|
case $j in
|
|
|
|
[0-9]) jn=$j ;;
|
|
|
|
a) jn=10 ;;
|
|
|
|
b) jn=11 ;;
|
|
|
|
c) jn=12 ;;
|
|
|
|
d) jn=13 ;;
|
|
|
|
e) jn=14 ;;
|
|
|
|
f) jn=15 ;;
|
|
|
|
esac
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev tty$unit$j c %mtty_chr% $(($unit * 64 + $jn))
|
2003-10-13 13:37:45 +04:00
|
|
|
done
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev bpp${unit}0 c %mbpp_chr% $(($unit * 64 + 0))
|
|
|
|
mkdev bpp${unit}1 c %mbpp_chr% $(($unit * 64 + 1))
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
clcd[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#clcd}
|
2003-12-21 20:37:26 +03:00
|
|
|
if [ 0$unit -gt 7 ]; then
|
2003-12-23 01:26:32 +03:00
|
|
|
warn "bad unit for $i: $unit"
|
2003-10-13 13:37:45 +04:00
|
|
|
break
|
|
|
|
fi
|
|
|
|
for j in 0 1 2 3 4 5 6 7
|
|
|
|
do
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev ttyA$unit$j c %clcd_chr% $(($unit * 8 + $j + $dialin)) "" "" $u_uucp
|
|
|
|
mkdev dtyA$unit$j c %clcd_chr% $(($unit * 8 + $j + $dialout)) "" "" $u_uucp
|
2003-10-13 13:37:45 +04:00
|
|
|
done
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
spif[0-9]*)
|
2004-08-01 14:43:47 +04:00
|
|
|
unit=${i#spif}
|
|
|
|
if [ 0$unit -gt 3 ]; then
|
|
|
|
warn "bad unit for $i: $unit"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
for j in 0 1 2 3 4 5 6 7; do
|
2012-02-11 00:54:11 +04:00
|
|
|
mkdev ttyS$unit$j c %stty_chr% $(($unit * 64 + $j)) "" "" $u_uucp
|
2004-08-01 14:43:47 +04:00
|
|
|
done
|
2012-02-11 00:54:11 +04:00
|
|
|
mkdev bppS${unit}0 c %sbpp_chr% $(($unit * 64 + 0))
|
|
|
|
mkdev bppS${unit}1 c %sbpp_chr% $(($unit * 64 + 1))
|
2004-08-01 14:43:47 +04:00
|
|
|
;;
|
|
|
|
|
2012-02-11 00:54:11 +04:00
|
|
|
bpp|bpp[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#bpp}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev bpp$unit c %bpp_chr% $(($unit + 0))
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
tctrl[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#tctrl}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev tctrl$unit c %tctrl_chr% $unit 666
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
bmd[0-9]*)
|
2003-12-21 20:37:26 +03:00
|
|
|
unit=${i#bmd}
|
|
|
|
mkdev bmd${unit}a b %bmd_blk% $(($unit * 8 + 0)) 640 $g_operator
|
|
|
|
mkdev bmd${unit}c b %bmd_blk% $(($unit * 8 + 2)) 640 $g_operator
|
|
|
|
mkdev rbmd${unit}a c %bmd_chr% $(($unit * 8 + 0)) 640 $g_operator
|
|
|
|
mkdev rbmd${unit}c c %bmd_chr% $(($unit * 8 + 2)) 640 $g_operator
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
sram)
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev sram c %sram_chr% 0 644
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
ttyS[0-9]*)
|
2003-10-13 13:37:45 +04:00
|
|
|
unit=${i#ttyS}
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev ttyS$unit c %sacom_chr% $(($unit + $dialin )) "" "" $u_uucp
|
|
|
|
mkdev dtyS$unit c %sacom_chr% $(($unit + $dialout)) "" "" $u_uucp
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
atabus[0-9]*)
|
2004-08-02 01:52:09 +04:00
|
|
|
unit=${i#atabus}
|
|
|
|
mkdev atabus$unit c %atabus_chr% $unit 644
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
drm[0-9]*)
|
2009-09-24 18:53:36 +04:00
|
|
|
unit=${i#drm}
|
2021-10-12 20:19:20 +03:00
|
|
|
unit2=$((unit + 128))
|
2009-07-03 10:33:56 +04:00
|
|
|
makedir dri 755
|
2009-09-24 18:53:36 +04:00
|
|
|
mkdev dri/card$unit c %drm_chr% $unit 660
|
2021-10-12 20:19:20 +03:00
|
|
|
mkdev dri/renderD${unit2} c %drm_chr% ${unit2} 660
|
2009-07-03 10:33:56 +04:00
|
|
|
;;
|
|
|
|
|
2004-08-27 21:50:57 +04:00
|
|
|
drvctl)
|
|
|
|
mkdev drvctl c %drvctl_chr% 0 644
|
|
|
|
;;
|
2004-08-02 01:52:09 +04:00
|
|
|
|
2008-04-02 05:34:36 +04:00
|
|
|
isv)
|
|
|
|
mkdev isv c %isv_chr% 0 644
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
tap|tap[0-9]*)
|
2005-01-09 01:31:28 +03:00
|
|
|
unit=${i#tap}
|
|
|
|
case "$unit" in
|
|
|
|
[0-9]*)
|
|
|
|
mkdev tap${unit} c %tap_chr% ${unit} 600
|
|
|
|
;;
|
2011-09-06 14:54:03 +04:00
|
|
|
"")
|
2005-01-09 01:31:28 +03:00
|
|
|
mkdev tap c %tap_chr% 0xfffff 600
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
|
2019-03-26 12:13:55 +03:00
|
|
|
srt[0-9]*)
|
|
|
|
unit=${i#srt}
|
|
|
|
mkdev srt$unit c %srt_chr% $unit 600
|
|
|
|
;;
|
|
|
|
|
2012-01-22 10:44:28 +04:00
|
|
|
tpm)
|
|
|
|
mkdev tpm c %tpm_chr% 0 600
|
|
|
|
;;
|
|
|
|
|
2013-02-28 06:00:27 +04:00
|
|
|
dtrace)
|
|
|
|
makedir dtrace 755
|
|
|
|
mkdev dtrace/dtrace c %dtrace_chr% 0 600
|
|
|
|
;;
|
|
|
|
|
2011-09-06 14:54:03 +04:00
|
|
|
fw[0-9]*)
|
2005-07-11 19:29:05 +04:00
|
|
|
unit=${i#fw}
|
|
|
|
for j in 0 1 2 3
|
|
|
|
do
|
|
|
|
mkdev fw${unit}.${j} c %fw_chr% $((${unit} * 256 + ${j})) 660 ${g_operator}
|
|
|
|
mkdev fwmem${unit}.${j} c %fw_chr% $((65536 + ${unit} * 256 + ${j})) 660 ${g_operator}
|
|
|
|
done
|
|
|
|
;;
|
|
|
|
|
2007-11-13 16:14:25 +03:00
|
|
|
# create putter device and symlinks for all subsystems using it
|
|
|
|
putter)
|
|
|
|
mkdev putter c %putter_chr% 0 600
|
2007-11-20 21:58:46 +03:00
|
|
|
mkdev pud c %putter_chr% 1 600
|
2008-04-10 00:19:15 +04:00
|
|
|
lndev putter puffs
|
2006-10-23 03:02:08 +04:00
|
|
|
;;
|
|
|
|
|
2009-05-24 02:29:14 +04:00
|
|
|
zfs)
|
|
|
|
mkdev zfs c %zfs_chr% 0 600
|
2009-06-15 01:34:15 +04:00
|
|
|
makedir zpool 755
|
2009-05-24 02:29:14 +04:00
|
|
|
;;
|
|
|
|
|
2011-11-19 20:41:55 +04:00
|
|
|
iscsi[0-9]*)
|
|
|
|
unit=${i#iscsi}
|
2019-03-27 09:55:09 +03:00
|
|
|
mkdev iscsi${unit} c %iscsi_chr% $unit 600
|
2011-11-19 20:41:55 +04:00
|
|
|
;;
|
|
|
|
|
2013-03-08 16:33:25 +04:00
|
|
|
vchiq)
|
|
|
|
mkdev vchiq c %vchiq_chr% 0 600
|
|
|
|
;;
|
|
|
|
|
2016-06-04 19:11:50 +03:00
|
|
|
nvme[0-9]*ns[0-9]*)
|
|
|
|
unit=${i#nvme}
|
|
|
|
unit=${unit%ns*}
|
|
|
|
subunit=${i#nvme${unit}ns}
|
2018-09-22 16:48:22 +03:00
|
|
|
if [ 0$subunit -le 0 ] || [ 0$subunit -ge 65536 ]; then
|
2016-06-04 19:11:50 +03:00
|
|
|
warn "bad nsid for $i: $subunit"
|
|
|
|
break
|
|
|
|
fi
|
2016-09-08 18:00:08 +03:00
|
|
|
mkdev nvme${unit}ns$subunit c %nvme_chr% $(($unit * 65536 + $subunit))
|
2016-06-04 19:11:50 +03:00
|
|
|
;;
|
|
|
|
|
|
|
|
nvme[0-9]*)
|
|
|
|
unit=${i#nvme}
|
2016-09-08 18:00:08 +03:00
|
|
|
mkdev nvme$unit c %nvme_chr% $(($unit * 65536))
|
2016-06-04 19:11:50 +03:00
|
|
|
;;
|
|
|
|
|
2018-11-07 10:43:07 +03:00
|
|
|
nvmm)
|
2019-10-27 10:08:15 +03:00
|
|
|
mkdev nvmm c %nvmm_chr% 0 640 $g_nvmm
|
2018-11-07 10:43:07 +03:00
|
|
|
;;
|
|
|
|
|
2018-01-09 06:31:12 +03:00
|
|
|
autofs)
|
|
|
|
mkdev autofs c %autofs_chr% 0 600
|
|
|
|
;;
|
|
|
|
|
2019-02-23 06:10:05 +03:00
|
|
|
kcov)
|
|
|
|
mkdev kcov c %kcov_chr% 0
|
|
|
|
;;
|
|
|
|
|
2019-05-18 11:38:00 +03:00
|
|
|
ipmi[0-9]*)
|
|
|
|
unit=${i#ipmi}
|
|
|
|
mkdev ipmi${unit} c %ipmi_chr% $unit 600
|
|
|
|
;;
|
|
|
|
|
2020-07-26 18:47:27 +03:00
|
|
|
xmm[0-9])
|
|
|
|
unit=${i#xmm}
|
|
|
|
makedir xmm${unit} 755
|
|
|
|
mkdev xmm${unit}/rpc c %wwanc_chr% $(($unit * 65536 + 1))
|
|
|
|
mkdev ttyXMM${unit}0 c %wwanc_chr% $(($unit * 65536 + 2))
|
|
|
|
mkdev ttyXMM${unit}1 c %wwanc_chr% $(($unit * 65536 + 4))
|
|
|
|
;;
|
|
|
|
|
2020-12-06 05:57:29 +03:00
|
|
|
acpi)
|
|
|
|
mkdev acpi c %acpi_chr% 0
|
|
|
|
;;
|
|
|
|
|
2021-07-24 14:39:18 +03:00
|
|
|
smbios)
|
|
|
|
mkdev smbios c %smbios_chr% 0
|
|
|
|
;;
|
|
|
|
|
2021-10-10 16:03:08 +03:00
|
|
|
efi)
|
|
|
|
mkdev efi c %efi_chr% 0 660
|
|
|
|
;;
|
|
|
|
|
2021-11-06 16:34:39 +03:00
|
|
|
sht3xtemp[0-9]*)
|
|
|
|
unit=${i#sht3xtemp}
|
|
|
|
mkdev sht3xtemp$unit c %sht3xtemp_chr% $unit 664
|
|
|
|
;;
|
|
|
|
|
2021-12-07 20:39:53 +03:00
|
|
|
scmd[0-9]*)
|
|
|
|
unit=${i#scmd}
|
|
|
|
mkdev scmd$unit c %scmd_chr% $unit 666
|
|
|
|
;;
|
|
|
|
|
2003-10-13 13:37:45 +04:00
|
|
|
midevend)
|
|
|
|
%MI_DEVICES_END%
|
|
|
|
local)
|
|
|
|
if [ -f "$0.local" ]; then
|
|
|
|
umask 0
|
2007-03-22 02:07:00 +03:00
|
|
|
if [ -n "$count_nodes" ]; then
|
2007-12-08 20:31:12 +03:00
|
|
|
count_nodes=$((count_nodes + \
|
2012-06-05 17:20:01 +04:00
|
|
|
$(linecount "$("$HOST_SH" "$0.local" $opts -s all)") ))
|
2007-03-22 02:07:00 +03:00
|
|
|
else
|
2012-06-05 17:20:01 +04:00
|
|
|
"$HOST_SH" "$0.local" $opts all
|
2007-03-22 02:07:00 +03:00
|
|
|
fi
|
2003-10-13 13:37:45 +04:00
|
|
|
umask 077
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
2003-12-23 01:26:32 +03:00
|
|
|
warn "$i: unknown device"
|
2003-10-13 13:37:45 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2003-12-21 20:37:26 +03:00
|
|
|
|
2003-10-13 13:37:45 +04:00
|
|
|
# three variants of disk partitions - max 8, max 16, max 16 with highpartoffset
|
2003-10-17 23:06:33 +04:00
|
|
|
# hack; only the one used by port is retained in final MAKEDEV script
|
2003-10-13 13:37:45 +04:00
|
|
|
# routine is called as:
|
|
|
|
# makedisk name unit blk chr
|
2003-12-21 20:37:26 +03:00
|
|
|
makedisk_p8()
|
|
|
|
{
|
2003-10-13 13:37:45 +04:00
|
|
|
name="$1"; unit="$2"; blk="$3"; chr="$4"
|
|
|
|
|
2016-06-16 18:33:38 +03:00
|
|
|
ro=%RAWDISK_OFF%
|
|
|
|
mkdev ${name}${unit} b $blk $(($unit * 8 + $ro)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit} c $chr $(($unit * 8 + $ro)) 640 $g_operator
|
|
|
|
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev ${name}${unit}a b $blk $(($unit * 8 + 0)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}b b $blk $(($unit * 8 + 1)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}c b $blk $(($unit * 8 + 2)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}d b $blk $(($unit * 8 + 3)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}e b $blk $(($unit * 8 + 4)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}f b $blk $(($unit * 8 + 5)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}g b $blk $(($unit * 8 + 6)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}h b $blk $(($unit * 8 + 7)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}a c $chr $(($unit * 8 + 0)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}b c $chr $(($unit * 8 + 1)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}c c $chr $(($unit * 8 + 2)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}d c $chr $(($unit * 8 + 3)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}e c $chr $(($unit * 8 + 4)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}f c $chr $(($unit * 8 + 5)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}g c $chr $(($unit * 8 + 6)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}h c $chr $(($unit * 8 + 7)) 640 $g_operator
|
2003-10-13 13:37:45 +04:00
|
|
|
}
|
2003-12-21 20:37:26 +03:00
|
|
|
|
2013-04-11 23:13:46 +04:00
|
|
|
makedisk_p12high()
|
|
|
|
{
|
|
|
|
ho=524280 # offset for partition 9 to 11 (same as ...p16high)
|
|
|
|
name="$1"; unit="$2"; blk="$3"; chr="$4"
|
|
|
|
|
2016-06-16 18:33:38 +03:00
|
|
|
ro=%RAWDISK_OFF%
|
|
|
|
mkdev ${name}${unit} b $blk $(($unit * 8 + $ro)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit} c $chr $(($unit * 8 + $ro)) 640 $g_operator
|
|
|
|
|
2013-04-11 23:13:46 +04:00
|
|
|
mkdev ${name}${unit}a b $blk $(($unit * 8 + 0)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}b b $blk $(($unit * 8 + 1)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}c b $blk $(($unit * 8 + 2)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}d b $blk $(($unit * 8 + 3)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}e b $blk $(($unit * 8 + 4)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}f b $blk $(($unit * 8 + 5)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}g b $blk $(($unit * 8 + 6)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}h b $blk $(($unit * 8 + 7)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}i b $blk $(($unit * 8 + $ho + 8)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}j b $blk $(($unit * 8 + $ho + 9)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}k b $blk $(($unit * 8 + $ho + 10)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}l b $blk $(($unit * 8 + $ho + 11)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}a c $chr $(($unit * 8 + 0)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}b c $chr $(($unit * 8 + 1)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}c c $chr $(($unit * 8 + 2)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}d c $chr $(($unit * 8 + 3)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}e c $chr $(($unit * 8 + 4)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}f c $chr $(($unit * 8 + 5)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}g c $chr $(($unit * 8 + 6)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}h c $chr $(($unit * 8 + 7)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}i c $chr $(($unit * 8 + $ho + 8)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}j c $chr $(($unit * 8 + $ho + 9)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}k c $chr $(($unit * 8 + $ho + 10)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}l c $chr $(($unit * 8 + $ho + 11)) 640 $g_operator
|
|
|
|
}
|
|
|
|
|
2003-12-21 20:37:26 +03:00
|
|
|
makedisk_p16()
|
|
|
|
{
|
2003-10-13 13:37:45 +04:00
|
|
|
name="$1"; unit="$2"; blk="$3"; chr="$4"
|
|
|
|
|
2016-06-16 18:33:38 +03:00
|
|
|
ro=%RAWDISK_OFF%
|
|
|
|
mkdev ${name}${unit} b $blk $(($unit * 16 + $ro)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit} c $chr $(($unit * 16 + $ro)) 640 $g_operator
|
|
|
|
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev ${name}${unit}a b $blk $(($unit * 16 + 0)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}b b $blk $(($unit * 16 + 1)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}c b $blk $(($unit * 16 + 2)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}d b $blk $(($unit * 16 + 3)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}e b $blk $(($unit * 16 + 4)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}f b $blk $(($unit * 16 + 5)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}g b $blk $(($unit * 16 + 6)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}h b $blk $(($unit * 16 + 7)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}i b $blk $(($unit * 16 + 8)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}j b $blk $(($unit * 16 + 9)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}k b $blk $(($unit * 16 + 10)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}l b $blk $(($unit * 16 + 11)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}m b $blk $(($unit * 16 + 12)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}n b $blk $(($unit * 16 + 13)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}o b $blk $(($unit * 16 + 14)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}p b $blk $(($unit * 16 + 15)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}a c $chr $(($unit * 16 + 0)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}b c $chr $(($unit * 16 + 1)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}c c $chr $(($unit * 16 + 2)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}d c $chr $(($unit * 16 + 3)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}e c $chr $(($unit * 16 + 4)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}f c $chr $(($unit * 16 + 5)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}g c $chr $(($unit * 16 + 6)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}h c $chr $(($unit * 16 + 7)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}i c $chr $(($unit * 16 + 8)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}j c $chr $(($unit * 16 + 9)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}k c $chr $(($unit * 16 + 10)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}l c $chr $(($unit * 16 + 11)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}m c $chr $(($unit * 16 + 12)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}n c $chr $(($unit * 16 + 13)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}o c $chr $(($unit * 16 + 14)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}p c $chr $(($unit * 16 + 15)) 640 $g_operator
|
2003-10-13 13:37:45 +04:00
|
|
|
}
|
2003-12-21 20:37:26 +03:00
|
|
|
|
|
|
|
makedisk_p16high()
|
|
|
|
{
|
|
|
|
ho=524280 # offset for partition 9 to 16
|
2003-10-13 13:37:45 +04:00
|
|
|
name="$1"; unit="$2"; blk="$3"; chr="$4"
|
|
|
|
|
2016-06-16 18:33:38 +03:00
|
|
|
ro=%RAWDISK_OFF%
|
|
|
|
mkdev ${name}${unit} b $blk $(($unit * 8 + $ro)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit} c $chr $(($unit * 8 + $ro)) 640 $g_operator
|
|
|
|
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev ${name}${unit}a b $blk $(($unit * 8 + 0)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}b b $blk $(($unit * 8 + 1)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}c b $blk $(($unit * 8 + 2)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}d b $blk $(($unit * 8 + 3)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}e b $blk $(($unit * 8 + 4)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}f b $blk $(($unit * 8 + 5)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}g b $blk $(($unit * 8 + 6)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}h b $blk $(($unit * 8 + 7)) 640 $g_operator
|
2008-04-10 00:19:15 +04:00
|
|
|
mkdev ${name}${unit}i b $blk $(($unit * 8 + $ho + 8)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}j b $blk $(($unit * 8 + $ho + 9)) 640 $g_operator
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev ${name}${unit}k b $blk $(($unit * 8 + $ho + 10)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}l b $blk $(($unit * 8 + $ho + 11)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}m b $blk $(($unit * 8 + $ho + 12)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}n b $blk $(($unit * 8 + $ho + 13)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}o b $blk $(($unit * 8 + $ho + 14)) 640 $g_operator
|
|
|
|
mkdev ${name}${unit}p b $blk $(($unit * 8 + $ho + 15)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}a c $chr $(($unit * 8 + 0)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}b c $chr $(($unit * 8 + 1)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}c c $chr $(($unit * 8 + 2)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}d c $chr $(($unit * 8 + 3)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}e c $chr $(($unit * 8 + 4)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}f c $chr $(($unit * 8 + 5)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}g c $chr $(($unit * 8 + 6)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}h c $chr $(($unit * 8 + 7)) 640 $g_operator
|
2008-04-10 00:19:15 +04:00
|
|
|
mkdev r${name}${unit}i c $chr $(($unit * 8 + $ho + 8)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}j c $chr $(($unit * 8 + $ho + 9)) 640 $g_operator
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev r${name}${unit}k c $chr $(($unit * 8 + $ho + 10)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}l c $chr $(($unit * 8 + $ho + 11)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}m c $chr $(($unit * 8 + $ho + 12)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}n c $chr $(($unit * 8 + $ho + 13)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}o c $chr $(($unit * 8 + $ho + 14)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}p c $chr $(($unit * 8 + $ho + 15)) 640 $g_operator
|
2003-10-13 13:37:45 +04:00
|
|
|
}
|
|
|
|
|
2003-10-24 12:29:57 +04:00
|
|
|
# make only the very few basic disk device nodes - 'a' partition
|
|
|
|
# and raw partition
|
2003-12-21 20:37:26 +03:00
|
|
|
makedisk_minimal()
|
|
|
|
{
|
2003-10-24 12:29:57 +04:00
|
|
|
name=$1; unit=$2; blk=$3; chr=$4
|
|
|
|
doff=%DISKMINOROFFSET%
|
2003-12-21 20:37:26 +03:00
|
|
|
ro=%RAWDISK_OFF%
|
|
|
|
rn=%RAWDISK_NAME%
|
|
|
|
|
2016-06-16 18:33:38 +03:00
|
|
|
mkdev ${name}${unit} b $blk $(($unit * $doff + $ro)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit} c $chr $(($unit * $doff + $ro)) 640 $g_operator
|
|
|
|
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev ${name}${unit}a b $blk $(($unit * $doff + 0)) 640 $g_operator
|
2008-04-10 00:19:15 +04:00
|
|
|
mkdev ${name}${unit}$rn b $blk $(($unit * $doff + $ro)) 640 $g_operator
|
2003-12-21 20:37:26 +03:00
|
|
|
mkdev r${name}${unit}a c $chr $(($unit * $doff + 0)) 640 $g_operator
|
|
|
|
mkdev r${name}${unit}$rn c $chr $(($unit * $doff + $ro)) 640 $g_operator
|
2003-10-24 12:29:57 +04:00
|
|
|
}
|
|
|
|
|
2007-12-16 00:33:13 +03:00
|
|
|
# create_mfs_dev nodes
|
2008-04-10 00:19:15 +04:00
|
|
|
# Create a memory file system for a given number of device nodes,
|
|
|
|
# and mount it. Attempts to use mount_tmpfs, or falls back to
|
|
|
|
# mount_mfs.
|
2007-12-16 00:33:13 +03:00
|
|
|
#
|
2008-04-10 00:19:15 +04:00
|
|
|
# If do_redirect, then also redirect output to the console.
|
2007-12-16 00:33:13 +03:00
|
|
|
#
|
2007-03-03 00:29:23 +03:00
|
|
|
create_mfs_dev()
|
|
|
|
{
|
2007-12-16 00:33:13 +03:00
|
|
|
ndevnodes=${1-1200}
|
2007-03-03 00:29:23 +03:00
|
|
|
dev_mountpoint=${PWD:-/dev}
|
2007-03-21 06:39:41 +03:00
|
|
|
|
2007-12-16 00:33:13 +03:00
|
|
|
# Number of inodes is the specified number of device nodes, plus
|
|
|
|
# a margin to allow for extra device nodes created later.
|
|
|
|
ninode=$((ndevnodes * 11 / 10))
|
|
|
|
# Add 2 reserved inodes (needed for both mfs and tmpfs), and round
|
|
|
|
# up to a multiple of 32 (needed for mfs, not needed for tmpfs).
|
|
|
|
ninode=$(( (ninode + 2 + 31) / 32 * 32 ))
|
|
|
|
# Try tmpfs; if that fails try mfs.
|
2008-11-28 19:04:31 +03:00
|
|
|
#
|
|
|
|
# For tmpfs, allocate 16KB and 512 byte per node.
|
|
|
|
# Actual requirements are much lower, but the size limit
|
|
|
|
# is only intended to avoid accidental writing to /dev.
|
|
|
|
fs_bytes=$((16384 + ninode * 512))
|
2007-12-16 19:09:27 +03:00
|
|
|
if mount_tmpfs -s $fs_bytes -n $ninode -m 0755 \
|
2007-12-16 00:33:13 +03:00
|
|
|
-o union tmpfs "$dev_mountpoint"
|
|
|
|
then
|
2008-11-28 19:04:31 +03:00
|
|
|
fstype=tmpfs
|
2007-12-16 00:33:13 +03:00
|
|
|
else
|
2008-11-28 19:04:31 +03:00
|
|
|
# This file system size calculation is exact for mount_mfs(8)
|
|
|
|
# with 512-byte sectors. 40960 bytes (80 blocks) is the
|
|
|
|
# minimum size allowed by mount_mfs.
|
|
|
|
fs_bytes=$((8192 + 2 * 8192 + 4096 + ninode*512 + 8192))
|
|
|
|
[ "$fs_bytes" -lt 40960 ] && fs_bytes=40960
|
|
|
|
fs_blocks=$((fs_bytes/512))
|
|
|
|
if mount_mfs -b 4096 -f 512 -s $fs_blocks -n $ninode -p 0755 \
|
|
|
|
-o union swap "$dev_mountpoint"
|
|
|
|
then
|
|
|
|
fstype=mfs
|
|
|
|
else
|
|
|
|
die "Failed to create memory file system"
|
|
|
|
fi
|
2007-12-16 00:33:13 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Our current directory was in the lower file system; change it to
|
|
|
|
# the newly mounted upper file system.
|
|
|
|
cd "$dev_mountpoint"
|
|
|
|
|
2007-03-11 18:52:30 +03:00
|
|
|
if $do_redirect; then
|
|
|
|
# Redirect stdout and stderr to console
|
2013-02-10 18:54:33 +04:00
|
|
|
${MKNOD} -m 600 -g 0 -u 0 temp_console c %CONSOLE_CMAJOR% 0
|
2007-03-11 18:52:30 +03:00
|
|
|
exec >temp_console 2>&1
|
|
|
|
rm temp_console
|
|
|
|
fi
|
2007-12-16 00:33:13 +03:00
|
|
|
|
|
|
|
echo "Created $fstype $dev_mountpoint" \
|
2008-11-28 19:04:31 +03:00
|
|
|
"($fs_bytes byte, $ninode inodes)"
|
2007-03-21 06:39:41 +03:00
|
|
|
}
|
2007-03-03 00:29:23 +03:00
|
|
|
|
2007-02-26 23:44:03 +03:00
|
|
|
#
|
2007-03-03 09:36:00 +03:00
|
|
|
# MAIN: If MAKEDEV_AS_LIBRARY is set, then we are being used as a
|
2007-12-08 20:52:34 +03:00
|
|
|
# function library, so just return. Otherwise, do all the real work.
|
2007-02-26 23:44:03 +03:00
|
|
|
#
|
2007-03-03 09:36:00 +03:00
|
|
|
[ -n "${MAKEDEV_AS_LIBRARY}" ] && return
|
2007-12-15 20:28:09 +03:00
|
|
|
makedev_main makedev ${1+"$@"}
|