You are not logged in.

#1 2012-01-21 22:49:20

Padfoot
Member
Registered: 2010-09-03
Posts: 381

[SOLVED] UDEV Rule - change device node group

Hi,

I am having problems getting a working udev rule to change the group for my touchscreen input device nodes. I need to do this as the nodes are currently only accessible to root, so using the python multitouch toolkit module called Kivy, I am only able to run the programs as root. I need to assign these device nodes to a different group so I can run Kivy apps as a regular user.

Following is what I have done:

1. Created a new group and added my user to it

# groupadd touch

# gpasswd -a USERNAME touch

2. Located the correct device nodes from dmesg

......
[    7.557793] input: eGalax Inc. USB TouchController as /devices/pci0000:00/0000:00:13.0/usb5/5-1/5-1:1.0/input/input13
[    7.560424] hid-multitouch 0003:0EEF:7302.0001: input,hiddev0,hidraw2: USB HID v2.10 Pointer [eGalax Inc. USB TouchController] on usb-0000:00:13.0-1/input0
......
[    8.743657] input: eGalaxTouch Virtual Device for Multi as /devices/virtual/input/input14
[    8.744747] input: eGalaxTouch Virtual Device for Single as /devices/virtual/input/input15

3. Confirmed the current permissions and ownership of the nodes

$ ls -l /dev/input/
......
crw-r----- 1 root root  13, 77 Jan 22 09:22 event13
crw-r----- 1 root root  13, 78 Jan 22 09:22 event14
crw-r----- 1 root root  13, 79 Jan 22 09:22 event15
......

4. Looked up device info for creating the udev rule

$ CLUE=input15
$ for DEVICE in $(find /sys ! -type l -iname "*${CLUE}*"); do ls -dl $DEVICE; udevadm info -a -p $DEVICE; done
......
  looking at device '/devices/virtual/input/input15':
    KERNEL=="input15"
    SUBSYSTEM=="input"
    DRIVER==""
    ATTR{name}=="eGalaxTouch Virtual Device for Single"
    ATTR{phys}==""
    ATTR{uniq}==""
    ATTR{properties}=="0"

$ CLUE=input14
$ for DEVICE in $(find /sys ! -type l -iname "*${CLUE}*"); do ls -dl $DEVICE; udevadm info -a -p $DEVICE; done
......
  looking at device '/devices/virtual/input/input14':
    KERNEL=="input14"
    SUBSYSTEM=="input"
    DRIVER==""
    ATTR{name}=="eGalaxTouch Virtual Device for Multi"
    ATTR{phys}==""
    ATTR{uniq}==""
    ATTR{properties}=="0"

