]> git.ipfire.org Git - thirdparty/systemd.git/commit - units/meson.build
units: introduce systemd-hibernate-clear.service that clears
authorMike Yuan <me@yhndnzj.com>
Sun, 31 Mar 2024 12:52:39 +0000 (20:52 +0800)
committerMike Yuan <me@yhndnzj.com>
Wed, 3 Apr 2024 14:07:43 +0000 (22:07 +0800)
commitdfad86b83807fa8696ca94982a5ba591b6d86a80
tree1946fe262e29d7c26012ebb48aca1587ef12f532
parent8f8e481f03c49cd2464ed0f54d5ba4da69b8796c
units: introduce systemd-hibernate-clear.service that clears
stale HibernateLocation EFI variable

Currently, if the HibernateLocation EFI variable exists,
but we failed to resume from it, the boot carries on
without clearing the stale variable. Therefore, the subsequent
boots would still be waiting for the device timeout,
unless the variable is purged manually.

There's no point to keep trying to resume after a successful
switch-root, because the hibernation image state
would have been invalidated by then. OTOH, we don't
want to clear the variable prematurely either,
i.e. in initrd, since if the resume device is the same
as root one, the boot won't succeed and the user might
be able to try resuming again. So, let's introduce a
unit that only runs after switch-root and clears the var.

Fixes #32021
man/rules/meson.build
man/systemd-hibernate-resume.service.xml
units/meson.build
units/systemd-hibernate-clear.service.in [new file with mode: 0644]