<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - systemd 208-1 handle lid switch hibernate"
href="https://bugs.freedesktop.org/show_bug.cgi?id=70267#c4">Comment # 4</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW --- - systemd 208-1 handle lid switch hibernate"
href="https://bugs.freedesktop.org/show_bug.cgi?id=70267">bug 70267</a>
from <span class="vcard"><a class="email" href="mailto:kovyale@gmail.com" title="Alexey <kovyale@gmail.com>"> <span class="fn">Alexey</span></a>
</span></b>
<pre>Hi All,
I managed to fix the bug (or maybe feature on purpose which i do not
understand).
The root cause when systemd-logind checks the swap for type and see not
'partition' (file src/shared/sleep-config.c) the upper level function can_sleep
(for hibernate) returns false which makes such log lines:
"Requested operation not supported, ignoring."
My laptop setup made that i have whole sda2 under LUKS and under LUKS is only
one partition (i called it /dev/mapper/root). On the given filesystem (ext4) i
created /swapfile with size 8.1G. The swap works just fine. And hibernate on
this swapfile works briliant out of the vanilla kernel (no uswsusp, no
tuxonice).
I added to my kernel cmd line: resume=/dev/mapper/root resume_offset=34816 (See
Documentation/power/swsusp-and-swap-files.txt for more)
Looking into systemd-logind code i found it checks for the swap type (from
/proc/swaps) which in my case says:
$ cat /proc/swaps
Filename Type Size Used
Priority
/swapfile file 8388604 0 -1
A very small patch fixes this:
patch - 0002-fix-operation-not-supported-to-hibernate-to-swap-file.patch
--- ./src/shared/sleep-config.c.orig 2013-09-18 01:55:37.241977274 +0400
+++ ./src/shared/sleep-config.c 2013-11-21 02:27:57.608209252 +0400
@@ -206,7 +206,7 @@
if (!d)
return -ENOMEM;
- if (!streq(type, "partition")) {
+ if (!streq(type, "partition") && !streq(type, "file")) {
log_debug("Partition %s has type %s, ignoring.", d,
type);
continue;
}
I have also submitted Arch linux user package "systemd-ak" with my fix to AUR
which is available here - <a href="https://aur.archlinux.org/packages/systemd-ak/">https://aur.archlinux.org/packages/systemd-ak/</a>
Please try it. Please let me know any issues.
--
Alexey</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>