sysfs-uevent 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. What: /sys/.../uevent
  2. Date: May 2017
  3. KernelVersion: 4.13
  4. Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org>
  5. Description:
  6. Enable passing additional variables for synthetic uevents that
  7. are generated by writing /sys/.../uevent file.
  8. Recognized extended format is::
  9. ACTION [UUID [KEY=VALUE ...]
  10. The ACTION is compulsory - it is the name of the uevent
  11. action (``add``, ``change``, ``remove``). There is no change
  12. compared to previous functionality here. The rest of the
  13. extended format is optional.
  14. You need to pass UUID first before any KEY=VALUE pairs.
  15. The UUID must be in ``xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx``
  16. format where 'x' is a hex digit. The UUID is considered to be
  17. a transaction identifier so it's possible to use the same UUID
  18. value for one or more synthetic uevents in which case we
  19. logically group these uevents together for any userspace
  20. listeners. The UUID value appears in uevent as
  21. ``SYNTH_UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`` environment
  22. variable.
  23. If UUID is not passed in, the generated synthetic uevent gains
  24. ``SYNTH_UUID=0`` environment variable automatically.
  25. The KEY=VALUE pairs can contain alphanumeric characters only.
  26. It's possible to define zero or more pairs - each pair is then
  27. delimited by a space character ' '. Each pair appears in
  28. synthetic uevent as ``SYNTH_ARG_KEY=VALUE``. That means the KEY
  29. name gains ``SYNTH_ARG_`` prefix to avoid possible collisions
  30. with existing variables.
  31. Example of valid sequence written to the uevent file::
  32. add fe4d7c9d-b8c6-4a70-9ef1-3d8a58d18eed A=1 B=abc
  33. This generates synthetic uevent including these variables::
  34. ACTION=add
  35. SYNTH_ARG_A=1
  36. SYNTH_ARG_B=abc
  37. SYNTH_UUID=fe4d7c9d-b8c6-4a70-9ef1-3d8a58d18eed
  38. Users:
  39. udev, userspace tools generating synthetic uevents