LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   How can i get udev to make a link for me ? (https://www.linuxquestions.org/questions/slackware-14/how-can-i-get-udev-to-make-a-link-for-me-749286/)

Scuzz 08-21-2009 08:20 AM

How can i get udev to make a link for me ?
 
I have lirc running and udev creates lirc0 in my /dev directory and i need it to be /dev/lirc .

I can create a link with ln -s lirc0 /dev/lirc and everything works fine but i want the link to be there everytime i bootup into slackware.

Iv tried adding ln -s lirc0 /dev/lirc to my /etc/udev/udev.conf but that just gives me an error on bootup.

Anyone have any ideas how i can achieve what im after ?

ilikejam 08-21-2009 08:39 AM

Hi.

Not tested, but should work...
Create a 10-local.rules file in /etc/udev/rules.d and in there put the line:
KERNEL=="lirc0", SYMLINK+="lirc"

Dave

rworkman 08-21-2009 08:43 AM

Quote:

Originally Posted by Scuzz (Post 3652333)
I have lirc running and udev creates lirc0 in my /dev directory and i need it to be /dev/lirc .

I can create a link with ln -s lirc0 /dev/lirc and everything works fine but i want the link to be there everytime i bootup into slackware.

Iv tried adding ln -s lirc0 /dev/lirc to my /etc/udev/udev.conf but that just gives me an error on bootup.

What made you think that would work?

Quote:

Anyone have any ideas how i can achieve what im after ?
Show the result of the following command:
Code:

udevadm info --attribute-walk --name /dev/lirc0

rworkman 08-21-2009 08:45 AM

Quote:

Originally Posted by ilikejam (Post 3652351)
Hi.

Not tested, but should work...
Create a 10-local.rules file in /etc/udev/rules.d and in there put the line:
KERNEL=="lirc0", SYMLINK+="lirc"

Yes, that should work, but the drawback is that multiple lirc* devices might cause the link to point at the wrong one. Ideally, the "udevadm info" results from what I posted in my previous reply will give us some unique information to key on.

Scuzz 08-21-2009 08:52 AM

Quote:

Originally Posted by rworkman (Post 3652355)
What made you think that would work?

Hahaha

That was my result of a google search.

udevadm info --attribute-walk --name /dev/lirc0 shows this info.


Code:

Udevadm info 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 '/devices/pci0000:00/0000:00:0b.0/usb2/2-2/2-2:1.0/lirc/lirc0':
    KERNEL=="lirc0"                                                               
    SUBSYSTEM=="lirc"                                                             
    DRIVER==""                                                                   

  looking at parent device '/devices/pci0000:00/0000:00:0b.0/usb2/2-2/2-2:1.0':
    KERNELS=="2-2:1.0"                                                       
    SUBSYSTEMS=="usb"                                                         
    DRIVERS=="lirc_mceusb2"                                                   
    ATTRS{bInterfaceNumber}=="00"                                             
    ATTRS{bAlternateSetting}==" 0"                                           
    ATTRS{bNumEndpoints}=="02"                                               
    ATTRS{bInterfaceClass}=="ff"                                             
    ATTRS{bInterfaceSubClass}=="ff"                                           
    ATTRS{bInterfaceProtocol}=="ff"                                           
    ATTRS{modalias}=="usb:v0471p0815d0000dc00dsc00dp00icFFiscFFipFF"         
    ATTRS{supports_autosuspend}=="0"                                         

  looking at parent device '/devices/pci0000:00/0000:00:0b.0/usb2/2-2':
    KERNELS=="2-2"                                                   
    SUBSYSTEMS=="usb"                                                 
    DRIVERS=="usb"                                                   
    ATTRS{configuration}==""                                         
    ATTRS{bNumInterfaces}==" 1"                                       
    ATTRS{bConfigurationValue}=="1"                                   
    ATTRS{bmAttributes}=="a0"                                         
    ATTRS{bMaxPower}=="100mA"                                         
    ATTRS{urbnum}=="464"                                             
    ATTRS{idVendor}=="0471"                                           
    ATTRS{idProduct}=="0815"                                         
    ATTRS{bcdDevice}=="0000"                                         
    ATTRS{bDeviceClass}=="00"                                         
    ATTRS{bDeviceSubClass}=="00"                                     
    ATTRS{bDeviceProtocol}=="00"                                     
    ATTRS{bNumConfigurations}=="1"                                   
    ATTRS{bMaxPacketSize0}=="16"                                     
    ATTRS{speed}=="12"                                               
    ATTRS{busnum}=="2"                                               
    ATTRS{devnum}=="2"                                               
    ATTRS{version}==" 1.10"                                           
    ATTRS{maxchild}=="0"                                             
    ATTRS{quirks}=="0x0"                                             
    ATTRS{authorized}=="1"
    ATTRS{manufacturer}=="Philips"
    ATTRS{product}=="eHome Infrared Transceiver"
    ATTRS{serial}=="PH00PrU2"

  looking at parent device '/devices/pci0000:00/0000:00:0b.0/usb2':
    KERNELS=="usb2"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bMaxPower}=="  0mA"
    ATTRS{urbnum}=="86"
    ATTRS{idVendor}=="1d6b"
    ATTRS{idProduct}=="0001"
    ATTRS{bcdDevice}=="0206"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{speed}=="12"
    ATTRS{busnum}=="2"
    ATTRS{devnum}=="1"
    ATTRS{version}==" 1.10"
    ATTRS{maxchild}=="10"
    ATTRS{quirks}=="0x0"
    ATTRS{authorized}=="1"
    ATTRS{manufacturer}=="Linux 2.6.29.6-smp ohci_hcd"
    ATTRS{product}=="OHCI Host Controller"
    ATTRS{serial}=="0000:00:0b.0"
    ATTRS{authorized_default}=="1"

  looking at parent device '/devices/pci0000:00/0000:00:0b.0':
    KERNELS=="0000:00:0b.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="ohci_hcd"
    ATTRS{vendor}=="0x10de"
    ATTRS{device}=="0x036c"
    ATTRS{subsystem_vendor}=="0x1043"
    ATTRS{subsystem_device}=="0xcb84"
    ATTRS{class}=="0x0c0310"
    ATTRS{irq}=="23"
    ATTRS{local_cpus}=="ffffffff"
    ATTRS{local_cpulist}=="0-31"
    ATTRS{modalias}=="pci:v000010DEd0000036Csv00001043sd0000CB84bc0Csc03i10"
    ATTRS{enable}=="1"
    ATTRS{broken_parity_status}=="0"
    ATTRS{msi_bus}==""

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


