[systemd-bugs] [Bug 70267] systemd 208-1 handle lid switch hibernate

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Nov 20 16:05:56 PST 2013


https://bugs.freedesktop.org/show_bug.cgi?id=70267

--- Comment #4 from Alexey <kovyale at gmail.com> ---
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 - https://aur.archlinux.org/packages/systemd-ak/

Please try it. Please let me know any issues.

--
 Alexey

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-bugs/attachments/20131121/eaf77423/attachment-0001.html>


More information about the systemd-bugs mailing list