Skip to content

Commit

Permalink
lirc: add lircd-uinput service
Browse files Browse the repository at this point in the history
  • Loading branch information
lrusak authored and Kwiboo committed Dec 28, 2016
1 parent 8cfa64d commit 2ce4f68
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/sysutils/eventlircd/udev.d/98-eventlircd.rules
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion packages/sysutils/lirc/scripts/lircd_helper
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 12 additions & 0 deletions packages/sysutils/lirc/system.d/[email protected]
Original file line number Diff line number Diff line change
@@ -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

6 changes: 6 additions & 0 deletions packages/sysutils/lirc/udev.d/98-lircd.rules
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 2ce4f68

Please sign in to comment.