[PR #421] [CLOSED] fix(fake-udev): persist /run/udev/data so libudev can enumerate devices #455

Closed
opened 2026-10-15 13:00:42 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/games-on-whales/wolf/pull/421
Author: @JBailes
Created: 6/7/2026
Status: ❌ Closed

Base: stable ← Head: fix/fake-udev-write-db


📝 Commits (2)

  • 13bb455 fix(fake-udev): persist the /run/udev/data DB record
  • 117e67d style(fake-udev): clang-format (wrap condition per .clang-format)

📊 Changes

1 file changed (+79 additions, -1 deletions)

View changed files

📝 src/fake-udev/fake-udev-cli.cpp (+79 -1)

📄 Description

Problem

fake-udev only broadcasts the NETLINK_KOBJECT_UEVENT; it never writes the /run/udev/data/c<maj>:<min> database record. libudev consumers enumerate devices from that database, not from the netlink event. In session images that run no udevd (gamescope/Steam), a Wolf virtual gamepad is mknod'd and its evdev events flow, but SDL never sees ID_INPUT_JOYSTICK for it, so certain games ignore the controller. Keyboard/mouse are unaffected because they don't depend on that tag. The fake-udev docs already state it should "generate the appropriate DB entries in /run/udev/data/" — the code never did.

Evidence

  • strace fake-udev -m <add event>: socket/bind/sendmsg only; no open/write under /run/udev.
  • With the record absent, SDL (udev_enumerate_scan_devices) skips the pad; writing the record by hand makes Steam detect it on its next scan.
  • A Wolf build whose fake-udev writes this record runs controllers correctly in production; this change brings stock fake-udev to parity.

Change

On add, parse the uevent payload and write the udev DB entry the way systemd-udevd does: E: device properties, I:USEC_INITIALIZED, G:/Q: tags, V:1, keyed on MAJOR:MINOR. On remove, unlink it. Written before the broadcast, so a consumer that looks the device up in response to the event finds a complete record. No-op when the payload carries no MAJOR/MINOR. No new dependencies — <fstream>/<sys/stat.h>/<unistd.h> are already included.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/games-on-whales/wolf/pull/421 **Author:** [@JBailes](https://github.com/JBailes) **Created:** 6/7/2026 **Status:** ❌ Closed **Base:** `stable` ← **Head:** `fix/fake-udev-write-db` --- ### 📝 Commits (2) - [`13bb455`](https://github.com/games-on-whales/wolf/commit/13bb455cc850a413fccb361a204c3f95cb7241bd) fix(fake-udev): persist the /run/udev/data DB record - [`117e67d`](https://github.com/games-on-whales/wolf/commit/117e67d1d1f48af7612faec1303715da4b77be31) style(fake-udev): clang-format (wrap condition per .clang-format) ### 📊 Changes **1 file changed** (+79 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/fake-udev/fake-udev-cli.cpp` (+79 -1) </details> ### 📄 Description ## Problem `fake-udev` only broadcasts the `NETLINK_KOBJECT_UEVENT`; it never writes the `/run/udev/data/c<maj>:<min>` database record. libudev consumers enumerate devices from that database, not from the netlink event. In session images that run no `udevd` (gamescope/Steam), a Wolf virtual gamepad is `mknod`'d and its evdev events flow, but SDL never sees `ID_INPUT_JOYSTICK` for it, so certain games ignore the controller. Keyboard/mouse are unaffected because they don't depend on that tag. The fake-udev docs already state it should "generate the appropriate DB entries in `/run/udev/data/`" — the code never did. ## Evidence - `strace fake-udev -m <add event>`: `socket`/`bind`/`sendmsg` only; no `open`/`write` under `/run/udev`. - With the record absent, SDL (`udev_enumerate_scan_devices`) skips the pad; writing the record by hand makes Steam detect it on its next scan. - A Wolf build whose `fake-udev` writes this record runs controllers correctly in production; this change brings stock `fake-udev` to parity. ## Change On `add`, parse the uevent payload and write the udev DB entry the way `systemd-udevd` does: `E:` device properties, `I:USEC_INITIALIZED`, `G:`/`Q:` tags, `V:1`, keyed on `MAJOR:MINOR`. On `remove`, unlink it. Written before the broadcast, so a consumer that looks the device up in response to the event finds a complete record. No-op when the payload carries no `MAJOR`/`MINOR`. No new dependencies — `<fstream>`/`<sys/stat.h>`/`<unistd.h>` are already included. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-15 13:00:42 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
games-on-whales/wolf#455
No description provided.