From 46ce85bf7f44679820118a1f95dd03192138771b Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Wed, 17 Jan 2024 19:52:40 +0800 Subject: [PATCH] hibernate-util: log that we actually read /sys/power/resume* rather than cmdline /sys/power/resume is always populated by the initrd, while /sys/power/resume_offset might have been populated by the kernel itself. Therefore, if the user is using an initrd that doesn't include resume hook, the hibernation would fail, which is expected. However, it was hard to track down the real problem, since the previous log message suggested that resume= is not set through kernel cmdline. --- src/shared/hibernate-util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shared/hibernate-util.c b/src/shared/hibernate-util.c index 795b3a2d56..3547476c85 100644 --- a/src/shared/hibernate-util.c +++ b/src/shared/hibernate-util.c @@ -152,7 +152,8 @@ static int read_resume_config(dev_t *ret_devno, uint64_t *ret_offset) { if (devno == 0 && offset > 0 && offset != UINT64_MAX) return log_debug_errno(SYNTHETIC_ERRNO(EINVAL), - "Found resume_offset=%" PRIu64 " but resume= is unset, refusing.", offset); + "Found populated /sys/power/resume_offset (%" PRIu64 ") but /sys/power/resume is not set, refusing.", + offset); *ret_devno = devno; *ret_offset = offset; -- 2.25.1