# Lirc devices and udev problem

## HelAu

Hello,

I have a system with a lirc_imon device and a seperate usb-ir remote with lirc_atiusb driver.

My problem is the following:

during boot udev recognizes both lirc devices and creates /dev/lirc0 and /dev/lirc1

Unfortunately sometimes lirc0 is lirc_imon and sometimes lirc_atiusb

How can I either detect which device is owned by which driver, or is there a way to force one of these drivers to create /dev/lirc1 ?

Thanks in advance

Helmut

----------

## Kompi

You can write an udev rule that creates a persistent symlink the /dev/lirc* devices based on the vendor and product id. I'm not an expert with udev rules, but according to  http://en.gentoo-wiki.com/wiki/LIRC#udev-rules this should create the symlinks /dev/lirc_atiusb and lirc_ir:

```
SUBSYSTEM=="usb", ATTRS{idVendor}=="xxxx", ATTRS{idProduct}=="xxxx", SYMLINK+="lirc_atisub"

SUBSYSTEM=="usb", ATTRS{idVendor}=="xxxx", ATTRS{idProduct}=="xxxx", SYMLINK+="lirc_ir"
```

Put these in a new file created in /etc/udev/rules.d/. (i.e. /etc/udev/rules.d/70-persistent-lirc.rules) 

Of course you would replace the xxxx with the vendor and productid of the corresponding devices. (you can get them with 'lspci').

hmm, I just tried it with mir lirc_atiusb and udev didn't create the link. But maybe that is the right direction and you figure it out.

Edit: Okay I got it working. SYMLINK+="lirc_XXX" without /dev/ works. fixed the code above.

You would also point to the new devices symlinks in LIRCD_OPTS="" in /etc/conf.d/lircd

----------

