The sysfs File System sys

The system file system is designed to hold detailed information about system devices. This information can be used by hotplug tools like udev to create device interfaces as they are needed. Instead of having a static and complete manual configuration for a device, the sysfs system is used to maintain configuration information about the device, which is then used as needed by the hotplugging system to create device interfaces when a device is attached to the system. More and more devices are now removable, and many are meant to be attached temporarily (cameras, for example). Instead of maintaining separate static and dynamic methods for configuring devices, Red Hat Enterprise and Fedora make all devices structurally hotplugged.

The sysfs file system is a virtual file system that provides the a hierarchical map of your kernel-supported devices such as PCI devices, buses, and block devices, as well as supporting kernel modules. The classes subdirectory will list all your supported devices by category, such as net and sound devices. With sysfs your system can easily determine the device file a particular device is associated with. This is very helpful for managing removable devices as well as dynamically managing and configuring devices as HAL and udev do. The sysfs file system is used by udev to dynamically generate needed device files in the /dev directory, as well as by HAL to manage removable device files as needed. The /sys file system type is sysfs. The /sys subdirectories organize your devices into different categories. The file system is used by systool to display a listing of your installed devices. The tool is part of the sysfsutils package. The following example will list all your system devices.

systool

Like /proc, the /sys directory resides only in memory, but it is still mounted in the /etc/fstab file. Fedora will include such an entry for you.

none /sys sysfs defaults 0 0

0 0

Post a comment