18 March 2007

Working Firefly Remote with Fedora FC6 and LIRC

A while ago I bought a Firefly Radio remote - the buttons in my ATI remote were wearing out. For the longest time it worked with my old ATI receiver. Then time passed and it ceased working, my TV died, I upgraded to Fedora Core 6 and bought a new TV.

It took a bit of digging and a bunch of helpful posts, but I finally got my Firefly working under FC6. Here's what I did:

# yum install lirc


You probably know what LIRC is.

# yum install dkms

I apparently have been living in a wet cardboard box for the past decade. You know all those third party drivers that have scripts to hand compile their kernel modules each time you upgrade your kernel (ala ./vmware-config.pl and the NVidia stuff), well Dynamic Kernel Module Support is a standard, easy way of handling those kind of things. I don't know how popular it is, but it makes good sense. Their page has a few links on what it does and why it's relatively cool. It's simple, it's documented, and it works. I'm sold.

Once it's installed, you should be able to type "dkms status" without any errors.

Now, FC6 has LIRC drivers built through DKMS. So go get them. I got mine from here, but I'd imagine googling for "lirc dkms fc6 rpm" will help you find your way. Make sure you've grabbed the FC6 ones.

# rpm -ivh dkms-lirc-0.8......etc..etc..noarch.rpm

First, try your luck at just building them (change the version accordingly):

# dkms build -m lirc -v 0.8.1-1.fc6.rf

If that didn't work, and the make.log complains about SLAB_CONFIG, you'll need to do what I did. Apparently SLAB_CONFIG is now known as GFP_KERNEL. Edit the .c files found with this:

# grep -l SLAB_CONFIG `rpm -ql dkms-lirc`

Done? Good. Run it again to make sure you didn't miss any. (The patching tip came from here.)

Now build again. It should print "This should take a few minutes.." dots as you patiently hope it works. Installing once it's done is pretty simple:

# dkms install -m lirc -v 0.8.1-1.fc6.rf
...scroll...
# dkms status
lirc, 0.8.1-1.fc6.rf, 2.6.20-1.2925.fc6, i686: installed

Okay. That's the hard part. I followed bits of this post for the rest. I ran modprobe lirc_atiusb by hand, and edited /etc/modprobe.conf as he suggested. I also used the /etc/lircd.conf config he specified - but I had to fix the name line. I booted up lircd in non daemon mode (because anything with "ircd" in its title should have a non-daemon mode):

# lircd -n &

I also symlink'd /dev/lirc0 to /dev/lirc. You probably want to do the Right Thing - whatever that is. Anyway, I ran the test app and pressed some buttons:

# irw
lircd-0.8.1[10441]: accepted new client on /dev/lircd
00000014739e0000 00 OK Firefly

Sweet!

No comments: