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.
This commit is contained in:
Mike Yuan
2024-01-17 16:10:14 +00:00
committed by Luca Boccassi
parent d9975dbb3c
commit 46ce85bf7f
+2 -1
View File
@@ -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;