Package: pm-utils
Version: 1.3.0-2
Severity: normal
Tags: patch

Hi there!

Today I upgraded my system and it happened that the kernel was upgraded
as well, from /var/log/dpkg.log:

  2010-09-16 09:28:54 upgrade linux-image-2.6.32-5-amd64 2.6.32-21 2.6.32-22

And now pm-hibernate does not want to suspend anymore, because from
/var/log/pm-suspend.log (implemented to solve #457515):

  Thu Sep 16 18:17:29 CEST 2010: Running hooks for hibernate.
  /usr/lib/pm-utils/sleep.d/000kernel-change hibernate hibernate:kernel \
   update inhibits hibernate (/var/run/do-not-hibernate present)
  Returned exit code 1.

However, I am running another kernel (2.6.34-1-amd64), thus pm-hibernate
should work anyway.  Indeed, removing /var/run/do-not-hibernate and
hibernating did not cause any issue (FYI, I am now at the third
hibernation/thawing cycle after the issue above).

The following patch should solve this issue, tested locally while both
upgrading the running kernel and a not-running one:

--8<---------------cut here---------------start------------->8---
--- a/kernel/postinst.d/pm-utils
+++ b/kernel/postinst.d/pm-utils
@@ -2,4 +2,11 @@
 
 # Let programs know not to hibernate if the kernel that would be used for
 # resume-from-hibernate is likely to differ from the currently running kernel.
-touch /var/run/do-not-hibernate
+
+# this fix bug #NNNNNN
+KERNEL_RUNNING=`uname -r`
+KERNEL_UPGRADING="$1"
+
+if [ "$KERNEL_RUNNING" = "$KERNEL_UPGRADING" ]; then
+       touch /var/run/do-not-hibernate
+fi
--8<---------------cut here---------------end--------------->8---

Thx, bye,
Gismo / Luca

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.34-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages pm-utils depends on:
ii  kbd                           1.15.2-1   Linux console font and keytable ut
ii  powermgmt-base                1.31       Common utils and configs for power

Versions of packages pm-utils recommends:
ii  procps                        1:3.2.8-9  /proc file system utilities
pn  radeontool                    <none>     (no description available)
pn  vbetool                       <none>     (no description available)

Versions of packages pm-utils suggests:
ii  cpufrequtils                  007-1      utilities to deal with the cpufreq
pn  uswsusp                       <none>     (no description available)

-- no debconf information

Attachment: pgpQyHCSsd5fc.pgp
Description: PGP signature

Reply via email to