udev-dev: Enumerate evdev devices via kern.evdev.input sysctls#12
Open
Defenso-QTH wants to merge 1 commit into
Open
udev-dev: Enumerate evdev devices via kern.evdev.input sysctls#12Defenso-QTH wants to merge 1 commit into
Defenso-QTH wants to merge 1 commit into
Conversation
When /dev/input/ is not visible to the calling process (for example, a FreeBSD jail without the corresponding devfs ruleset), the existing scandir-based enumeration in udev_dev_enumerate() cannot discover any input devices, even though the kern.evdev.input.* sysctls remain readable and the per-device property handlers already populate from those sysctls. Add a sysctl tree-walk fallback that runs after the scandir pass. The walk uses CTL_SYSCTL_NEXT to discover the actual children of kern.evdev.input without a fixed upper bound, then resolves each unit's name via CTL_SYSCTL_NAME to extract the unit number for the /dev/input/eventN syspath. Devices already discovered by scandir are deduplicated by udev_list_insert. This lets libinput (and other libudev consumers) enumerate input devices in environments where the evdev sysctls are accessible but the devnodes are not. Signed-off-by: Quentin Thebault <quentin.thebault@defenso.fr> Sponsored-by: Defenso
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test setup:
seatdexposed through nullfslibinputwith patch to trustseatdprovided by fd even if no device node is found: freebsd/freebsd-ports@90514b8 (under review in libinput: https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1471)cagecompositor andfootterminal