Summary: | RFE: honour gpio input device shutdown keypresses | ||
---|---|---|---|
Product: | systemd | Reporter: | dann frazier <dannf> |
Component: | general | Assignee: | systemd-bugs |
Status: | RESOLVED FIXED | QA Contact: | systemd-bugs |
Severity: | normal | ||
Priority: | medium | ||
Version: | unspecified | ||
Hardware: | ARM | ||
OS: | Linux (All) | ||
URL: | https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1354306 | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
dann frazier
2014-08-08 13:01:28 UTC
Note that, due to a firmware change, the m400 rule should use "gpio_keys" instead of "gpio-keys". Here is the new rule: SUBSYSTEM=="input", KERNEL=="event*", SUBSYSTEMS=="platform", KERNELS=="gpio_keys.6", PROGRAM="/bin/grep '^HP ProLiant m400 Server Cartridge$' /proc/device-tree/model", TAG+="power-switch" (In reply to comment #1) > Note that, due to a firmware change, the m400 rule should use "gpio_keys" > instead of "gpio-keys". Here is the new rule: > > SUBSYSTEM=="input", KERNEL=="event*", SUBSYSTEMS=="platform", > KERNELS=="gpio_keys.6", PROGRAM="/bin/grep '^HP ProLiant m400 Server > Cartridge$' /proc/device-tree/model", TAG+="power-switch" That's a neat hack, but in no way upstreamable. Upstream udev dev will not read the device information from /proc, and will also not call any external tools like grep. This all needs to be solved properly on the kernel side, to export real devices and allow efficient and reliable matching from userspace tools. Right, that wasn't intended to be an upstream patch submittal, just a description of the problem. My best guess at a "good" solution would be something like this: SUBSYSTEM=="input", KERNEL=="event*", SUBSYSTEMS=="platform", ATTRS{keys}=="116", TAG+="power-switch" Which would obviously require some new support in gpio-keyboard-polled to expose the ATTRS{keys}. But I don't know if it is safe to assume that KEY_POWER is always a graceful powerdown request. I think the proper way to fix this is by waiting for this kernel patch to be applied: http://www.spinics.net/lists/linux-input/msg33007.html With that in place we can then update logind to make use of it, and then simply add the udev tag to all keyboards that are discovered, which would then implicitly include any gpio kbd devices. Without that kernel patch I am a bit concerned about listening to all of the system's keypresses, as that might be a bit too much. This has been implemented a while back, see 405e116f57b1cf33d4ca0294ab045a9f709bbc96 |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.