LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 08-21-2009, 08:20 AM   #1
Scuzz
Member
 
Registered: Jul 2009
Posts: 35

Rep: Reputation: 16
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 ?
 
Old 08-21-2009, 08:39 AM   #2
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 96
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
 
Old 08-21-2009, 08:43 AM   #3
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 1,913

Rep: Reputation: Disabled
Quote:
Originally Posted by Scuzz View Post
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
 
Old 08-21-2009, 08:45 AM   #4
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 1,913

Rep: Reputation: Disabled
Quote:
Originally Posted by ilikejam View Post
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.
 
Old 08-21-2009, 08:52 AM   #5
Scuzz
Member
 
Registered: Jul 2009
Posts: 35

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by rworkman View Post
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==""
 
Old 08-21-2009, 10:00 AM   #6
Scuzz
Member
 
Registered: Jul 2009
Posts: 35

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by ilikejam View Post
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.
 
Old 08-21-2009, 01:06 PM   #7
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 1,913

Rep: Reputation: Disabled
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"
 
Old 08-21-2009, 03:12 PM   #8
Scuzz
Member
 
Registered: Jul 2009
Posts: 35

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by rworkman View Post
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?
 
Old 08-21-2009, 11:57 PM   #9
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 1,913

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


Reply

Tags
lirc


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I make a udev rule for a particular usb port? kairen Slackware 3 02-15-2008 08:30 AM
does udev make /dev/ttyS0 ? dansawyer Linux - Software 2 10-23-2005 11:16 PM
how to make udev save changes? h3xis Linux - Software 3 07-19-2005 11:34 PM
how to tell udev to make a dev jimdaworm Slackware 10 08-13-2004 07:12 AM
Make Link Insomnia Linux - General 2 05-28-2004 05:33 AM


All times are GMT -5. The time now is 02:59 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration