[mythtv-users] How to make the LIRC_DEVICE static in Fedora 16

Joey Morris rjmorris at nc.rr.com
Tue Dec 13 01:13:21 UTC 2011


Gabe Rubin <gaberubin at gmail.com> wrote on Mon, Dec 12, 2011 at 04:37:50PM -0800:
> On Mon, Dec 12, 2011 at 4:20 PM, Joey Morris <rjmorris at nc.rr.com> wrote:
> > Gabe Rubin <gaberubin at gmail.com> wrote on Mon, Dec 12, 2011 at 09:32:41AM -0800:
> >> On Sun, Dec 11, 2011 at 6:26 AM, Joey Morris <rjmorris at nc.rr.com> wrote:
> >> > When you did this:
> >> >
> >> >  # ln -fs /dev/input/`cat /proc/bus/input/devices|grep -A 3
> >> >    "Hauppauge"|grep event|cut -d ' ' -f3` /dev/input/remote
> >> >
> >> > the reason you ended up with this symlink:
> >> >
> >> >  remote -> /dev/input/
> >> >
> >> > is that the cat|grep|grep|cut sequence didn't return anything. Did you
> >> > try running cat /proc/bus/input/devices by itself on the command line
> >> > to see what it gives you? Maybe you just need to change how you're
> >> > grepping.
> >>
> >> Here is what I get.  I am not sure how to modify the grep sequence
> >> (and I am concerned that on reboot, when the event id changes, the
> >> symlink won't reflect that).  I just used the syntax that was in the
> >> wiki:
> >>
> >> [root at localhost ~]# cat cat /proc/bus/input/devices
> >>
> >> [snip]
> >>
> >> I: Bus=0018 Vendor=0000 Product=0000 Version=0000
> >> N: Name="i2c IR (Hauppauge WinTV PVR-350"
> >> P: Phys=i2c-1/1-0018/ir0
> >> S: Sysfs=/devices/virtual/rc/rc0/input2
> >> U: Uniq=
> >> H: Handlers=kbd event2
> >> B: PROP=0
> >> B: EV=100013
> >> B: KEY=10afc312 2142017 0 0 0 0 118000 41a8 4801 9e16c0 0 0 10000ffc
> >> B: MSC=10
> >>
> >> [snip]
> >
> > (For brevity, I've cut out the part of your /proc/bus/input/devices
> > output that doesn't apply to your IR receiver.)
> >
> > Assuming that the event listed in your Handlers line is the right
> > one and that it changes appropriately on reboot, you should get the
> > right symlink if you change grep -A 3 to grep -A 4, like this:
> >
> >    ln -fs /dev/input/`cat /proc/bus/input/devices|grep -A 4
> >     "Hauppauge"|grep event|cut -d ' ' -f3` /dev/input/remote
> >
> > The event line is now 4 lines below the Hauppauge line. It must have
> > only been 3 lines below when the wiki page was written.
> >
> > Using udev is probably the more elegant solution, because you don't
> > have to worry about parsing that file. If you want to try the udev
> > route, your udev rules need to match against the device's attributes
> > in the udev database. The Sysfs line from /proc/bus/input/devices
> > shows you the path to your device, and you can use udevadm to display
> > all its attributes, like this:
> >
> >    udevadm info --attribute-walk --path /sys/devices/virtual/rc/rc0/input2
> >
> > >From the output of that, you can probably figure out how to modify the
> > other udev rule examples to match what you have.
> >
> > Note that I'm basing all this on my Ubuntu 11.04 install, so there are
> > no guarantees that any of this will work on F16.
> 
> I am thinking that the udev route is probably the way to go, and I
> will experiment with it.  But until I do, I am going to try the
> symlink (btw, the syntax you gave me works, thanks!!).  However, if
> the event number changes on reboot, won't the symlink just point to an
> incorrect event number?  Do I need to run a startup script that
> removes the symlink, creates the symlink, and then  starts up lirc
> (while turning off the lirc service from autostarting)?
> 
> I figure I can just make a script like so and call it from rc.local
> 
> #! /bin/bash
> /bin/rm -f /dev/input/remote
> /bin/ln -fs /dev/input/`cat /proc/bus/input/devices|grep -A 4
> "Hauppauge"|grep event|cut -d ' ' -f3` /dev/input/remote
> # restart lirc in case it is already running
> /sbin/service lirc restart
> 
> Is this correct, unneeded, or a very ugly hack?

Yes, you'll need to re-create the symlink at every reboot. The wiki
suggests adding the ln command to whichever file starts up lirc,
/etc/init.d/lirc in the example from the wiki. I'd assume that would
work for you, but calling it from rc.local seems fine also.

It won't hurt anything, but you don't need to explicitly delete the
symlink before creating it. ln will overwrite the existing one without
prompting thanks to -f.


More information about the mythtv-users mailing list