From: Mike Yuan Date: Wed, 17 Jan 2024 11:52:40 +0000 (+0800) Subject: hibernate-util: log that we actually read /sys/power/resume* rather than cmdline X-Git-Tag: v256-rc1~1123 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=46ce85bf7f44679820118a1f95dd03192138771b;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/shared/hibernate-util.c b/src/shared/hibernate-util.c index 795b3a2d56f..3547476c851 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;