From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Adam Kropelin" Date: Fri, 03 Aug 2007 00:44:09 +0000 Subject: Re: Static naming for hiddev nodes Message-Id: <024701c7d567$678b03e0$03c8a8c0@kroptech.com> List-Id: References: <01fe01c7d561$6a20b1a0$03c8a8c0@kroptech.com> In-Reply-To: <01fe01c7d561$6a20b1a0$03c8a8c0@kroptech.com> MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org Kay Sievers wrote: > On 8/3/07, Adam Kropelin wrote: >> I'm attempting to establish static naming for some hiddev devices >> (UPSes) based on serial numbers. I used to be able to do this fairly >> easily many moons ago in the early days of udev. Revisiting it on a >> modern distro (RHEL5) I am unable to make it work. Here are the udev >> rules I've tried and what happened with each.... >> >> DRIVER=3D"hiddev", SYSFS{serial}=3D"JB0319039999", NAME=3D"ups1" >> - Does not match >> >> DRIVER=3D"usbhid", SYSFS{serial}=3D"JB0319039999", NAME=3D"ups1" >> - Does not match >> >> SYSFS{serial}=3D"JB0319039999", NAME=3D"ups1" >> - Matches, but results in a device node for the usbdev not for >> the hiddev >> >> BUS=3D"usb", SYSFS{serial}=3D"JB0319039999", NAME=3D"ups1" >> - Matches, but results in a device node for the usbdev not for >> the hiddev >> >> SUBSYSTEM=3D"usb", SYSFS{serial}=3D"JB0319039999", NAME=3D"ups1" >> - Does not match >> >> I admit to being almost completely lost in the sysfs hierarchy. I'd >> be happy to post a subtree if someone can suggest which one would be >> helpful. It is worth noting that the default rules create correct and >> working hiddev* nodes...I'm just trying to given them persistent >> names. > > What is the "original" device node name, you expect and want to > rename? hiddev0 > What does: > udevmonitor --env --kernel > print when you connect the device? My udevmonitor does not appear to support the --kernel option, but here=20 is output from --env: UEVENT[1186101574.223153]=20 add@/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3 ACTION=ADd DEVPATH=3D/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3 SUBSYSTEM=3Dusb SEQNUM(30 PHYSDEVBUS=3Dusb PHYSDEVDRIVER=3Dusb UEVENT[1186101574.223808]=20 add@/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3/usbdev1.5_ep00 ACTION=ADd DEVPATH=3D/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3/usbdev1.5_ep00 SUBSYSTEM=3Dusb_endpoint SEQNUM(31 MAJORD2 MINOR=3D4 UEVENT[1186101574.224163]=20 add@/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3/1-2.3:1.0 ACTION=ADd DEVPATH=3D/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3/1-2.3:1.0 SUBSYSTEM=3Dusb SEQNUM(32 PHYSDEVBUS=3Dusb DEVICE=3D/proc/bus/usb/001/005 PRODUCTQd/2/106 TYPE=3D0/0/0 INTERFACE=3D3/0/0 MODALIAS=3Dusb:v051Dp0002d0106dc00dsc00dp00ic03isc00ip00 UDEV [1186101574.230511]=20 add@/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3 UDEV_LOG=3D3 ACTION=ADd DEVPATH=3D/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3 SUBSYSTEM=3Dusb SEQNUM(30 PHYSDEVBUS=3Dusb PHYSDEVDRIVER=3Dusb UDEVD_EVENT=3D1 UDEV [1186101574.262073]=20 add@/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3/usbdev1.5_ep00 UDEV_LOG=3D3 ACTION=ADd DEVPATH=3D/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3/usbdev1.5_ep00 SUBSYSTEM=3Dusb_endpoint SEQNUM(31 MAJORD2 MINOR=3D4 UDEVD_EVENT=3D1 DEVNAME=3D/dev/usbdev1.5_ep00 UDEV [1186101574.649249]=20 add@/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3/1-2.3:1.0 UDEV_LOG=3D3 ACTION=ADd DEVPATH=3D/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3/1-2.3:1.0 SUBSYSTEM=3Dusb SEQNUM(32 PHYSDEVBUS=3Dusb DEVICE=3D/proc/bus/usb/001/005 PRODUCTQd/2/106 TYPE=3D0/0/0 INTERFACE=3D3/0/0 MODALIAS=3Dusb:v051Dp0002d0106dc00dsc00dp00ic03isc00ip00 UDEVD_EVENT=3D1 UEVENT[1186101575.338918] add@/class/usb/hiddev0 UDEV [1186101575.338918] add@/class/usb/hiddev0 UDEV_LOG=3D3 ACTION=ADd DEVPATH=3D/class/usb/hiddev0 SUBSYSTEM=3Dusb SEQNUM(33 PHYSDEVPATH=3D/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3/1-2.3:1.0 PHYSDEVBUS=3Dusb PHYSDEVDRIVER=3Dusbhid MAJOR=180 MINOR=96 UDEVD_EVENT=3D1 DEVNAME=3D/dev/hiddev0 UEVENT[1186101575.340947]=20 add@/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3/1-2.3:1.0/usbdev1.5_ep81 ACTION=ADd DEVPATH=3D/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3/1-2.3:1.0/usbdev1= .5_ep81 SUBSYSTEM=3Dusb_endpoint SEQNUM(34 MAJORD2 MINOR=3D4 UEVENT[1186101575.341275] add@/class/usb_device/usbdev1.5 ACTION=ADd DEVPATH=3D/class/usb_device/usbdev1.5 SUBSYSTEM=3Dusb_device SEQNUM(35 PHYSDEVPATH=3D/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3 PHYSDEVBUS=3Dusb PHYSDEVDRIVER=3Dusb MAJOR=189 MINOR=3D4 UDEV [1186101575.346565]=20 add@/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3/1-2.3:1.0/usbdev1.5_ep81 UDEV_LOG=3D3 ACTION=ADd DEVPATH=3D/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3/1-2.3:1.0/usbdev1= .5_ep81 SUBSYSTEM=3Dusb_endpoint SEQNUM(34 MAJORD2 MINOR=3D4 UDEVD_EVENT=3D1 DEVNAME=3D/dev/usbdev1.5_ep81 UDEV [1186101575.590750] add@/class/usb_device/usbdev1.5 UDEV_LOG=3D3 ACTION=ADd DEVPATH=3D/class/usb_device/usbdev1.5 SUBSYSTEM=3Dusb_device SEQNUM(35 PHYSDEVPATH=3D/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3 PHYSDEVBUS=3Dusb PHYSDEVDRIVER=3Dusb MAJOR=189 MINOR=3D4 UDEVD_EVENT=3D1 DEVNAME=3D/dev/bus/usb/001/005 --Adam ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel