Skip to content

Commit

Permalink
Merge pull request #3193 from HiassofT/le9-v4l-utils-fix-udev-rule
Browse files Browse the repository at this point in the history
v4l-utils: simplify 70-infrared.rules and fix kernel 4.20 issues
  • Loading branch information
CvH authored Dec 30, 2018
2 parents 0fc9075 + 37dc6ef commit 4de1c8b
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions packages/sysutils/v4l-utils/udev.d/70-infrared.rules
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@

# Automatically load the proper keymaps after the Remote Controller device
# creation.
#
# User-defined rules can be stored in /storage/.config/rc_maps.cfg. If that
# file doesn't exist the default rules from /etc/rc_maps.cfg are used.

ACTION=="add", SUBSYSTEMS=="rc", GOTO="begin"
ACTION=="add", KERNEL=="event*", SUBSYSTEM=="input", SUBSYSTEMS=="rc", ENV{.rc_sysdev}="$id", GOTO="begin"
GOTO="end"

LABEL="begin"

SUBSYSTEM=="rc", ENV{rc_sysdev}="$name"

SUBSYSTEM=="input", IMPORT{parent}="rc_sysdev"
ENV{.rc_maps_cfg}="/etc/rc_maps.cfg"
TEST=="/storage/.config/rc_maps.cfg", ENV{.rc_maps_cfg}="/storage/.config/rc_maps.cfg"

KERNEL=="event[0-9]*", ENV{rc_sysdev}=="?*", IMPORT{program}="/usr/bin/sh -c '\
if [ -r /storage/.config/rc_maps.cfg ] ; then \
echo rc_maps_cfg=/storage/.config/rc_maps.cfg ; \
else \
echo rc_maps_cfg=/etc/rc_maps.cfg ; \
fi'"

ENV{rc_maps_cfg}=="?*", RUN+="/usr/bin/ir-keytable -a $env{rc_maps_cfg} -s $env{rc_sysdev}"
RUN+="/usr/bin/ir-keytable -a $env{.rc_maps_cfg} -s $env{.rc_sysdev}"

LABEL="end"

0 comments on commit 4de1c8b

Please sign in to comment.