diff options
author | Mike Frysinger <vapier@gentoo.org> | 2010-06-06 06:59:47 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2010-06-06 06:59:47 +0000 |
commit | d3cb191213390b841094f9424515a5b679dc110f (patch) | |
tree | 8b52ec12d347be359cb966ff46c7b6b147857efd /sys-apps/sysvinit/files | |
parent | Version bump for prawn 0.8.4. (diff) | |
download | gentoo-2-d3cb191213390b841094f9424515a5b679dc110f.tar.gz gentoo-2-d3cb191213390b841094f9424515a5b679dc110f.tar.bz2 gentoo-2-d3cb191213390b841094f9424515a5b679dc110f.zip |
Version bump #319197 by Daniel Pielmeier.
(Portage version: 2.2_rc67/cvs/Linux x86_64)
Diffstat (limited to 'sys-apps/sysvinit/files')
-rw-r--r-- | sys-apps/sysvinit/files/sysvinit-2.86-kexec.patch | 142 | ||||
-rw-r--r-- | sys-apps/sysvinit/files/sysvinit-2.86-shutdown-single.patch | 36 | ||||
-rw-r--r-- | sys-apps/sysvinit/files/sysvinit-2.88-makefile.patch | 60 |
3 files changed, 238 insertions, 0 deletions
diff --git a/sys-apps/sysvinit/files/sysvinit-2.86-kexec.patch b/sys-apps/sysvinit/files/sysvinit-2.86-kexec.patch new file mode 100644 index 000000000000..4948806d9eb9 --- /dev/null +++ b/sys-apps/sysvinit/files/sysvinit-2.86-kexec.patch @@ -0,0 +1,142 @@ +halt: add a -k kexec flag + +--- a/man/halt.8 ++++ b/man/halt.8 +@@ -40,6 +40,7 @@ halt, reboot, poweroff \- stop the system. + .RB [ \-d ] + .RB [ \-f ] + .RB [ \-i ] ++.RB [ \-k ] + .br + .B /sbin/poweroff + .RB [ \-n ] +@@ -83,6 +84,8 @@ Put all hard drives on the system in stand-by mode just before halt or power-off + .IP \fB\-p\fP + When halting the system, switch off the power. This is the default when halt is + called as \fBpoweroff\fP. ++.IP \fB\-k\fP ++Try to reboot using \fBkexec\fP, if kernel supports it. + .\"}}} + .\"{{{ Diagnostics + .SH DIAGNOSTICS +--- a/src/halt.c ++++ b/src/halt.c +@@ -8,7 +8,7 @@ + * execute an "shutdown -r". This is for compatibility with + * sysvinit 2.4. + * +- * Usage: halt [-n] [-w] [-d] [-f] [-h] [-i] [-p] ++ * Usage: halt [-n] [-w] [-d] [-f] [-h] [-i] [-p] [-k] + * -n: don't sync before halting the system + * -w: only write a wtmp reboot record and exit. + * -d: don't write a wtmp record. +@@ -16,6 +16,7 @@ + * -h: put harddisks in standby mode + * -i: shut down all network interfaces. + * -p: power down the system (if possible, otherwise halt). ++ * -k: reboot the system using kexec. + * + * Reboot and halt are both this program. Reboot + * is just a link to halt. Invoking the program +@@ -74,8 +75,10 @@ extern void write_wtmp(char *user, char *id, int pid, int type, char *line); + */ + void usage(void) + { +- fprintf(stderr, "usage: %s [-n] [-w] [-d] [-f] [-h] [-i]%s\n", +- progname, strcmp(progname, "halt") ? "" : " [-p]"); ++ fprintf(stderr, "usage: %s [-n] [-w] [-d] [-f] [-h] [-i]%s%s\n", ++ progname, ++ strcmp(progname, "halt") ? "" : " [-p]", ++ strcmp(progname, "reboot") ? "" : " [-k]"); + fprintf(stderr, "\t-n: don't sync before halting the system\n"); + fprintf(stderr, "\t-w: only write a wtmp reboot record and exit.\n"); + fprintf(stderr, "\t-d: don't write a wtmp record.\n"); +@@ -84,6 +87,8 @@ void usage(void) + fprintf(stderr, "\t-i: shut down all network interfaces.\n"); + if (!strcmp(progname, "halt")) + fprintf(stderr, "\t-p: power down the system (if possible, otherwise halt).\n"); ++ if (!strcmp(progname, "reboot")) ++ fprintf(stderr, "\t-k: reboot the system using kexec.\n"); + exit(1); + } + +@@ -182,6 +187,7 @@ int main(int argc, char **argv) + int do_ifdown = 0; + int do_hddown = 0; + int do_poweroff = 0; ++ int do_kexec = 0; + int c; + char *tm = NULL; + +@@ -201,7 +207,7 @@ int main(int argc, char **argv) + /* + * Get flags + */ +- while((c = getopt(argc, argv, ":ihdfnpwt:")) != EOF) { ++ while((c = getopt(argc, argv, ":ihdfnpwkt:")) != EOF) { + switch(c) { + case 'n': + do_sync = 0; +@@ -225,6 +231,9 @@ int main(int argc, char **argv) + case 'p': + do_poweroff = 1; + break; ++ case 'k': ++ do_kexec = 1; ++ break; + case 't': + tm = optarg; + break; +@@ -242,10 +251,24 @@ int main(int argc, char **argv) + (void)chdir("/"); + + if (!do_hard && !do_nothing) { ++ c = get_runlevel(); ++ ++ /* ++ * We can't reboot using kexec through this path. ++ */ ++ if (c != '6' && do_reboot && do_kexec) { ++ fprintf(stderr, "ERROR: using -k at this" ++ " runlevel requires also -f\n" ++ " (You probably want instead to reboot" ++ " normally and let your reboot\n" ++ " script, usually /etc/init.d/reboot," ++ " specify -k)\n"); ++ exit(1); ++ } ++ + /* + * See if we are in runlevel 0 or 6. + */ +- c = get_runlevel(); + if (c != '0' && c != '6') + do_shutdown(do_reboot ? "-r" : "-h", tm); + } +@@ -277,6 +300,15 @@ int main(int argc, char **argv) + if (do_nothing) exit(0); + + if (do_reboot) { ++ /* ++ * kexec or reboot ++ */ ++ if (do_kexec) ++ init_reboot(BMAGIC_KEXEC); ++ ++ /* ++ * Fall through if failed ++ */ + init_reboot(BMAGIC_REBOOT); + } else { + /* +--- a/src/reboot.h ++++ b/src/reboot.h +@@ -47,5 +47,8 @@ + # define BMAGIC_POWEROFF BMAGIC_HALT + #endif + ++/* for kexec support */ ++#define BMAGIC_KEXEC 0x45584543 ++ + #define init_reboot(magic) reboot(magic) + diff --git a/sys-apps/sysvinit/files/sysvinit-2.86-shutdown-single.patch b/sys-apps/sysvinit/files/sysvinit-2.86-shutdown-single.patch new file mode 100644 index 000000000000..b8e403f629f7 --- /dev/null +++ b/sys-apps/sysvinit/files/sysvinit-2.86-shutdown-single.patch @@ -0,0 +1,36 @@ +This patch makes shutdown use the Single User runlevel by default so +the gettys are shutdown too. + +Roy Marples <uberlord@gentoo.org> + +--- a/man/shutdown.8 ++++ b/man/shutdown.8 +@@ -44,7 +44,7 @@ mail and news processing programs a chance to exit cleanly, etc. + \fBshutdown\fP does its job by signalling the \fBinit\fP process, + asking it to change the runlevel. + Runlevel \fB0\fP is used to halt the system, runlevel \fB6\fP is used +-to reboot the system, and runlevel \fB1\fP is used to put to system into ++to reboot the system, and runlevel \fBS\fP is used to put to system into + a state where administrative tasks can be performed; this is the default + if neither the \fI-h\fP or \fI-r\fP flag is given to \fBshutdown\fP. + To see which actions are taken on halt or reboot see the appropriate +--- a/src/shutdown.c ++++ b/src/shutdown.c +@@ -506,7 +506,7 @@ int main(int argc, char **argv) + usage(); + exit(1); + } +- strcpy(down_level, "1"); ++ strcpy(down_level, "S"); + halttype = NULL; + + /* Process the options. */ +@@ -685,6 +685,8 @@ int main(int argc, char **argv) + strcpy(newstate, "for reboot"); + break; + case '1': ++ case 'S': ++ case 's': + strcpy(newstate, "to maintenance mode"); + break; + default: diff --git a/sys-apps/sysvinit/files/sysvinit-2.88-makefile.patch b/sys-apps/sysvinit/files/sysvinit-2.88-makefile.patch new file mode 100644 index 000000000000..22f463cddb51 --- /dev/null +++ b/sys-apps/sysvinit/files/sysvinit-2.88-makefile.patch @@ -0,0 +1,60 @@ +http://savannah.nongnu.org/bugs/index.php?29758 + +From 2b7d90f04cdd0e343f413c5c7672615926c02706 Mon Sep 17 00:00:00 2001 +From: wfink <wfink@456724a4-4300-0410-8514-c89748c515a2> +Date: Tue, 4 May 2010 07:50:12 +0000 +Subject: [PATCH] Fix sysvinit bug #29758 + +git-svn-id: svn://svn.sv.gnu.org/sysvinit/sysvinit/trunk@87 456724a4-4300-0410-8514-c89748c515a2 + +diff --git a/src/Makefile b/src/Makefile +index e2b8028..19675c5 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -92,9 +92,9 @@ all: $(BIN) $(SBIN) $(USRBIN) + init: LDLIBS += $(INITLIBS) $(STATIC) + init: init.o init_utmp.o + +-halt: halt.o ifdown.o hddown.o utmp.o reboot.h ++halt: halt.o ifdown.o hddown.o utmp.o + +-last: last.o oldutmp.h ++last: last.o + + mesg: mesg.o + +@@ -109,7 +109,7 @@ sulogin: sulogin.o + + wall: dowall.o wall.o + +-shutdown: dowall.o shutdown.o utmp.o reboot.h ++shutdown: dowall.o shutdown.o utmp.o + + bootlogd: LDLIBS += -lutil + bootlogd: bootlogd.o +@@ -118,14 +118,22 @@ sulogin.o: CPPFLAGS += $(SELINUX_DEF) + sulogin.o: sulogin.c + + init.o: CPPFLAGS += $(SELINUX_DEF) +-init.o: init.c init.h set.h reboot.h initreq.h ++init.o: init.c init.h initreq.h paths.h reboot.h set.h + +-utmp.o: utmp.c init.h ++utmp.o: + + init_utmp.o: CPPFLAGS += -DINIT_MAIN +-init_utmp.o: utmp.c init.h ++init_utmp.o: utmp.c init.h initreq.h paths.h + $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< + ++utmpdump.o: utmpdump.c oldutmp.h ++ ++shutdown.o: shutdown.c paths.h reboot.h initreq.h init.h ++ ++halt.o: halt.c reboot.h ++ ++last.o: last.c oldutmp.h ++ + cleanobjs: + rm -f *.o *.bak + |