Merge lp:~hzliu123/ubuntu/precise/pm-utils/fix-for-1172692 into lp:ubuntu/precise/pm-utils

Proposed by Hao-Ran Liu
Status: Merged
Merge reported by: Martin Pitt
Merged at revision: not available
Proposed branch: lp:~hzliu123/ubuntu/precise/pm-utils/fix-for-1172692
Merge into: lp:ubuntu/precise/pm-utils
Diff against target: 100 lines (+66/-0)
4 files modified
debian/changelog (+6/-0)
debian/patches/28-suspend-hybrid.patch (+39/-0)
debian/patches/series (+1/-0)
pm/pm-functions.in (+20/-0)
To merge this branch: bzr merge lp:~hzliu123/ubuntu/precise/pm-utils/fix-for-1172692
Reviewer Review Type Date Requested Status
Martin Pitt Approve
Review via email: mp+193738@code.launchpad.net

Description of the change

In-kernel suspend to both ram and disk has been supported since kernel 3.6.
This patch add the support and has been verified and works correctly on
Ubuntu trusty and precise with 3.11 kernel.

In order to support hybrid suspend in 12.04.4, Canonical OEM projects would
like this patch upstreamed.

To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

Thanks! I cannot formally merge that as the precise-proposed branch doesn't exist yet. But I uploaded the package to the SRU review queue, thus closing manually.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2012-01-16 15:55:45 +0000
+++ debian/changelog 2013-11-04 08:32:10 +0000
@@ -1,3 +1,9 @@
1pm-utils (1.4.1-9ubuntu1) precise; urgency=low
2
3 * Add support for in-kernel suspend to both (LP: #1172692)
4
5 -- Hao-Ran Liu (Joseph Liu) <hao-ran.liu@canonical.com> Mon, 04 Nov 2013 15:39:45 +0800
6
1pm-utils (1.4.1-9) unstable; urgency=low7pm-utils (1.4.1-9) unstable; urgency=low
28
3 * Add 26-inhibit-on-right-status.patch: Do not use the exit status of log9 * Add 26-inhibit-on-right-status.patch: Do not use the exit status of log
410
=== added file 'debian/patches/28-suspend-hybrid.patch'
--- debian/patches/28-suspend-hybrid.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/28-suspend-hybrid.patch 2013-11-04 08:32:10 +0000
@@ -0,0 +1,39 @@
1Description: Add support for in-kernel suspend to both
2Author: Bojan Smojver <bojan@rexursive.com>
3Author: Jaroslav Škarvada <jskarvad@redhat.com>
4Bug: https://bugs.freedesktop.org/show_bug.cgi?id=52572
5Bug-Ubuntu: https://launchpad.net/bugs/1172692
6
7Index: pm-utils/pm/pm-functions.in
8===================================================================
9--- pm-utils.orig/pm/pm-functions.in 2013-11-01 17:03:17.371325000 +0800
10+++ pm-utils/pm/pm-functions.in 2013-11-01 17:59:36.803067865 +0800
11@@ -336,8 +336,28 @@
12 {
13 [ -n "${HIBERNATE_MODE}" ] && \
14 grep -qw "${HIBERNATE_MODE}" /sys/power/disk && \
15+ HIBERNATE_MODE_SAVE=$(cat /sys/power/disk) && \
16+ HIBERNATE_MODE_SAVE="${HIBERNATE_MODE_SAVE##*[}" && \
17+ HIBERNATE_MODE_SAVE="${HIBERNATE_MODE_SAVE%%]*}" && \
18 echo -n "${HIBERNATE_MODE}" > /sys/power/disk
19 echo -n "disk" > /sys/power/state
20+ RET=$?
21+ echo -n "$HIBERNATE_MODE_SAVE" > /sys/power/disk
22+ return "$RET"
23+ }
24+fi
25+
26+# for kernels that support suspend to both (i.e. hybrid suspend)
27+# since kernel 3.6
28+if [ -z "$SUSPEND_HYBRID_MODULE" ] && \
29+ [ -f /sys/power/disk ] && \
30+ grep -q disk /sys/power/state && \
31+ grep -q suspend /sys/power/disk; then
32+ SUSPEND_HYBRID_MODULE="kernel"
33+ do_suspend_hybrid()
34+ {
35+ HIBERNATE_MODE="suspend"
36+ do_hibernate
37 }
38 fi
39
040
=== modified file 'debian/patches/series'
--- debian/patches/series 2012-01-16 15:55:45 +0000
+++ debian/patches/series 2013-11-04 08:32:10 +0000
@@ -9,5 +9,6 @@
914-disable-sata-alpm.patch914-disable-sata-alpm.patch
1025-pmu.patch1025-pmu.patch
1126-inhibit-on-right-status.patch1126-inhibit-on-right-status.patch
1228-suspend-hybrid.patch
1280-service.patch1380-service.patch
1390-nm-proper-wakeup.patch1490-nm-proper-wakeup.patch
1415
=== modified file 'pm/pm-functions.in'
--- pm/pm-functions.in 2011-07-08 15:02:58 +0000
+++ pm/pm-functions.in 2013-11-04 08:32:10 +0000
@@ -336,8 +336,28 @@
336 {336 {
337 [ -n "${HIBERNATE_MODE}" ] && \337 [ -n "${HIBERNATE_MODE}" ] && \
338 grep -qw "${HIBERNATE_MODE}" /sys/power/disk && \338 grep -qw "${HIBERNATE_MODE}" /sys/power/disk && \
339 HIBERNATE_MODE_SAVE=$(cat /sys/power/disk) && \
340 HIBERNATE_MODE_SAVE="${HIBERNATE_MODE_SAVE##*[}" && \
341 HIBERNATE_MODE_SAVE="${HIBERNATE_MODE_SAVE%%]*}" && \
339 echo -n "${HIBERNATE_MODE}" > /sys/power/disk342 echo -n "${HIBERNATE_MODE}" > /sys/power/disk
340 echo -n "disk" > /sys/power/state343 echo -n "disk" > /sys/power/state
344 RET=$?
345 echo -n "$HIBERNATE_MODE_SAVE" > /sys/power/disk
346 return "$RET"
347 }
348fi
349
350# for kernels that support suspend to both (i.e. hybrid suspend)
351# since kernel 3.6
352if [ -z "$SUSPEND_HYBRID_MODULE" ] && \
353 [ -f /sys/power/disk ] && \
354 grep -q disk /sys/power/state && \
355 grep -q suspend /sys/power/disk; then
356 SUSPEND_HYBRID_MODULE="kernel"
357 do_suspend_hybrid()
358 {
359 HIBERNATE_MODE="suspend"
360 do_hibernate
341 }361 }
342fi362fi
343363

Subscribers

People subscribed via source and target branches

to all changes: