From e69350f6edd49b9b94937f6561322e3568e40d68 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 16 Jul 2017 14:01:08 +0200 Subject: [PATCH 1/2] v4l-utils: fix racy udev rule ir-keytable -a can fail if it's run before the input and event devices are created. Fix this by changing the udev rule to trigger on event device creation instead of rc device creation. Also drop the udev rules patch and simply replace the udev rule with our version, this is easier to maintain. Signed-off-by: Matthias Reichl --- packages/sysutils/v4l-utils/package.mk | 4 +++ ...l-utils-10-support-user-rc-maps-file.patch | 35 ------------------- .../v4l-utils/udev.d/70-infrared.rules | 25 +++++++++++++ 3 files changed, 29 insertions(+), 35 deletions(-) delete mode 100644 packages/sysutils/v4l-utils/patches/v4l-utils-10-support-user-rc-maps-file.patch create mode 100644 packages/sysutils/v4l-utils/udev.d/70-infrared.rules diff --git a/packages/sysutils/v4l-utils/package.mk b/packages/sysutils/v4l-utils/package.mk index 4167fc01ea2..f56ba003313 100644 --- a/packages/sysutils/v4l-utils/package.mk +++ b/packages/sysutils/v4l-utils/package.mk @@ -46,6 +46,10 @@ post_makeinstall_target() { mkdir -p $INSTALL/usr/config cp -PR $PKG_DIR/config/* $INSTALL/usr/config + rm -rf $INSTALL/usr/lib/udev/rules.d + mkdir -p $INSTALL/usr/lib/udev/rules.d + cp -PR $PKG_DIR/udev.d/*.rules $INSTALL/usr/lib/udev/rules.d + ( echo "# table libreelec_multi, type: RC6 NEC" for f in rc6_mce xbox_360 zotac_ad10 hp_mce xbox_one cubox_i ; do diff --git a/packages/sysutils/v4l-utils/patches/v4l-utils-10-support-user-rc-maps-file.patch b/packages/sysutils/v4l-utils/patches/v4l-utils-10-support-user-rc-maps-file.patch deleted file mode 100644 index 7d0981e1087..00000000000 --- a/packages/sysutils/v4l-utils/patches/v4l-utils-10-support-user-rc-maps-file.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 996fdbf54f4b6c479dc7dd6ab4ca7933730aba93 Mon Sep 17 00:00:00 2001 -From: Matthias Reichl -Date: Sun, 12 Mar 2017 12:22:14 +0100 -Subject: [PATCH] ir-keytable: allow map rules override via - /storage/.config/rc_maps.cfg - -Signed-off-by: Matthias Reichl ---- - utils/keytable/70-infrared.rules | 14 ++++++++++++-- - 1 file changed, 12 insertions(+), 2 deletions(-) - -diff --git a/utils/keytable/70-infrared.rules b/utils/keytable/70-infrared.rules -index afffd95..eef3234 100644 ---- a/utils/keytable/70-infrared.rules -+++ b/utils/keytable/70-infrared.rules -@@ -1,4 +1,14 @@ - # Automatically load the proper keymaps after the Remote Controller device --# creation. The keycode tables rules should be at /etc/rc_maps.cfg -+# 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", SUBSYSTEM=="rc", RUN+="/usr/bin/ir-keytable -a /etc/rc_maps.cfg -s $name" -+ACTION=="add", SUBSYSTEM=="rc", 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 $name" --- -2.1.4 - diff --git a/packages/sysutils/v4l-utils/udev.d/70-infrared.rules b/packages/sysutils/v4l-utils/udev.d/70-infrared.rules new file mode 100644 index 00000000000..f644ee44496 --- /dev/null +++ b/packages/sysutils/v4l-utils/udev.d/70-infrared.rules @@ -0,0 +1,25 @@ +# 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" +GOTO="end" + +LABEL="begin" + +SUBSYSTEM=="rc", ENV{rc_sysdev}="$name" + +SUBSYSTEM=="input", IMPORT{parent}="rc_sysdev" + +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}" + +LABEL="end" From 5c28dc0a771007b6a783faa1c8ea4fbb33c9e6ef Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Fri, 21 Jul 2017 16:47:16 +0200 Subject: [PATCH 2/2] v4l-utils: build and install ir-ctl as well Signed-off-by: Matthias Reichl --- packages/sysutils/v4l-utils/package.mk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/sysutils/v4l-utils/package.mk b/packages/sysutils/v4l-utils/package.mk index f56ba003313..4afd1f55eaf 100644 --- a/packages/sysutils/v4l-utils/package.mk +++ b/packages/sysutils/v4l-utils/package.mk @@ -33,10 +33,15 @@ PKG_IS_ADDON="no" PKG_AUTORECONF="no" PKG_CONFIGURE_OPTS_TARGET="--without-jpeg" -PKG_MAKEINSTALL_OPTS_TARGET="PREFIX=/usr -C utils/keytable" make_target() { make -C utils/keytable CFLAGS="$TARGET_CFLAGS" + make -C utils/ir-ctl CFLAGS="$TARGET_CFLAGS" +} + +makeinstall_target() { + make install DESTDIR=$INSTALL PREFIX=/usr -C utils/keytable + make install DESTDIR=$INSTALL PREFIX=/usr -C utils/ir-ctl } post_makeinstall_target() {