Skip to content

[2.30] webos: only ask /sys/class/input about input nodes - #16

Merged
mariotaku merged 1 commit into
webOS-2.30.xfrom
webos-2.30/presence-input-only
Sep 24, 2026
Merged

mariotaku merged 1 commit into
webOS-2.30.xfrom
webos-2.30/presence-input-only

Conversation

@mariotaku

Copy link
Copy Markdown
Member

/sys/class/input only lists evdev and js nodes, so wherever /sys/dev is missing (every production jail) the presence probe reported every hidraw node as absent. Other names now fall through to the open() probe. Backport of the same change on webOS-3.4.x.

Verified: builds with the webOS toolchain (CI config), no warnings.

Untested on a device under a production (native/native_game) jail. The check: under jailer -t native with a hidraw gamepad, unplugging it should be reported; and dead /dev/hidrawN slots should fail open() with ENODEV/ENXIO (EACCES would make them read as present).

🤖 Generated with Claude Code

/sys/class/input only lists evdev and js nodes, so wherever /sys/dev
is missing (every production jail) it reported every hidraw node as
absent. Let other names fall through to the open() probe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mariotaku

Copy link
Copy Markdown
Member Author

Tested on lk5900 (webOS 4.4.3) under jailer -t native (no /sys/dev), comparing 649b462 (before) with 2dd4597 (after), with a DualShock 4 (054c:09cc) on USB.

Snapshot, pad plugged in: /dev/hidraw0 opens fine in both builds. Before: verdict ABSENT, HIDRAW=0x0. After: verdict PRESENT, HIDRAW=0x1. evdev/js identical.

Snapshot, pad unplugged: every hidraw slot fails with ENODEV and reads ABSENT in both builds, so no phantom devices. The jail's copies are 0660 root:5000 and the app runs as gid 5000, so the driver itself answers. Same result earlier in native_game and native_devmode, and on up7560 (webOS 6.5.2), which has no /dev/hidraw* at all until a device binds.

Live hot-plug (testwebosuevent, 2 plug/unplug cycles each):

before after
netlink add/remove for hidraw0 4 4
poll saw hidraw0 change 0 ("the bitmask could express 0") 4 (0.2–1 s after netlink)
transitions the poll cannot see 4 0
[115.198] netlink  add    /dev/hidraw0
[115.846] poll     add    hidraw/0 (netlink was 648ms ahead)
[116.671] netlink  remove /dev/hidraw0
[116.855] poll     remove hidraw/0 (netlink was 184ms ahead)

Only the 3.4.x build ran on the TV; the 2.30.x change has the same logic.

🤖 Generated with Claude Code

@mariotaku
mariotaku merged commit ba4c86a into webOS-2.30.x Sep 24, 2026
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant