First of all, it seems very unlikely that we'd be in the pending state
if not booted via EFI in the first place. Moreover, the operation didn't
work out, hence let's not spurious report success.
return 0;
}
- if (!is_efi_boot()) {
- if (!arg_quiet)
- log_info("Not an EFI boot, cannot remove FactoryResetMode EFI variable, not cancelling.");
-
- return 0;
- }
+ if (!is_efi_boot())
+ return log_error_errno(SYNTHETIC_ERRNO(ENOTRECOVERABLE),
+ "Not an EFI boot, cannot remove FactoryResetMode EFI variable, not cancelling.");
r = efi_set_variable(EFI_SYSTEMD_VARIABLE_STR("FactoryResetRequest"), /* value= */ NULL, /* size= */ 0);
if (r < 0)