eudev-project / eudev

Repository for eudev development
GNU General Public License v2.0
522 stars 147 forks source link

udevd does not store custom TAGS #228

Open konradgraefe opened 2 years ago

konradgraefe commented 2 years ago

Hello,

i have a rule tagging any device on a specific USB port with a custom tag:

TAGS=="CUSTOM_USB", \
    DEVPATH=="/devices/platform/ff340000.usb/usb1/1-1/1-1.2", \
    TAG+="CUSTOM_USB", \
    TAG+="CUSTOM_USB_EXT"

I also have a custom daemon listening for events with this tag using libudev. This works while processing the event but I cannot enumerate devices by the tag that were already connected before my daemon started.

Also udevadm info does not show the tags:

# udevadm info  /sys/devices/platform/ff340000.usb/usb1/1-1/1-1.2 | grep TAGS
#

After running udevadm test they are present and detection would work in my daemon:

# udevadm test /sys/devices/platform/ff340000.usb/usb1/1-1/1-1.2
[...]
# udevadm info  /sys/devices/platform/ff340000.usb/usb1/1-1/1-1.2 | grep TAGS
E: TAGS=:CUSTOM_USB:CUSTOM_USB_EXT:

Is that the desired behavior? Can I configure udevd to store the TAGS after evaluating my rules?

Please feel free to ask if you need any additional information.

konradgraefe commented 2 years ago

Running udevadm trigger /sys/devices/platform/ff340000.usb/usb1/1-1/1-1.2 makes the tags permanent as well.