summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Eden <yamakuzure@gmx.net>2018-08-21 08:20:36 +0200
committerSven Eden <yamakuzure@gmx.net>2018-08-24 16:47:08 +0200
commitfe9f813b914df4d0451f8e7b12eca0408db625bf (patch)
tree63a2281034efe71508dd12cdcaa5f70d3731c23a
parentcf380e653e9ff12805ef32041118fe3c1b9fbd55 (diff)
Prep v239: Add support for the new 'suspend-then-hibernate' method.
-rw-r--r--cb/elogind.cbp501
-rw-r--r--src/login/elogind-dbus.c8
-rw-r--r--src/login/elogind.c18
-rw-r--r--src/login/logind-action.c2
-rw-r--r--src/login/logind-dbus.c6
-rw-r--r--src/login/logind-gperf.gperf1
-rw-r--r--src/login/logind.c2
-rw-r--r--src/login/logind.conf.in9
-rw-r--r--src/login/logind.h2
-rw-r--r--src/shared/bus-util.c6
-rw-r--r--src/shared/sleep-config.c12
-rw-r--r--src/shared/sleep-config.h4
-rw-r--r--src/sleep/sleep.c53
-rw-r--r--src/sleep/sleep.h4
14 files changed, 180 insertions, 448 deletions
diff --git a/cb/elogind.cbp b/cb/elogind.cbp
index 2df9826..0245f86 100644
--- a/cb/elogind.cbp
+++ b/cb/elogind.cbp
@@ -68,614 +68,289 @@
</Unit>
<Unit filename="../src/basic/alloc-util.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/alloc-util.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/alloc-util.h" />
<Unit filename="../src/basic/audit-util.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/audit-util.h">
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/build.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/audit-util.h" />
+ <Unit filename="../src/basic/build.h" />
<Unit filename="../src/basic/bus-label.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/bus-label.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/bus-label.h" />
<Unit filename="../src/basic/cap-list.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/cap-list.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/cap-list.h" />
<Unit filename="../src/basic/capability-util.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/capability-util.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/capability-util.h" />
<Unit filename="../src/basic/cgroup-util.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/cgroup-util.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/cgroup-util.h" />
<Unit filename="../src/basic/conf-files.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/conf-files.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/conf-files.h" />
<Unit filename="../src/basic/copy.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/copy.h">
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/def.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/copy.h" />
+ <Unit filename="../src/basic/def.h" />
<Unit filename="../src/basic/dirent-util.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/dirent-util.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/dirent-util.h" />
<Unit filename="../src/basic/env-util.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/env-util.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/env-util.h" />
<Unit filename="../src/basic/errno-list.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/errno-list.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/errno-list.h" />
<Unit filename="../src/basic/escape.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/escape.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/escape.h" />
<Unit filename="../src/basic/exec-util.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/exec-util.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/exec-util.h" />
<Unit filename="../src/basic/extract-word.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/extract-word.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/extract-word.h" />
<Unit filename="../src/basic/fd-util.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/fd-util.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/fd-util.h" />
<Unit filename="../src/basic/fileio-label.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/fileio-label.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/fileio-label.h" />
<Unit filename="../src/basic/fileio.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/fileio.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
- <Unit filename="../src/basic/format-util.h">
- <Option target="all" />
- <Option target="clean" />
+ <Unit filename="../src/basic/fileio.h" />
+ <Unit filename="../src/basic/format-table.c">
+ <Option compilerVar="CC" />
</Unit>
+ <Unit filename="../src/basic/format-table.h" />
+ <Unit filename="../src/basic/format-util.h" />
<Unit filename="../src/basic/fs-util.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/fs-util.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/fs-util.h" />
<Unit filename="../src/basic/gunicode.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/gunicode.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/gunicode.h" />
<Unit filename="../src/basic/hash-funcs.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/hash-funcs.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/hash-funcs.h" />
<Unit filename="../src/basic/hashmap.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/hashmap.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/hashmap.h" />
<Unit filename="../src/basic/hexdecoct.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/hexdecoct.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/hexdecoct.h" />
<Unit filename="../src/basic/hostname-util.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/hostname-util.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/hostname-util.h" />
<Unit filename="../src/basic/io-util.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/io-util.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/io-util.h" />
<Unit filename="../src/basic/khash.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/khash.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/khash.h" />
<Unit filename="../src/basic/label.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/label.h">
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/list.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/label.h" />
+ <Unit filename="../src/basic/list.h" />
<Unit filename="../src/basic/locale-util.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/locale-util.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/locale-util.h" />
<Unit filename="../src/basic/log.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/log.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/log.h" />
<Unit filename="../src/basic/login-util.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/login-util.h">
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/macro.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/login-util.h" />
+ <Unit filename="../src/basic/macro.h" />
<Unit filename="../src/basic/memfd-util.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/memfd-util.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/memfd-util.h" />
<Unit filename="../src/basic/mempool.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/mempool.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/mempool.h" />
<Unit filename="../src/basic/meson.build">
<Option target="all" />
<Option target="clean" />
</Unit>
- <Unit filename="../src/basic/missing.h">
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/missing_syscall.h">
- <Option target="all" />
- <Option target="clean" />
- </Unit>
+ <Unit filename="../src/basic/missing.h" />
+ <Unit filename="../src/basic/missing_syscall.h" />
<Unit filename="../src/basic/mkdir-label.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
</Unit>
<Unit filename="../src/basic/mkdir.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/mkdir.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/mkdir.h" />
<Unit filename="../src/basic/mount-util.c">
- <Option target="all" />
- <Option target="clean" />
</Unit>
- <Unit filename="../src/basic/mount-util.h">
- <Option target="all" />
- <Option target="clean" />
+ <Unit filename="../src/basic/mount-util.h" />
+ <Unit filename="../src/basic/os-util.c">
+ <Option compilerVar="CC" />
</Unit>
+ <Unit filename="../src/basic/os-util.h" />
<Unit filename="../src/basic/pager.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../src/basic/pager.h" />
<Unit filename="../src/basic/parse-printf-format.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/parse-printf-format.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/parse-printf-format.h" />
<Unit filename="../src/basic/parse-util.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/parse-util.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/parse-util.h" />
<Unit filename="../src/basic/path-util.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/path-util.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/path-util.h" />
<Unit filename="../src/basic/prioq.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/prioq.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/prioq.h" />
<Unit filename="../src/basic/proc-cmdline.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/proc-cmdline.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/proc-cmdline.h" />
<Unit filename="../src/basic/process-util.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/process-util.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/process-util.h" />
<Unit filename="../src/basic/procfs-util.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../src/basic/procfs-util.h" />
<Unit filename="../src/basic/random-util.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/random-util.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/random-util.h" />
<Unit filename="../src/basic/raw-clone.h" />
- <Unit filename="../src/basic/refcnt.h">
- <Option target="all" />
- <Option target="clean" />
- </Unit>
+ <Unit filename="../src/basic/refcnt.h" />
<Unit filename="../src/basic/rm-rf.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/rm-rf.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/rm-rf.h" />
<Unit filename="../src/basic/selinux-util.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
</Unit>
- <Unit filename="../src/basic/selinux-util.h">
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/set.h">
- <Option target="all" />
- <Option target="clean" />
+ <Unit filename="../src/basic/selinux-util.h" />
+ <Unit filename="../src/basic/set.h" />
+ <Unit filename="../src/basic/sigbus.c">
+ <Option compilerVar="CC" />
</Unit>
+ <Unit filename="../src/basic/sigbus.h" />
<Unit filename="../src/basic/signal-util.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/signal-util.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/signal-util.h" />
<Unit filename="../src/basic/siphash24.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/siphash24.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/siphash24.h" />
<Unit filename="../src/basic/smack-util.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/smack-util.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/smack-util.h" />
<Unit filename="../src/basic/socket-util.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/socket-util.h">
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/sparse-endian.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/socket-util.h" />
+ <Unit filename="../src/basic/sparse-endian.h" />
<Unit filename="../src/basic/special.h" />
<Unit filename="../src/basic/stat-util.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/stat-util.h">
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/stdio-util.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/stat-util.h" />
+ <Unit filename="../src/basic/stdio-util.h" />
<Unit filename="../src/basic/string-table.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/string-table.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/string-table.h" />
<Unit filename="../src/basic/string-util.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/string-util.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/string-util.h" />
<Unit filename="../src/basic/strv.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/strv.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/strv.h" />
<Unit filename="../src/basic/syslog-util.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/syslog-util.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/syslog-util.h" />
<Unit filename="../src/basic/terminal-util.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/terminal-util.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/terminal-util.h" />
<Unit filename="../src/basic/time-util.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/time-util.h">
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/umask-util.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
- <Unit filename="../src/basic/unaligned.h">
- <Option target="all" />
- <Option target="clean" />
+ <Unit filename="../src/basic/time-util.h" />
+ <Unit filename="../src/basic/umask-util.h" />
+ <Unit filename="../src/basic/unaligned.h" />
+ <Unit filename="../src/basic/unit-def.c">
+ <Option compilerVar="CC" />
</Unit>
+ <Unit filename="../src/basic/unit-def.h" />
<Unit filename="../src/basic/unit-name.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/unit-name.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/unit-name.h" />
<Unit filename="../src/basic/user-util.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/user-util.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/user-util.h" />
<Unit filename="../src/basic/utf8.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/utf8.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/utf8.h" />
<Unit filename="../src/basic/util.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/util.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/util.h" />
<Unit filename="../src/basic/verbs.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/verbs.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/verbs.h" />
<Unit filename="../src/basic/virt.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/virt.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/virt.h" />
<Unit filename="../src/basic/xattr-util.c">
<Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/basic/xattr-util.h">
- <Option target="all" />
- <Option target="clean" />
</Unit>
+ <Unit filename="../src/basic/xattr-util.h" />
<Unit filename="../src/cgroups-agent/cgroups-agent.c">
<Option compilerVar="CC" />
<Option target="all" />
@@ -1231,12 +906,6 @@
<Option target="all" />
<Option target="clean" />
</Unit>
- <Unit filename="../src/shared/tests.c">
- <Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
- <Unit filename="../src/shared/tests.h">
<Option target="all" />
<Option target="clean" />
</Unit>
diff --git a/src/login/elogind-dbus.c b/src/login/elogind-dbus.c
index 39f5e8c..bed5281 100644
--- a/src/login/elogind-dbus.c
+++ b/src/login/elogind-dbus.c
@@ -107,11 +107,13 @@ static int shutdown_or_sleep(Manager *m, HandleAction action) {
case HANDLE_KEXEC:
return run_helper(KEXEC);
case HANDLE_SUSPEND:
- return do_sleep("suspend", m->suspend_mode, m->suspend_state, 0);
+ return do_sleep(m, "suspend");
case HANDLE_HIBERNATE:
- return do_sleep("hibernate", m->hibernate_mode, m->hibernate_state, 0);
+ return do_sleep(m, "hibernate");
case HANDLE_HYBRID_SLEEP:
- return do_sleep("hybrid-sleep", m->hybrid_sleep_mode, m->hybrid_sleep_state, 0);
+ return do_sleep(m, "hybrid-sleep");
+ case HANDLE_SUSPEND_THEN_HIBERNATE:
+ return do_sleep(m, "suspend-then-hibernate");
default:
return -EINVAL;
}
diff --git a/src/login/elogind.c b/src/login/elogind.c
index 90ae3d7..c884789 100644
--- a/src/login/elogind.c
+++ b/src/login/elogind.c
@@ -379,12 +379,13 @@ int elogind_manager_new(Manager* m) {
m->test_run_flags = 0;
/* Init sleep modes and states */
- m->suspend_mode = NULL;
- m->suspend_state = NULL;
- m->hibernate_mode = NULL;
- m->hibernate_state = NULL;
- m->hybrid_sleep_mode = NULL;
- m->hybrid_sleep_state = NULL;
+ m->suspend_mode = NULL;
+ m->suspend_state = NULL;
+ m->hibernate_mode = NULL;
+ m->hibernate_state = NULL;
+ m->hybrid_sleep_mode = NULL;
+ m->hybrid_sleep_state = NULL;
+ m->hibernate_delay_sec = 0;
/* If elogind should be its own controller, mount its cgroup */
if (streq(SYSTEMD_CGROUP_CONTROLLER, "_elogind")) {
@@ -419,6 +420,8 @@ void elogind_manager_reset_config(Manager* m) {
m->hybrid_sleep_mode = strv_new("suspend", "platform", "shutdown", NULL);
if (!m->hybrid_sleep_state)
m->hybrid_sleep_state = strv_new("disk", NULL);
+ if (!m->hibernate_delay_sec)
+ m->hibernate_delay_sec = 180 * USEC_PER_MINUTE;
#if ENABLE_DEBUG_ELOGIND
dbg_cnt = -1;
@@ -445,6 +448,9 @@ void elogind_manager_reset_config(Manager* m) {
while (m->hybrid_sleep_state[++dbg_cnt])
log_debug_elogind("hybrid_sleep_state[%d] = %s",
dbg_cnt, m->hybrid_sleep_state[dbg_cnt]);
+ log_debug_elogind("hibernate_delay_sec: %ul seconds (%ul minutes)",
+ m->hibernate_delay_sec / USEC_PER_SEC,
+ m->hibernate_delay_sec / USEC_PER_MINUTE);
#endif // ENABLE_DEBUG_ELOGIND
}
diff --git a/src/login/logind-action.c b/src/login/logind-action.c
index 0426acb..497164e 100644
--- a/src/login/logind-action.c
+++ b/src/login/logind-action.c
@@ -118,6 +118,8 @@ int manager_handle_action(
supported = can_sleep(m, "hibernate") > 0;
else if (handle == HANDLE_HYBRID_SLEEP)
supported = can_sleep(m, "hybrid-sleep") > 0;
+ else if (handle == HANDLE_SUSPEND_THEN_HIBERNATE)
+ supported = can_sleep(m, "suspend-then-hibernate") > 0;
#endif // 0
else if (handle == HANDLE_KEXEC)
supported = access(KEXEC, X_OK) >= 0;
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index 31acd57..2f7782a 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -1979,6 +1979,9 @@ static int method_hybrid_sleep(sd_bus_message *message, void *userdata, sd_bus_e
m, message,
#if 0 /// elogind uses HandleAction instead of const char* unti names
SPECIAL_HYBRID_SLEEP_TARGET,
+#else
+ HANDLE_HYBRID_SLEEP,
+#endif // 0
INHIBIT_SLEEP,
"org.freedesktop.login1.hibernate",
"org.freedesktop.login1.hibernate-multiple-sessions",
@@ -1992,9 +1995,10 @@ static int method_suspend_then_hibernate(sd_bus_message *message, void *userdata
return method_do_shutdown_or_sleep(
m, message,
+#if 0 /// elogind uses HandleAction instead of const char* unti names
SPECIAL_SUSPEND_THEN_HIBERNATE_TARGET,
#else
- HANDLE_HYBRID_SLEEP,
+ HANDLE_SUSPEND_THEN_HIBERNATE,
#endif // 0
INHIBIT_SLEEP,
"org.freedesktop.login1.hibernate",
diff --git a/src/login/logind-gperf.gperf b/src/login/logind-gperf.gperf
index 80e9e8c..c8523fb 100644
--- a/src/login/logind-gperf.gperf
+++ b/src/login/logind-gperf.gperf
@@ -24,6 +24,7 @@ Sleep.HibernateMode, config_parse_strv, 0, offsetof(Manag
Sleep.HibernateState, config_parse_strv, 0, offsetof(Manager, hibernate_state)
Sleep.HybridSleepMode, config_parse_strv, 0, offsetof(Manager, hybrid_sleep_mode)
Sleep.HybridSleepState, config_parse_strv, 0, offsetof(Manager, hybrid_sleep_state)
+Sleep.HibernateDelaySec, config_parse_sec, 0, offsetof(Manager, hibernate_delay_sec),
#endif // 1
#if 0 /// UNNEEDED by elogind
# Login.NAutoVTs, config_parse_n_autovts, 0, offsetof(Manager, n_autovts)
diff --git a/src/login/logind.c b/src/login/logind.c
index b605367..4c45779 100644
--- a/src/login/logind.c
+++ b/src/login/logind.c
@@ -1314,8 +1314,6 @@ int main(int argc, char *argv[]) {
if ( r < 0 && (-EEXIST != r) )
return log_error_errno(r, "Failed to create /run/systemd/machines : %m");
#endif // 0
- goto finish;
- }
(void) manager_parse_config_file(m);
diff --git a/src/login/logind.conf.in b/src/login/logind.conf.in
index 1794014..6da3f16 100644
--- a/src/login/logind.conf.in
+++ b/src/login/logind.conf.in
@@ -35,3 +35,12 @@
#RemoveIPC=yes
#InhibitorsMax=8192
#SessionsMax=8192
+
+[Sleep]
+#SuspendState=mem standby freeze
+#SuspendMode=
+#HibernateState=disk
+#HibernateMode=platform shutdown
+#HybridSleepState=disk
+#HybridSleepMode=suspend platform shutdown
+#HibernateDelaySec=10800
diff --git a/src/login/logind.h b/src/login/logind.h
index 48fc619..3f17d5d 100644
--- a/src/login/logind.h
+++ b/src/login/logind.h
@@ -116,7 +116,7 @@ struct Manager {
char **suspend_state, **suspend_mode;
char **hibernate_state, **hibernate_mode;
char **hybrid_sleep_state, **hybrid_sleep_mode;
-
+ usec_t hibernate_delay_sec;
#endif // 0
sd_event_source *inhibit_timeout_source;
diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c
index b33a727..c3be787 100644
--- a/src/shared/bus-util.c
+++ b/src/shared/bus-util.c
@@ -1302,16 +1302,18 @@ int bus_connect_transport(BusTransport transport, const char *host, bool user, s
#if 0 /// elogind does not support a user bus
if (user)
r = sd_bus_default_user(&bus);
-#endif // 0
else {
if (sd_booted() <= 0) {
/* Print a friendly message when the local system is actually not running systemd as PID 1. */
- log_error("System has not been booted with elogind as init system (PID 1). Can't operate.");
+ log_error("System has not been booted with systemd as init system (PID 1). Can't operate.");
return -EHOSTDOWN;
}
+#endif // 0
r = sd_bus_default_system(&bus);
+#if 0 /// No closing bracket with elogind... Ain't we simple? ;-)
}
+#endif // 0
break;
case BUS_TRANSPORT_REMOTE:
diff --git a/src/shared/sleep-config.c b/src/shared/sleep-config.c
index 3cb9173..1d7d46a 100644
--- a/src/shared/sleep-config.c
+++ b/src/shared/sleep-config.c
@@ -378,11 +378,19 @@ static bool can_s2h(Manager *m) {
#if 0 /// elogind has to ask the manager for some stuff
int can_sleep(const char *verb) {
+ _cleanup_strv_free_ char **modes = NULL, **states = NULL;
+ int r;
#else
int can_sleep(Manager *m, const char *verb) {
+ assert(m);
+
+ char **modes = streq(verb, "suspend") ? m->suspend_mode :
+ streq(verb, "hibernate") ? m->hibernate_mode :
+ m->hybrid_sleep_mode;
+ char **states = streq(verb, "suspend") ? m->suspend_state :
+ streq(verb, "hibernate") ? m->hibernate_state :
+ m->hybrid_sleep_state;
#endif // 0
- _cleanup_strv_free_ char **modes = NULL, **states = NULL;
- int r;
assert(STR_IN_SET(verb, "suspend", "hibernate", "hybrid-sleep", "suspend-then-hibernate"));
diff --git a/src/shared/sleep-config.h b/src/shared/sleep-config.h
index 026849c..b291651 100644
--- a/src/shared/sleep-config.h
+++ b/src/shared/sleep-config.h
@@ -10,11 +10,11 @@ int parse_sleep_config(const char *verb, char ***modes, char ***states, usec_t *
#endif // 0
int find_hibernate_location(char **device, char **type, size_t *size, size_t *used);
-#if 0 /// UNNEEDED by elogind
+#if 0 /// elogind has to transport its manager instance
int can_sleep(const char *verb);
int can_sleep_disk(char **types);
int can_sleep_state(char **types);
#else
#include <logind.h>
-int can_sleep(Manager* m, const char *verb);
+int can_sleep(Manager *m, const char *verb);
#endif // 0
diff --git a/src/sleep/sleep.c b/src/sleep/sleep.c
index cf5f49b..fba7b9b 100644
--- a/src/sleep/sleep.c
+++ b/src/sleep/sleep.c
@@ -6,7 +6,7 @@
//#include <errno.h>
//#include <getopt.h>
-//#include <linux/fiemap.h>
+#include <linux/fiemap.h>
//#include <stdio.h>
#include "sd-messages.h"
@@ -133,7 +133,22 @@ static int write_state(FILE **f, char **states) {
return r;
}
+#if 0 /// elogind uses the values stored in its manager instance
static int execute(char **modes, char **states) {
+#else
+static int execute(Manager *m, const char *verb) {
+ assert(m);
+
+ if (verb)
+ arg_verb = (char*)verb;
+
+ char **modes = streq(arg_verb, "suspend") ? m->suspend_mode :
+ streq(arg_verb, "hibernate") ? m->hibernate_mode :
+ m->hybrid_sleep_mode;
+ char **states = streq(arg_verb, "suspend") ? m->suspend_state :
+ streq(arg_verb, "hibernate") ? m->hibernate_state :
+ m->hybrid_sleep_state;
+#endif // 0
char *arguments[] = {
NULL,
@@ -211,10 +226,17 @@ static int write_wakealarm(const char *str) {
return 0;
}
+#if 0 /// elogind uses the values stored in its manager instance
static int execute_s2h(usec_t hibernate_delay_sec) {
_cleanup_strv_free_ char **hibernate_modes = NULL, **hibernate_states = NULL,
**suspend_modes = NULL, **suspend_states = NULL;
+#else
+static int execute_s2h(Manager *m) {
+ assert(m);
+
+ usec_t hibernate_delay_sec = m->hibernate_delay_sec;
+#endif // 0
usec_t orig_time, cmp_time;
char time_str[DECIMAL_STR_MAX(uint64_t)];
int r;
@@ -244,7 +266,11 @@ static int execute_s2h(usec_t hibernate_delay_sec) {
log_debug("Set RTC wake alarm for %s", time_str);
+#if 0 /// elogind uses its manager instance values
r = execute(suspend_modes, suspend_states);
+#else
+ r = execute(m, "suspend");
+#endif // 0
if (r < 0)
return r;
@@ -261,7 +287,11 @@ static int execute_s2h(usec_t hibernate_delay_sec) {
/* if woken up after alarm time, hibernate */
if (cmp_time >= orig_time)
+#if 0 /// elogind uses its manager instance values
r = execute(hibernate_modes, hibernate_states);
+#else
+ r = execute(m, "hibernate");
+#endif // 0
return r;
}
@@ -349,21 +379,22 @@ int main(int argc, char *argv[]) {
if (r < 0)
goto finish;
-#else
-int do_sleep(const char *verb, char **modes, char **states, usec_t delay) {
- int r;
-
- assert(verb);
- arg_verb = (char*)verb;
-#endif // 0
if (streq(arg_verb, "suspend-then-hibernate"))
r = execute_s2h(delay);
else
r = execute(modes, states);
-#if 0 /// In elogind we give the result back, no interpretation here.
-finish:
return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
+}
#else
- return r;
+int do_sleep(Manager *m, const char *verb) {
+ assert(verb);
+ assert(m);
+
+ arg_verb = (char*)verb;
+
+ if (streq(arg_verb, "suspend-then-hibernate"))
+ return execute_s2h(m);
+
+ return execute(m, NULL);
}
#endif // 0
diff --git a/src/sleep/sleep.h b/src/sleep/sleep.h
index 2c35d20..eeffa21 100644
--- a/src/sleep/sleep.h
+++ b/src/sleep/sleep.h
@@ -21,8 +21,8 @@
along with elogind; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "time-util.h"
+#include <logind.h>
-int do_sleep(const char *verb, char **modes, char **states, usec_t delay);
+int do_sleep(Manager *m, const char *verb);
#endif // ELOGIND_SRC_SLEEP_SLEEP_H_INCLUDED