1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
|
--- a/Makefile.in
+++ b/Makefile.in
@@ -181,9 +181,11 @@
SRCS:= $(dist)
MAN_PAGES:=$(KEXEC_MANPAGE) $(VMCORE_DMESG_MANPAGE)
+MAN_PAGES+=$(MANDIR)/man8/coldreboot.8
BINARIES_i386:=$(KEXEC_TEST)
BINARIES_x86_64:=$(KEXEC_TEST)
BINARIES:=$(KEXEC) $(VMCORE_DMESG) $(BINARIES_$(ARCH))
+SCRIPTS:=$(SBINDIR)/coldreboot
UNINSTALL_KDUMP = $(sbindir)/kdump
UNINSTALL_KDUMP_MANPAGE = $(mandir)/man8/kdump.8
@@ -193,7 +195,7 @@
UNINSTALL_VMCORE_DMESG = $(sbindir)/vmcore-dmesg
UNINSTALL_VMCORE_DMESG_MANPAGE = $(mandir)/man8/vmcore-dmesg.8
-TARGETS:=$(BINARIES) $(MAN_PAGES)
+TARGETS:=$(BINARIES) $(MAN_PAGES) $(SCRIPTS)
targets: $(TARGETS)
UNINSTALL_TARGETS_i386:=$(UNINSTALL_KEXEC_TEST)
--- a/kexec/Makefile
+++ b/kexec/Makefile
@@ -108,6 +108,8 @@
KEXEC = $(SBINDIR)/kexec
KEXEC_MANPAGE = $(MANDIR)/man8/kexec.8
+KEXEC_COLDREBOOT=$(SBINDIR)/coldreboot
+KEXEC_COLDREBOOT_MANPAGE=$(MANDIR)/man8/coldreboot.8
-include $(KEXEC_DEPS)
@@ -122,6 +124,16 @@
$(KEXEC_MANPAGE): kexec/kexec.8
@$(MKDIR) -p $(MANDIR)/man8
cp $^ $(KEXEC_MANPAGE)
+
+$(KEXEC_COLDREBOOT): kexec/coldreboot
+ @$(MKDIR) -p $(@D)
+ cp kexec/coldreboot $(KEXEC_COLDREBOOT)
+ /bin/chmod 755 $(KEXEC_COLDREBOOT)
+
+$(KEXEC_COLDREBOOT_MANPAGE): kexec/coldreboot.8
+ @$(MKDIR) -p $(MANDIR)/man8
+ cp kexec/coldreboot.8 $(KEXEC_COLDREBOOT_MANPAGE)
+
echo::
@echo "KEXEC_SRCS $(KEXEC_SRCS)"
@echo "KEXEC_DEPS $(KEXEC_DEPS)"
--- /dev/null
+++ b/kexec/coldreboot
@@ -0,0 +1,6 @@
+#!/bin/sh
+NOKEXECFILE=/no-kexec-reboot
+
+/bin/rm -f $NOKEXECFILE
+touch $NOKEXECFILE
+/sbin/reboot $*
--- /dev/null
+++ b/kexec/coldreboot.8
@@ -0,0 +1,25 @@
+.\" Process this file with
+.\" groff -man -Tascii coldreboot.8
+.\"
+.TH kexec 8 "April 2006" Linux "User Manuals"
+.SH NAME
+coldreboot \- Force a cold reboot bypassing kexec-tools default
+.SH SYNOPSIS
+.B /sbin/coldreboot
+.B [reboot options]
+
+.SH DESCRIPTION
+.B coldreboot
+is a script that forces a cold reboot regardless of whether kexec is enabled
+or not in /etc/default/kexec.
+.B coldreboot
+takes the same arguments as /sbin/reboot and passes them on to /sbin/reboot
+later.
+
+.SH NOTES
+.PP
+.B coldreboot
+prevents a kexec kernel from being loaded automatically and thus
+forces a cold reboot. If the user loads a kexec kernel by hand,
+.B coldreboot
+will still result in a kexec reboot.
|