Skip to content
Draft
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
1 change: 1 addition & 0 deletions conf/include/package_revisions_oss.inc
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ PREFERRED_VERSION_gettext-native = "0.21"
PREFERRED_VERSION_libdrm = "2.4.110"
PREFERRED_VERSION_nativesdk-libdrm = "2.4.110"
PREFERRED_VERSION_sed = "4.1.2"
PREFERRED_VERSION_libmanette ??= "0.2%"

# Workaround to build allarch packags as oss arch
MULTILIB_VARIANTS:pn-alsa-topology-conf = " multilib "
Expand Down
10 changes: 4 additions & 6 deletions recipes-core/glib-2.0/glib-2.0_2.7%.bbappend
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/glib-2.0:"

SRC_URI += " \
file://0001-glib-gmessages-UTC_glib2_72.patch \
file://0002-Fix-passing-NULL-to-g_task_get_cancellable.patch \
file://0003-RDKTV-35445-Fix-localhost-DNS-resolution.patch \
file://CVE-2024-52533_2.74_fix.patch \
file://CVE-2025-4056_2.74_fix.patch \
"

SRC_URI:append = " \
file://0001-RDKTV-35445-Fix-localhost-DNS-resolution.patch \
file://CVE-2024-52533_2.74_fix.patch \
file://CVE-2025-4056_2.74_fix.patch \
"
12 changes: 0 additions & 12 deletions recipes-core/glib-2.0/glib-2.0_2.72.%.bbappend

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"

# Only patches specific to the 2.72 series live here. Shared patches
# (relax_read_error_handling, force_tls1_2, XRE-14265) are in
# glib-networking_2.7%.bbappend which also matches 2.72.x.
SRC_URI += "\
file://relax_read_error_handling.patch \
file://force_tls1_2.patch \
file://0001-Add-support-for-PKCS-12-encrypted-files.patch \
file://0001-XRE-14265-request-client-cert-support.patch \
file://handle_ZERO_RETURN_as_closed_connection.patch \
"

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
From 0bd707a560d0631ef77f656a156b3a44ad3aa371 Mon Sep 17 00:00:00 2001
From: Petar Tijanic <petar_tijanic@comcast.com>
Date: Tue, 9 Jun 2026 08:06:02 +0000
Subject: [PATCH] Build against GLib < 2.76 (RDK platform ships GLib 2.72)

libmanette 1.0 uses two GLib APIs newer than the RDK platform's GLib 2.72.3,
causing implicit-declaration errors and a failed build:

* manette_monitor_list_devices() uses g_hash_table_get_values_as_ptr_array()
(GLib >= 2.76). Replaced with an explicit GHashTableIter loop filling a
GPtrArray (available since 2.16); g_ptr_array_steal() is 2.64.

* The Steam Deck HID driver arms its rumble-stop timeout with
g_timeout_add_once() / GSourceOnceFunc (GLib >= 2.74). Replaced with plain
g_timeout_add(): stop_rumble_cb() now returns gboolean G_SOURCE_REMOVE so it
still fires exactly once.
---
src/drivers/manette-steam-deck-driver.c | 10 ++++++----
src/manette-monitor.c | 9 ++++++++-
2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/src/drivers/manette-steam-deck-driver.c b/src/drivers/manette-steam-deck-driver.c
index 577b8ed..150625a 100644
--- a/src/drivers/manette-steam-deck-driver.c
+++ b/src/drivers/manette-steam-deck-driver.c
@@ -834,12 +834,14 @@ send_rumble (ManetteSteamDeckDriver *self,
return TRUE;
}

-static void
+static gboolean
stop_rumble_cb (ManetteSteamDeckDriver *self)
{
self->rumble_timeout = 0;

send_rumble (self, 0, 0);
+
+ return G_SOURCE_REMOVE;
}

static gboolean
@@ -858,9 +860,9 @@ manette_steam_deck_driver_rumble (ManetteHidDriver *driver,

g_clear_handle_id (&self->rumble_timeout, g_source_remove);

- self->rumble_timeout = g_timeout_add_once (milliseconds,
- (GSourceOnceFunc) stop_rumble_cb,
- self);
+ self->rumble_timeout = g_timeout_add (milliseconds,
+ G_SOURCE_FUNC (stop_rumble_cb),
+ self);

return TRUE;
}
diff --git a/src/manette-monitor.c b/src/manette-monitor.c
index 48f71ae..f73328a 100644
--- a/src/manette-monitor.c
+++ b/src/manette-monitor.c
@@ -599,11 +599,18 @@ manette_monitor_list_devices (ManetteMonitor *self,
gsize *n_devices)
{
GPtrArray *devices;
+ GHashTableIter iter;
+ gpointer value;

g_return_val_if_fail (MANETTE_IS_MONITOR (self), NULL);
g_return_val_if_fail (n_devices != NULL, NULL);

- devices = g_hash_table_get_values_as_ptr_array (self->devices);
+ /* g_hash_table_get_values_as_ptr_array() requires GLib >= 2.76; the RDK
+ * platform ships GLib 2.72. Build the array manually instead. */
+ devices = g_ptr_array_new ();
+ g_hash_table_iter_init (&iter, self->devices);
+ while (g_hash_table_iter_next (&iter, NULL, &value))
+ g_ptr_array_add (devices, value);

return (ManetteDevice **) g_ptr_array_steal (devices, n_devices);
}
--
2.34.1

Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Petar Tijanic <petartijanic01@gmail.com>
Date: Tue, 9 Jun 2026 12:22:15 +0000
Subject: [PATCH] nintendo joycon L/R detect

