]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
hibernate-util: log that we actually read /sys/power/resume* rather than cmdline
authorMike Yuan <me@yhndnzj.com>
Wed, 17 Jan 2024 11:52:40 +0000 (19:52 +0800)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 17 Jan 2024 16:10:14 +0000 (16:10 +0000)
/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

index 795b3a2d56f915b4bdadb61d9ed320dca5b3ae07..3547476c85141522c0fc130d0ed55f7306caa0dc 100644 (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;