Open ABeltramo opened 4 months ago
Intercept /dev/uinput ioctl calls?
Yes. A valve engineer confirm to me, that LD_PRELOAD-ing steam to do this should give us all the infos we need.
Basically we should intercept UI_DEV_CREATE and then internally call UI_GET_SYSNAME, matching the name to our container and returning from the intercepted ioctl.
Everything that is not UI_DEV_CREATE
we can just passthrough and ignore.
Thank you so much for confirming it! It should be fairly straightforward then, just need to plug together fake-udev
and mknod
in a simple library that I'll preload.
Damn I wish I could bother a Valve engineer too 😅
Steam input works by creating virtual devices using
uinput
(similar to how we do it in inputtino). So the first step is obviously to allow the Steam container to access it:When you start a game with steam input enabled the following
uevents
will be generated:As you can see it's missing the corresponding
udev
events (network isolation for the win); we'll have to pick those kernel events up,mknod
the devices and relay the correspondentudev
event using fake-udev.The only bit that I'm not sure is how to avoid mounting other containers devices. Unfortunately kernel events aren't isolated, for example I can see the event for when a device is plugged in the host.. How can we
mknod
only the devices that are actually generated by this steam instance? Intercept/dev/uinput
ioctl calls?Quick fix
This will break isolation, but for a single user this should work:
And set the env variable
WOLF_DOCKER_FAKE_UDEV_PATH=""
to disable ourfake_udev
implementation.