1
#!/bin/sh /usr/share/dpatch/dpatch-run
2
## coldreboot.dpatch by <khalid@debian.org>
4
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: This patch adds a cold reboot script which can be used to force a cold
6
## DP: reboot instead of a kexec reboot
9
diff -urNp kexec-tools-build//kexec/coldreboot kexec-tools-new//kexec/coldreboot
10
--- kexec-tools-build//kexec/coldreboot 1969-12-31 17:00:00.000000000 -0700
11
+++ kexec-tools-new//kexec/coldreboot 2010-04-22 11:13:26.000000000 -0600
14
+NOKEXECFILE=/tmp/no-kexec-reboot
16
+/bin/rm -f $NOKEXECFILE
19
diff -urNp kexec-tools-build//kexec/coldreboot.8 kexec-tools-new//kexec/coldreboot.8
20
--- kexec-tools-build//kexec/coldreboot.8 1969-12-31 17:00:00.000000000 -0700
21
+++ kexec-tools-new//kexec/coldreboot.8 2010-04-22 11:39:43.000000000 -0600
23
+.\" Process this file with
24
+.\" groff -man -Tascii coldreboot.8
26
+.TH kexec 8 "April 2006" Linux "User Manuals"
28
+coldreboot \- Force a cold reboot bypassing kexec-tools default
35
+is a script that forces a cold reboot regardless of whether kexec is enabled
36
+or not in /etc/default/kexec
38
+takes the same arguments as /sbin/reboot and passes them on to /sbin/reboot
44
+prevents a kexec kernel from being loaded automatically and thus
45
+forces a cold reboot. If the user loads a kexec kernel by hand,
47
+will still result in a kexec reboot.
48
diff -urNp kexec-tools-build//kexec/Makefile kexec-tools-new//kexec/Makefile
49
--- kexec-tools-build//kexec/Makefile 2008-10-08 16:32:14.000000000 -0600
50
+++ kexec-tools-new//kexec/Makefile 2010-04-22 15:06:33.000000000 -0600
51
@@ -65,6 +65,8 @@ clean += $(KEXEC_OBJS) $(KEXEC_DEPS) $(K
53
KEXEC = $(SBINDIR)/kexec
54
KEXEC_MANPAGE = $(MANDIR)/man8/kexec.8
55
+KEXEC_COLDREBOOT=$(SBINDIR)/coldreboot
56
+KEXEC_COLDREBOOT_MANPAGE=$(MANDIR)/man8/coldreboot.8
58
-include $(KEXEC_DEPS)
60
@@ -77,6 +79,16 @@ $(KEXEC): CPPFLAGS+=-I$(srcdir)/kexec/ar
61
$(KEXEC_MANPAGE): kexec/kexec.8
62
@$(MKDIR) -p $(MANDIR)/man8
63
cp kexec/kexec.8 $(KEXEC_MANPAGE)
65
+$(KEXEC_COLDREBOOT): kexec/coldreboot
67
+ cp kexec/coldreboot $(KEXEC_COLDREBOOT)
68
+ /bin/chmod 755 $(KEXEC_COLDREBOOT)
70
+$(KEXEC_COLDREBOOT_MANPAGE): kexec/coldreboot.8
71
+ @$(MKDIR) -p $(MANDIR)/man8
72
+ cp kexec/coldreboot.8 $(KEXEC_COLDREBOOT_MANPAGE)
75
@echo "KEXEC_SRCS $(KEXEC_SRCS)"
76
@echo "KEXEC_DEPS $(KEXEC_DEPS)"
77
diff -urNp kexec-tools-build//Makefile.in kexec-tools-new//Makefile.in
78
--- kexec-tools-build//Makefile.in 2010-04-22 11:05:48.000000000 -0600
79
+++ kexec-tools-new//Makefile.in 2010-04-22 14:40:06.000000000 -0600
80
@@ -106,11 +106,13 @@ PKGINCLUDEIR=$(INCLUDEDIR)/$(PACKAGE_NAM
82
MAN_PAGES:= $(MANDIR)/man8/kexec.8
83
MAN_PAGES+= $(MANDIR)/man8/kdump.8
84
+MAN_PAGES+= $(MANDIR)/man8/coldreboot.8
85
BINARIES_i386:= $(SBINDIR)/kexec $(PKGLIBDIR)/kexec_test.static
86
BINARIES_x86_64:=$(SBINDIR)/kexec $(PKGLIBDIR)/kexec_test.static
87
BINARIES:=$(SBINDIR)/kexec $(SBINDIR)/kdump $(BINARIES_$(ARCH))
88
+SCRIPTS:=$(SBINDIR)/coldreboot
90
-TARGETS:=$(BINARIES) $(MAN_PAGES)
91
+TARGETS:=$(BINARIES) $(MAN_PAGES) $(SCRIPTS)