Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4l-utils: fix racy udev rule #1802

Merged
merged 2 commits into from
Jul 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion packages/sysutils/v4l-utils/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -46,6 +51,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
Expand Down

This file was deleted.

25 changes: 25 additions & 0 deletions packages/sysutils/v4l-utils/udev.d/70-infrared.rules
Original file line number Diff line number Diff line change
@@ -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"