/etc/devfsd.conf - the main configuration file for devfsd.
Compatibility entries, the following will create symbolic links from /dev/misc/device to /dev/device on node registration and remove them on unregistration:
REGISTER misc MKOLDCOMPAT
UNREGISTER misc RMOLDCOMPAT
The following means to ignore any REGISTER or CHANGE entries occurring later in the file for devices matching the regex ^pt[sy]/.*:
REGISTER ^pt[sy]/.* IGNORE
CHANGE ^pt[sy]/.* IGNORE
CREATE ^pt[sy]/.* IGNORE
This will copy the state of entries to /dev-state when it changes, and copy it back next time the device driver registers the node:
REGISTER .* COPY /dev-state/$devname $devpath
CHANGE .* COPY $devpath /dev-state/$devname
CREATE .* COPY $devpath /dev-state/$devname
This runs modprobe on any LOOKUP operation, this means that any call to stat("/dev/foo", ...) will result in modprobe /dev/foo being run:
LOOKUP .* MODLOAD
This runs the partx command to tell the kernel about the partitioning of an IDE or SCSI hard disk when one of the partitions is accessed for the first time. Notice the use of regular expression substituation in the command "\1", corresponding to the first set of parentheses in the regular expression being matched (yes, the backslashes are syntactically necesary for the special meaning of the parentheses, the vertical bar and the plus sign).
LOOKUP ^\(\(ide\|scsi\)/host[0-9]\+/bus[0-9]\+/target[0-9]\+/lun[0-9]\+\)/part[0-9]\+$ EXECUTE /sbin/partx -a $mntpnt/\1/disc
This calls the GLOBAL function to create a symlink from /dev/tts/0 to /dev/ttyS0 and also to /dev/modem, the links will be removed at device unregistration time. The order of link creation is the reverse of the order in the config file. Typically the GLOBAL functions are in libc.
REGISTER ^tts/0$ CFUNCTION GLOBAL symlink $devname modem
REGISTER ^tts/3$ CFUNCTION GLOBAL symlink $devname ttyS0
UNREGISTER ^tts/0$ CFUNCTION GLOBAL unlink modem
UNREGISTER ^tts/3$ CFUNCTION GLOBAL unlink ttyS0
The other use of CFUNCTION and MFUNCTION is to call a function in a shared object that devfsd will load. See the examples directory for code for some shared objects.
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |