| 123456789101112131415161718192021222324252627282930313233 | Purpose of rules file:The kernel does not always fully populate a given kobject's attributes beforesending the uevent for that kobject.  This means that a given sysfs directorymay not have all the required files in it (each directory corresponds to akobject, and each file corresponds to an attribute).Therefore, we must sometimes wait for attributes to show up when devices arediscovered.  This is accomplished by udev's WAIT_FOR_SYSFS rule types.Description of rules:All rules in this file match ACTION="add", because none of them apply whendevices are being removed.SUBSYSTEM is the kernel subsystem that the device uses.  Current kernels havesome issues with SCSI device attributes being created too late.  For any devicewith a SUBSYSTEM of scsi, we must wait for the ioerr_cnt attribute.  (This isthe last attribute created for SCSI devices, so when this attribute appears,the kobject is fully populated.)It is also possible to use SUBSYSTEMS in Udev rules.  Using SUBSYSTEMS wouldcause Udev to search up the device tree for a matching SUBSYSTEM value.  (Notethat "the device tree" is not necessarily the same as the path under /sys (theDEVPATH).  Rather, "up the device tree" is the path followed by udevinfo whenit is given the argument "-a".)We do not use SUBSYSTEMS in this rule, because we only care about the SUBSYSTEMof the kobject in question.  We don't care about devices that are children ofSCSI devices, only the SCSI device itself.  We will use SUBSYSTEMS in laterrules, though.
 |