udev device entries, what is the technical difference between a "property" and an "attribute"? How are they customarily created (generated?) and used? Which one is the better source of truth?
I'm asking in the context of a Raspberrypi Python application that should detect any hot-plugged serial port adapters and display the "relevant" device information (whatever that is) to the user, to enable them recognise their devices. In particular, I use the
pyudev library to interface with
libudev, and my plan is to search for devices from the
tty subsystem that are provided by a
usb-serial subsystem device. I've looked through the properties and attributes by some test devices I had lying around, to see what values they provide and where. So far, they all have in common that there is a
subsystem: usb, device_type: usb_interface->
subsystem: usb, device_type: usb_device device ancestor chain (below the USB hub) that relates to the adapter, and the values like vendor, model and serial number are duplicated in various properties and attributes all over the four devices (or sometimes three, ACM*
tty devices have no
usb-serial). So which one should I access? Is there any (written) convention which attributes/properties such devices bring with them, and where can I find it?
I've read (or at least skimmed over) various documentation pages, but they mostly describe how to write your own udev rules, which is not what I'm after. I understood from the
udev manual (, ) that
ATTR is used for values stored in sysfs attributes of the device, and
ENV is used for "device properties", but both can be matched and also written. I suppose there are some default rules that inherit values from a parent device to a child device, but that's happening for both properties and attributes alike?
This answer says "If both
ATTR contain the same information - you can use any of them, there is no any difference.", which doesn't leave me any wiser.