Here is an example rule which matches a single attribute from sysfs.
这里有一个匹配sysfs中单个属性例子。
Sysfs is actually a very simple structure. It is logically divided into directories.
sysfs实际上是一个非常简单的结构,逻辑上以目录形式区分。
A number of similar file systems are already present, for example, procfs, sysfs, or mqueue.
现在存在很多类似的文件系统,例如procfs、sysfs或mqueue。
ATTRS - match a sysfs attribute of the device, or a sysfs attribute of any of the parent devices.
ATTRS-匹配设备的sysfs属性,或任何它的上级设备的sysfs属性。
sysfs, which gives a userspace representation of the system's device model, has been introduced in 2.5.
在2.5中引入了sys文件系统,它给出了系统的设备模型的用户空间描述。
All you need to know is the sysfs device path of the device in question. A trimmed example is shown below.
只需要知道一个设备的sysfs设备路径。
This process begins by removing the module from the various lists that it was placed on during installation (sysfs, module list, and so on).
首先,从安装期间添加的各种列表中(系统文件、模块列表等)删除模块。
The Linux kernel actually represents devices in a tree-like structure, and this information is exposed through sysfs and useful when writing rules.
linux内核实际上以树状结构展示设备,这种树状关系可以通过sysfs查看,在编写我们自己的规则时这非常有用。
Many drivers export information like this into sysfs, and udev allows us to incorporate sysfs-matching into our rules, using the ATTR key with a slightly different syntax.
许多驱动程序会导出这些信息到sysfs,udev允许我们使用ATTR键通过稍捎不同的语法来合并sysfs匹配到自己的规则中。
Although this serves as a useful introduction as to the structure of sysfs and exactly how udev matches values, manually trawling through sysfs is both time consuming and unnecessary.
虽然这对于关于sysfs的结构和udev如何匹配值的介绍很有用,但手工对sysfs的梳理是个既耗时也没必要的事。
When you write rules based on sysfs information, you are simply matching attribute contents of some files in one part of the chain. For example, I can read the size of my hard disk as follows.
当我们编写基于sysfs信息的规则时,只是简单的匹配链条上一部分文件的属性内容。
When you write rules based on sysfs information, you are simply matching attribute contents of some files in one part of the chain. For example, I can read the size of my hard disk as follows.
当我们编写基于sysfs信息的规则时,只是简单的匹配链条上一部分文件的属性内容。
应用推荐