Summary: | systemd overriding /sys/power/disk with "platform" on hibernate | ||
---|---|---|---|
Product: | systemd | Reporter: | tekrotzen <tekrotzen+bugzilla> |
Component: | general | Assignee: | systemd-bugs |
Status: | RESOLVED NOTOURBUG | QA Contact: | systemd-bugs |
Severity: | normal | ||
Priority: | medium | CC: | tekrotzen+bugzilla |
Version: | unspecified | ||
Hardware: | x86 (IA32) | ||
OS: | Linux (All) | ||
See Also: | https://bugs.freedesktop.org/show_bug.cgi?id=57882 | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
tekrotzen
2012-12-23 12:07:50 UTC
at the moment I created a copy of systemd-hibernate.service in /etc/systemd/system/ , replacing ExecStart=/usr/lib/systemd/systemd-sleep hibernate with a small script: #!/bin/sh echo -n "shutdown" > /sys/power/disk echo -n "disk" > /sys/power/state This really sounds as if this should be fixed in the kernel. i.e. if "platform" doesn't work correctly on your system the kernel should have a DMI check and execute a normal shutdown instead. Working around that in userspace is not how we do these things these days. I guess you're right. I don't know what is visible with a DMI check, and saw the following in the kernel docs, so I thought I was maybe not alone... ;) ___________ http://www.kernel.org/doc/Documentation/power/swsusp.txt : You need to append resume=/dev/your_swap_partition to kernel command line. Then you suspend by echo shutdown > /sys/power/disk; echo disk > /sys/power/state . If you feel ACPI works pretty well on your system, you might try echo platform > /sys/power/disk; echo disk > /sys/power/state _______________________ Reason I filled this bug. But I do completely understand your point. I was just wondering: as some people seem to use other options, as "reboot" (see attached bug), maybe a solution could be to grep /sys/power/disk for the selected option and to use that instead of "platform"? This way "platform" would still be used if it is the system default, but if for any reason a user wants to use something else instead it wouldn't be overwritten: This could be a cheap way to allow testing and customisation... Not sure if I'm missing something obvious, in this case please accept my appologies... And thanks for the quick feedback, in any case! Tekrotzen's replacement script works fine for me too, adapted to do either 'reboot' or 'platform' as required (see my bug report 57882). The only drawback is that it doesn't appear to run the sleep hooks in /usr/lib/systemd/system-sleep/ - no doubt these could be added to the script instead. The bug definitely appeared at version 196, perhaps as a result of the changes for 'hybrid sleep' - reverting back to 195 results in the problem going away. Hopefully the developers will produce a fix in due course. Using a workaround is not ideal. Thanks. We won't work around kernel bugs from userspace really. Fix problems where they are. If it is known that some firmware cannot handle "platform" in /sys/power/disk, then this option should be removed from the settings on that system, but that needs to happen in the kernel, not worked around in userspace. Or in other words: essential quirks like this (i.e. which if not applied will cause fatal issues) need to be applied in the kernel, not in userspace. hence closing, please file bug on the kernel bugzilla, possibly referring to this bug. |
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.