LFS Devfs
Description
In the /dev directory are the device nodes for the access to all devices (e.g. hard drives, mice, sound cards). There are two different types, character devices (unbuffered I/O) and block devices (buffered I/O). Those device node are normally created with MAKEDEV, without a node, no access to the device is possible.
This is the reason why there could be thousands of files in the /dev directory without corresponding devices connected to the computer.
The DevFS filesystem on the other hand creates those device nodes dynamically, MAKEDEV is not necessary anymore and only needed device files are in the /dev directory. And there is now also a logical directory hierarchy structure.
Installation
Kernel with DevFS support
A kernel with support for the DevFS filesystem (CONFIG_DEVFS_FS=y) is required
File systems ---> Pseudo filesystems ---> [X] /dev file system support
This option is not activated by default.
The options
[ ] Automatically mount at boot [ ] Debug devfs
should NOT be activated
The rest of the kernel is configured, compiled and installed as normal.
Devfsd
Devfsd
cd $SOURCEDIR tar xvfz devfsd-v<VERSION>.tar.gz cd devfsd-v<VERSION> make make install
Configuration
After the installation of devfsd, the /etc/devfsd.conf should customised to the system.
The devfsd should be started at system startup and that as early as possible. Der devfsd muss mit dem System gestartet werden, und zwar möglichst früh. Nur so kann auf gebräuchliche
Here is an example for a /etc/rc.d/init.d/devfsd
#!/bin/sh # begin of /etc/rc.d/init.d/devfsd # # startet den Daemon für das virtuelle /dev Dateisystem source /etc/sysconfig/rc source $rc_functions case "$1" in start) echo "Starte devfs Daemon " /sbin/devfsd /dev evaluate_retval ;; stop) echo "Stoppe devfs Daemon " #evaluate_retval ;; status) echo "$0 Status: not implemented" ;; *) echo "Usage: $0 {start|stop|status}" exit 1 ;; esac test "$return" = "$rc_done" || exit 1 exit 0
Anschließend noch ein Link:
ln -sf /etc/rc.d/init.d/devfsd /etc/rc.d/rcsysinit.d/S00devfsd
Problems
- Some (very rare) drivers do not support DevFS, they have to be configured through the /etc/devfsd.conf
Links
[1] | http://www.atnf.csiro.au/people/rgooch/linux/docs/devfs.html | The FAQ for DevFS |
[2] | http://www.atnf.csiro.au/people/rgooch/linux | Richard Goochs Webpage |