aboutsummaryrefslogtreecommitdiffstats
path: root/com32/hdt/hdt-cli-hdt.c
diff options
context:
space:
mode:
authorPierre-Alexandre Meyer <pierre@mouraf.org>2009-11-01 16:19:47 -0800
committerPierre-Alexandre Meyer <pierre@mouraf.org>2009-11-01 16:19:47 -0800
commitad501c9ca99dad2f52af62399c3ff7da9bfe09b5 (patch)
tree338f5a7b6fe2017264673d6cce81c520ca0dc036 /com32/hdt/hdt-cli-hdt.c
parentd98e625fcbafcfffdcef3932cf6d267a8b698789 (diff)
downloadsyslinux.git-ad501c9ca99dad2f52af62399c3ff7da9bfe09b5.tar.gz
syslinux.git-ad501c9ca99dad2f52af62399c3ff7da9bfe09b5.tar.xz
syslinux.git-ad501c9ca99dad2f52af62399c3ff7da9bfe09b5.zip
hdt: add reboot command in HDT mode (CLI)
Reboot the system via the 'reboot' command in the CLI. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Diffstat (limited to 'com32/hdt/hdt-cli-hdt.c')
-rw-r--r--com32/hdt/hdt-cli-hdt.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/com32/hdt/hdt-cli-hdt.c b/com32/hdt/hdt-cli-hdt.c
index 1a2df78e..396a929c 100644
--- a/com32/hdt/hdt-cli-hdt.c
+++ b/com32/hdt/hdt-cli-hdt.c
@@ -251,6 +251,19 @@ void main_show_hdt(int argc __unused, char **argv __unused,
}
}
+/**
+ * do_reboot - reboot the system
+ **/
+static void do_reboot(int argc __unused, char** argv __unused,
+ struct s_hardware *hardware)
+{
+ /* Use specific syslinux call if needed */
+ if (issyslinux())
+ return runsyslinuxcmd(hardware->reboot_label);
+ else
+ return csprint(hardware->reboot_label, 0x07);
+}
+
/* Default hdt mode */
struct cli_callback_descr list_hdt_default_modules[] = {
{
@@ -270,6 +283,10 @@ struct cli_callback_descr list_hdt_default_modules[] = {
.exec = goto_menu,
},
{
+ .name = CLI_REBOOT,
+ .exec = do_reboot,
+ },
+ {
.name = NULL,
.exec = NULL
},