Broaden is_game_controller() so single Nintendo Joy-Con (L)/(R)
controllers are recognised as game controllers. They expose buttons and
axes that the upstream systemd-derived detection misses (BTN_Z, BTN_TR2,
BTN_TL2 and the ABS_X/ABS_Y main-stick axes), so without these they are
filtered out by the evdev backend.

Forward-ported to libmanette 1.0 (was 0.2 src/manette-device.c, now
src/manette-evdev-backend.c). Original-Change: RDKOSS-596.
---
src/manette-evdev-backend.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/manette-evdev-backend.c b/src/manette-evdev-backend.c
index 5d2ce10..f2c3145 100644
--- a/src/manette-evdev-backend.c
+++ b/src/manette-evdev-backend.c
@@ -89,12 +89,17 @@ is_game_controller (struct libevdev *device,
has_buttons =
has_key (device, BTN_TRIGGER) ||
has_key (device, BTN_A) ||
- has_key (device, BTN_1);
+ has_key (device, BTN_Z) ||
+ has_key (device, BTN_1) ||
+ has_key (device, BTN_TR2) ||
+ has_key (device, BTN_TL2);

has_axes =
has_abs (device, ABS_RX) ||
has_abs (device, ABS_RY) ||
has_abs (device, ABS_RZ) ||
+ has_abs (device, ABS_X) ||
+ has_abs (device, ABS_Y) ||
has_abs (device, ABS_THROTTLE) ||
has_abs (device, ABS_RUDDER) ||
has_abs (device, ABS_WHEEL) ||
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Petar Tijanic <petartijanic01@gmail.com>
Date: Tue, 9 Jun 2026 12:23:55 +0000
Subject: [PATCH] handle revoked evdev devices

An evdev fd can be revoked (EVIOCREVOKE) or the device can vanish without a
udev remove event reaching the monitor. Previously poll_events() watched only
G_IO_IN, ignored libevdev read errors and always returned G_SOURCE_CONTINUE,
so it would keep firing on a dead fd.

Watch G_IO_HUP/G_IO_ERR as well, and tear down the poll source (returning
G_SOURCE_REMOVE, clearing event_source_id so finalize does not double-remove
it) when the channel reports error/disconnect or libevdev returns a read
error.

Forward-ported to libmanette 1.0 (was 0.2 src/manette-device.c poll_events,
now src/manette-evdev-backend.c). Original-Change: RDKOSS-709.
---
src/manette-evdev-backend.c | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)

diff --git a/src/manette-evdev-backend.c b/src/manette-evdev-backend.c
index f2c3145..403a345 100644
--- a/src/manette-evdev-backend.c
+++ b/src/manette-evdev-backend.c
@@ -395,18 +395,34 @@ poll_events (GIOChannel *source,
ManetteEvdevBackend *self)
{
struct input_event evdev_event;
+ int rc;

g_assert (MANETTE_IS_EVDEV_BACKEND (self));

+ /* The fd may be revoked (EVIOCREVOKE) or the device may disappear without a
+ * udev remove event. In that case the channel signals HUP/ERR/NVAL; drop the
+ * watch so we stop polling a dead fd. */
+ if (condition & (G_IO_HUP | G_IO_ERR | G_IO_NVAL)) {
+ g_debug ("Evdev poll condition indicates error/disconnect (condition=0x%x), removing poll source",
+ (guint) condition);
+ self->event_source_id = 0;
+ return G_SOURCE_REMOVE;
+ }
+
while (libevdev_has_event_pending (self->evdev_device)) {
- if (libevdev_next_event (self->evdev_device,
- (guint) LIBEVDEV_READ_FLAG_NORMAL,
- &evdev_event) == 0) {
+ rc = libevdev_next_event (self->evdev_device,
+ (guint) LIBEVDEV_READ_FLAG_NORMAL,
+ &evdev_event);
+ if (rc == LIBEVDEV_READ_STATUS_SUCCESS) {
on_evdev_event (self, &evdev_event);
+ } else if (rc < 0) {
+ g_debug ("Error reading from evdev (%d), removing poll source", rc);
+ self->event_source_id = 0;
+ return G_SOURCE_REMOVE;
}
}

- return TRUE;
+ return G_SOURCE_CONTINUE;
}

static void
@@ -471,7 +487,7 @@ manette_evdev_backend_initialize (ManetteBackend *backend)

// Poll the events in the main loop.
channel = g_io_channel_unix_new (self->fd);
- self->event_source_id = g_io_add_watch (channel, G_IO_IN, (GIOFunc) poll_events, self);
+ self->event_source_id = g_io_add_watch (channel, G_IO_IN | G_IO_HUP | G_IO_ERR, (GIOFunc) poll_events, self);

buttons_number = 0;

Loading
Loading