Scuzz 08-21-2009 10:00 AM

Quote:

Originally Posted by ilikejam (Post 3652351)
Hi.

Not tested, but should work...
Create a 10-local.rules file in /etc/udev/rules.d and in there put the line:
KERNEL=="lirc0", SYMLINK+="lirc"

Dave


Thank you sir , it works.

rworkman 08-21-2009 01:06 PM

The following should key on that specific lirc device. Honestly though, if you only have one, then the line you're using now is fine.
Code:

SUBSYSTEMS=="usb", \
  ATTRS{manufacturer}=="Philips", \
  ATTRS{product}=="eHome Infrared Transceiver", \
  ATTRS{serial}=="PH00PrU2", \
  SYMLINK+="lirc"


Scuzz 08-21-2009 03:12 PM

Quote:

Originally Posted by rworkman (Post 3652706)
The following should key on that specific lirc device,
Code:


SUBSYSTEMS=="usb", \
  ATTRS{manufacturer}=="Philips", \
  ATTRS{product}=="eHome Infrared Transceiver", \
  ATTRS{serial}=="PH00PrU2", \
  SYMLINK+="lirc"


Just for the sake of learning something new at this point, Would i insert your code snippet into /etc/udev/rules.d/10-local.rules or some other location?

rworkman 08-21-2009 11:57 PM

Yeah, 10-local.rules is fine. Comment out the first part you already added though (or delete it).


All times are GMT -5. The time now is 08:38 PM.