1f36776faSPeter RajnohaWhat: /sys/.../uevent 2f36776faSPeter RajnohaDate: May 2017 3e622ec57SPeter RajnohaKernelVersion: 4.13 4f36776faSPeter RajnohaContact: Linux kernel mailing list <linux-kernel@vger.kernel.org> 5f36776faSPeter RajnohaDescription: 6f36776faSPeter Rajnoha Enable passing additional variables for synthetic uevents that 7f36776faSPeter Rajnoha are generated by writing /sys/.../uevent file. 8f36776faSPeter Rajnoha 9906e4af9SMauro Carvalho Chehab Recognized extended format is:: 10f36776faSPeter Rajnoha 11906e4af9SMauro Carvalho Chehab ACTION [UUID [KEY=VALUE ...] 12906e4af9SMauro Carvalho Chehab 13906e4af9SMauro Carvalho Chehab The ACTION is compulsory - it is the name of the uevent 14906e4af9SMauro Carvalho Chehab action (``add``, ``change``, ``remove``). There is no change 15906e4af9SMauro Carvalho Chehab compared to previous functionality here. The rest of the 16906e4af9SMauro Carvalho Chehab extended format is optional. 17f36776faSPeter Rajnoha 18f36776faSPeter Rajnoha You need to pass UUID first before any KEY=VALUE pairs. 19906e4af9SMauro Carvalho Chehab The UUID must be in ``xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`` 20f36776faSPeter Rajnoha format where 'x' is a hex digit. The UUID is considered to be 21f36776faSPeter Rajnoha a transaction identifier so it's possible to use the same UUID 22f36776faSPeter Rajnoha value for one or more synthetic uevents in which case we 23f36776faSPeter Rajnoha logically group these uevents together for any userspace 24f36776faSPeter Rajnoha listeners. The UUID value appears in uevent as 25906e4af9SMauro Carvalho Chehab ``SYNTH_UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`` environment 26f36776faSPeter Rajnoha variable. 27f36776faSPeter Rajnoha 28f36776faSPeter Rajnoha If UUID is not passed in, the generated synthetic uevent gains 29906e4af9SMauro Carvalho Chehab ``SYNTH_UUID=0`` environment variable automatically. 30f36776faSPeter Rajnoha 31f36776faSPeter Rajnoha The KEY=VALUE pairs can contain alphanumeric characters only. 32906e4af9SMauro Carvalho Chehab 33f36776faSPeter Rajnoha It's possible to define zero or more pairs - each pair is then 34f36776faSPeter Rajnoha delimited by a space character ' '. Each pair appears in 35906e4af9SMauro Carvalho Chehab synthetic uevent as ``SYNTH_ARG_KEY=VALUE``. That means the KEY 36906e4af9SMauro Carvalho Chehab name gains ``SYNTH_ARG_`` prefix to avoid possible collisions 37f36776faSPeter Rajnoha with existing variables. 38f36776faSPeter Rajnoha 39906e4af9SMauro Carvalho Chehab Example of valid sequence written to the uevent file:: 40f36776faSPeter Rajnoha 41f36776faSPeter Rajnoha add fe4d7c9d-b8c6-4a70-9ef1-3d8a58d18eed A=1 B=abc 42f36776faSPeter Rajnoha 43906e4af9SMauro Carvalho Chehab This generates synthetic uevent including these variables:: 44f36776faSPeter Rajnoha 45f36776faSPeter Rajnoha ACTION=add 46f36776faSPeter Rajnoha SYNTH_ARG_A=1 47f36776faSPeter Rajnoha SYNTH_ARG_B=abc 48f36776faSPeter Rajnoha SYNTH_UUID=fe4d7c9d-b8c6-4a70-9ef1-3d8a58d18eed 49906e4af9SMauro Carvalho Chehab 50f36776faSPeter RajnohaUsers: 51f36776faSPeter Rajnoha udev, userspace tools generating synthetic uevents 52