loader.efi: add poweroff command
Add poweroff command to make life a bit easier. Reviewed by: imp, allanjude Approved by: re (kib) Differential Revision: https://reviews.freebsd.org/D17535
This commit is contained in:
parent
555225c062
commit
0f31e1e6a8
@ -993,6 +993,23 @@ main(int argc, CHAR16 *argv[])
|
|||||||
return (EFI_SUCCESS); /* keep compiler happy */
|
return (EFI_SUCCESS); /* keep compiler happy */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
COMMAND_SET(poweroff, "poweroff", "power off the system", command_poweroff);
|
||||||
|
|
||||||
|
static int
|
||||||
|
command_poweroff(int argc __unused, char *argv[] __unused)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; devsw[i] != NULL; ++i)
|
||||||
|
if (devsw[i]->dv_cleanup != NULL)
|
||||||
|
(devsw[i]->dv_cleanup)();
|
||||||
|
|
||||||
|
RS->ResetSystem(EfiResetShutdown, EFI_SUCCESS, 0, NULL);
|
||||||
|
|
||||||
|
/* NOTREACHED */
|
||||||
|
return (CMD_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot);
|
COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot);
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
Loading…
Reference in New Issue
Block a user