[Pkg-utopia-maintainers] Bug#561300: devicekit-power: can_hibernate property should be false when no swap exists

Debbie Beliveau debbie.beliveau at gmail.com
Wed Dec 16 00:31:36 UTC 2009


Package: devicekit-power
Version: 011-1
Severity: normal
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu karmic ubuntu-patch


dkp_client_can_hibernate can return true even if the machine has no swap partition.  When determining the value of its can_hibernate property, devicekit-power checks if the kernel supports hibernate and whether there is enough swap space available to perform a hibernate.  However, it does not seem to account for the possibility that a machine may not have a swap partition even though its kernel supports it.  In this case, devicekit-power detects that the kernel supports hibernate and treats the swap space as completely available (therefore dkp_client_can_hibernate returns true).  The attached patch modifies devicekit-power to first check if a swap partition exists before calculating how much is available.

*** /tmp/tmpXwgupz
In Ubuntu, we've applied the attached patch to achieve the following:

  * 05_no_swap_no_hibernate.patch: Have dkp_daemon_check_swap function 1st
    check if swap exists before determining how much is free

We thought you might be interested in doing the same. 


-- System Information:
Debian Release: 5.0
  APT prefers jaunty-updates
  APT policy: (500, 'jaunty-updates'), (500, 'jaunty-security'), (500, 'jaunty-proposed'), (500, 'jaunty-backports'), (500, 'jaunty')
Architecture: i386 (i686)

Kernel: Linux 2.6.28-17-generic (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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tmpSMxEfo
Type: text/x-diff
Size: 1694 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-utopia-maintainers/attachments/20091215/dc4d8c65/attachment.diff>


More information about the Pkg-utopia-maintainers mailing list