Skip to contentSkip to conversation

How to write this rule?

DISCUSSION Yan Seiner 2 participants 4 messages Feb 10, 2009

lore
Share & tools
lore

Yan Seiner

author
#0 lore raw

I have a device that presents itself as both a /dev/input/mouise and /dev/input/event.

The mouse:

looking at device '/class/input/input10/mouse6':

    KERNEL="mouse6"
    SUBSYSTEM="input"
    DRIVER=""

looking at parent device '/class/input/input10':

    KERNELS="input10"
    SUBSYSTEMS="input"
    DRIVERS=""
    ATTRS{name}="HID 06b4:1c70"
    ATTRS{phys}="usb-0000:00:02.1-4.4.4.4.4.1/input0"
    ATTRS{uniq}=""

The event:

looking at device '/class/input/input10/event10':

    KERNEL="event10"
    SUBSYSTEM="input"
    DRIVER=""

looking at parent device '/class/input/input10':

    KERNELS="input10"
    SUBSYSTEMS="input"
    DRIVERS=""
    ATTRS{name}="HID 06b4:1c70"
    ATTRS{phys}="usb-0000:00:02.1-4.4.4.4.4.1/input0"
    ATTRS{uniq}=""

The *only* difference between the two is the KERNEL= line. I need to create a symlink to both the mouse and the event. I tried this:

# usb remote
KERNEL="event*", ENV{ID_CLASS}="event"
KERNEL="input*", ENV{ID_CLASS}="input"

ENV{ID_CLASS}="event", SUBSYSTEMS="input", ATTRS{name}="HID

06b4:1c70", ATTRS{phys}="usb-0000:00:02.1-4.4.4.4.4.1/input0", \
        SYMLINK+="myth/remote", ENV{GENERATED}="1"

ENV{ID_CLASS}="input", SUBSYSTEMS="input", ATTRS{name}="HID

06b4:1c70", ATTRS{phys}="usb-0000:00:02.1-4.4.4.4.4.1/input0", \
        SYMLINK+="myth/rmouse", ENV{GENERATED}="1"

But it doesn't work. I'm unclear on how to deal with this; I need to somehow remember if I am looking at the event device or the mouse device.... But how?

Thanks,

--Yan

#1 lore raw
Quoted 12 lines · Yan Seiner

I have a device that presents itself as both a /dev/input/mouise and /dev/input/event.

The mouse:

looking at device '/class/input/input10/mouse6':
KERNEL="mouse6"
SUBSYSTEM="input"
DRIVER=""

The event:

Quoted 7 lines

looking at device '/class/input/input10/event10':
KERNEL="event10"
SUBSYSTEM="input"
DRIVER=""

The *only* difference between the two is the KERNEL= line. I need to create a symlink to both the mouse and the event. I tried this:

Use the links in: /dev/input/by-id/?

They look like this for a USB mouse here:

  $ tree /dev/input/by-id/
  /dev/input/by-id/
  |-- usb-Logitech_USB-PS_2_Optical_Mouse-event-mouse -> ../event8
  `-- usb-Logitech_USB-PS_2_Optical_Mouse-mouse -> ../mouse1

Kay

author
#2 lore raw
In reply to Yan Seiner
Quoted 23 lines · Kay Sievers
Quoted 12 lines · Yan Seiner

I have a device that presents itself as both a /dev/input/mouise and /dev/input/event.

The mouse:

looking at device '/class/input/input10/mouse6':
KERNEL="mouse6"
SUBSYSTEM="input"
DRIVER=""

The event:

Quoted 7 lines

looking at device '/class/input/input10/event10':
KERNEL="event10"
SUBSYSTEM="input"
DRIVER=""

The *only* difference between the two is the KERNEL= line. I need to create a symlink to both the mouse and the event. I tried this:

Use the links in: /dev/input/by-id/?

Quoted 7 lines

They look like this for a USB mouse here:

  $ tree /dev/input/by-id/
  /dev/input/by-id/
  |-- usb-Logitech_USB-PS_2_Optical_Mouse-event-mouse -> ../event8
  `-- usb-Logitech_USB-PS_2_Optical_Mouse-mouse -> ../mouse1

Kay

Hah! Won't quite work as I have 2 of these, but I can match on the ID_PATH env var!

Thanks!

--Yan

Signature · 10 lines
  o__
  ,>/'_          o__
  (_)\(_)        ,>/'_        o__
Yan Seiner      (_)\(_)       ,>/'_     o__
       Personal Trainer      (_)\(_)    ,>/'_        o__
             Professional Engineer     (_)\(_)       ,>/'_
Who says engineers have to be pencil necked geeks?  (_)\(_)

You are an adult when you realize that everyone's an idiot sometimes. You
are wise when you include yourself.
#3 lore raw
In reply to Yan Seiner
Quoted 24 lines · Yan Seiner
Quoted 23 lines · Kay Sievers
Quoted 12 lines · Yan Seiner

I have a device that presents itself as both a /dev/input/mouise and /dev/input/event.

The mouse:

looking at device '/class/input/input10/mouse6':
KERNEL="mouse6"
SUBSYSTEM="input"
DRIVER=""

The event:

Quoted 7 lines

looking at device '/class/input/input10/event10':
KERNEL="event10"
SUBSYSTEM="input"
DRIVER=""

The *only* difference between the two is the KERNEL= line. I need to create a symlink to both the mouse and the event. I tried this:

Use the links in: /dev/input/by-id/?

Quoted 8 lines
Quoted 5 lines

They look like this for a USB mouse here:

  $ tree /dev/input/by-id/
  /dev/input/by-id/
  |-- usb-Logitech_USB-PS_2_Optical_Mouse-event-mouse -> ../event8
  `-- usb-Logitech_USB-PS_2_Optical_Mouse-mouse -> ../mouse1

Hah! Won't quite work as I have 2 of these, but I can match on the ID_PATH env var!

That's what /dev/input/by-path/ is for:

/dev/input/

|-- by-id
|   |-- usb-Logitech_USB-PS_2_Optical_Mouse-event-mouse -> ../event6
|   `-- usb-Logitech_USB-PS_2_Optical_Mouse-mouse -> ../mouse1
|-- by-path
|   |-- pci-0000:00:1d.2-usb-0:1:1.0-event-mouse -> ../event6
|   |-- pci-0000:00:1d.2-usb-0:1:1.0-mouse -> ../mouse1
|   |-- platform-i8042-serio-0-event-kbd -> ../event0
|   |-- platform-i8042-serio-1-event-mouse -> ../event1
|   |-- platform-i8042-serio-1-mouse -> ../mouse0
|   `-- platform-pcspkr-event-spkr -> ../event2

...

Kay