1
1
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 for f1f331a252
This commit is contained in:
Mike Yuan 2023-08-13 22:59:30 +08:00 committed by Luca Boccassi
parent 57ffa99daa
commit 031a399d87

View File

@ -270,8 +270,12 @@ static int execute(
return r;
r = write_kernel_hibernate_location(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);