Personal tools
You are here: Home Open Source && Programming && Life Lirc-modules got broke in Linux 2.6.19/2.6.20+

Lirc-modules got broke in Linux 2.6.19/2.6.20+ Lirc-modules got broke in Linux 2.6.19/2.6.20+

Document Actions
Submitted by ironstorm. on 2007-02-08 03:10. Kubuntu/UbuntuLinuxMythTVOpen Source

This is a continuation of "Soundgraph iMON PAD + VFD LIRC kernel modules the Debian-way"...

Somewhere along the way to Linux 2.6.19 being released config.h fell out of style, resulting in the following error when attempting to build LIRC the debian/ubuntu way, here's what you see:
...
test -e include/linux/autoconf.h -a -e include/config/auto.conf || ( \
echo; \
echo " ERROR: Kernel configuration is invalid."; \
echo " include/linux/autoconf.h or include/config/auto.conf are missing."; \
echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \
echo; \
/bin/false)
mkdir -p /usr/src/lirc-0.8.1pre2/drivers/lirc_dev/.tmp_versions
rm -f /usr/src/lirc-0.8.1pre2/drivers/lirc_dev/.tmp_versions/*
make -f scripts/Makefile.build obj=/usr/src/lirc-0.8.1pre2/drivers/lirc_dev
gcc -Wp,-MD,/usr/src/lirc-0.8.1pre2/drivers/lirc_dev/.lirc_dev.o.d -nostdinc -isystem ....
/usr/src/lirc-0.8.1pre2/drivers/lirc_dev/lirc_dev.c:35:26: error: linux/config.h: No such file or directory
...


To fix it, we patch the lirc-modules.tar.gz tarball to look for linux/autoconf.h in its place. Here's how I did it:
### Patch the lirc-modules.tar.gz file to work with Linux 2.6.19+ 
### Run this before trying to build with 'module-assistant --text-mode --kernel-dir /usr/src/linux-source-`uname -r` build lirc'
if [ "`uname -r|cut -d- -f1|sed 's/\.//g'`" -ge "2619" ]; then
cd /usr/src
mkdir patch-lirc-for-2.6.20+
cd patch-lirc-for-2.6.20+
tar -zxf /usr/src/lirc-modules.tar.gz
grep -r "linux/config.h" * | cut -d: -f1 | xargs sed -i 's-linux/config.h-linux/autoconf.h-g'
mv -i /usr/src/lirc-modules.tar.gz /usr/src/lirc-modules-unpatched.tar.gz
tar -czf /usr/src/lirc-modules.tar.gz .
cd /usr/src
rm -rf patch-lirc-for-2.6.20+
fi

EDIT (Feb 9): there's also a patch that will likely go into Debian (upstream) which does something similar to the above code, but is version safe for older kernels...  that is here: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=400494;msg=5;filename=lirc-config.patch;att=1 [Debian Bug Link] [Ubuntu Bug Link]

Finally when I tried to build my imon module my compile dumped with some crap error relating to Windows MCE IR device modules:
...
/usr/src/lirc-0.8.1/drivers/lirc_mceusb2/lirc_mceusb2.c: In function ‘request_packet_async’:
/usr/src/lirc-0.8.1/drivers/lirc_mceusb2/lirc_mceusb2.c:237: warning: passing argument 6 of ‘usb_fill_int_urb’ from incompatible pointer type
/usr/src/lirc-0.8.1/drivers/lirc_mceusb2/lirc_mceusb2.c:245: warning: passing argument 6 of ‘usb_fill_int_urb’ from incompatible pointer type
/usr/src/lirc-0.8.1/drivers/lirc_mceusb2/lirc_mceusb2.c:266: error: ‘SLAB_ATOMIC’ undeclared (first use in this function)
/usr/src/lirc-0.8.1/drivers/lirc_mceusb2/lirc_mceusb2.c:266: error: (Each undeclared identifier is reported only once
/usr/src/lirc-0.8.1/drivers/lirc_mceusb2/lirc_mceusb2.c:266: error: for each function it appears in.)
...
Since I don't care about MCE support at the moment, the solution for that one was to rerun dpkg-reconfigure and unselect the mceusb/mceusb2 modules and build again:
dpkg-reconfigure lirc-modules-source  # ditch building mceusb2 and mceusb modules if they give trouble.	

After the rest of the build and install, did a quick restart to confirmed that everything is back up and running (you can follow the older post's restart steps if you'd prefer not to reboot).


OMGWTFBBQ!!

Posted by Anonymous User at 2007-06-04 13:14

@ ironstorm

OMG you are my saviour!! I'd just put together my brand new myth box (ubuntu w./ a-whole-bunch-of-nice-though-expensive-hardware) and paid the extra 50% for the vfd in the silverstone lc20m... felt kindda stupid when it was dead all the time:P So thanx man - love it!

Blog
« July 2008 »
Su Mo Tu We Th Fr Sa
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    
Categories:
Best Practices (0)
Cooking (2)
EeePC (1)
Embedded (3)
HDTV (2)
Health (1)
J2EE (1)
Java (6)
Linux (24)
Movies (1)
Music (3)
MythTV (10)
NSLU2 (2)
Not Tech (11)
Plone (2)
Politics (2)
QEMU (4)
Tomcat (1)
Tooling (4)
Travel (1)
VoIP (1)
Websphere (1)
Windows (6)
Zaurus (4)
 

Powered by Plone, the Open Source Content Management System

This site conforms to the following standards: