Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 568180 - app-misc/lirc-0.9.0-r5 using lirc_serial doesn't compile with kernel 4.1.12
Summary: app-misc/lirc-0.9.0-r5 using lirc_serial doesn't compile with kernel 4.1.12
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Craig Andrews
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2015-12-13 16:58 UTC by Tom Dexter
Modified: 2016-07-31 22:09 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for lirc-0.9.0-r5 lirc_serial for 4.1.12 (0002-lirc.patch,19.56 KB, patch)
2015-12-13 16:58 UTC, Tom Dexter
Details | Diff
Patch for lirc-0.9.0-r5 for kernel 4.0.5 for lirc_dev.c (0001-fix-file-dentry.patch,2.27 KB, patch)
2015-12-13 17:00 UTC, Tom Dexter
Details | Diff
Minimal ebuild for lirc-0.9.2a and openrc init (lirc-0.9.2a-r1.ebuild,964 bytes, text/plain)
2015-12-25 16:36 UTC, Tom Dexter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Dexter 2015-12-13 16:58:57 UTC
Created attachment 419128 [details, diff]
Patch for lirc-0.9.0-r5 lirc_serial for 4.1.12

I was already running a patched version of lirc-0.9.0-r5 to handle changes needed in drivers/lirc_dev/lirc_dev.c for kernel 4.0.5.  I can't recall where I obtained that patch but I've attached that here as well.

When trying to compile that version against kernel 4.1.12, it failed with an error that appears to have started with this:

In file included from /var/tmp/portage/app-misc/lirc-0.9.0-r5/work/lirc-0.9.0/drivers/lirc_serial/lirc_serial.c:69:0:
/var/tmp/portage/app-misc/lirc-0.9.0-r5/work/lirc-0.9.0/drivers/lirc_serial/lirc_serial.c: In function ‘set_use_inc’:
/var/tmp/portage/app-misc/lirc-0.9.0-r5/work/lirc-0.9.0/drivers/lirc_serial/../../drivers/kcompat.h:117:23: error: ‘SA_INTERRUPT’ undeclared (first us
e in this function)
 #define IRQF_DISABLED SA_INTERRUPT

I've been able to get it working with a patch to drivers/lirc_serial/lirc_serial.c based on a diff between the file currently in lirc-0.9.0-r5 and this:

https://fossies.org/linux/kernel/v4.1/linux-4.1.14.tar.gz/linux-4.1.14/drivers/staging/media/lirc/lirc_serial.c

I've attached that patch.  Honestly I was stunned that it even worked, as there were enough differences that I'm not sure that isn't from an altogether newer version of lirc, however it appears to have worked flawlessly.

The attached file 0001-fix-file-dentry.patch was from the previous fix for 4.0.5 and 0002-lirc.patch is the patch for lirc_serial.c.
Comment 1 Tom Dexter 2015-12-13 17:00:12 UTC
Created attachment 419130 [details, diff]
Patch for lirc-0.9.0-r5 for kernel 4.0.5 for lirc_dev.c
Comment 2 Tom Dexter 2015-12-14 15:02:07 UTC
Just wow...I decided to do a little more digging to try and figure out exactly what that lirc_serial.c above even is.  The first thing I discovered was that there was no such version anywhere in the lirc git repo at all.  Anything I could find there appeared to be like the version currently in 0.9.0-r5, and anything past 0.9.1 no longer has any of this in the drivers directory at all.

Finally I discovered that that's simply the exact version of lirc_serial.c that's apparently appeared in the kernel itself at drivers/staging/media/lirc/lirc_serial.c since (at least) kernel 4.0.5 apparently.

Again...the patch is working fine for me but this has me totally confused.  Is the approach in the newer versions of lirc that the actual support be enables in the kernel and that the lirc package just provides the daemon or something?

Very confusing.
Comment 3 Ian Stakenvicius (RETIRED) gentoo-dev 2015-12-14 15:37:41 UTC
Linux kernels starting somewhere around 3.0 have been carrying the physical drivers for most remote controls; to be honest it has imo rendered the lirc package nearly useless, at least from the perspective of any LIRC_DEVICES other than "userspace".

I think anyone that's involved in maintaining this package should consider its future in terms of continuing to maintain the drivers, or just dropping them.
Comment 4 Tom Dexter 2015-12-25 16:30:02 UTC
Agreed.  Correct me if I'm wrong, but it appears that the newer versions of lirc are mostly just a means of exposing the kernel drivers to userland via a socket using /usr/sbin/lircd.  I see the the drivers directory isn't even really used apparently.

I ended up compiling the lirc_serial support directly into my kernel (not as a module), and cobbling together a rather simple modified version of the 0.9.2a ebuild referenced here:

https://bugs.gentoo.org/show_bug.cgi?id=515902

I'll probably attach it here for reference, but it's surely incomplete for many purposes.  The primary differences between the mine and the one referenced there is that, rather than the systemd stuff he has in his, mine installs the openrc lircd init script and doesn't require anything in files that isn't already in the current files directory.

In my case using lirc_serial it was surprisingly easy to get working.  The only real difference in my case as far as configuration files was that I used the new /etc/lirc/lircd.conf format, which includes "lircd.conf.d/*.conf", and I put my existing remote config under lircd.conf.d.

I sure won't miss recompiling lirc (or wondering if it in fact will) every time I upgrade my kernel.
Comment 5 Tom Dexter 2015-12-25 16:36:55 UTC
Created attachment 420780 [details]
Minimal ebuild for lirc-0.9.2a and openrc init
Comment 6 Pacho Ramos gentoo-dev 2016-02-18 10:21:26 UTC
Is anyone willing to proxy maintain this package?
https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers
Comment 7 Craig Andrews gentoo-dev 2016-07-31 22:09:09 UTC
As of app-misc/lirc-0.9.4, lirc doesn't have LIRC_DEVICES or any kernel drivers (because, as stated in a previous comment, those are included in the kernel). So this issue is no longer relevant - please include whatever drivers you want/need using kernel configuration.