aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-08-14 15:20:13 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-08-14 15:20:13 -0700
commit5bcb0644ba86675c5912714d8b91689c0859b4ca (patch)
treeb6c7d33378e184547a7fab2285a875d823c48380
parent9298132fc4d36498b5ee4ffb574e3b2cdc9d1358 (diff)
downloadsyslinux-elf-5bcb0644ba86675c5912714d8b91689c0859b4ca.tar.gz
syslinux-elf-5bcb0644ba86675c5912714d8b91689c0859b4ca.tar.xz
syslinux-elf-5bcb0644ba86675c5912714d8b91689c0859b4ca.zip
Add reboot.c32 modulesyslinux-3.52-pre6
A very simple module to reboot the machine.
-rw-r--r--com32/modules/Makefile3
-rw-r--r--com32/modules/reboot.c16
2 files changed, 18 insertions, 1 deletions
diff --git a/com32/modules/Makefile b/com32/modules/Makefile
index b83a65cb..933987e2 100644
--- a/com32/modules/Makefile
+++ b/com32/modules/Makefile
@@ -47,7 +47,8 @@ INCDIR = /usr/include
COM32DIR = $(AUXDIR)/com32
MODULES = chain.c32 menu.c32 vesamenu.c32 ethersel.c32 mboot.c32 \
- dmitest.c32 cpuidtest.c32 pcitest.c32 elf.c32 linux.c32
+ dmitest.c32 cpuidtest.c32 pcitest.c32 elf.c32 linux.c32 \
+ reboot.c32
TESTFILES =
all: $(MODULES) $(TESTFILES)
diff --git a/com32/modules/reboot.c b/com32/modules/reboot.c
new file mode 100644
index 00000000..f5056759
--- /dev/null
+++ b/com32/modules/reboot.c
@@ -0,0 +1,16 @@
+#include <syslinux/reboot.h>
+#include <string.h>
+
+int main(int argc, char *argv[])
+{
+ int warm = 0;
+ int i;
+
+ for (i = 1; i < argc; i++) {
+ if (!strcmp(argv[i], "-w") ||
+ !strcmp(argv[i], "--warm"))
+ warm = 1;
+ }
+
+ syslinux_reboot(warm);
+}