[Pm-utils] [RFC] Writing "${HIBERNATE_MODE}" unconditionally to /sys/power/disk

Michael Biebl mbiebl at gmail.com
Mon Mar 17 23:04:58 PDT 2008


Hi,

please see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=450515
for the background.

Apparently, writing "platform" unconditionally to /sys/power/disk can
lead to suspend failures, if this method is not supported.

If I read the kernel documentation correctly [1], "firmware" or
"platform" can be not supported on certain platforms. The way to
detect that, is probably to grep for it in /sys/power/disk. The
documentation is not clear about that.


So the question: Should we generally check for HIBERNATE_MODE first:
--- a/pm/module.d/kernel
+++ b/pm/module.d/kernel
@@ -22,6 +22,7 @@ check_hibernate()

 do_hibernate()
 {
+       grep -q "${HIBERNATE_MODE}" /sys/power/disk && \
        echo -n "${HIBERNATE_MODE}" > /sys/power/disk
        echo -n "disk" > /sys/power/state
 }


Or only, if HIBERNATE_MODE is firmware or platform? And is this the
correct way to determine if firmware or platform is supported.

Cheers,
Michael

[1] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/ABI/testing/sysfs-power
-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?


More information about the Pm-utils mailing list