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