mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
factory-reset-tool: error out if we can't cancel pending reset
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.
This commit is contained in:
@@ -209,12 +209,9 @@ static int verb_cancel(int argc, char *argv[], void *userdata) {
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user