Back to home page

OSCL-LXR

 
 

    


0001 What:           /sys/.../uevent
0002 Date:           May 2017
0003 KernelVersion:  4.13
0004 Contact:        Linux kernel mailing list <linux-kernel@vger.kernel.org>
0005 Description:
0006                 Enable passing additional variables for synthetic uevents that
0007                 are generated by writing /sys/.../uevent file.
0008 
0009                 Recognized extended format is::
0010 
0011                         ACTION [UUID [KEY=VALUE ...]
0012 
0013                 The ACTION is compulsory - it is the name of the uevent
0014                 action (``add``, ``change``, ``remove``). There is no change
0015                 compared to previous functionality here. The rest of the
0016                 extended format is optional.
0017 
0018                 You need to pass UUID first before any KEY=VALUE pairs.
0019                 The UUID must be in ``xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx``
0020                 format where 'x' is a hex digit. The UUID is considered to be
0021                 a transaction identifier so it's possible to use the same UUID
0022                 value for one or more synthetic uevents in which case we
0023                 logically group these uevents together for any userspace
0024                 listeners. The UUID value appears in uevent as
0025                 ``SYNTH_UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`` environment
0026                 variable.
0027 
0028                 If UUID is not passed in, the generated synthetic uevent gains
0029                 ``SYNTH_UUID=0`` environment variable automatically.
0030 
0031                 The KEY=VALUE pairs can contain alphanumeric characters only.
0032 
0033                 It's possible to define zero or more pairs - each pair is then
0034                 delimited by a space character ' '. Each pair appears in
0035                 synthetic uevent as ``SYNTH_ARG_KEY=VALUE``. That means the KEY
0036                 name gains ``SYNTH_ARG_`` prefix to avoid possible collisions
0037                 with existing variables.
0038 
0039                 Example of valid sequence written to the uevent file::
0040 
0041                     add fe4d7c9d-b8c6-4a70-9ef1-3d8a58d18eed A=1 B=abc
0042 
0043                 This generates synthetic uevent including these variables::
0044 
0045                     ACTION=add
0046                     SYNTH_ARG_A=1
0047                     SYNTH_ARG_B=abc
0048                     SYNTH_UUID=fe4d7c9d-b8c6-4a70-9ef1-3d8a58d18eed
0049 
0050 Users:
0051                 udev, userspace tools generating synthetic uevents