git: a8b253fced5e - stable/13 - stand: Move quit command to common commands
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 24 Jan 2023 22:11:42 UTC
The branch stable/13 has been updated by imp:
URL: https://cgit.FreeBSD.org/src/commit/?id=a8b253fced5ef5a7af67c89ee715028b2853e560
commit a8b253fced5ef5a7af67c89ee715028b2853e560
Author: Warner Losh <imp@FreeBSD.org>
AuthorDate: 2022-07-30 10:43:21 +0000
Commit: Warner Losh <imp@FreeBSD.org>
CommitDate: 2023-01-24 21:49:29 +0000
stand: Move quit command to common commands
Since both EFI and the future kboot will benefit from a 'quit' command,
move it from efi/loader/main.c to common/commands.c. In EFI this command
exits back to the boot loader (which will cause the next BootXXXX in the
BootOrder list to be attempted). In kboot, this will exit back to
whatever called loader.kboot. In uboot this will cause a reset (which
will restart uboot, not quite a simple exit, but will look similar)
and in OFW it will execute OF_exit which should return to the
openfirmware prompt.
Sponsored by: Netflix
[[ tweaked because mips is still in stable/13 leading to conflict ]]
(cherry picked from commit 2101541ff1222788901d9503001add9f288a4c40)
---
stand/common/commands.c | 9 +++++++++
stand/efi/loader/main.c | 9 ---------
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/stand/common/commands.c b/stand/common/commands.c
index e56d37c497b1..d109a2a8dbcf 100644
--- a/stand/common/commands.c
+++ b/stand/common/commands.c
@@ -578,3 +578,12 @@ command_readtest(int argc, char *argv[])
COMMAND_SET(readtest, "readtest", "Time a file read", command_readtest);
#endif
+
+static int
+command_quit(int argc, char *argv[])
+{
+ exit(0);
+ return (CMD_OK);
+}
+
+COMMAND_SET(quit, "quit", "exit the loader", command_quit);
diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c
index e5f7b7820b4f..0a5a03765ddc 100644
--- a/stand/efi/loader/main.c
+++ b/stand/efi/loader/main.c
@@ -1280,15 +1280,6 @@ command_reboot(int argc, char *argv[])
return (CMD_ERROR);
}
-COMMAND_SET(quit, "quit", "exit the loader", command_quit);
-
-static int
-command_quit(int argc, char *argv[])
-{
- exit(0);
- return (CMD_OK);
-}
-
COMMAND_SET(memmap, "memmap", "print memory map", command_memmap);
static int