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

Proposed by Hao-Ran Liu
Status: Merged
Merge reported by: Martin Pitt
Merged at revision: not available
Proposed branch: lp:~hzliu123/ubuntu/trusty/pm-utils/fix-for-1172692
Merge into: lp:ubuntu/trusty/pm-utils
Diff against target: 99 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/trusty/pm-utils/fix-for-1172692
Reviewer Review Type Date Requested Status
Martin Pitt Approve
Review via email: mp+193620@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. It has been included in Fedora 19.

To post a comment you must log in.
Revision history for this message
Jackson Doak (noskcaj) wrote :

Please try to minimise changes to the .pc folder.
I.E. Only have patches applied that where already applied, and don't commit any of the .pc folder

63. By Hao-Ran Liu

Add support for in-kernel suspend to both (LP: #1172692)

Revision history for this message
Hao-Ran Liu (hzliu123) wrote :

Commit to the .pc folder removed.

Revision history for this message
Martin Pitt (pitti) wrote :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2013-10-14 10:25:46 +0000
3+++ debian/changelog 2013-11-04 07:30:28 +0000
4@@ -1,3 +1,9 @@
5+pm-utils (1.4.1-12ubuntu2) saucy; urgency=low
6+
7+ * Add support for in-kernel suspend to both (LP: #1172692)
8+
9+ -- Hao-Ran Liu (Joseph Liu) <hao-ran.liu@canonical.com> Fri, 01 Nov 2013 20:54:16 +0800
10+
11 pm-utils (1.4.1-12ubuntu1) saucy; urgency=low
12
13 * debian/sleep.d/50unload_alx: Unload the alx module during suspend.
14
15=== added file 'debian/patches/28-suspend-hybrid.patch'
16--- debian/patches/28-suspend-hybrid.patch 1970-01-01 00:00:00 +0000
17+++ debian/patches/28-suspend-hybrid.patch 2013-11-04 07:30:28 +0000
18@@ -0,0 +1,39 @@
19+Description: Add support for in-kernel suspend to both
20+Author: Bojan Smojver <bojan@rexursive.com>
21+Author: Jaroslav Škarvada <jskarvad@redhat.com>
22+Bug: https://bugs.freedesktop.org/show_bug.cgi?id=52572
23+Bug-Ubuntu: https://launchpad.net/bugs/1172692
24+
25+Index: pm-utils/pm/pm-functions.in
26+===================================================================
27+--- pm-utils.orig/pm/pm-functions.in 2013-11-01 17:03:17.371325000 +0800
28++++ pm-utils/pm/pm-functions.in 2013-11-01 17:59:36.803067865 +0800
29+@@ -336,8 +336,28 @@
30+ {
31+ [ -n "${HIBERNATE_MODE}" ] && \
32+ grep -qw "${HIBERNATE_MODE}" /sys/power/disk && \
33++ HIBERNATE_MODE_SAVE=$(cat /sys/power/disk) && \
34++ HIBERNATE_MODE_SAVE="${HIBERNATE_MODE_SAVE##*[}" && \
35++ HIBERNATE_MODE_SAVE="${HIBERNATE_MODE_SAVE%%]*}" && \
36+ echo -n "${HIBERNATE_MODE}" > /sys/power/disk
37+ echo -n "disk" > /sys/power/state
38++ RET=$?
39++ echo -n "$HIBERNATE_MODE_SAVE" > /sys/power/disk
40++ return "$RET"
41++ }
42++fi
43++
44++# for kernels that support suspend to both (i.e. hybrid suspend)
45++# since kernel 3.6
46++if [ -z "$SUSPEND_HYBRID_MODULE" ] && \
47++ [ -f /sys/power/disk ] && \
48++ grep -q disk /sys/power/state && \
49++ grep -q suspend /sys/power/disk; then
50++ SUSPEND_HYBRID_MODULE="kernel"
51++ do_suspend_hybrid()
52++ {
53++ HIBERNATE_MODE="suspend"
54++ do_hibernate
55+ }
56+ fi
57+
58
59=== modified file 'debian/patches/series'
60--- debian/patches/series 2013-10-09 07:49:49 +0000
61+++ debian/patches/series 2013-11-04 07:30:28 +0000
62@@ -14,4 +14,5 @@
63 25-pmu.patch
64 26-inhibit-on-right-status.patch
65 27-run-hook-logging.patch
66+28-suspend-hybrid.patch
67 80-service.patch
68
69=== modified file 'pm/pm-functions.in'
70--- pm/pm-functions.in 2013-10-09 07:49:49 +0000
71+++ pm/pm-functions.in 2013-11-04 07:30:28 +0000
72@@ -336,8 +336,28 @@
73 {
74 [ -n "${HIBERNATE_MODE}" ] && \
75 grep -qw "${HIBERNATE_MODE}" /sys/power/disk && \
76+ HIBERNATE_MODE_SAVE=$(cat /sys/power/disk) && \
77+ HIBERNATE_MODE_SAVE="${HIBERNATE_MODE_SAVE##*[}" && \
78+ HIBERNATE_MODE_SAVE="${HIBERNATE_MODE_SAVE%%]*}" && \
79 echo -n "${HIBERNATE_MODE}" > /sys/power/disk
80 echo -n "disk" > /sys/power/state
81+ RET=$?
82+ echo -n "$HIBERNATE_MODE_SAVE" > /sys/power/disk
83+ return "$RET"
84+ }
85+fi
86+
87+# for kernels that support suspend to both (i.e. hybrid suspend)
88+# since kernel 3.6
89+if [ -z "$SUSPEND_HYBRID_MODULE" ] && \
90+ [ -f /sys/power/disk ] && \
91+ grep -q disk /sys/power/state && \
92+ grep -q suspend /sys/power/disk; then
93+ SUSPEND_HYBRID_MODULE="kernel"
94+ do_suspend_hybrid()
95+ {
96+ HIBERNATE_MODE="suspend"
97+ do_hibernate
98 }
99 fi
100

Subscribers

People subscribed via source and target branches

to all changes: