* Re: Static naming for hiddev nodes
2007-08-03 0:01 Static naming for hiddev nodes Adam Kropelin
@ 2007-08-03 0:12 ` Kay Sievers
2007-08-03 0:44 ` Adam Kropelin
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Kay Sievers @ 2007-08-03 0:12 UTC (permalink / raw)
To: linux-hotplug
On 8/3/07, Adam Kropelin <akropel1@rochester.rr.com> 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="hiddev", SYSFS{serial}="JB0319039999", NAME="ups1"
> - Does not match
>
> DRIVER="usbhid", SYSFS{serial}="JB0319039999", NAME="ups1"
> - Does not match
>
> SYSFS{serial}="JB0319039999", NAME="ups1"
> - Matches, but results in a device node for the usbdev not for the
> hiddev
>
> BUS="usb", SYSFS{serial}="JB0319039999", NAME="ups1"
> - Matches, but results in a device node for the usbdev not for the
> hiddev
>
> SUBSYSTEM="usb", SYSFS{serial}="JB0319039999", NAME="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?
What does:
udevmonitor --env --kernel
print when you connect the device?
Kay
-------------------------------------------------------------------------
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
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: Static naming for hiddev nodes
2007-08-03 0:01 Static naming for hiddev nodes Adam Kropelin
2007-08-03 0:12 ` Kay Sievers
@ 2007-08-03 0:44 ` Adam Kropelin
2007-08-03 0:59 ` Kay Sievers
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Adam Kropelin @ 2007-08-03 0:44 UTC (permalink / raw)
To: linux-hotplug
Kay Sievers wrote:
> On 8/3/07, Adam Kropelin <akropel1@rochester.rr.com> 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="hiddev", SYSFS{serial}="JB0319039999", NAME="ups1"
>> - Does not match
>>
>> DRIVER="usbhid", SYSFS{serial}="JB0319039999", NAME="ups1"
>> - Does not match
>>
>> SYSFS{serial}="JB0319039999", NAME="ups1"
>> - Matches, but results in a device node for the usbdev not for
>> the hiddev
>>
>> BUS="usb", SYSFS{serial}="JB0319039999", NAME="ups1"
>> - Matches, but results in a device node for the usbdev not for
>> the hiddev
>>
>> SUBSYSTEM="usb", SYSFS{serial}="JB0319039999", NAME="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
is output from --env:
UEVENT[1186101574.223153]
add@/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3
ACTIONd
DEVPATH=/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3
SUBSYSTEM=usb
SEQNUM(30
PHYSDEVBUS=usb
PHYSDEVDRIVER=usb
UEVENT[1186101574.223808]
add@/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3/usbdev1.5_ep00
ACTIONd
DEVPATH=/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3/usbdev1.5_ep00
SUBSYSTEM=usb_endpoint
SEQNUM(31
MAJORD2
MINOR=4
UEVENT[1186101574.224163]
add@/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3/1-2.3:1.0
ACTIONd
DEVPATH=/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3/1-2.3:1.0
SUBSYSTEM=usb
SEQNUM(32
PHYSDEVBUS=usb
DEVICE=/proc/bus/usb/001/005
PRODUCTQd/2/106
TYPE=0/0/0
INTERFACE=3/0/0
MODALIAS=usb:v051Dp0002d0106dc00dsc00dp00ic03isc00ip00
UDEV [1186101574.230511]
add@/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3
UDEV_LOG=3
ACTIONd
DEVPATH=/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3
SUBSYSTEM=usb
SEQNUM(30
PHYSDEVBUS=usb
PHYSDEVDRIVER=usb
UDEVD_EVENT=1
UDEV [1186101574.262073]
add@/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3/usbdev1.5_ep00
UDEV_LOG=3
ACTIONd
DEVPATH=/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3/usbdev1.5_ep00
SUBSYSTEM=usb_endpoint
SEQNUM(31
MAJORD2
MINOR=4
UDEVD_EVENT=1
DEVNAME=/dev/usbdev1.5_ep00
UDEV [1186101574.649249]
add@/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3/1-2.3:1.0
UDEV_LOG=3
ACTIONd
DEVPATH=/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3/1-2.3:1.0
SUBSYSTEM=usb
SEQNUM(32
PHYSDEVBUS=usb
DEVICE=/proc/bus/usb/001/005
PRODUCTQd/2/106
TYPE=0/0/0
INTERFACE=3/0/0
MODALIAS=usb:v051Dp0002d0106dc00dsc00dp00ic03isc00ip00
UDEVD_EVENT=1
UEVENT[1186101575.338918] add@/class/usb/hiddev0
UDEV [1186101575.338918] add@/class/usb/hiddev0
UDEV_LOG=3
ACTIONd
DEVPATH=/class/usb/hiddev0
SUBSYSTEM=usb
SEQNUM(33
PHYSDEVPATH=/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3/1-2.3:1.0
PHYSDEVBUS=usb
PHYSDEVDRIVER=usbhid
MAJOR\x180
MINOR–
UDEVD_EVENT=1
DEVNAME=/dev/hiddev0
UEVENT[1186101575.340947]
add@/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3/1-2.3:1.0/usbdev1.5_ep81
ACTIONd
DEVPATH=/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3/1-2.3:1.0/usbdev1.5_ep81
SUBSYSTEM=usb_endpoint
SEQNUM(34
MAJORD2
MINOR=4
UEVENT[1186101575.341275] add@/class/usb_device/usbdev1.5
ACTIONd
DEVPATH=/class/usb_device/usbdev1.5
SUBSYSTEM=usb_device
SEQNUM(35
PHYSDEVPATH=/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3
PHYSDEVBUS=usb
PHYSDEVDRIVER=usb
MAJOR\x189
MINOR=4
UDEV [1186101575.346565]
add@/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3/1-2.3:1.0/usbdev1.5_ep81
UDEV_LOG=3
ACTIONd
DEVPATH=/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3/1-2.3:1.0/usbdev1.5_ep81
SUBSYSTEM=usb_endpoint
SEQNUM(34
MAJORD2
MINOR=4
UDEVD_EVENT=1
DEVNAME=/dev/usbdev1.5_ep81
UDEV [1186101575.590750] add@/class/usb_device/usbdev1.5
UDEV_LOG=3
ACTIONd
DEVPATH=/class/usb_device/usbdev1.5
SUBSYSTEM=usb_device
SEQNUM(35
PHYSDEVPATH=/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3
PHYSDEVBUS=usb
PHYSDEVDRIVER=usb
MAJOR\x189
MINOR=4
UDEVD_EVENT=1
DEVNAME=/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
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: Static naming for hiddev nodes
2007-08-03 0:01 Static naming for hiddev nodes Adam Kropelin
2007-08-03 0:12 ` Kay Sievers
2007-08-03 0:44 ` Adam Kropelin
@ 2007-08-03 0:59 ` Kay Sievers
2007-08-03 1:11 ` Adam Kropelin
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Kay Sievers @ 2007-08-03 0:59 UTC (permalink / raw)
To: linux-hotplug
On 8/3/07, Adam Kropelin <akropel1@rochester.rr.com> wrote:
> Kay Sievers wrote:
> > On 8/3/07, Adam Kropelin <akropel1@rochester.rr.com> 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="hiddev", SYSFS{serial}="JB0319039999", NAME="ups1"
> >> - Does not match
> >>
> >> DRIVER="usbhid", SYSFS{serial}="JB0319039999", NAME="ups1"
> >> - Does not match
> >>
> >> SYSFS{serial}="JB0319039999", NAME="ups1"
> >> - Matches, but results in a device node for the usbdev not for
> >> the hiddev
> >>
> >> BUS="usb", SYSFS{serial}="JB0319039999", NAME="ups1"
> >> - Matches, but results in a device node for the usbdev not for
> >> the hiddev
> >>
> >> SUBSYSTEM="usb", SYSFS{serial}="JB0319039999", NAME="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
> is output from --env:
> UDEV [1186101575.338918] add@/class/usb/hiddev0
> UDEV_LOG=3
> ACTIONd
> DEVPATH=/class/usb/hiddev0
> SUBSYSTEM=usb
> SEQNUM(33
> PHYSDEVPATH=/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3/1-2.3:1.0
> PHYSDEVBUS=usb
> PHYSDEVDRIVER=usbhid
> MAJOR\x180
> MINOR–
> UDEVD_EVENT=1
> DEVNAME=/dev/hiddev0
What does:
udevinfo -a -p /class/usb/hiddev0
print?
Kay
-------------------------------------------------------------------------
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
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: Static naming for hiddev nodes
2007-08-03 0:01 Static naming for hiddev nodes Adam Kropelin
` (2 preceding siblings ...)
2007-08-03 0:59 ` Kay Sievers
@ 2007-08-03 1:11 ` Adam Kropelin
2007-08-03 1:29 ` Kay Sievers
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Adam Kropelin @ 2007-08-03 1:11 UTC (permalink / raw)
To: linux-hotplug
Kay Sievers wrote:
> On 8/3/07, Adam Kropelin <akropel1@rochester.rr.com> wrote:
>> Kay Sievers wrote:
>>> On 8/3/07, Adam Kropelin <akropel1@rochester.rr.com> 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="hiddev", SYSFS{serial}="JB0319039999", NAME="ups1"
>>>> - Does not match
>>>>
>>>> DRIVER="usbhid", SYSFS{serial}="JB0319039999", NAME="ups1"
>>>> - Does not match
>>>>
>>>> SYSFS{serial}="JB0319039999", NAME="ups1"
>>>> - Matches, but results in a device node for the usbdev not for
>>>> the hiddev
>>>>
>>>> BUS="usb", SYSFS{serial}="JB0319039999", NAME="ups1"
>>>> - Matches, but results in a device node for the usbdev not for
>>>> the hiddev
>>>>
>>>> SUBSYSTEM="usb", SYSFS{serial}="JB0319039999", NAME="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 is output from --env:
>
>> UDEV [1186101575.338918] add@/class/usb/hiddev0
>> UDEV_LOG=3
>> ACTIONd
>> DEVPATH=/class/usb/hiddev0
>> SUBSYSTEM=usb
>> SEQNUM(33
>> PHYSDEVPATH=/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3/1-2.3:1.0
>> PHYSDEVBUS=usb
>> PHYSDEVDRIVER=usbhid
>> MAJOR\x180
>> MINOR–
>> UDEVD_EVENT=1
>> DEVNAME=/dev/hiddev0
>
> What does:
> udevinfo -a -p /class/usb/hiddev0
> print?
[adk0212@mail etc]$ udevinfo -a -p /class/usb/hiddev0
Udevinfo starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/class/usb/hiddev0':
KERNEL="hiddev0"
SUBSYSTEM="usb"
SYSFS{dev}="180:96"
looking at parent device
'/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3/1-2.3:1.0':
ID="1-2.3:1.0"
BUS="usb"
DRIVER="usbhid"
SYSFS{modalias}="usb:v051Dp0002d0106dc00dsc00dp00ic03isc00ip00"
SYSFS{bInterfaceProtocol}="00"
SYSFS{bInterfaceSubClass}="00"
SYSFS{bInterfaceClass}="03"
SYSFS{bNumEndpoints}="01"
SYSFS{bAlternateSetting}=" 0"
SYSFS{bInterfaceNumber}="00"
looking at parent device
'/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3':
ID="1-2.3"
BUS="usb"
DRIVER="usb"
SYSFS{configuration}=""
SYSFS{serial}="BB0100009999 "
[I swapped UPSes at one point tonight, which is why this serial doesn't
match the udev rules I quoted earlier. I had the serial number right at
the time I did the test.]
SYSFS{product}="Back-UPS RS 1500 FW:8.g6 .D USB FW:g6 "
SYSFS{manufacturer}="American Power Conversion"
SYSFS{maxchild}="0"
SYSFS{version}=" 1.10"
SYSFS{devnum}="5"
SYSFS{speed}="1.5"
SYSFS{bMaxPacketSize0}="8"
SYSFS{bNumConfigurations}="1"
SYSFS{bDeviceProtocol}="00"
SYSFS{bDeviceSubClass}="00"
SYSFS{bDeviceClass}="00"
SYSFS{bcdDevice}="0106"
SYSFS{idProduct}="0002"
SYSFS{idVendor}="051d"
SYSFS{bMaxPower}=" 24mA"
SYSFS{bmAttributes}="a0"
SYSFS{bConfigurationValue}="1"
SYSFS{bNumInterfaces}=" 1"
looking at parent device '/devices/pci0000:00/0000:00:07.2/usb1/1-2':
ID="1-2"
BUS="usb"
DRIVER="usb"
SYSFS{configuration}=""
SYSFS{product}="USB2.0 Hub Controller"
SYSFS{manufacturer}="NEC Corporation"
SYSFS{maxchild}="4"
SYSFS{version}=" 2.00"
SYSFS{devnum}="2"
SYSFS{speed}="12"
SYSFS{bMaxPacketSize0}="64"
SYSFS{bNumConfigurations}="1"
SYSFS{bDeviceProtocol}="00"
SYSFS{bDeviceSubClass}="00"
SYSFS{bDeviceClass}="09"
SYSFS{bcdDevice}="0100"
SYSFS{idProduct}="0058"
SYSFS{idVendor}="0409"
SYSFS{bMaxPower}="100mA"
SYSFS{bmAttributes}="e0"
SYSFS{bConfigurationValue}="1"
SYSFS{bNumInterfaces}=" 1"
looking at parent device '/devices/pci0000:00/0000:00:07.2/usb1':
ID="usb1"
BUS="usb"
DRIVER="usb"
SYSFS{configuration}=""
SYSFS{serial}="0000:00:07.2"
SYSFS{product}="UHCI Host Controller"
SYSFS{manufacturer}="Linux 2.6.18-8.1.8.el5 uhci_hcd"
SYSFS{maxchild}="2"
SYSFS{version}=" 1.10"
SYSFS{devnum}="1"
SYSFS{speed}="12"
SYSFS{bMaxPacketSize0}="64"
SYSFS{bNumConfigurations}="1"
SYSFS{bDeviceProtocol}="00"
SYSFS{bDeviceSubClass}="00"
SYSFS{bDeviceClass}="09"
SYSFS{bcdDevice}="0206"
SYSFS{idProduct}="0000"
SYSFS{idVendor}="0000"
SYSFS{bMaxPower}=" 0mA"
SYSFS{bmAttributes}="e0"
SYSFS{bConfigurationValue}="1"
SYSFS{bNumInterfaces}=" 1"
looking at parent device '/devices/pci0000:00/0000:00:07.2':
ID="0000:00:07.2"
BUS="pci"
DRIVER="uhci_hcd"
SYSFS{broken_parity_status}="0"
SYSFS{modalias}="pci:v00008086d00007020sv00000000sd00000000bc0Csc03i00"
SYSFS{local_cpus}="ffffffff"
SYSFS{irq}="11"
SYSFS{class}="0x0c0300"
SYSFS{subsystem_device}="0x0000"
SYSFS{subsystem_vendor}="0x0000"
SYSFS{device}="0x7020"
SYSFS{vendor}="0x8086"
looking at parent device '/devices/pci0000:00':
ID="pci0000:00"
BUS=""
DRIVER=""
--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
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: Static naming for hiddev nodes
2007-08-03 0:01 Static naming for hiddev nodes Adam Kropelin
` (3 preceding siblings ...)
2007-08-03 1:11 ` Adam Kropelin
@ 2007-08-03 1:29 ` Kay Sievers
2007-08-03 12:12 ` Adam Kropelin
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Kay Sievers @ 2007-08-03 1:29 UTC (permalink / raw)
To: linux-hotplug
On Thu, 2007-08-02 at 21:11 -0400, Adam Kropelin wrote:
> Kay Sievers wrote:
> > On 8/3/07, Adam Kropelin <akropel1@rochester.rr.com> wrote:
> >> Kay Sievers wrote:
> >>> On 8/3/07, Adam Kropelin <akropel1@rochester.rr.com> 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="hiddev", SYSFS{serial}="JB0319039999", NAME="ups1"
> >>>> - Does not match
> >>>>
> >>>> DRIVER="usbhid", SYSFS{serial}="JB0319039999", NAME="ups1"
> >>>> - Does not match
> >>>>
> >>>> SYSFS{serial}="JB0319039999", NAME="ups1"
> >>>> - Matches, but results in a device node for the usbdev not for
> >>>> the hiddev
> >>>>
> >>>> BUS="usb", SYSFS{serial}="JB0319039999", NAME="ups1"
> >>>> - Matches, but results in a device node for the usbdev not for
> >>>> the hiddev
> >>>>
> >>>> SUBSYSTEM="usb", SYSFS{serial}="JB0319039999", NAME="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 is output from --env:
> >
> >> UDEV [1186101575.338918] add@/class/usb/hiddev0
> >> UDEV_LOG=3
> >> ACTIONd
> >> DEVPATH=/class/usb/hiddev0
> >> SUBSYSTEM=usb
> >> SEQNUM(33
> >> PHYSDEVPATH=/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3/1-2.3:1.0
> >> PHYSDEVBUS=usb
> >> PHYSDEVDRIVER=usbhid
> >> MAJOR\x180
> >> MINOR–
> >> UDEVD_EVENT=1
> >> DEVNAME=/dev/hiddev0
> >
> > What does:
> > udevinfo -a -p /class/usb/hiddev0
> > print?
>
> [adk0212@mail etc]$ udevinfo -a -p /class/usb/hiddev0
>
> Udevinfo starts with the device specified by the devpath and then
> walks up the chain of parent devices. It prints for every device
> found, all possible attributes in the udev rules key format.
> A rule to match, can be composed by the attributes of the device
> and the attributes from one single parent device.
>
> looking at device '/class/usb/hiddev0':
> KERNEL="hiddev0"
> SUBSYSTEM="usb"
> SYSFS{dev}="180:96"
>
> looking at parent device
> '/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3/1-2.3:1.0':
> ID="1-2.3:1.0"
> BUS="usb"
> DRIVER="usbhid"
> SYSFS{modalias}="usb:v051Dp0002d0106dc00dsc00dp00ic03isc00ip00"
> SYSFS{bInterfaceProtocol}="00"
> SYSFS{bInterfaceSubClass}="00"
> SYSFS{bInterfaceClass}="03"
> SYSFS{bNumEndpoints}="01"
> SYSFS{bAlternateSetting}=" 0"
> SYSFS{bInterfaceNumber}="00"
>
> looking at parent device
> '/devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2.3':
> ID="1-2.3"
> BUS="usb"
> DRIVER="usb"
> SYSFS{configuration}=""
> SYSFS{serial}="BB0100009999 "
>
> [I swapped UPSes at one point tonight, which is why this serial doesn't
> match the udev rules I quoted earlier. I had the serial number right at
> the time I did the test.]
Does:
KERNEL="hiddev*", SYSFS{serial}="BB0100009999", NAME="ups"
work?
Kay
-------------------------------------------------------------------------
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
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: Static naming for hiddev nodes
2007-08-03 0:01 Static naming for hiddev nodes Adam Kropelin
` (4 preceding siblings ...)
2007-08-03 1:29 ` Kay Sievers
@ 2007-08-03 12:12 ` Adam Kropelin
2007-08-03 14:10 ` Kay Sievers
2007-08-03 17:04 ` Adam Kropelin
7 siblings, 0 replies; 9+ messages in thread
From: Adam Kropelin @ 2007-08-03 12:12 UTC (permalink / raw)
To: linux-hotplug
Kay Sievers wrote:
> Does:
> KERNEL="hiddev*", SYSFS{serial}="BB0100009999", NAME="ups"
> work?
Perfectly.
It is interesting, looking at the udevinfo output, to see that the
device with DRIVER="usbhid" has no SYSFS{serial}...which explains why
that particular permutation of the rule did not work.
Thanks very much for your help!
--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
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: Static naming for hiddev nodes
2007-08-03 0:01 Static naming for hiddev nodes Adam Kropelin
` (5 preceding siblings ...)
2007-08-03 12:12 ` Adam Kropelin
@ 2007-08-03 14:10 ` Kay Sievers
2007-08-03 17:04 ` Adam Kropelin
7 siblings, 0 replies; 9+ messages in thread
From: Kay Sievers @ 2007-08-03 14:10 UTC (permalink / raw)
To: linux-hotplug
On 8/3/07, Adam Kropelin <akropel1@rochester.rr.com> wrote:
> Kay Sievers wrote:
> > Does:
> > KERNEL="hiddev*", SYSFS{serial}="BB0100009999", NAME="ups"
> > work?
>
> Perfectly.
>
> It is interesting, looking at the udevinfo output, to see that the
> device with DRIVER="usbhid" has no SYSFS{serial}...which explains why
> that particular permutation of the rule did not work.
It should still have worked, maybe there are timing problems. In
general its better to match directly on a device property of the
device you want to hook into, like "hiddev*" is doing. That way, you
will never catch any of the parent events, only check for the
properties of the parents starting at the right event.
It may also be better to create just a symlink, because the kernel log
will report errors with the kernel name and you have no easy way to
tell which of your names belong to which kernel device.
Kay
-------------------------------------------------------------------------
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
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: Static naming for hiddev nodes
2007-08-03 0:01 Static naming for hiddev nodes Adam Kropelin
` (6 preceding siblings ...)
2007-08-03 14:10 ` Kay Sievers
@ 2007-08-03 17:04 ` Adam Kropelin
7 siblings, 0 replies; 9+ messages in thread
From: Adam Kropelin @ 2007-08-03 17:04 UTC (permalink / raw)
To: linux-hotplug
Kay Sievers wrote:
> On 8/3/07, Adam Kropelin <akropel1@rochester.rr.com> wrote:
>> Kay Sievers wrote:
>>> Does:
>>> KERNEL="hiddev*", SYSFS{serial}="BB0100009999", NAME="ups"
>>> work?
>>
>> Perfectly.
>>
>> It is interesting, looking at the udevinfo output, to see that the
>> device with DRIVER="usbhid" has no SYSFS{serial}...which explains
>> why that particular permutation of the rule did not work.
>
> It should still have worked, maybe there are timing problems. In
> general its better to match directly on a device property of the
> device you want to hook into, like "hiddev*" is doing. That way, you
> will never catch any of the parent events, only check for the
> properties of the parents starting at the right event.
Makes sense now.
> It may also be better to create just a symlink, because the kernel log
> will report errors with the kernel name and you have no easy way to
> tell which of your names belong to which kernel device.
Good point. I'll make that change.
--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
^ permalink raw reply [flat|nested] 9+ messages in thread