diff --git a/packages/devel/libirman/patches/libirman-0001-fix-poll-include.patch b/packages/devel/libirman/patches/libirman-0001-fix-poll-include.patch new file mode 100644 index 00000000000..50057243498 --- /dev/null +++ b/packages/devel/libirman/patches/libirman-0001-fix-poll-include.patch @@ -0,0 +1,35 @@ +diff -Naur a/config.h.in b/config.h.in +--- a/config.h.in 2016-05-18 18:19:56.000000000 +0200 ++++ b/config.h.in 2016-12-26 22:49:43.514203152 +0100 +@@ -21,6 +21,9 @@ + /* Define to 1 if you have the `mkfifo' function. */ + #undef HAVE_MKFIFO + ++/* defined if poll.h is available */ ++#undef HAVE_POLL_H ++ + /* Define to 1 if you have the `select' function. */ + #undef HAVE_SELECT + +@@ -48,6 +51,9 @@ + /* Define to 1 if you have the header file. */ + #undef HAVE_SYS_FILE_H + ++/* defined if sys/poll.h is available */ ++#undef HAVE_SYS_POLL_H ++ + /* Define to 1 if you have the header file. */ + #undef HAVE_SYS_STAT_H + +diff -Naur a/configure.ac b/configure.ac +--- a/configure.ac 2016-05-18 18:19:41.000000000 +0200 ++++ b/configure.ac 2016-12-26 22:48:40.190031280 +0100 +@@ -20,7 +20,7 @@ + + dnl Checks for header files. + AC_HEADER_STDC +-AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h termios.h memory.hi sys/file.h) ++AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h termios.h memory.hi sys/file.h poll.h sys/poll.h) + + dnl Checks for typedefs, structures, and compiler characteristics. + AC_TYPE_PID_T diff --git a/packages/sysutils/eventlircd/udev.d/98-eventlircd.rules b/packages/sysutils/eventlircd/udev.d/98-eventlircd.rules index 446a82c18b4..f75dea2ee81 100644 --- a/packages/sysutils/eventlircd/udev.d/98-eventlircd.rules +++ b/packages/sysutils/eventlircd/udev.d/98-eventlircd.rules @@ -30,6 +30,9 @@ ATTRS{name}=="eventlircd", GOTO="end" ATTRS{name}=="lircd", \ ENV{eventlircd_enable}="true" +ATTRS{name}=="lircd-uinput", \ + ENV{eventlircd_enable}="true" + #------------------------------------------------------------------------------- # Ask eventlircd to handle input event devices created by bdremoteng. For this # to work, bdremoteng must be configured to output Linux input events and must diff --git a/packages/sysutils/lirc/package.mk b/packages/sysutils/lirc/package.mk index e39ac2d9762..550fecb0e33 100644 --- a/packages/sysutils/lirc/package.mk +++ b/packages/sysutils/lirc/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="lirc" -PKG_VERSION="0.9.4" +PKG_VERSION="0.9.4c" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="GPL" @@ -31,8 +31,7 @@ PKG_LONGDESC="LIRC is a package that allows you to decode and send infra-red sig PKG_IS_ADDON="no" PKG_AUTORECONF="yes" -PKG_CONFIGURE_OPTS_TARGET="ac_cv_path_LIBUSB_CONFIG= / - ac_cv_func_forkpty=no \ +PKG_CONFIGURE_OPTS_TARGET="ac_cv_func_forkpty=no \ ac_cv_lib_util_forkpty=no \ ac_cv_prog_HAVE_PYTHON3=no \ --localstatedir=/ \ @@ -40,10 +39,6 @@ PKG_CONFIGURE_OPTS_TARGET="ac_cv_path_LIBUSB_CONFIG= / --without-x" post_makeinstall_target() { - rm -rf $INSTALL/usr/bin/pronto2lirc - rm -rf $INSTALL/usr/bin/lirc-setup - rm -rf $INSTALL/usr/sbin/lircd-setup - rm -rf $INSTALL/usr/lib/python3.4 rm -rf $INSTALL/usr/lib/systemd rm -rf $INSTALL/lib rm -rf $INSTALL/usr/share diff --git a/packages/sysutils/lirc/patches/lirc-0002-disable-python3.patch b/packages/sysutils/lirc/patches/lirc-0002-disable-python3.patch index 603bc582496..797dbccff4f 100644 --- a/packages/sysutils/lirc/patches/lirc-0002-disable-python3.patch +++ b/packages/sysutils/lirc/patches/lirc-0002-disable-python3.patch @@ -1,13 +1,15 @@ diff -Naur a/configure.ac b/configure.ac --- a/configure.ac 2016-06-08 13:06:09.757102470 -0700 +++ b/configure.ac 2016-06-08 13:07:04.620705345 -0700 -@@ -41,8 +41,8 @@ +@@ -40,9 +40,9 @@ + AM_CONDITIONAL(HAVE_DOXYGEN, test x$DOXYGEN = xyes) AC_PROG_LN_S LT_INIT([disable-static]) - AM_PATH_PYTHON([3.1],,) +-AM_PATH_PYTHON([3.1],,) -AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != ""]) -AC_CHECK_PROG([HAVE_PYTHON3],[python3],[yes],[no]) -+AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" == ""]) ++AM_PATH_PYTHON([3.1],,[:]) ++AM_CONDITIONAL([HAVE_PYTHON], [false]) +AC_CHECK_PROG([HAVE_PYTHON3],[python3],[no],[no]) LIBUSB_CONFIG="pkg-config libusb" @@ -15,24 +17,27 @@ diff -Naur a/configure.ac b/configure.ac diff -Naur a/tools/Makefile.am b/tools/Makefile.am --- a/tools/Makefile.am 2016-05-23 10:18:48.000000000 -0700 +++ b/tools/Makefile.am 2016-06-08 13:15:25.711341537 -0700 -@@ -114,19 +114,12 @@ +@@ -114,22 +114,7 @@ install-exec-hook: $(SED) -i -e 's/@version@/$(VERSION)/' \ - $(DESTDIR)$(bindir)/lirc-config-tool \ - $(DESTDIR)$(bindir)/irdb-get -+ $(DESTDIR)$(bindir)/lirc-config-tool - rm -f $(DESTDIR)/$(bindir)/lirc-setup - $(srcdir)/make_rel_symlink.py \ - $(DESTDIR)/$(pkgpythondir)/lirc-setup \ - $(DESTDIR)/$(bindir)/lirc-setup - +- rm -f $(DESTDIR)/$(bindir)/lirc-setup +- $(srcdir)/make_rel_symlink.py \ +- $(DESTDIR)/$(pkgpythondir)/lirc-setup \ +- $(DESTDIR)/$(bindir)/lirc-setup +- -install-data-hook: - rm -f $(DESTDIR)/$(pkgpythondir)/configs - $(srcdir)/make_rel_symlink.py \ - $(DESTDIR)$(pkgdatadir)/configs \ - $(DESTDIR)$(pkgpythondir)/configs - - uninstall-hook: - rm -f $(DESTDIR)/$(bindir)/lirc-setup \ - $(DESTDIR)/$(pkgpythondir)/configs +-uninstall-hook: +- rm -f $(DESTDIR)/$(bindir)/lirc-setup \ +- $(DESTDIR)/$(pkgpythondir)/configs ++ $(DESTDIR)$(bindir)/lirc-config-tool + + clean-local: + -find . -name __pycache__ -exec rm -r {} \; diff --git a/packages/sysutils/lirc/patches/lirc-0003-add-dependencies-to-fix-parallel-build-issue.patch b/packages/sysutils/lirc/patches/lirc-0003-add-dependencies-to-fix-parallel-build-issue.patch deleted file mode 100644 index 09add56b197..00000000000 --- a/packages/sysutils/lirc/patches/lirc-0003-add-dependencies-to-fix-parallel-build-issue.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/lib/Makefile.am.org 2016-05-23 19:18:48.000000000 +0200 -+++ a/lib/Makefile.am 2016-06-22 22:15:26.511048224 +0200 -@@ -31,9 +31,11 @@ - - libirrecord_la_LDFLAGS = -llirc - libirrecord_la_SOURCES = irrecord.c -+libirrecord_la_DEPENDENCIES = liblirc.la - - liblirc_client_la_LDFLAGS = -version-info 4:0:4 - liblirc_client_la_SOURCES = lirc_client.c lirc_client.h lirc_log.c lirc_log.h -+liblirc_client_la_DEPENDENCIES = liblirc.la - - liblirc_driver_la_LDFLAGS = -version-info 0:0:0 - liblirc_driver_la_SOURCES = driver.h \ -@@ -49,6 +51,7 @@ - serial.c \ - transmit.c \ - transmit.h -+liblirc_driver_la_DEPENDENCIES = liblirc.la - - dist_include_HEADERS = lirc_client.h \ - lirc_driver.h \ diff --git a/packages/sysutils/lirc/patches/lirc-0004-fix-freeaddrinfo-handling.patch b/packages/sysutils/lirc/patches/lirc-0004-fix-freeaddrinfo-handling.patch deleted file mode 100644 index e5915723c4c..00000000000 --- a/packages/sysutils/lirc/patches/lirc-0004-fix-freeaddrinfo-handling.patch +++ /dev/null @@ -1,110 +0,0 @@ ---- a/daemons/lircd.cpp -+++ b/daemons/lircd.cpp -@@ -901,43 +901,41 @@ - { - int r; - char service[64]; -- struct addrinfo* addr; -- struct addrinfo* tmp; -+ struct addrinfo* addrinfos; -+ struct addrinfo* a; - int enable = 1; - - snprintf(service, sizeof(service), "%d", peer->port); - peer->socket = socket(AF_INET, SOCK_STREAM, 0); -- r = getaddrinfo(peer->host, service, NULL, &addr); -+ r = getaddrinfo(peer->host, service, NULL, &addrinfos); - if (r != 0) { -- log_error("Name lookup failure connecting to %s", -- peer->host); -- peer->connection_failure++; -- gettimeofday(&peer->reconnect, NULL); -- peer->reconnect.tv_sec += 5 * peer->connection_failure; -- close(peer->socket); -- peer->socket = -1; -- return; -+ log_perror_err("Name lookup failure connecting to %s", -+ peer->host); -+ goto errexit; - } - (void)setsockopt(peer->socket, - SOL_SOCKET, SO_KEEPALIVE, &enable, sizeof(enable)); -- do { -- r = connect(peer->socket, -- addr->ai_addr, sizeof(struct sockaddr)); -- tmp = addr; -- addr = addr->ai_next; -- freeaddrinfo(tmp); -- } while (r < 0 && addr != NULL); -+ for (a = addrinfos; a != NULL; a = a->ai_next) { -+ r = connect(peer->socket, a->ai_addr, a->ai_addrlen); -+ if (r >= 0) -+ break; -+ } -+ freeaddrinfo(addrinfos); - if (r == -1) { - log_perror_err("Cannot connect to %s", peer->host); -- peer->connection_failure++; -- gettimeofday(&peer->reconnect, NULL); -- peer->reconnect.tv_sec += 5 * peer->connection_failure; -- close(peer->socket); -- peer->socket = -1; -- return; -- } -- log_notice("connected to %s", peer->host); -+ goto errexit; -+ } -+ log_notice("Connected to %s", peer->host); - peer->connection_failure = 0; -+ return; -+ -+errexit: -+ peer->connection_failure++; -+ gettimeofday(&peer->reconnect, NULL); -+ peer->reconnect.tv_sec += 5 * peer->connection_failure; -+ close(peer->socket); -+ peer->socket = -1; -+ return; - } - - ---- a/lib/lirc_client.c -+++ b/lib/lirc_client.c -@@ -2050,28 +2050,25 @@ - - int lirc_get_remote_socket(const char* address, int port, int quiet) - { -- struct addrinfo* host; -- struct addrinfo* tmp; -+ struct addrinfo* addrinfos; -+ struct addrinfo* a; - char service[64]; - int r; - - snprintf(service, sizeof(service), - "%d", port > 0 ? port : LIRC_INET_PORT); -- r = getaddrinfo(address, service, NULL, &host); -+ r = getaddrinfo(address, service, NULL, &addrinfos); - if (r < 0) { - if (!quiet) - fprintf(stderr, "get_remote_socket: host %s unknown\n", - address); - return -EADDRNOTAVAIL; - } -- do { -- r = do_connect(host->ai_family, -- host->ai_addr, -- sizeof(host->ai_addr), -- quiet); -- tmp = host; -- host = host->ai_next; -- freeaddrinfo(tmp); -- } while (r < 0 && host != NULL); -+ for (a = addrinfos; a != NULL; a = a->ai_next) { -+ r = do_connect(a->ai_family, a->ai_addr, a->ai_addrlen, quiet); -+ if (r >= 0) -+ break; -+ }; -+ freeaddrinfo(addrinfos); - return r; - } diff --git a/packages/sysutils/lirc/patches/lirc-0005-uinput.patch b/packages/sysutils/lirc/patches/lirc-0005-uinput.patch deleted file mode 100644 index 6456a5d86c9..00000000000 --- a/packages/sysutils/lirc/patches/lirc-0005-uinput.patch +++ /dev/null @@ -1,110 +0,0 @@ -diff --git a/daemons/lircd-uinput.cpp b/daemons/lircd-uinput.cpp -index 6a619e9..1bee48b 100644 ---- a/daemons/lircd-uinput.cpp -+++ b/daemons/lircd-uinput.cpp -@@ -135,6 +135,8 @@ int setup_uinputfd(const char* path) - { - int fd; - int key; -+ linux_input_code code; -+ int i; - struct uinput_user_dev dev; - - fd = open(path, O_RDWR); -@@ -150,9 +152,14 @@ int setup_uinputfd(const char* path) - || ioctl(fd, UI_SET_EVBIT, EV_REP) != 0) - goto setup_error; - -- for (key = KEY_RESERVED; key <= KEY_UNKNOWN; key++) -- if (ioctl(fd, UI_SET_KEYBIT, key) != 0) -- goto setup_error; -+ for (i = 0; get_input_code_by_index(i, &code) >= 0; i++) { -+ key = (int)code; -+ if (((key >= KEY_ESC) && (key <= KEY_RFKILL)) || -+ ((key >= KEY_OK ) && (key <= KEY_WPS_BUTTON))) { -+ if (ioctl(fd, UI_SET_KEYBIT, key) != 0) -+ goto setup_error; -+ } -+ } - - if (ioctl(fd, UI_DEV_CREATE) != 0) - goto setup_error; -diff --git a/daemons/lircd.cpp b/daemons/lircd.cpp -index 782b6d3..020c57e 100644 ---- a/daemons/lircd.cpp -+++ b/daemons/lircd.cpp -@@ -695,6 +695,8 @@ int setup_uinputfd(const char* name) - #if defined(__linux__) - int fd; - int key; -+ linux_input_code code; -+ int i; - struct uinput_user_dev dev; - - fd = open("/dev/input/uinput", O_RDWR); -@@ -715,9 +717,14 @@ int setup_uinputfd(const char* name) - || ioctl(fd, UI_SET_EVBIT, EV_REP) != 0) - goto setup_error; - -- for (key = KEY_RESERVED; key <= KEY_UNKNOWN; key++) -- if (ioctl(fd, UI_SET_KEYBIT, key) != 0) -- goto setup_error; -+ for (i = 0; get_input_code_by_index(i, &code) >= 0; i++) { -+ key = (int)code; -+ if (((key >= KEY_ESC) && (key <= KEY_RFKILL)) || -+ ((key >= KEY_OK ) && (key <= KEY_WPS_BUTTON))) { -+ if (ioctl(fd, UI_SET_KEYBIT, key) != 0) -+ goto setup_error; -+ } -+ } - - if (ioctl(fd, UI_DEV_CREATE) != 0) - goto setup_error; -diff --git a/lib/input_map.c b/lib/input_map.c -index 7c54301..31341b7 100644 ---- a/lib/input_map.c -+++ b/lib/input_map.c -@@ -29,6 +29,19 @@ struct { - } - }; - -+int get_input_code_by_index(int index, linux_input_code * code) -+{ -+ int i; -+ -+ for (i = 0; input_map[i].name != NULL; i++) { -+ if (i == index) { -+ *code = input_map[i].code; -+ return i; -+ } -+ } -+ return -1; -+} -+ - int get_input_code(const char* name, linux_input_code* code) - { - int i; -diff --git a/lib/input_map.h b/lib/input_map.h -index f5798d0..1efa4f1 100644 ---- a/lib/input_map.h -+++ b/lib/input_map.h -@@ -36,6 +36,7 @@ typedef __u16 linux_input_code; - typedef unsigned short linux_input_code; - #endif - -+int get_input_code_by_index(int index, linux_input_code * code); - int get_input_code(const char* name, linux_input_code* code); - void fprint_namespace(FILE* f); - int is_in_namespace(const char* name); -diff --git a/lib/lirc/input_map.h b/lib/lirc/input_map.h -index f5798d0..1efa4f1 100644 ---- a/lib/lirc/input_map.h -+++ b/lib/lirc/input_map.h -@@ -36,6 +36,7 @@ typedef __u16 linux_input_code; - typedef unsigned short linux_input_code; - #endif - -+int get_input_code_by_index(int index, linux_input_code * code); - int get_input_code(const char* name, linux_input_code* code); - void fprint_namespace(FILE* f); - int is_in_namespace(const char* name); diff --git a/packages/sysutils/lirc/patches/lirc-0006-kernel-4.8.patch b/packages/sysutils/lirc/patches/lirc-0006-kernel-4.8.patch deleted file mode 100644 index 456468b873d..00000000000 --- a/packages/sysutils/lirc/patches/lirc-0006-kernel-4.8.patch +++ /dev/null @@ -1,138 +0,0 @@ -From 31fcc8aa39f62c5cbf0e4af19d253764c905e4d4 Mon Sep 17 00:00:00 2001 -From: Alec Leamas -Date: Fri, 19 Aug 2016 04:48:02 +0200 -Subject: [PATCH 1/2] lircd: Remove use of functions killed in kernel 4.8.0 - -From 4.8.0 the kernel no longer supports LIRC_NOTIFY_DECODE, -LIRC_SETUP_START/LIRC_SETUP_END and several constants related -to initiating filters. Remove corresponding calls from lircd. ---- - daemons/lircd.cpp | 51 ++------------------------------------------------- - lib/driver.h | 7 +++++++ - 2 files changed, 9 insertions(+), 49 deletions(-) - -diff --git a/daemons/lircd.cpp b/daemons/lircd.cpp -index a7dbc94..a50d11f 100644 ---- a/daemons/lircd.cpp -+++ b/daemons/lircd.cpp -@@ -464,50 +464,6 @@ static int setup_timeout(void) - } - - --static int setup_filter(void) --{ -- int ret1, ret2; -- lirc_t min_pulse_supported = 0, max_pulse_supported = 0; -- lirc_t min_space_supported = 0, max_space_supported = 0; -- -- if (!(curr_driver->features & LIRC_CAN_SET_REC_FILTER)) -- return 1; -- if (curr_driver->drvctl_func(LIRC_GET_MIN_FILTER_PULSE, -- &min_pulse_supported) == -1 || -- curr_driver->drvctl_func(LIRC_GET_MAX_FILTER_PULSE, &max_pulse_supported) == -1 -- || curr_driver->drvctl_func(LIRC_GET_MIN_FILTER_SPACE, &min_space_supported) == -1 -- || curr_driver->drvctl_func(LIRC_GET_MAX_FILTER_SPACE, &max_space_supported) == -1) { -- log_error("could not get filter range"); -- log_perror_err(__func__); -- } -- -- if (setup_min_pulse > max_pulse_supported) -- setup_min_pulse = max_pulse_supported; -- else if (setup_min_pulse < min_pulse_supported) -- setup_min_pulse = 0; /* disable filtering */ -- -- if (setup_min_space > max_space_supported) -- setup_min_space = max_space_supported; -- else if (setup_min_space < min_space_supported) -- setup_min_space = 0; /* disable filtering */ -- -- ret1 = curr_driver->drvctl_func(LIRC_SET_REC_FILTER_PULSE, &setup_min_pulse); -- ret2 = curr_driver->drvctl_func(LIRC_SET_REC_FILTER_SPACE, &setup_min_space); -- if (ret1 == -1 || ret2 == -1) { -- if (curr_driver-> -- drvctl_func(LIRC_SET_REC_FILTER, -- setup_min_pulse < setup_min_space ? &setup_min_pulse : &setup_min_space) == -1) { -- log_error("could not set filter"); -- log_perror_err(__func__); -- return 0; -- } -- } -- return 1; --} -- -- -- -- - static int setup_hardware(void) - { - int ret = 1; -@@ -516,10 +472,7 @@ static int setup_hardware(void) - if ((curr_driver->features & LIRC_CAN_SET_REC_CARRIER) - || (curr_driver->features & LIRC_CAN_SET_REC_TIMEOUT) - || (curr_driver->features & LIRC_CAN_SET_REC_FILTER)) { -- (void)curr_driver->drvctl_func(LIRC_SETUP_START, NULL); -- ret = setup_frequency() && setup_timeout() -- && setup_filter(); -- (void)curr_driver->drvctl_func(LIRC_SETUP_END, NULL); -+ ret = setup_frequency() && setup_timeout(); - } - } - return ret; -@@ -2162,7 +2115,7 @@ void loop(void) - int reps; - - if (curr_driver->drvctl_func && (curr_driver->features & LIRC_CAN_NOTIFY_DECODE)) -- curr_driver->drvctl_func(LIRC_NOTIFY_DECODE, NULL); -+ curr_driver->drvctl_func(DRVCTL_NOTIFY_DECODE, NULL); - - get_release_data(&remote_name, &button_name, &reps); - -diff --git a/lib/driver.h b/lib/driver.h -index c7c4a6a..fc7318e 100644 ---- a/lib/driver.h -+++ b/lib/driver.h -@@ -97,6 +97,13 @@ int drv_handle_options(const char* options); - /** drvctl cmd: Free memory in argument obtained using DRVCTL_GET_DEVICES. */ - #define DRVCTL_FREE_DEVICES 6 - -+/** -+ * The former LIRC_NOTIFY_DECODE, informs drier that signal is successfully -+ * decoded e. g., to initiate some visual feedback through a LED. -+ */ -+ -+#define DRVCTL_NOTIFY_DECODE 7 -+ - /** Last well-known command. Remaining is used in driver-specific controls.*/ - #define DRVCTL_MAX 128 - --- -2.7.4 - - -From 55cd30e16a46bde49ccbbce1dea8bc734362170d Mon Sep 17 00:00:00 2001 -From: MilhouseVH -Date: Fri, 30 Sep 2016 01:53:50 +0100 -Subject: [PATCH 2/2] build hack - -Hack to build with 4.8 backport above. Including "driver.h" -isn't enough, but this works. Can all be dropped once lirc -0.9.5 is released. ---- - daemons/lircd.cpp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/daemons/lircd.cpp b/daemons/lircd.cpp -index a50d11f..8b46bc0 100644 ---- a/daemons/lircd.cpp -+++ b/daemons/lircd.cpp -@@ -71,6 +71,7 @@ - #endif - - #include "lirc_private.h" -+#define DRVCTL_NOTIFY_DECODE 7 - - #ifdef HAVE_INT_GETGROUPLIST_GROUPS - #define lirc_gid int --- -2.7.4 - diff --git a/packages/sysutils/lirc/patches/lirc-0008-force-have-poll-fine.patch b/packages/sysutils/lirc/patches/lirc-0008-force-have-poll-fine.patch new file mode 100644 index 00000000000..1f82dd1a0e9 --- /dev/null +++ b/packages/sysutils/lirc/patches/lirc-0008-force-have-poll-fine.patch @@ -0,0 +1,41 @@ +diff -Naur a/configure.ac b/configure.ac +--- a/configure.ac 2016-10-22 06:21:56.000000000 +0200 ++++ b/configure.ac 2016-12-26 21:54:42.489330474 +0100 +@@ -277,36 +277,7 @@ + AM_CONDITIONAL([BUILD_ALSA_SB_RC],[false]) + fi + +-dnl see https://daniel.haxx.se/blog/2016/10/11/poll-on-mac-10-12-is-broken/ +-AC_MSG_CHECKING(for working poll(2)) +-AC_RUN_IFELSE([AC_LANG_PROGRAM([[ +- #include +- #include +- #include +- #include +- #include +-]],[[ +- int fd = open("/dev/tty", O_RDONLY); +- if (fd == -1) return 2; +- struct pollfd pfd = {fd, 1, 0}; +- +- struct timeval before, after; +- gettimeofday(&before, NULL); +- int rc = poll(&pfd, 1, 500); +- if (rc < 0) return errno; +- if (rc > 0) return rc; +- gettimeofday(&after, NULL); +- +- suseconds_t us = (after.tv_sec - before.tv_sec) * 1000000 + +- (after.tv_usec - before.tv_usec); +- return us >= 400000 ? 0 : 1; +-]])],[ +- AC_DEFINE(HAVE_POLL_FINE) +- AC_MSG_RESULT(yes) +-],[ +- AC_MSG_RESULT(no) +-]) +- ++AC_DEFINE(HAVE_POLL_FINE) + + dnl check for kernel-headers + AC_CHECK_HEADERS([linux/input.h], diff --git a/packages/sysutils/lirc/scripts/lircd_helper b/packages/sysutils/lirc/scripts/lircd_helper index c83c512341c..6895403ca97 100755 --- a/packages/sysutils/lirc/scripts/lircd_helper +++ b/packages/sysutils/lirc/scripts/lircd_helper @@ -33,9 +33,10 @@ case "$ACTION" in if [ ! -e "/run/lirc/lircd-$DEVICE.pid" ]; then LIRCD="/usr/sbin/lircd" - LIRCD_CONFIG="--uinput --driver=$DRIVER --device=/dev/$DEVICE" + LIRCD_CONFIG="--driver=$DRIVER --device=/dev/$DEVICE" LIRCD_CONFIG="$LIRCD_CONFIG --output=/run/lirc/lircd-$DEVICE" LIRCD_CONFIG="$LIRCD_CONFIG --pidfile=/run/lirc/lircd-$DEVICE.pid" + LIRCD_CONFIG="$LIRCD_CONFIG --release=_UP" if [ -e "/storage/.config/lircd.conf" ]; then LIRCD_CONFIG="$LIRCD_CONFIG /storage/.config/lircd.conf" diff --git a/packages/sysutils/lirc/system.d/lircd-uinput@.service b/packages/sysutils/lirc/system.d/lircd-uinput@.service new file mode 100644 index 00000000000..485f5389183 --- /dev/null +++ b/packages/sysutils/lirc/system.d/lircd-uinput@.service @@ -0,0 +1,12 @@ +[Unit] +Description=lircd-uinput with %I + +[Service] +ExecStart=/usr/sbin/lircd-uinput /run/lirc/lircd-%I +Slice=system-lircd.slice +Restart=on-failure +RestartSec=2 + +[Install] +WantedBy=multi-user.target + diff --git a/packages/sysutils/lirc/udev.d/98-lircd.rules b/packages/sysutils/lirc/udev.d/98-lircd.rules index aca4dce8682..0bc7714ed78 100644 --- a/packages/sysutils/lirc/udev.d/98-lircd.rules +++ b/packages/sysutils/lirc/udev.d/98-lircd.rules @@ -67,6 +67,12 @@ ENV{lircd_driver}=="?*", ENV{lircd_conf}=="?*", ACTION=="add", \ TAG+="systemd", ENV{SYSTEMD_WANTS}+="lircd@$name:$env{lircd_driver}:$env{lircd_conf}.service", \ RUN+="lircd_wakeup_enable" +ENV{lircd_driver}=="?*", ENV{lircd_conf}=="?*", ACTION=="add", \ + TAG+="systemd", ENV{SYSTEMD_WANTS}+="lircd-uinput@$name.service" + +ENV{lircd_driver}=="?*", ENV{lircd_conf}=="?*", ACTION=="remove", \ + RUN+="/usr/bin/systemctl stop lircd-uinput@$name.service" + ENV{lircd_driver}=="?*", ENV{lircd_conf}=="?*", ACTION=="remove", \ RUN+="/usr/bin/systemctl stop lircd@$name:$env{lircd_driver}:$env{lircd_conf}.service"