mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-06 13:17:44 +03:00
sleep: clear EFI HibernateLocation if writing kernel config fails
Follow-up forf1f331a252
(cherry picked from commit031a399d87
) (cherry picked from commitf2fad15239
)
This commit is contained in:
parent
ef7eedb8c0
commit
1a77552257
@ -23,6 +23,7 @@
|
||||
#include "bus-locator.h"
|
||||
#include "bus-util.h"
|
||||
#include "constants.h"
|
||||
#include "efivars.h"
|
||||
#include "exec-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
@ -224,8 +225,12 @@ static int execute(
|
||||
* do it ourselves then. > 0 means: kernel already had a configured hibernation
|
||||
* location which we shouldn't touch. */
|
||||
r = write_hibernate_location_info(hibernate_location);
|
||||
if (r < 0)
|
||||
if (r < 0) {
|
||||
if (is_efi_boot())
|
||||
(void) efi_set_variable(EFI_SYSTEMD_VARIABLE(HibernateLocation), NULL, 0);
|
||||
|
||||
return log_error_errno(r, "Failed to prepare for hibernation: %m");
|
||||
}
|
||||
}
|
||||
|
||||
r = write_mode(modes);
|
||||
|
Loading…
Reference in New Issue
Block a user