$ CLUE=input13
$ for DEVICE in $(find /sys ! -type l -iname "*${CLUE}*"); do ls -dl $DEVICE; udevadm info -a -p $DEVICE; done
......
  looking at device '/devices/pci0000:00/0000:00:13.0/usb5/5-1/5-1:1.0/input/input13':
    KERNEL=="input13"
    SUBSYSTEM=="input"
    DRIVER==""
    ATTR{name}=="eGalax Inc. USB TouchController"
    ATTR{phys}=="usb-0000:00:13.0-1/input0"
    ATTR{uniq}==""
    ATTR{properties}=="2"

  looking at parent device '/devices/pci0000:00/0000:00:13.0/usb5/5-1/5-1:1.0':
    KERNELS=="5-1:1.0"
    SUBSYSTEMS=="usb"
    DRIVERS=="usbhid"
    ATTRS{bInterfaceNumber}=="00"
    ATTRS{bAlternateSetting}==" 0"
    ATTRS{bNumEndpoints}=="01"
    ATTRS{bInterfaceClass}=="03"
    ATTRS{bInterfaceSubClass}=="01"
    ATTRS{bInterfaceProtocol}=="02"
    ATTRS{supports_autosuspend}=="1"

  looking at parent device '/devices/pci0000:00/0000:00:13.0/usb5/5-1':
    KERNELS=="5-1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}=="eGalax Inc."
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="a0"
    ATTRS{bMaxPower}=="100mA"
    ATTRS{urbnum}=="1815"
    ATTRS{idVendor}=="0eef"
    ATTRS{idProduct}=="7302"
    ATTRS{bcdDevice}=="1006"
    ATTRS{bDeviceClass}=="00"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{speed}=="12"
    ATTRS{busnum}=="5"
    ATTRS{devnum}=="2"
    ATTRS{devpath}=="1"
    ATTRS{version}==" 1.10"
    ATTRS{maxchild}=="0"
    ATTRS{quirks}=="0x0"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{authorized}=="1"
    ATTRS{manufacturer}=="eGalax Inc."
    ATTRS{product}=="USB TouchController"

  looking at parent device '/devices/pci0000:00/0000:00:13.0/usb5':
    KERNELS=="usb5"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bMaxPower}=="  0mA"
    ATTRS{urbnum}=="49"
    ATTRS{idVendor}=="1d6b"
    ATTRS{idProduct}=="0001"
    ATTRS{bcdDevice}=="0302"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{speed}=="12"
    ATTRS{busnum}=="5"
    ATTRS{devnum}=="1"
    ATTRS{devpath}=="0"
    ATTRS{version}==" 1.10"
    ATTRS{maxchild}=="5"
    ATTRS{quirks}=="0x0"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{authorized}=="1"
    ATTRS{manufacturer}=="Linux 3.2.1-1-ARCH ohci_hcd"
    ATTRS{product}=="OHCI Host Controller"
    ATTRS{serial}=="0000:00:13.0"
    ATTRS{authorized_default}=="1"

  looking at parent device '/devices/pci0000:00/0000:00:13.0':
    KERNELS=="0000:00:13.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="ohci_hcd"
    ATTRS{vendor}=="0x1002"
    ATTRS{device}=="0x4397"
    ATTRS{subsystem_vendor}=="0x1025"
    ATTRS{subsystem_device}=="0x0577"
    ATTRS{class}=="0x0c0310"
    ATTRS{irq}=="18"
    ATTRS{local_cpus}=="00000000,00000003"
    ATTRS{local_cpulist}=="0-1"
    ATTRS{numa_node}=="-1"
    ATTRS{dma_mask_bits}=="32"
    ATTRS{consistent_dma_mask_bits}=="32"
    ATTRS{broken_parity_status}=="0"
    ATTRS{msi_bus}==""

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""

5. Created the udev rule

# nano /etc/udev/rules.d/99-egalax.rules

# Assign eGalax input device nodes to touch group
ACTION!="add|change", GOTO="egalax_end"
SUBSYSTEMS=="usb", ATTRS{manufacturer}=="eGalax Inc.", ATTRS{product}=="USB TouchController", GROUP="touch"
SUBSYSTEM=="input", ATTR{name}=="eGalaxTouch Virtual Device for Multi", GROUP="touch"
SUBSYSTEM=="input", ATTR{name}=="eGalaxTouch Virtual Device for Single", GROUP="touch"
LABEL="egalax_end"

6 Rebooted to no success

 ls -l /dev/input/
......
crw-r----- 1 root touch 13, 77 Jan 22 09:22 event13
crw-r----- 1 root root  13, 78 Jan 22 09:22 event14
crw-r----- 1 root root  13, 79 Jan 22 09:22 event15
......

As you can see, the group has been changed for /dev/input/event13
I actually do not need to change that one. I just added it to see if my rule was being parsed or not. I really need the group changed on /dev/input/event14 and /dev/input/event15

All help gratefully appreciated.

Cheers.

Last edited by Padfoot (2012-01-24 08:13:32)

Offline

#2 2012-01-24 00:02:01

ant1-antuan
Member
Registered: 2011-08-07
Posts: 12

Re: [SOLVED] UDEV Rule - change device node group

Hi Padfoot,
adding your version of 99-egalax.rules I got same result.
In order to configure correctly I have changed SUBSYSTEM in SUBSYSTEMS and ATTR in ATTRS on line 4 and line 5.
I hope this can help you to solve the problem.

Cheers

Offline

#3 2012-01-24 08:12:57

Padfoot
Member
Registered: 2010-09-03
Posts: 381

Re: [SOLVED] UDEV Rule - change device node group

ant1-antuan wrote:

Hi Padfoot,
adding your version of 99-egalax.rules I got same result.
In order to configure correctly I have changed SUBSYSTEM in SUBSYSTEMS and ATTR in ATTRS on line 4 and line 5.
I hope this can help you to solve the problem.

Cheers

Ant, you are a champion. Just missing the S on the end of SUBSYSTEM and ATTR made all the difference.

Udev is now changing my touch device nodes to a new group.

Cheers.

Offline

Board footer

Powered by FluxBB