summaryrefslogtreecommitdiffstats
path: root/units/meson.build
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2023-09-05 15:50:04 +0200
committerMike Yuan <me@yhndnzj.com>2023-09-07 14:21:16 +0200
commita628d933cc67cc8b183dc809ba1451aa5b2996e5 (patch)
tree4440309c1b40d99372a6dffcded8f680e4f541f7 /units/meson.build
parentMerge pull request #28957 from yuwata/core-mount-set-dirty-on-umount (diff)
downloadsystemd-a628d933cc67cc8b183dc809ba1451aa5b2996e5.tar.xz
systemd-a628d933cc67cc8b183dc809ba1451aa5b2996e5.zip
hibernate-resume: split out the logic of finding hibernate location
Before this commit, the hibernate location logic only exists in the generator. Also, we compare device nodes (devnode_same()) and clear EFI variable HibernateLocation in the generator too. This is not ideal though: when the generator gets to run, udev hasn't yet started, so effectively devnode_same() always fails. Moreover, if the boot process is interrupted by e.g. battery-check, the hibernate information is lost. Therefore, let's split out the logic of finding hibernate location. The generator only does the initial validation of system info and enables systemd-hibernate-resume.service, and when the service actually runs we validate everything again, which includes comparing the device nodes and clearing the EFI variable. This should make things more robust, plus systems that don't utilize a systemd-enabled initrd can use the exact same logic to resume using the EFI variable. I.e., systemd-hibernate-resume can be used standalone.
Diffstat (limited to 'units/meson.build')
-rw-r--r--units/meson.build4
1 files changed, 4 insertions, 0 deletions
diff --git a/units/meson.build b/units/meson.build
index 2e649d6e5f..2fb87934b8 100644
--- a/units/meson.build
+++ b/units/meson.build
@@ -292,6 +292,10 @@ units = [
{ 'file' : 'systemd-growfs@.service.in' },
{ 'file' : 'systemd-halt.service' },
{
+ 'file' : 'systemd-hibernate-resume.service.in',
+ 'conditions' : ['ENABLE_HIBERNATE'],
+ },
+ {
'file' : 'systemd-hibernate.service.in',
'conditions' : ['ENABLE_HIBERNATE'],
},