05-udev-early.txt 1.5 KB

123456789101112131415161718192021222324252627282930313233
  1. Purpose of rules file:
  2. The kernel does not always fully populate a given kobject's attributes before
  3. sending the uevent for that kobject. This means that a given sysfs directory
  4. may not have all the required files in it (each directory corresponds to a
  5. kobject, and each file corresponds to an attribute).
  6. Therefore, we must sometimes wait for attributes to show up when devices are
  7. discovered. This is accomplished by udev's WAIT_FOR_SYSFS rule types.
  8. Description of rules:
  9. All rules in this file match ACTION="add", because none of them apply when
  10. devices are being removed.
  11. SUBSYSTEM is the kernel subsystem that the device uses. Current kernels have
  12. some issues with SCSI device attributes being created too late. For any device
  13. with a SUBSYSTEM of scsi, we must wait for the ioerr_cnt attribute. (This is
  14. the last attribute created for SCSI devices, so when this attribute appears,
  15. the kobject is fully populated.)
  16. It is also possible to use SUBSYSTEMS in Udev rules. Using SUBSYSTEMS would
  17. cause Udev to search up the device tree for a matching SUBSYSTEM value. (Note
  18. that "the device tree" is not necessarily the same as the path under /sys (the
  19. DEVPATH). Rather, "up the device tree" is the path followed by udevinfo when
  20. it is given the argument "-a".)
  21. We do not use SUBSYSTEMS in this rule, because we only care about the SUBSYSTEM
  22. of the kobject in question. We don't care about devices that are children of
  23. SCSI devices, only the SCSI device itself. We will use SUBSYSTEMS in later
  24. rules, though.