Follow-up for
a628d933cc67cc8b183dc809ba1451aa5b2996e5
HibernateInfo.from_efi is not actually useful. info.efi is only
set if the system identifier stored in EFI variable matches with
that of the running system, and thus the variable should be cleared
no matter whether resume= is set from kernel cmdline or not.
int r;
assert(info);
- assert(info->from_efi || info->cmdline);
- if (info->from_efi)
- return;
- if (!info->efi)
+ if (!info->cmdline || !info->efi)
return;
+ assert(info->device == info->cmdline->device);
+
if (!path_equal(info->cmdline->device, info->efi->device)) {
r = devnode_same(info->cmdline->device, info->efi->device);
if (r < 0)
if (i.cmdline) {
i.device = i.cmdline->device;
i.offset = i.cmdline->offset;
- i.from_efi = false;
} else if (i.efi) {
i.device = i.efi->device;
i.offset = i.efi->offset;
- i.from_efi = true;
} else
return -ENODEV;
typedef struct HibernateInfo {
const char *device;
uint64_t offset; /* in memory pages */
- bool from_efi;
KernelHibernateLocation *cmdline;
EFIHibernateLocation *efi;
if (r <= 0)
return r;
- if (arg_info.from_efi)
+ if (arg_info.efi)
clear_efi_hibernate_location();
}