ValveSoftware / steam-devices

List of devices Steam and SteamVR will want read/write permissions on, to help downstream distributions create udev rules/etc
MIT License
153 stars 42 forks source link

Error at boot: eudev complains about an invalid key/value pair #10

Closed xrogaan closed 4 years ago

xrogaan commented 4 years ago

Your system information

Please describe your issue in as much detail as possible:

At boot, eudev complains about an invalid key/value pair:

udevd[425]: invalid key/value pair in file /lib/udev/rules.d/60-steam-input.rules on line 42, starting at character 82 ('u')

Offending line:

KERNEL=="input*", ATTRS{name}=="Lic Pro Controller", RUN{program}+="/bin/sh -c \"udevadm test-builtin uaccess /sys/%p/../../hidraw/hidraw*\""

It seems that eudev doesn't like escaped double quotes. I'm not sure whether to report it to the Eudev folks.

ndreys commented 4 years ago

@xrogaan at a first glance this looks like something to report to eudev folks, I think. Here's the PR that added that feature to systemd-udev: https://github.com/systemd/systemd/pull/6890

smcv commented 4 years ago

If eudev is meant to be compatible enough with original udev that it reads the same rules files, then it needs to accept all the same syntax, including escaped quotes; so yes, please report that to the eudev developers.

Having said that, for this particular rule, it might be possible to work around this by replacing the escaped double quotes with single quotes. Please try that? Something like this:

KERNEL=="input*", ATTRS{name}=="Lic Pro Controller", RUN{program}+="/bin/sh -c 'udevadm test-builtin uaccess /sys/%p/../../hidraw/hidraw*'"
smcv commented 4 years ago

udev(7) (from systemd 245.6) says "Single quotes can be used to specify arguments with spaces" and doesn't actually document escaped double quotes, so it seems the version in my previous comment might be the preferred form anyway.

xrogaan commented 4 years ago

Their issues tracker is also available on github. I'm not well versed in all the udev/eudev backend, and I'm afraid I wouldn't be capable to building a proper argument for them to be "more like systemd". The only thing I can come up with is that eudev will be broken if systemd's become prevalent over a saner approach (escaping is ugly and confusing).

chewi commented 4 years ago

While this could potentially be addressed in eudev, it seems easier all round to just use single quotes here so I've submitted a pull request.

smcv commented 4 years ago

I'm not well versed in all the udev/eudev backend

udev and systemd were originally separate projects (udev is much older), then they merged into one source tree in version 183 to be able to share code and maintenance. They're still semi-separate, and you can still use udev without booting with the systemd service manager: that's how it works in Debian systems that have been configured to boot using sysvinit, in older Ubuntu systems that boot using Upstart, and in initramfs environments. However, some people dislike systemd enough to consider that to be insufficient separation, resulting in a fork of udev under the name eudev, which is used in Devuan and optional (I think?) in Gentoo.

The escaped double quotes will also be a problem for older versions of the original udev (including any version older than the merge with systemd, if anyone is still using those). systemd/systemd#6835 was reported against the version of udev included in systemd 233, so this will affect Debian 9, Ubuntu 16.04 and contemporary distributions.

I think the right answer to this is to change steam-devices' udev rule to use single quotes (#11), and teach eudev to understand escaped double quotes so that it's more compatible with newer udev versions.

chewi commented 4 years ago

Gentoo defaults to eudev but gives you a choice of that, standalone udev, udev with systemd, or even mdev, which I do use on one oddball ARM system.

smcv commented 4 years ago

Updated udev rules released in steam-launcher 1.0.0.66 (currently a beta, should become the stable release later).