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