Created
May 17, 2023 22:30
-
-
Save macromorgan/ecc6956b661125ffc927a6f4f0945dc4 to your computer and use it in GitHub Desktop.
Interception for JELOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 803127622846e44ea2e55818bcf498493f470434 Mon Sep 17 00:00:00 2001 | |
From: Chris Morgan <[email protected]> | |
Date: Wed, 17 May 2023 17:26:16 -0500 | |
Subject: [PATCH] package: Add interception package and activate for rk3326 | |
Use the interception package to merge the gpio-keys and adc-joystick | |
input devices found in mainline Linux to avoid the need to have | |
an out of tree input driver. | |
Signed-off-by: Chris Morgan <[email protected]> | |
--- | |
packages/devel/yaml-cpp/package.mk | 11 +++++++++++ | |
packages/sysutils/interception/package.mk | 14 ++++++++++++++ | |
.../etc/interception/oga-controls.yaml | 19 +++++++++++++++++++ | |
.../filesystem/etc/interception/udevmon.yaml | 8 ++++++++ | |
.../usr/lib/systemd/system/udevmon.service | 14 ++++++++++++++ | |
projects/Rockchip/devices/RK3326/options | 2 +- | |
6 files changed, 67 insertions(+), 1 deletion(-) | |
create mode 100644 packages/devel/yaml-cpp/package.mk | |
create mode 100644 packages/sysutils/interception/package.mk | |
create mode 100755 projects/Rockchip/devices/RK3326/filesystem/etc/interception/oga-controls.yaml | |
create mode 100755 projects/Rockchip/devices/RK3326/filesystem/etc/interception/udevmon.yaml | |
create mode 100644 projects/Rockchip/devices/RK3326/filesystem/usr/lib/systemd/system/udevmon.service | |
diff --git a/packages/devel/yaml-cpp/package.mk b/packages/devel/yaml-cpp/package.mk | |
new file mode 100644 | |
index 00000000..2b28ef56 | |
--- /dev/null | |
+++ b/packages/devel/yaml-cpp/package.mk | |
@@ -0,0 +1,11 @@ | |
+# SPDX-License-Identifier: GPL-2.0-or-later | |
+# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv) | |
+ | |
+PKG_NAME="yaml-cpp" | |
+PKG_VERSION="0.7.0" | |
+PKG_SHA256="43e6a9fcb146ad871515f0d0873947e5d497a1c9c60c58cb102a97b47208b7c3" | |
+PKG_LICENSE="MIT" | |
+PKG_SITE="https://github.com/jbeder/yaml-cpp" | |
+PKG_URL="https://github.com/jbeder/yaml-cpp/archive/refs/tags/yaml-cpp-${PKG_VERSION}.tar.gz" | |
+#PKG_DEPENDS_TARGET="toolchain" | |
+PKG_LONGDESC="yaml-cpp is a YAML parser and emitter in C++ matching the YAML 1.2 spec." | |
diff --git a/packages/sysutils/interception/package.mk b/packages/sysutils/interception/package.mk | |
new file mode 100644 | |
index 00000000..3b5790e7 | |
--- /dev/null | |
+++ b/packages/sysutils/interception/package.mk | |
@@ -0,0 +1,14 @@ | |
+# SPDX-License-Identifier: GPL-2.0-or-later | |
+# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv) | |
+ | |
+PKG_NAME="interception" | |
+PKG_VERSION="0.6.8" | |
+PKG_SHA256="45527d9430c2d29f9dce9403d2f8d76f393fe156c8736d618166388169d4268d" | |
+PKG_LICENSE="GPLv3" | |
+PKG_SITE="https://gitlab.com/interception/linux/tools" | |
+PKG_URL="https://gitlab.com/interception/linux/tools/-/archive/v${PKG_VERSION}/tools-v${PKG_VERSION}.tar.bz2" | |
+PKG_DEPENDS_TARGET="boost yaml-cpp" | |
+PKG_TOOLCHAIN="cmake" | |
+PKG_LONGDESC="A minimal composable infrastructure on top of libudev and libevdev." | |
+ | |
+PKG_CMAKE_OPTS_COMMON="-DCMAKE_BUILD_TYPE=Release" | |
diff --git a/projects/Rockchip/devices/RK3326/filesystem/etc/interception/oga-controls.yaml b/projects/Rockchip/devices/RK3326/filesystem/etc/interception/oga-controls.yaml | |
new file mode 100755 | |
index 00000000..6b9de5eb | |
--- /dev/null | |
+++ b/projects/Rockchip/devices/RK3326/filesystem/etc/interception/oga-controls.yaml | |
@@ -0,0 +1,19 @@ | |
+NAME: GO-Advance Gamepad Virtual | |
+PRODUCT: 0x1000 | |
+VENDOR: 0x484B | |
+BUSTYPE: BUS_HOST | |
+DRIVER_VERSION: 0x0100 | |
+EVENTS: | |
+ EV_SYN: [SYN_REPORT, SYN_CONFIG, SYN_MT_REPORT, SYN_DROPPED] | |
+ EV_KEY: [BTN_SOUTH, BTN_EAST, BTN_NORTH, BTN_WEST, BTN_TL, BTN_TR, BTN_DPAD_UP, BTN_DPAD_DOWN, BTN_DPAD_LEFT, BTN_DPAD_RIGHT, BTN_TRIGGER_HAPPY1, BTN_TRIGGER_HAPPY2, BTN_TRIGGER_HAPPY3, BTN_TRIGGER_HAPPY4, BTN_TRIGGER_HAPPY5, BTN_TRIGGER_HAPPY6] | |
+ EV_ABS: | |
+ ABS_X: | |
+ MIN: 172 | |
+ MAX: 772 | |
+ FLAT: 10 | |
+ FUZZ: 10 | |
+ ABS_Y: | |
+ MIN: 278 | |
+ MAX: 815 | |
+ FLAT: 10 | |
+ FUZZ: 10 | |
diff --git a/projects/Rockchip/devices/RK3326/filesystem/etc/interception/udevmon.yaml b/projects/Rockchip/devices/RK3326/filesystem/etc/interception/udevmon.yaml | |
new file mode 100755 | |
index 00000000..478329fd | |
--- /dev/null | |
+++ b/projects/Rockchip/devices/RK3326/filesystem/etc/interception/udevmon.yaml | |
@@ -0,0 +1,8 @@ | |
+- CMD: mux -c oga-control | |
+- JOB: mux -i oga-control | uinput -c /etc/interception/oga-controls.yaml | |
+- JOB: intercept -g $DEVNODE | mux -o oga-control | |
+ DEVICE: | |
+ LINK: /dev/input/by-path/platform-adc-joystick-event | |
+- JOB: intercept -g $DEVNODE | mux -o oga-control | |
+ DEVICE: | |
+ LINK: /dev/input/by-path/platform-gpio-keys-event-joystick | |
diff --git a/projects/Rockchip/devices/RK3326/filesystem/usr/lib/systemd/system/udevmon.service b/projects/Rockchip/devices/RK3326/filesystem/usr/lib/systemd/system/udevmon.service | |
new file mode 100644 | |
index 00000000..d209dda2 | |
--- /dev/null | |
+++ b/projects/Rockchip/devices/RK3326/filesystem/usr/lib/systemd/system/udevmon.service | |
@@ -0,0 +1,14 @@ | |
+[Unit] | |
+Description=Monitor input devices for launching tasks | |
+Wants=systemd-udev-settle.service | |
+After=systemd-udev-settle.service | |
+Documentation=man:udev(7) | |
+ | |
+[Service] | |
+ExecStart=/usr/bin/udevmon -c /etc/interception/udevmon.yaml | |
+Nice=-20 | |
+Restart=on-failure | |
+OOMScoreAdjust=-1000 | |
+ | |
+[Install] | |
+WantedBy=multi-user.target | |
diff --git a/projects/Rockchip/devices/RK3326/options b/projects/Rockchip/devices/RK3326/options | |
index 283c5d16..457ea299 100644 | |
--- a/projects/Rockchip/devices/RK3326/options | |
+++ b/projects/Rockchip/devices/RK3326/options | |
@@ -73,7 +73,7 @@ | |
EXTRA_CMDLINE="quiet rootwait console=tty0 fbcon=rotate:3 ssh consoleblank=0 systemd.show_status=0 loglevel=0 panic=20" | |
# additional packages to install | |
- ADDITIONAL_PACKAGES="" | |
+ ADDITIONAL_PACKAGES="interception" | |
# additional Firmware to use (dvb-firmware, misc-firmware, wlan-firmware) | |
# Space separated list is supported, | |
-- | |
2.34.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment