log_warning("resume_offset=%" PRIu64 " doesn't match with EFI HibernateLocation offset %" PRIu64 ", proceeding anyway with resume_offset=.",
info->cmdline->offset, info->efi->offset);
}
-
-void clear_efi_hibernate_location(void) {
- int r;
-
- if (!is_efi_boot())
- return;
-
- r = efi_set_variable(EFI_SYSTEMD_VARIABLE(HibernateLocation), NULL, 0);
- if (r < 0)
- log_warning_errno(r, "Failed to clear EFI variable HibernateLocation, ignoring: %m");
-}
#endif
int acquire_hibernate_info(HibernateInfo *ret) {
void compare_hibernate_location_and_warn(const HibernateInfo *info);
-void clear_efi_hibernate_location(void);
-
#else
static inline void compare_hibernate_location_and_warn(const HibernateInfo *info) {
return;
}
-static inline void clear_efi_hibernate_location(void) {
- return;
-}
-
#endif
return r;
if (arg_info.efi)
- clear_efi_hibernate_location();
+ clear_efi_hibernate_location_and_warn();
}
if (stat(arg_info.device, &st) < 0)
return 0;
}
+
+void clear_efi_hibernate_location_and_warn(void) {
+ int r;
+
+ if (!is_efi_boot())
+ return;
+
+ r = efi_set_variable(EFI_SYSTEMD_VARIABLE(HibernateLocation), NULL, 0);
+ if (r < 0)
+ log_warning_errno(r, "Failed to clear EFI variable HibernateLocation, ignoring: %m");
+}
int write_resume_config(dev_t devno, uint64_t offset, const char *device);
+void clear_efi_hibernate_location_and_warn(void);
+
/* Only for test-fiemap */
int read_fiemap(int fd, struct fiemap **ret);
return 0;
fail:
- if (sleep_operation_is_hibernation(operation) && is_efi_boot())
- (void) efi_set_variable(EFI_SYSTEMD_VARIABLE(HibernateLocation), NULL, 0);
+ if (sleep_operation_is_hibernation(operation))
+ clear_efi_hibernate_location_and_warn();
return r;
}