Skip to content

Fall back to plain files when mknod is unavailable - #175

Draft
LoneAngelFayt wants to merge 1 commit into
linuxserver:masterfrom
LoneAngelFayt:gamepad-rootless-fallback
Draft

Fall back to plain files when mknod is unavailable#175
LoneAngelFayt wants to merge 1 commit into
linuxserver:masterfrom
LoneAngelFayt:gamepad-rootless-fallback

Conversation

@LoneAngelFayt

Copy link
Copy Markdown

linuxserver.io


  • I have read the contributing guideline and understand that I have made the correct modifications

Description:

Adds an elif branch to the gamepad block in init-selkies-config/run that falls back to plain files when mknod is not available, gated on touch /dev/input/js0 the same way the existing block is gated on mknod /dev/input/js0.

Benefits of this PR and context:

Under rootless podman there is no CAP_MKNOD, and the kernel refuses device nodes inside a userns anyway, so the mknod fails and the whole block drops to the else branch. That sets SELKIES_GAMEPAD_ENABLED=false and never writes LD_PRELOAD into container_environment, so gamepads are dead in every app and nothing logs why.

Empty files are enough here because the joystick interposer hooks open() on the path name and the fake libudev handles enumeration, so nothing ever opens the real node.

How Has This Been Tested?

Rootless podman on Fedora 43, running the webstation image. Before the change /dev/input is empty and /run/s6/container_environment/LD_PRELOAD does not exist. After it, the js/event files are created, LD_PRELOAD is set, and the gamepad env vars stay at their defaults. Verified controller input reaching PCSX2 through the browser, with connections on /tmp/selkies_js*.sock.

Also checked the rootful path is untouched: with mknod available the first branch still wins and the elif never runs.

Source / References:

n/a

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening this pull request! Be sure to follow the pull request template!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants