summaryrefslogtreecommitdiffstats
path: root/src/hci/commands
diff options
context:
space:
mode:
authorMichael Brown2013-03-22 14:54:44 +0100
committerMichael Brown2013-03-22 14:54:44 +0100
commite68a6ca225115a8796e6d63ffc32856043e25886 (patch)
tree3bb58a45adbf41533d910482618b2ea306e4cb2c /src/hci/commands
parent[efi] Add "reboot" command for EFI (diff)
downloadipxe-e68a6ca225115a8796e6d63ffc32856043e25886.tar.gz
ipxe-e68a6ca225115a8796e6d63ffc32856043e25886.tar.xz
ipxe-e68a6ca225115a8796e6d63ffc32856043e25886.zip
[cmdline] Add ability to perform a warm reboot
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/hci/commands')
-rw-r--r--src/hci/commands/reboot_cmd.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/hci/commands/reboot_cmd.c b/src/hci/commands/reboot_cmd.c
index 19d3d6df..44dcfc71 100644
--- a/src/hci/commands/reboot_cmd.c
+++ b/src/hci/commands/reboot_cmd.c
@@ -17,6 +17,7 @@
* 02110-1301, USA.
*/
+#include <getopt.h>
#include <ipxe/command.h>
#include <ipxe/parseopt.h>
#include <ipxe/reboot.h>
@@ -30,14 +31,20 @@ FILE_LICENCE ( GPL2_OR_LATER );
*/
/** "reboot" options */
-struct reboot_options {};
+struct reboot_options {
+ /** Perform a warm reboot */
+ int warm;
+};
/** "reboot" option list */
-static struct option_descriptor reboot_opts[] = {};
+static struct option_descriptor reboot_opts[] = {
+ OPTION_DESC ( "warm", 'w', no_argument,
+ struct reboot_options, warm, parse_flag ),
+};
/** "reboot" command descriptor */
static struct command_descriptor reboot_cmd =
- COMMAND_DESC ( struct reboot_options, reboot_opts, 0, 0, "" );
+ COMMAND_DESC ( struct reboot_options, reboot_opts, 0, 0, "[--warm]" );
/**
* The "reboot" command
@@ -55,7 +62,7 @@ static int reboot_exec ( int argc, char **argv ) {
return rc;
/* Reboot system */
- reboot();
+ reboot ( opts.warm );
return 0;
}