Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lirc cleanup: switch to upstream fixes and configuration #1320

Merged
merged 11 commits into from Apr 23, 2017

Conversation

HiassofT
Copy link
Member

don't merge yet, this is WIP

Discussion with upstream revealed that several crosscompile issues (yaml, poll, uinput) are already fixed in lircd 0.9.4d and we can use upstream configure methods instead of working around these with downstream patches.

I've also added the proposed upstream fixes from https://sourceforge.net/p/lirc/tickets/264/ (lirc-make-devinput picking up host headers and enabling devinput on the target) so we can test them in LE builds.

@lrusak @Kwiboo @jerome-benoit the downstream lircd patches seem to be originating from you, can you please check if everything's still fine?

Also: what's the purpose of lirc-0002-disable-python3.patch? lirc compiled fine without that patch on Debian Jessie and lircd still worked fine on my RPi2 so not quite sure why we are carrying it.

@Kwiboo
Copy link
Member

Kwiboo commented Feb 11, 2017

lirc-0002-disable-python3.patch was needed last time I tried to build when python was missing on build host (minimal ubuntu xenial docker container). I will test again if this is still needed.

@Kwiboo
Copy link
Member

Kwiboo commented Feb 12, 2017

Without lirc-0002-disable-python3.patch building lirc without Python 3.1 on host errors out:

checking for a Python interpreter with version >= 3.1... none
configure: error: no suitable Python interpreter found

From https://www.gnu.org/software/automake/manual/html_node/Python.html
If action-if-not-found is not specified, as in the following example, the default is to abort configure.

Use upstream configuration settings where possible and
replace downstream patches with upstream fixes.

Rename downstream patches to start with 0100
This fixes lircd not picking up devices created after lircd
startup

See https://sourceforge.net/p/lirc/tickets/279/
Docs are removed after installation so no need to build them
Based on upstream lirc_options.conf with the following changes:
- socket set to /run/lirc/lircd.socket, the default clashes with eventlircd
- pidfile in /run instead of /var/run
- driver set to default
- device set to /dev/lirc0
Add helper scripts for lircd and lircd-uinput so that we can
override lirc_options.conf and lircd.conf via files in
/storage/.config

Use separate systemd units for lircd and lircd-uinput, like in
upstream, and just add a ConditionPathExists to enable/disable
the services.

The lirc socket is managed by systemd via lircd.socket, like
in upstream.

Remove udev file for enabling lirc, this is now handled via
systemd only.
@HiassofT HiassofT changed the title lirc cleanup: switch to upstream fixes [WIP] lirc cleanup: switch to upstream fixes and configuration Apr 7, 2017
@HiassofT
Copy link
Member Author

HiassofT commented Apr 7, 2017

I've finished the cleanup and moved compilation and configuration very close to upstream:

lircd and lircd-uinput are now standard systemd units, lircd socket is managed by systemd - like in upstream.

I've kept the .cache/services/lircd.conf ConditionPathExists so enabling lirc via LE settings works as before, but for proper starting/stopping the services (while LE is running) a LE settings update is needed: HiassofT/service.libreelec.settings@03511b3

Common configuration (driver etc) is now handled via lirc_options.conf, the default in /etc can be overridden via //storage/.config.

I've also split the huge combined lircd.conf.* files into separate ones in lircd.conf.d and added a default lircd.conf file which includes all these separate files.

I also had to add a few fixes backported from lirc master branch which can be dropped on the next lirc bump. I've reorganized the patch numbering so that the upstream fixes (which can be dropped) start with 0001 whereas our downstream patches start with 0100.

@HiassofT
Copy link
Member Author

this PR survived 2 weeks of testing in milhouse builds, so I'd say this is good to go now!

Copy link
Member

@chewitt chewitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HiassofT thanks, great work 👍

@chewitt chewitt merged commit 576ddc0 into LibreELEC:master Apr 23, 2017
@HiassofT HiassofT deleted the le-lirc-cleanup branch January 16, 2021 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants