Closed pilebones closed 6 years ago
Feature already fonctionnal and native, ie:
2018/07/10 13:08:02 Handle netlink.UEvent{
Action: "bind",
KObj: "/devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1.1/2-1.1:1.1",
Env: {"USEC_INITIALIZED":"5095183791", "ID_MODEL_FROM_DATABASE":"Keyboard", "DEVPATH":"/devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1.1/2-1.1:1.1", "SUBSYSTEM":"usb", "DEVTYPE":"usb_interface", "DRIVER":"usbhid", "TYPE":"0/0/0", "ID_VENDOR_FROM_DATABASE":"Cherry GmbH", "ACTION":"bind", "PRODUCT":"46a/23/220", "INTERFACE":"3/0/0", "MODALIAS":"usb:v046Ap0023d0220dc00dsc00dp00ic03isc00ip00in01", "SEQNUM":"3109"},
}
2018/07/10 13:08:02 Handle netlink.UEvent{
Action: "bind",
KObj: "/devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1.1",
Env: {"BUSNUM":"002", "DEVNUM":"009", "ID_MODEL_ENC":"0023", "ID_REVISION":"0220", "ACTION":"bind", "DEVPATH":"/devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1.1", "PRODUCT":"46a/23/220", "SEQNUM":"3110", "MINOR":"136", "ID_VENDOR":"046a", "ID_MODEL_FROM_DATABASE":"Keyboard", "SUBSYSTEM":"usb", "DEVTYPE":"usb_device", "DRIVER":"usb", "ID_USB_INTERFACES":":030101:030000:", "DEVNAME":"/dev/bus/usb/002/009", "TYPE":"0/0/0", "MAJOR":"189", "ID_MODEL":"0023", "ID_MODEL_ID":"0023", "ID_SERIAL":"046a_0023", "ID_BUS":"usb", "ID_VENDOR_FROM_DATABASE":"Cherry GmbH", "USEC_INITIALIZED":"5095111292", "ID_VENDOR_ENC":"046a", "ID_VENDOR_ID":"046a"},
}
Example of Uevent from this tool:
PRODUCT
should be translate to extract the vendor, manufacturer and product name.Example with a basic USB storage using
udevadm
: