summaryrefslogtreecommitdiff
path: root/src/shared/sleep-config.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-07-27 17:36:56 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-07-29 11:12:13 +0200
commitc550cb7f8cbd4727cb484e6ef30fc6b95d7e4d34 (patch)
treedb2e33707a76d6b2eb93a326602eb731dcf6550a /src/shared/sleep-config.c
parentc21ed6812e9894365e080b0ca9e917b79587f6f3 (diff)
downloadsystemd-c550cb7f8cbd4727cb484e6ef30fc6b95d7e4d34.tar.gz
test-sleep: add more logging, show secure boot mode
In https://bugzilla.redhat.com/show_bug.cgi?id=1858219 a user reported that hibernation is not supported. This is probably caused by secure boot, but our current logging does not make this obvious.
Diffstat (limited to 'src/shared/sleep-config.c')
-rw-r--r--src/shared/sleep-config.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/shared/sleep-config.c b/src/shared/sleep-config.c
index 6b9074ce2b..0dccc8f970 100644
--- a/src/shared/sleep-config.c
+++ b/src/shared/sleep-config.c
@@ -125,10 +125,16 @@ int can_sleep_state(char **types) {
k = strlen(*type);
FOREACH_WORD_SEPARATOR(word, l, p, WHITESPACE, state)
- if (l == k && memcmp(word, *type, l) == 0)
+ if (l == k && memcmp(word, *type, l) == 0) {
+ log_debug("Sleep mode \"%s\" is supported by the kernel.", *type);
return true;
+ }
}
+ if (DEBUG_LOGGING) {
+ _cleanup_free_ char *t = strv_join(types, "/");
+ log_debug("Sleep mode %s not supported by the kernel, sorry.", strnull(t));
+ }
return false;
}