From 8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 14 Jul 2018 21:03:06 +0100 Subject: gentoo resync : 14.07.2018 --- app-misc/lirc/files/irexec-confd | 9 + app-misc/lirc/files/irexec-initd-0.8.6-r2 | 27 + app-misc/lirc/files/irexec-initd-0.9.4a-r2 | 27 + app-misc/lirc/files/irexec.service | 10 + .../files/lirc-0.8.3_pre1-remotewonderplus.patch | 26 + .../lirc/files/lirc-0.8.4-portaudio_check.patch | 18 + .../lirc/files/lirc-0.9.0-add-zotac-support.patch | 658 +++++++++++++++++++++ app-misc/lirc/files/lirc-0.9.0-atiusb_kfifo.patch | 14 + app-misc/lirc/files/lirc-0.9.0-fixed-font.patch | 20 + .../files/lirc-0.9.0-kernel-2.6.39-fixes.patch | 67 +++ .../lirc/files/lirc-0.9.0-kernel-3.3.0-fixes.patch | 50 ++ .../lirc/files/lirc-0.9.0-kernel-3.5-err-fix.patch | 12 + .../lirc/files/lirc-0.9.0-kernel-3.8-fixes.patch | 80 +++ app-misc/lirc/files/lirc.service | 11 + app-misc/lirc/files/lircd-0.8.6-r2 | 51 ++ app-misc/lirc/files/lircd.conf.4 | 22 + app-misc/lirc/files/lircm.service | 11 + app-misc/lirc/files/lircmd | 19 + app-misc/lirc/files/lircmd-0.10.0.conf | 4 + app-misc/lirc/files/lircmd-0.9.4a-r2 | 19 + app-misc/lirc/files/modprobed.lirc | 22 + 21 files changed, 1177 insertions(+) create mode 100644 app-misc/lirc/files/irexec-confd create mode 100644 app-misc/lirc/files/irexec-initd-0.8.6-r2 create mode 100644 app-misc/lirc/files/irexec-initd-0.9.4a-r2 create mode 100644 app-misc/lirc/files/irexec.service create mode 100644 app-misc/lirc/files/lirc-0.8.3_pre1-remotewonderplus.patch create mode 100644 app-misc/lirc/files/lirc-0.8.4-portaudio_check.patch create mode 100644 app-misc/lirc/files/lirc-0.9.0-add-zotac-support.patch create mode 100644 app-misc/lirc/files/lirc-0.9.0-atiusb_kfifo.patch create mode 100644 app-misc/lirc/files/lirc-0.9.0-fixed-font.patch create mode 100644 app-misc/lirc/files/lirc-0.9.0-kernel-2.6.39-fixes.patch create mode 100644 app-misc/lirc/files/lirc-0.9.0-kernel-3.3.0-fixes.patch create mode 100644 app-misc/lirc/files/lirc-0.9.0-kernel-3.5-err-fix.patch create mode 100644 app-misc/lirc/files/lirc-0.9.0-kernel-3.8-fixes.patch create mode 100644 app-misc/lirc/files/lirc.service create mode 100644 app-misc/lirc/files/lircd-0.8.6-r2 create mode 100644 app-misc/lirc/files/lircd.conf.4 create mode 100644 app-misc/lirc/files/lircm.service create mode 100644 app-misc/lirc/files/lircmd create mode 100644 app-misc/lirc/files/lircmd-0.10.0.conf create mode 100644 app-misc/lirc/files/lircmd-0.9.4a-r2 create mode 100644 app-misc/lirc/files/modprobed.lirc (limited to 'app-misc/lirc/files') diff --git a/app-misc/lirc/files/irexec-confd b/app-misc/lirc/files/irexec-confd new file mode 100644 index 000000000000..48eb8dd4c806 --- /dev/null +++ b/app-misc/lirc/files/irexec-confd @@ -0,0 +1,9 @@ +# Options to pass to the irexec process +IREXEC_OPTS="/etc/lircrc" + +# User to execute irexec as. +# Warning: Running irexec as root can open security holes +#IREXEC_USER="root" + +# Use this to disable the warning printed when starting irexec as root +# IREXEC_DISABLE_ROOT_WARNING=yes diff --git a/app-misc/lirc/files/irexec-initd-0.8.6-r2 b/app-misc/lirc/files/irexec-initd-0.8.6-r2 new file mode 100644 index 000000000000..e62497306d0f --- /dev/null +++ b/app-misc/lirc/files/irexec-initd-0.8.6-r2 @@ -0,0 +1,27 @@ +#!/sbin/openrc-run +# Copyright 2003 Martin Hierling +# Distributed under the terms of the GNU General Public License v2 + +: ${IREXEC_USER:=root} + +depend() { + need lirc +} + +start() { + if [ "x${IREXEC_USER}" = "xroot" -a "x${IREXEC_DISABLE_ROOT_WARNING}" != "xyes" ]; then + ewarn "Warning: Running irexec as root can open security holes" + fi + + ebegin "Starting irexec" + start-stop-daemon --start --chuid ${IREXEC_USER} --user ${IREXEC_USER} --chdir / \ + --exec /usr/bin/irexec -- --daemon ${IREXEC_OPTS} + eend $? "Failed to start irexec." +} + +stop() { + ebegin "Stopping irexec" + start-stop-daemon --stop --exec /usr/bin/irexec --user ${IREXEC_USER} + eend $? "Failed to stop irexec." +} + diff --git a/app-misc/lirc/files/irexec-initd-0.9.4a-r2 b/app-misc/lirc/files/irexec-initd-0.9.4a-r2 new file mode 100644 index 000000000000..01234c3264fa --- /dev/null +++ b/app-misc/lirc/files/irexec-initd-0.9.4a-r2 @@ -0,0 +1,27 @@ +#!/sbin/openrc-run +# Copyright 2003 Martin Hierling +# Distributed under the terms of the GNU General Public License v2 + +: ${IREXEC_USER:=root} + +depend() { + need lircd +} + +start() { + if [ "x${IREXEC_USER}" = "xroot" -a "x${IREXEC_DISABLE_ROOT_WARNING}" != "xyes" ]; then + ewarn "Warning: Running irexec as root can open security holes" + fi + + ebegin "Starting irexec" + start-stop-daemon --start --user ${IREXEC_USER} --chdir / \ + --exec /usr/bin/irexec -- --daemon ${IREXEC_OPTS} + eend $? "Failed to start irexec." +} + +stop() { + ebegin "Stopping irexec" + start-stop-daemon --stop --exec /usr/bin/irexec --user ${IREXEC_USER} + eend $? "Failed to stop irexec." +} + diff --git a/app-misc/lirc/files/irexec.service b/app-misc/lirc/files/irexec.service new file mode 100644 index 000000000000..53dac65dc234 --- /dev/null +++ b/app-misc/lirc/files/irexec.service @@ -0,0 +1,10 @@ +[Unit] +Description=IR Exec +After=lirc.service +Wants=lirc.service + +[Service] +ExecStart=/usr/bin/irexec + +[Install] +WantedBy=multi-user.target diff --git a/app-misc/lirc/files/lirc-0.8.3_pre1-remotewonderplus.patch b/app-misc/lirc/files/lirc-0.8.3_pre1-remotewonderplus.patch new file mode 100644 index 000000000000..66527bcc5709 --- /dev/null +++ b/app-misc/lirc/files/lirc-0.8.3_pre1-remotewonderplus.patch @@ -0,0 +1,26 @@ +--- lirc-0.8.0/drivers/lirc_atiusb/lirc_atiusb.c.orig 2005-10-29 08:18:53.000000000 -0600 ++++ lirc-0.8.0/drivers/lirc_atiusb/lirc_atiusb.c 2006-04-01 14:31:05.000000000 -0700 +@@ -147,8 +147,9 @@ + /* init strings */ + #define USB_OUTLEN 7 + +-static char init1[] = {0x01, 0x00, 0x20, 0x14}; +-static char init2[] = {0x01, 0x00, 0x20, 0x14, 0x20, 0x20, 0x20}; ++static char init1[] = {0x80, 0x05, 0x1b, 0x15, 0x14, 0x20, 0x24, 0x15}; ++static char init2[] = {0x83, 0x03}; ++static char init3[] = {0x84, 0xd7, 0x020}; + + struct in_endpt { + /* inner link in list of endpoints for the remote specified by ir */ +@@ -1034,8 +1034,9 @@ + usb_sndintpipe(ir->usbdev, oep->ep->bEndpointAddress), oep->buf, + USB_OUTLEN, usb_remote_send, oep, oep->ep->bInterval); + +- send_packet(oep, 0x8004, init1); +- send_packet(oep, 0x8007, init2); ++ send_packet(oep, 0x8007, init1); ++ send_packet(oep, 0x8002, init2); ++ send_packet(oep, 0x8003, init3); + } + } + diff --git a/app-misc/lirc/files/lirc-0.8.4-portaudio_check.patch b/app-misc/lirc/files/lirc-0.8.4-portaudio_check.patch new file mode 100644 index 000000000000..36f5f360cd18 --- /dev/null +++ b/app-misc/lirc/files/lirc-0.8.4-portaudio_check.patch @@ -0,0 +1,18 @@ +Portaudio is only needed for LIRC_DEVICES=audio, so not checking for Portaudio when the device is disabled will prevent automagic dependencies. +--- configure.ac.orig 2009-03-13 10:02:50.000000000 +0100 ++++ configure.ac 2009-03-13 10:04:00.000000000 +0100 +@@ -336,14 +336,6 @@ + AC_DEFINE(HAVE_LIBIRMAN_SW) + possible_drivers="${possible_drivers} (irman_sw)" + ) +-dnl audio driver requires PortAudio library installed and some linker flags +-AC_CHECK_HEADERS(portaudio.h,[ +- AC_CHECK_LIB(portaudio, Pa_Initialize,[ +- AC_DEFINE(HAVE_LIBPORTAUDIO) +- possible_drivers="${possible_drivers} (audio)" +- ],,${portaudio_lib_other} +- )] +-) + dnl audio_alsa driver requires ALSA library installed and some linker flags + have_alsa=no + AC_CHECK_HEADERS(alsa/asoundlib.h,[ diff --git a/app-misc/lirc/files/lirc-0.9.0-add-zotac-support.patch b/app-misc/lirc/files/lirc-0.9.0-add-zotac-support.patch new file mode 100644 index 000000000000..381860ced6fb --- /dev/null +++ b/app-misc/lirc/files/lirc-0.9.0-add-zotac-support.patch @@ -0,0 +1,658 @@ +diff -rupN base/configure.ac mod/configure.ac +--- base/configure.ac 2011-03-25 23:28:18.000000000 +0100 ++++ mod/configure.ac 2013-03-21 16:25:07.218419985 +0100 +@@ -383,7 +383,7 @@ AC_CHECK_HEADERS(linux/input.h,[ + dnl check if hiddev is available + AC_CHECK_HEADERS([linux/types.h]) + AC_CHECK_HEADERS([linux/hiddev.h],[ +- possible_drivers="${possible_drivers} (asusdh) (bw6130) (dvico) (macmini)" ++ possible_drivers="${possible_drivers} (asusdh) (bw6130) (dvico) (macmini) (zotac)" + AC_MSG_CHECKING(for HIDDEV_FLAG_UREF support) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include +@@ -393,7 +393,7 @@ AC_CHECK_HEADERS([linux/hiddev.h],[ + ]])],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_LINUX_HIDDEV_FLAG_UREF) +- possible_drivers="${possible_drivers} (samsung) (sb0540)" ++ possible_drivers="${possible_drivers} (samsung) (sb0540) (zotac)" + ],[ + AC_MSG_RESULT(no) + ]) +@@ -446,7 +446,7 @@ AC_ARG_WITH(driver, + srm7500libusb, tekram, + tekram_bt829, tira, tira_raw, ttusbir, + tuxbox, tvbox, udp, uirt2, uirt2_raw, +- usb_uirt_raw, usbx, wpc8769l], ++ usb_uirt_raw, usbx, wpc8769l, zotac], + driver=${withval}, + driver="unset" + ) +@@ -464,6 +464,7 @@ portaudio_lib="" + alsa_lib="" + atilibusb_lib="" + atwf83_lib="" ++zotac_lib="" + awlibusb_lib="" + dfclibusb_lib="" + srm7500libusb_lib="" +@@ -683,6 +684,10 @@ if test "$driver" = "userspace" -o "$dri + usbx) + hw_module="${hw_module} hw_usbx.o serial.o" + ;; ++ zotac) ++ hw_module="${hw_module} hw_zotac.o" ++ zotac_lib=-lpthread ++ ;; + esac + done + #remove duplicates +@@ -733,6 +738,14 @@ if test "$driver" = "alsa_usb"; then + lircd_conf="creative/lircd.conf.alsa_usb" + fi + ++if test "$driver" = "zotac"; then ++ lirc_driver="$driver" ++ hw_module="hw_zotac.o" ++ HW_DEFAULT="hw_zotac" ++ lircd_conf="zotac/lircd.conf.zotac" ++ zotac_lib=-lpthread ++fi ++ + if test "$driver" = "animax"; then + lirc_driver="lirc_dev lirc_serial" + lircd_conf="animax/lircd.conf.animax" +@@ -1499,6 +1512,7 @@ if test "$lirc_driver" = "none" || \ + test "$lirc_driver" = "macmini" || \ + test "$lirc_driver" = "samsung" || \ + test "$lirc_driver" = "sb0540" || \ ++ test "$lirc_driver" = "zotac" || \ + test "$lirc_driver" = "srm7500libusb" || \ + test "$lirc_driver" = "userspace"; then + lirc_driver= +@@ -1669,7 +1683,7 @@ if ! echo ${hw_module}|grep " receive.o" + receive="receive.o" + fi + +-hw_module_libs="${alsa_lib} ${atilibusb_lib} ${awlibusb_lib} ${caraca_lib} ${commandir_lib} ${dfclibusb_lib} ${ftdi_lib} ${iguanaIR_lib} ${irman_lib} ${portaudio_lib} ${srm7500libusb_lib} ${atwf83_lib}" ++hw_module_libs="${alsa_lib} ${atilibusb_lib} ${awlibusb_lib} ${caraca_lib} ${commandir_lib} ${dfclibusb_lib} ${ftdi_lib} ${iguanaIR_lib} ${irman_lib} ${portaudio_lib} ${srm7500libusb_lib} ${atwf83_lib} ${zotac_lib}" + + dnl tell the Makefiles what we decided + AC_SUBST(daemon) +diff -rupN base/daemons/Makefile.am mod/daemons/Makefile.am +--- base/daemons/Makefile.am 2011-03-25 23:28:18.000000000 +0100 ++++ mod/daemons/Makefile.am 2013-03-21 16:25:40.488790784 +0100 +@@ -58,7 +58,8 @@ EXTRA_libhw_module_a_SOURCES = \ + hw_usbx.c hw_usbx.h \ + receive.c receive.h \ + transmit.c transmit.h \ +- serial.c serial.h ++ serial.c serial.h \ ++ hw_zotac.c + + libhw_module_a_LIBADD = @hw_module@ + libhw_module_a_DEPENDENCIES = @hw_module@ +diff -rupN base/daemons/hw-types.c mod/daemons/hw-types.c +--- base/daemons/hw-types.c 2011-03-25 23:28:18.000000000 +0100 ++++ mod/daemons/hw-types.c 2013-03-21 16:26:38.913200218 +0100 +@@ -59,6 +59,7 @@ extern struct hardware hw_uirt2; + extern struct hardware hw_uirt2_raw; + extern struct hardware hw_usb_uirt_raw; + extern struct hardware hw_usbx; ++extern struct hardware hw_zotac; + + #ifndef HW_DEFAULT + # define HW_DEFAULT hw_default +@@ -160,6 +161,7 @@ struct hardware *hw_list[] = { + #ifdef HAVE_LINUX_HIDDEV_FLAG_UREF + &hw_samsung, + &hw_sb0540, ++ &hw_zotac, + #endif + &hw_silitek, + #ifdef HAVE_LIBUSB +diff -rupN base/daemons/hw_zotac.c mod/daemons/hw_zotac.c +--- base/daemons/hw_zotac.c 1970-01-01 01:00:00.000000000 +0100 ++++ mod/daemons/hw_zotac.c 2013-03-21 16:31:06.989272556 +0100 +@@ -0,0 +1,429 @@ ++/**************************************************************************** ++ ** hw_zotac.c ************************************************************* ++ **************************************************************************** ++ * ++ * Lirc driver for Zotac remote ++ * ++ * Copyright (C) 2010 Rainer Hochecker ++ * ++ * Distribute under GPL version 2 or later. ++ * ++ */ ++ ++#ifdef HAVE_CONFIG_H ++# include ++#endif ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include "hardware.h" ++#include "ir_remote.h" ++#include "lircd.h" ++ ++enum { ++ RPT_NO = 0, ++ RPT_YES = 1, ++}; ++ ++static int zotac_init(); ++static int zotac_deinit(); ++static char *zotac_rec(struct ir_remote *remotes); ++static int zotac_decode(struct ir_remote *remote, ir_code * prep, ir_code * codep, ir_code * postp, int *repeat_flagp, ++ lirc_t * min_remaining_gapp, lirc_t * max_remaining_gapp); ++static void *zotac_repeat(); ++static int zotac_getcode(); ++ ++/** Max number of repetitions */ ++static unsigned max_repeat_count = 500; ++/** Code that triggers key release */ ++static unsigned release_code = 0x00000000; ++/** Code that triggers device remove */ ++static unsigned remove_code =0x00FFFFFF; ++/** Time to wait before first repetition */ ++static unsigned repeat_time1_us = 500000; ++/** Time to wait between two repetitions */ ++static unsigned repeat_time2_us = 100000; ++/** Pipe between main thread and repetition thread */ ++static int fd_pipe[2] = { -1, -1 }; ++ ++/** Thread that simulates repetitions */ ++static pthread_t repeat_thread; ++/** File descriptor for the real device */ ++static int fd_hidraw; ++ ++static int main_code_length = 32; ++static signed int main_code = 0; ++static struct timeval start, end, last; ++static int repeat_state = RPT_NO; ++static int error_state = 0; ++static int probe_code = 0; ++ ++#ifdef HAVE_LINUX_HIDDEV_FLAG_UREF ++/* Zotac USB iR Receiver */ ++struct hardware hw_zotac = { ++ "/dev/usb/hiddev0", /* "device" */ ++ -1, /* fd (device) */ ++ LIRC_CAN_REC_LIRCCODE, /* features */ ++ 0, /* send_mode */ ++ LIRC_MODE_LIRCCODE, /* rec_mode */ ++ 32, /* code_length */ ++ zotac_init, /* init_func */ ++ zotac_deinit, /* deinit_func */ ++ NULL, /* send_func */ ++ zotac_rec, /* rec_func */ ++ zotac_decode, /* decode_func */ ++ NULL, /* ioctl_func */ ++ NULL, /* readdata */ ++ "zotac" /* name */ ++}; ++#endif ++ ++static int zotac_decode(struct ir_remote *remote, ir_code * prep, ir_code * codep, ir_code * postp, int *repeat_flagp, ++ lirc_t * min_remaining_gapp, lirc_t * max_remaining_gapp) ++{ ++ LOGPRINTF(1, "zotac_decode"); ++ ++ if (!map_code(remote, prep, codep, postp, 0, 0, main_code_length, main_code, 0, 0)) { ++ return 0; ++ } ++ ++ map_gap(remote, &start, &last, 0, repeat_flagp, min_remaining_gapp, max_remaining_gapp); ++ /* override repeat */ ++ *repeat_flagp = repeat_state; ++ ++ return 1; ++} ++ ++static int zotac_getcode() { ++ ++ ssize_t rd; ++ struct hiddev_usage_ref uref; ++ struct hiddev_report_info rinfo; ++ struct hiddev_field_info finfo; ++ int shift = 0; ++ ++ rd = read(fd_hidraw, &uref, sizeof(uref)); ++ if (rd < 0) { ++ logprintf(LOG_ERR, "error reading '%s'", hw.device); ++ logperror(LOG_ERR, NULL); ++ zotac_deinit(); ++ error_state = 1; ++ return -1; ++ } ++ ++ if (uref.field_index == HID_FIELD_INDEX_NONE) { ++ /* ++ * we get this when the new report has been send from ++ * device at this point we have the uref structure ++ * prefilled with correct report type and id ++ * ++ */ ++ ++ switch (uref.report_id) { ++ case 1: /* USB standard keyboard usage page */ ++ { ++ /* This page reports cursor keys */ ++ LOGPRINTF(3, "Keyboard (standard)\n"); ++ ++ /* check for special codes */ ++ uref.field_index = 0; ++ uref.usage_index = 1; ++ /* fetch the usage code for given indexes */ ++ ioctl(fd_hidraw, HIDIOCGUCODE, &uref, sizeof(uref)); ++ /* fetch the value from report */ ++ ioctl(fd_hidraw, HIDIOCGUSAGE, &uref, sizeof(uref)); ++ ++ if (uref.value) ++ shift = 1; ++ ++ /* populate required field number */ ++ uref.field_index = 1; ++ uref.usage_index = 0; ++ /* fetch the usage code for given indexes */ ++ ioctl(fd_hidraw, HIDIOCGUCODE, &uref, sizeof(uref)); ++ /* fetch the value from report */ ++ ioctl(fd_hidraw, HIDIOCGUSAGE, &uref, sizeof(uref)); ++ /* now we have the key */ ++ ++ LOGPRINTF(3, "usage: %x value: %x shift: %d\n",uref.usage_code, uref.value, shift); ++ ++ /* now we have the key */ ++ if (uref.value) { ++ probe_code = (uref.usage_code | uref.value); ++ if (shift) ++ probe_code |= 0x10000000; ++ LOGPRINTF(3, "Main code 1: %x\n", probe_code); ++ return 1; ++ } ++ else { ++ LOGPRINTF(3, "rel button\n"); ++ probe_code = release_code; ++ return 2; ++ } ++ } ++ break; ++ ++ case 2: ++ case 3: /* USB generic desktop usage page */ ++ case 4: ++ { ++ /* This page reports power key ++ * (via SystemControl SLEEP) ++ */ ++ LOGPRINTF(3, "Generic desktop (standard)\n"); ++ ++ ++ /* traverse report descriptor */ ++ rinfo.report_type = HID_REPORT_TYPE_INPUT; ++ rinfo.report_id = HID_REPORT_ID_FIRST; ++ rd = ioctl(fd_hidraw, HIDIOCGREPORTINFO, &rinfo); ++ ++ unsigned int i,j; ++ while (rd >= 0) { ++ for (i = 0; i < rinfo.num_fields; i++) { ++ finfo.report_type = rinfo.report_type; ++ finfo.report_id = rinfo.report_id; ++ finfo.field_index = i; ++ ioctl(fd_hidraw, HIDIOCGFIELDINFO, &finfo); ++ for (j = 0; j < finfo.maxusage; j++) { ++ uref.field_index = i; ++ uref.usage_index = j; ++ ioctl(fd_hidraw, HIDIOCGUCODE, &uref); ++ ioctl(fd_hidraw, HIDIOCGUSAGE, &uref); ++ ++ if (uref.value != 0) { ++ LOGPRINTF(3, "field: %d, idx: %d, usage: %x value: %x\n",i, j, uref.usage_code, uref.value); ++ probe_code = uref.usage_code; ++ return 1; ++ } ++ } ++ } ++ rinfo.report_id |= HID_REPORT_ID_NEXT; ++ rd = ioctl(fd_hidraw, HIDIOCGREPORTINFO, &rinfo); ++ } ++ return 2; ++ } ++ break; ++ default: ++ /* Unknown/unsupported report id. ++ * Should not happen because remaining reports ++ * from report descriptor seem to be unused by remote. ++ */ ++ logprintf(LOG_ERR, "Unexpected report id %d", uref.report_id); ++ break; ++ } ++ } ++ else { ++ /* This page reports power key ++ * (via SystemControl SLEEP) ++ */ ++ LOGPRINTF(3, "Same Event ...\n"); ++ ++ /* traverse report descriptor */ ++ rinfo.report_type = HID_REPORT_TYPE_INPUT; ++ rinfo.report_id = HID_REPORT_ID_FIRST; ++ rd = ioctl(fd_hidraw, HIDIOCGREPORTINFO, &rinfo); ++ ++ unsigned int i,j; ++ while (rd >= 0) { ++ for (i = 0; i < rinfo.num_fields; i++) { ++ finfo.report_type = rinfo.report_type; ++ finfo.report_id = rinfo.report_id; ++ finfo.field_index = i; ++ ioctl(fd_hidraw, HIDIOCGFIELDINFO, &finfo); ++ for (j = 0; j < finfo.maxusage; j++) { ++ uref.field_index = i; ++ uref.usage_index = j; ++ ioctl(fd_hidraw, HIDIOCGUCODE, &uref); ++ ioctl(fd_hidraw, HIDIOCGUSAGE, &uref); ++ ++ if (uref.value != 0) { ++ LOGPRINTF(3, "usage: %x value: %x\n",uref.usage_code, uref.value); ++ //probe_code = uref.usage_code; ++ return 0; ++ } ++ } ++ } ++ rinfo.report_id |= HID_REPORT_ID_NEXT; ++ rd = ioctl(fd_hidraw, HIDIOCGREPORTINFO, &rinfo); ++ } ++ return 2; ++ } ++ return 0; ++} ++ ++static int zotac_init() ++{ ++ logprintf(LOG_INFO, "zotac initializing '%s'", hw.device); ++ if ((fd_hidraw = open(hw.device, O_RDONLY)) < 0) { ++ logprintf(LOG_ERR, "unable to open '%s'", hw.device); ++ return 0; ++ } ++ int flags = HIDDEV_FLAG_UREF | HIDDEV_FLAG_REPORT; ++ if (ioctl(fd_hidraw, HIDIOCSFLAG, &flags)) { ++ return 0; ++ } ++ hw.fd = fd_hidraw; ++ ++ /* Create pipe so that events sent by the repeat thread will ++ trigger main thread */ ++ if (pipe(fd_pipe) != 0) { ++ logperror(LOG_ERR, "couldn't open pipe"); ++ close(fd_hidraw); ++ return 0; ++ } ++ hw.fd = fd_pipe[0]; ++ /* Create thread to simulate repetitions */ ++ if (pthread_create(&repeat_thread, NULL, zotac_repeat, NULL)) { ++ logprintf(LOG_ERR, "Could not create \"repeat thread\""); ++ return 0; ++ } ++ return 1; ++} ++ ++static int zotac_deinit() ++{ ++ pthread_cancel(repeat_thread); ++ if (fd_hidraw != -1) { ++ // Close device if it is open ++ logprintf(LOG_INFO, "closing '%s'", hw.device); ++ close(fd_hidraw); ++ fd_hidraw = -1; ++ } ++ // Close pipe input ++ if (fd_pipe[1] >= 0) { ++ close(fd_pipe[1]); ++ fd_pipe[1] = -1; ++ } ++ // Close pipe output ++ if (fd_pipe[0] >= 0) { ++ close(fd_pipe[0]); ++ fd_pipe[0] = -1; ++ } ++ hw.fd = -1; ++ return 1; ++} ++ ++/** ++ * Runtime that reads device, forwards codes to main thread ++ * and simulates repetitions. ++ */ ++static void *zotac_repeat() ++{ ++ int repeat_count = 0; ++ unsigned current_code; ++ int ret; ++ int sel; ++ fd_set files; ++ struct timeval delay; ++ int pressed = 0; ++ int fd = fd_pipe[1]; ++ ++ while (1) { ++ // Initialize set to monitor device's events ++ FD_ZERO(&files); ++ FD_SET(fd_hidraw, &files); ++ if (pressed) { ++ sel = select(FD_SETSIZE, &files, NULL, NULL, &delay); ++ } else { ++ sel = select(FD_SETSIZE, &files, NULL, NULL, NULL); ++ } ++ ++ switch (sel) { ++ case 1: ++ // Data ready in device's file ++ ret = zotac_getcode(); ++ ++ if (ret < 0) { ++ // Error ++ logprintf(LOG_ERR, "(%s) Could not read %s", __FUNCTION__, hw.device); ++ goto exit_loop; ++ } ++ if (ret == 1) { ++ // Key code : forward it to main thread ++ pressed = 1; ++ repeat_count = 0; ++ delay.tv_sec = 0; ++ delay.tv_usec = repeat_time1_us; ++ current_code = probe_code; ++ } else if (ret == 2) { ++ // Release code : stop repetitions ++ pressed = 0; ++ current_code = release_code; ++ } else if (ret == 0) { ++ continue; ++ } ++ break; ++ case 0: ++ repeat_count++; ++ if (repeat_count >= max_repeat_count) { ++ // Too many repetitions, something must have gone wrong ++ logprintf(LOG_ERR,"(%s) too many repetitions", __FUNCTION__); ++ goto exit_loop; ++ } ++ // Timeout : send current_code again to main ++ // thread to simulate repetition ++ delay.tv_sec = 0; ++ delay.tv_usec = repeat_time2_us; ++ break; ++ default: ++ // Error ++ logprintf(LOG_ERR, "(%s) select() failed", __FUNCTION__); ++ goto exit_loop; ++ } ++ // Send code to main thread through pipe ++ write(fd, ¤t_code, sizeof(current_code)); ++ } ++exit_loop: ++ ++ // Wake up main thread with special key code ++ current_code = remove_code; ++ write(fd, ¤t_code, sizeof(current_code)); ++ return NULL; ++} ++ ++/* ++* Aureal Technology ATWF@83 cheap remote ++* specific code. ++*/ ++ ++static char *zotac_rec(struct ir_remote *remotes) ++{ ++ unsigned ev; ++ int rd; ++ last = end; ++ gettimeofday(&start, NULL); ++ rd = read(hw.fd, &ev, sizeof(ev)); ++ ++ if (rd == -1) { ++ // Error ++ logprintf(LOG_ERR, "(%s) could not read pipe", __FUNCTION__); ++ zotac_deinit(); ++ return 0; ++ } ++ ++ if (ev == release_code) { ++ // Release code ++ main_code = 0; ++ return 0; ++ } else if (ev == remove_code) { ++ // Device has been removed ++ zotac_deinit(); ++ return 0; ++ } ++ ++ LOGPRINTF(1, "zotac : %x", ev); ++ // Record the code and check for repetition ++ if (main_code == ev) { ++ repeat_state = RPT_YES; ++ } else { ++ main_code = ev; ++ repeat_state = RPT_NO; ++ } ++ gettimeofday(&end, NULL); ++ return decode_all(remotes); ++} +diff -rupN base/remotes/zotac/lircd.conf.zotac mod/remotes/zotac/lircd.conf.zotac +--- base/remotes/zotac/lircd.conf.zotac 1970-01-01 01:00:00.000000000 +0100 ++++ mod/remotes/zotac/lircd.conf.zotac 2013-03-21 16:31:31.343367869 +0100 +@@ -0,0 +1,77 @@ ++ ++# Please make this file available to others ++# by sending it to ++# ++# this config file was automatically generated ++# using lirc-0.9.1-git(zotac) on Mon Apr 2 14:10:29 2012 ++# ++# contributed by ++# ++# brand: zotac.conf ++# model no. of remote control: ++# devices being controlled by this remote: ++# ++ ++begin remote ++ ++ name zotac.conf ++ bits 32 ++ eps 30 ++ aeps 100 ++ ++ one 0 0 ++ zero 0 0 ++ gap 100123 ++ min_repeat 9 ++# suppress_repeat 9 ++# uncomment to suppress unwanted repeats ++# toggle_bit_mask 0x7004F ++ ++ begin codes ++ KEY_SLEEP 0x00010082 ++ KEY_WAKEUP 0x00010083 ++ KEY_RECORD 0x000C00B2 ++ KEY_PAUSE 0x000C00B1 ++ KEY_STOP 0x000C00B7 ++ KEY_REWIND 0x000C00B4 ++ KEY_PLAY 0x000C00B0 ++ KEY_FORWARD 0x000C00B3 ++ KEY_LEFTSHIFT 0x000C00B6 ++ KEY_RIGHTSHIFT 0x000C00B5 ++ KEY_BACK 0x000C0224 ++ KEY_INFO 0x000C0209 ++ KEY_MENU 0xFFBC000D ++ KEY_UP 0x00070052 ++ KEY_LEFT 0x00070050 ++ KEY_RIGHT 0x0007004F ++ KEY_DOWN 0x00070051 ++ KEY_OK 0x00070028 ++ KEY_VOLUMEUP 0x000C00E9 ++ KEY_VOLUMEDOWN 0x000C00EA ++ KEY_MUTE 0x000C00E2 ++ KEY_CHANNELUP 0x000C009C ++ KEY_CHANNELDOWN 0x000C009D ++ KEY_1 0x0007001E ++ KEY_2 0x0007001F ++ KEY_3 0x00070020 ++ KEY_4 0x00070021 ++ KEY_5 0x00070022 ++ KEY_6 0x00070023 ++ KEY_7 0x00070024 ++ KEY_8 0x00070025 ++ KEY_9 0x00070026 ++ KEY_0 0x00070027 ++ KEY_NUMERIC_STAR 0x10070025 ++ KEY_NUMERIC_POUND 0x10070020 ++ KEY_CLEAR 0x00070029 ++ KEY_TEXT 0xFFBC005A ++ KEY_TITLE 0x000C008D ++ KEY_ENTER 0x00070028 ++ KEY_RED 0xFFBC005B ++ KEY_GREEN 0xFFBC005C ++ KEY_YELLOW 0xFFBC005D ++ KEY_BLUE 0xFFBC005E ++ end codes ++ ++end remote ++ +diff -rupN base/setup.data mod/setup.data +--- base/setup.data 2011-03-25 23:28:18.000000000 +0100 ++++ mod/setup.data 2013-03-21 16:28:11.433935463 +0100 +@@ -146,6 +146,7 @@ hw_menu_entry: @hw-usb + usb_uirt_raw: "USB-UIRT" + mplay: "VLSystem MPlay Blast" + mplay: "VLSystem MPlay Mini" ++ zotac: "Zotac USB IR Receiver" + + param_type: \ + act200l \ +@@ -260,7 +261,8 @@ param_type: \ + ttusbir \ + tvbox \ + udp \ +- wpc8769l ++ wpc8769l \ ++ zotac + none: + + default_param: \ +@@ -331,7 +333,8 @@ default_param: \ + ttusbir \ + tvbox \ + udp \ +- wpc8769l ++ wpc8769l \ ++ zotac + none: + + default_param: \ diff --git a/app-misc/lirc/files/lirc-0.9.0-atiusb_kfifo.patch b/app-misc/lirc/files/lirc-0.9.0-atiusb_kfifo.patch new file mode 100644 index 000000000000..32edb244b412 --- /dev/null +++ b/app-misc/lirc/files/lirc-0.9.0-atiusb_kfifo.patch @@ -0,0 +1,14 @@ +--- a/drivers/lirc_atiusb/lirc_atiusb.c 2012-07-17 16:04:39.000000000 -0400 ++++ b/drivers/lirc_atiusb/lirc_atiusb.c 2012-07-17 16:19:06.000000000 -0400 +@@ -1050,7 +1050,11 @@ + goto new_irctl_failure_check; + } + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 38) + if (lirc_buffer_init(driver->rbuf, dclen, 1)) { ++#else ++ if (lirc_buffer_init(driver->rbuf, dclen, 2)) { ++#endif + mem_failure = 4; + goto new_irctl_failure_check; + } diff --git a/app-misc/lirc/files/lirc-0.9.0-fixed-font.patch b/app-misc/lirc/files/lirc-0.9.0-fixed-font.patch new file mode 100644 index 000000000000..fd122e7362b6 --- /dev/null +++ b/app-misc/lirc/files/lirc-0.9.0-fixed-font.patch @@ -0,0 +1,20 @@ +--- a/tools/xmode2.c 2011-03-25 23:28:18.000000000 +0100 ++++ b/tools/xmode2.c 2012-07-29 19:36:34.972246587 +0200 +@@ -69,7 +69,7 @@ + Window w0, w1; /*w0 = root */ + char w1_wname[] = "xmode2"; + char w1_iname[] = "xmode2"; +-char font1_name[] = "-*-Courier-medium-r-*-*-8-*-*-m-*-iso8859-1"; ++char font1_name[] = "fixed"; + + int w1_x = 0, w1_y = 0; + unsigned int w1_w = 640, w1_h = 480, w1_border = 0; +@@ -201,7 +201,7 @@ + printf("coudn't allocate blue color\n"); + f1_str = XLoadQueryFont(d1, font1_name); + if (f1_str == NULL) { +- printf("could't load font\n"); ++ printf("couldn't load font\n"); + exit(EXIT_FAILURE); + } + diff --git a/app-misc/lirc/files/lirc-0.9.0-kernel-2.6.39-fixes.patch b/app-misc/lirc/files/lirc-0.9.0-kernel-2.6.39-fixes.patch new file mode 100644 index 000000000000..624737090bbe --- /dev/null +++ b/app-misc/lirc/files/lirc-0.9.0-kernel-2.6.39-fixes.patch @@ -0,0 +1,67 @@ +diff -u a/drivers/lirc_atiusb/lirc_atiusb.c b/drivers/lirc_atiusb/lirc_atiusb.c +--- a/drivers/lirc_atiusb/lirc_atiusb.c ++++ b/drivers/lirc_atiusb/lirc_atiusb.c +@@ -48,7 +48,9 @@ + #include + #include + #include ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39) + #include ++#endif + #include + #include + #include +diff -u a/drivers/lirc_i2c/lirc_i2c.c b/drivers/lirc_i2c/lirc_i2c.c +--- a/drivers/lirc_i2c/lirc_i2c.c ++++ b/drivers/lirc_i2c/lirc_i2c.c +@@ -555,8 +555,8 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) + kfree(ir); + return -EINVAL; + } +- printk(KERN_INFO "lirc_i2c: chip 0x%x found @ 0x%02x (%s)\n", +- adap->id, addr, ir->c.name); ++ printk(KERN_INFO "lirc_i2c: chip found @ 0x%02x (%s)\n", ++ addr, ir->c.name); + + #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31) + /* register device */ +diff -u a/drivers/lirc_wpc8769l/lirc_wpc8769l.c b/drivers/lirc_wpc8769l/lirc_wpc8769l.c +--- a/drivers/lirc_wpc8769l/lirc_wpc8769l.c ++++ b/drivers/lirc_wpc8769l/lirc_wpc8769l.c +@@ -361,14 +361,22 @@ static irqreturn_t irq_handler(int irqno, void *blah, struct pt_regs *regs) + size = count << 3; + + ldata = (unsigned long *) data_buf; ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39) + next_one = generic_find_next_le_bit(ldata, size, 0); ++#else ++ next_one = find_next_zero_bit_le(ldata, size, 0); ++#endif + + if (next_one > 0) + put_pulse_bit(next_one + * WPC8769L_USECS_PER_BIT); + + while (next_one < size) { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39) + next_zero = generic_find_next_zero_le_bit(ldata, ++#else ++ next_zero = find_next_zero_bit_le(ldata, ++#endif + size, next_one + 1); + + put_space_bit( +@@ -376,7 +384,11 @@ static irqreturn_t irq_handler(int irqno, void *blah, struct pt_regs *regs) + * WPC8769L_USECS_PER_BIT); + + if (next_zero < size) { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39) + next_one = generic_find_next_le_bit(ldata, ++#else ++ next_one = find_next_bit_le(ldata, ++#endif + size, next_zero + 1); + + put_pulse_bit( +-- +1.7.5.4 diff --git a/app-misc/lirc/files/lirc-0.9.0-kernel-3.3.0-fixes.patch b/app-misc/lirc/files/lirc-0.9.0-kernel-3.3.0-fixes.patch new file mode 100644 index 000000000000..9b7d3ef1f539 --- /dev/null +++ b/app-misc/lirc/files/lirc-0.9.0-kernel-3.3.0-fixes.patch @@ -0,0 +1,50 @@ +diff -ur drivers/lirc_serial/lirc_serial.c drivers.new/lirc_serial/lirc_serial.c +--- drivers/lirc_serial/lirc_serial.c 2011-03-25 18:28:18.000000000 -0400 ++++ drivers.new/lirc_serial/lirc_serial.c 2012-10-24 14:32:14.000000000 -0400 +@@ -66,7 +66,12 @@ + #include + #include + ++#include "drivers/kcompat.h" ++#if LINUX_VERSION_CODE > KERNEL_VERSION(3, 3, 0) ++#include ++#else + #include ++#endif + #include + #include + #include +@@ -80,7 +85,6 @@ + #define UART_IE_IXP42X_UUE 0x40 /* IXP42X UART Unit enable */ + #define UART_IE_IXP42X_RTOIE 0x10 /* IXP42X Receiver Data Timeout int.enable */ + +-#include "drivers/kcompat.h" + #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35) + #include + #include +diff -ur drivers/lirc_sir/lirc_sir.c drivers.new/lirc_sir/lirc_sir.c +--- drivers/lirc_sir/lirc_sir.c 2011-03-25 18:28:18.000000000 -0400 ++++ drivers.new/lirc_sir/lirc_sir.c 2012-10-24 14:32:46.000000000 -0400 +@@ -59,7 +59,14 @@ + #include + #include + #include ++ ++#include "drivers/kcompat.h" ++#if LINUX_VERSION_CODE > KERNEL_VERSION(3, 3, 0) ++#include ++#else + #include ++#endif ++ + #include + #include + #include +@@ -74,7 +81,6 @@ + + #include + +-#include "drivers/kcompat.h" + #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35) + #include + #include diff --git a/app-misc/lirc/files/lirc-0.9.0-kernel-3.5-err-fix.patch b/app-misc/lirc/files/lirc-0.9.0-kernel-3.5-err-fix.patch new file mode 100644 index 000000000000..b06d94efb322 --- /dev/null +++ b/app-misc/lirc/files/lirc-0.9.0-kernel-3.5-err-fix.patch @@ -0,0 +1,12 @@ +--- a/drivers/kcompat.h 2011-03-25 18:28:18.000000000 -0400 ++++ b/drivers/kcompat.h 2012-11-27 13:37:55.000000000 -0500 +@@ -136,4 +136,9 @@ + ) + #endif + ++#ifndef err ++#define err(format, arg...) \ ++ printk(KERN_ERR KBUILD_MODNAME ": " format "\n", ##arg) ++#endif ++ + #endif /* _KCOMPAT_H */ diff --git a/app-misc/lirc/files/lirc-0.9.0-kernel-3.8-fixes.patch b/app-misc/lirc/files/lirc-0.9.0-kernel-3.8-fixes.patch new file mode 100644 index 000000000000..bd11b61c19d8 --- /dev/null +++ b/app-misc/lirc/files/lirc-0.9.0-kernel-3.8-fixes.patch @@ -0,0 +1,80 @@ +diff -Naur lirc-0.9.0/drivers/lirc_serial/lirc_serial.c lirc-0.9.0.new/drivers/lirc_serial/lirc_serial.c +--- lirc-0.9.0/drivers/lirc_serial/lirc_serial.c 2013-05-24 11:58:31.017566567 -0400 ++++ lirc-0.9.0.new/drivers/lirc_serial/lirc_serial.c 2013-05-24 12:00:38.733568898 -0400 +@@ -1107,12 +1107,12 @@ + + static struct platform_device *lirc_serial_dev; + +-static int __devinit lirc_serial_probe(struct platform_device *dev) ++static int lirc_serial_probe(struct platform_device *dev) + { + return 0; + } + +-static int __devexit lirc_serial_remove(struct platform_device *dev) ++static int lirc_serial_remove(struct platform_device *dev) + { + return 0; + } +@@ -1163,7 +1163,7 @@ + + static struct platform_driver lirc_serial_driver = { + .probe = lirc_serial_probe, +- .remove = __devexit_p(lirc_serial_remove), ++ .remove = lirc_serial_remove, + .suspend = lirc_serial_suspend, + .resume = lirc_serial_resume, + .driver = { +diff -Naur lirc-0.9.0/drivers/lirc_sir/lirc_sir.c lirc-0.9.0.new/drivers/lirc_sir/lirc_sir.c +--- lirc-0.9.0/drivers/lirc_sir/lirc_sir.c 2013-05-24 11:58:31.017566567 -0400 ++++ lirc-0.9.0.new/drivers/lirc_sir/lirc_sir.c 2013-05-24 12:00:38.733568898 -0400 +@@ -1296,19 +1296,19 @@ + return 0; + } + +-static int __devinit lirc_sir_probe(struct platform_device *dev) ++static int lirc_sir_probe(struct platform_device *dev) + { + return 0; + } + +-static int __devexit lirc_sir_remove(struct platform_device *dev) ++static int lirc_sir_remove(struct platform_device *dev) + { + return 0; + } + + static struct platform_driver lirc_sir_driver = { + .probe = lirc_sir_probe, +- .remove = __devexit_p(lirc_sir_remove), ++ .remove = lirc_sir_remove, + .driver = { + .name = "lirc_sir", + .owner = THIS_MODULE, +diff -Naur lirc-0.9.0/drivers/lirc_wpc8769l/lirc_wpc8769l.c lirc-0.9.0.new/drivers/lirc_wpc8769l/lirc_wpc8769l.c +--- lirc-0.9.0/drivers/lirc_wpc8769l/lirc_wpc8769l.c 2013-05-24 11:58:30.974566567 -0400 ++++ lirc-0.9.0.new/drivers/lirc_wpc8769l/lirc_wpc8769l.c 2013-05-24 12:00:38.734568898 -0400 +@@ -942,12 +942,12 @@ + #ifdef MODULE + static struct platform_device *lirc_wpc8769l_platform_dev; + +-static int __devinit lirc_wpc8769l_probe(struct platform_device *dev) ++static int lirc_wpc8769l_probe(struct platform_device *dev) + { + return 0; + } + +-static int __devexit lirc_wpc8769l_remove(struct platform_device *dev) ++static int lirc_wpc8769l_remove(struct platform_device *dev) + { + return 0; + } +@@ -975,7 +975,7 @@ + + static struct platform_driver lirc_wpc8769l_platform_driver = { + .probe = lirc_wpc8769l_probe, +- .remove = __devexit_p(lirc_wpc8769l_remove), ++ .remove = lirc_wpc8769l_remove, + .suspend = lirc_wpc8769l_suspend, + .resume = lirc_wpc8769l_resume, + .driver = { diff --git a/app-misc/lirc/files/lirc.service b/app-misc/lirc/files/lirc.service new file mode 100644 index 000000000000..e184dfc09d44 --- /dev/null +++ b/app-misc/lirc/files/lirc.service @@ -0,0 +1,11 @@ +[Unit] +Description=Linux Infrared Remote Control +After=network.target + +[Service] +RuntimeDirectory=lirc +ExecStart=/usr/sbin/lircd --nodaemon --driver=default --device=/dev/lirc0 + +[Install] +WantedBy=multi-user.target + diff --git a/app-misc/lirc/files/lircd-0.8.6-r2 b/app-misc/lirc/files/lircd-0.8.6-r2 new file mode 100644 index 000000000000..757d4e689e18 --- /dev/null +++ b/app-misc/lirc/files/lircd-0.8.6-r2 @@ -0,0 +1,51 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +PIDFILE=/var/run/lirc/${SVCNAME}.pid +: ${LIRCD_SYMLINKFILE:=/dev/lircd} +: ${LIRCD_SOCKET:=/var/run/lirc/lircd} + +depend() { + need localmount + use modules + provide lirc +} + +start() { + local retval + + ebegin "Starting lircd" + + for retval in ${LIRCD_SET_SYSCLASSRCS} ; do + if [ -e /sys/class/rc/${retval}/protocols ] && \ + grep -qs 'lirc' /sys/class/rc/${retval}/protocols ; then + einfo "Setting lirc protocol active for ${retval}" + echo lirc >/sys/class/rc/${retval}/protocols + fi + done + + checkpath -q -d -m 0755 -o root:root /var/run/lirc + rm -Rf ${LIRCD_SOCKET} && ln -s ${LIRCD_SOCKET} ${LIRCD_SYMLINKFILE} + if [ $? -ne 0 ]; then + eend $? "Unable to create symbolic link ${LIRCD_SYMLINKFILE}" + return 1 + fi + + start-stop-daemon --start --quiet --pidfile "${PIDFILE}" --exec /usr/sbin/lircd -- \ + -P "${PIDFILE}" ${LIRCD_OPTS} + retval=$? + + if [ ${retval} -ne 0 ]; then + rm -Rf ${LIRCD_SOCKET} + fi + + eend ${retval} +} + +stop() { + ebegin "Stopping lircd" + rm -f ${LIRCD_SYMLINKFILE} + start-stop-daemon --stop --quiet --pidfile "${PIDFILE}" --exec /usr/sbin/lircd + eend $? +} diff --git a/app-misc/lirc/files/lircd.conf.4 b/app-misc/lirc/files/lircd.conf.4 new file mode 100644 index 000000000000..f59c5f214283 --- /dev/null +++ b/app-misc/lirc/files/lircd.conf.4 @@ -0,0 +1,22 @@ +# Options to pass to the lircd process + +# for devices with lirc-kernel-module +#LIRCD_OPTS="-d /dev/lirc0" +#LIRCD_OPTS="-d /dev/lirc" + +# for devices using the input-layer +#LIRCD_OPTS="-H devinput -d /dev/input/by-path/pci-0000:00:0a.0--event-ir" +# This should work, Bug #235107 +#LIRCD_OPTS="-H devinput -d name=*DVB*" + +# set default protocol to 'lirc' for in-kernel IR decoding +# for the following entries in /sys/class/rc/ +# (space-separated list if there is more than one) +LIRCD_SET_SYSCLASSRCS="rc0" + +# If running mulitple instances of lircd, the following +# can be used to override the default socket path and +# socket symlink +#LIRCD_SOCKET="/var/run/lirc/lircd" +#LIRCD_SYMLINKFILE="/dev/lircd" + diff --git a/app-misc/lirc/files/lircm.service b/app-misc/lirc/files/lircm.service new file mode 100644 index 000000000000..cfd2c93caf6a --- /dev/null +++ b/app-misc/lirc/files/lircm.service @@ -0,0 +1,11 @@ +[Unit] +Description=LIRC Mouse +Requires=lirc.service +After=network.target lirc.service + +[Service] +ExecStart=/usr/sbin/lircmd --nodaemon + +[Install] +WantedBy=multi-user.target + diff --git a/app-misc/lirc/files/lircmd b/app-misc/lirc/files/lircmd new file mode 100644 index 000000000000..e979f74413fc --- /dev/null +++ b/app-misc/lirc/files/lircmd @@ -0,0 +1,19 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + need lircd +} + +start() { + ebegin "Starting lircmd" + start-stop-daemon --start --quiet --exec /usr/sbin/lircmd + eend $? +} + +stop() { + ebegin "Stopping lircmd" + start-stop-daemon --stop --quiet --exec /usr/sbin/lircmd + eend $? +} diff --git a/app-misc/lirc/files/lircmd-0.10.0.conf b/app-misc/lirc/files/lircmd-0.10.0.conf new file mode 100644 index 000000000000..4ba169de582d --- /dev/null +++ b/app-misc/lirc/files/lircmd-0.10.0.conf @@ -0,0 +1,4 @@ +# Options to pass to the lircmd process + +LIRCMD_OPTS="" + diff --git a/app-misc/lirc/files/lircmd-0.9.4a-r2 b/app-misc/lirc/files/lircmd-0.9.4a-r2 new file mode 100644 index 000000000000..a287dc75c636 --- /dev/null +++ b/app-misc/lirc/files/lircmd-0.9.4a-r2 @@ -0,0 +1,19 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + need lircd +} + +start() { + ebegin "Starting lircmd" + start-stop-daemon --start --quiet --exec /usr/sbin/lircmd -- ${LIRCMD_OPTS} + eend $? +} + +stop() { + ebegin "Stopping lircmd" + start-stop-daemon --stop --quiet --exec /usr/sbin/lircmd + eend $? +} diff --git a/app-misc/lirc/files/modprobed.lirc b/app-misc/lirc/files/modprobed.lirc new file mode 100644 index 000000000000..2ed95589b66d --- /dev/null +++ b/app-misc/lirc/files/modprobed.lirc @@ -0,0 +1,22 @@ +# +# For first serial receivers: +# +#options lirc_serial irq=4 io=0x3f8 +#options lirc_sir irq=4 io=0x3f8 + +# +# Detach first serial port from serial-driver. +# Use this when you have your serial-port-driver statically +# compiled into your kernel, or as a module but loaded before +# the lirc-module. +# +#install lirc_serial setserial /dev/ttyS0 uart none; modprobe --ignore-install lirc_serial +# +#install lirc_sir setserial /dev/ttyS0 uart none; modprobe --ignore-install lirc_sir + + +# +# For parallel receivers: +# +#options lirc_parallel irq=7 io=0x3bc + -- cgit v1.2.3