0001-clean-restart.patch 787 B

12345678910111213141516171819202122232425262728293031323334
  1. From 0a654c20e1b9324c57ba4116b52fb6ab33847e1d Mon Sep 17 00:00:00 2001
  2. From: Jeremy Kerr <jk@ozlabs.org>
  3. Date: Thu, 8 Aug 2013 17:16:31 +0800
  4. Subject: [PATCH] kexec: Implement clean restart for busybox init
  5. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
  6. ---
  7. kexec.c | 3 ++-
  8. 1 file changed, 2 insertions(+), 1 deletion(-)
  9. diff --git a/kexec.c b/kexec.c
  10. index 2edb7df..b2a0c42 100644
  11. --- a/kexec.c
  12. +++ b/kexec.c
  13. @@ -27,6 +27,7 @@
  14. #include <fcntl.h>
  15. #include <errno.h>
  16. #include <syscall.h>
  17. +#include <signal.h>
  18. #include <libfdt.h>
  19. #include <getopt.h>
  20. #include <sys/types.h>
  21. @@ -818,7 +819,7 @@ int main(int argc, char *argv[])
  22. sync();
  23. exec_kexec();
  24. } else {
  25. - execlp("shutdown", "shutdown", "-r", "now", NULL);
  26. + kill(1, SIGQUIT);
  27. }
  28. return -1;
  29. --
  30. 1.7.10.4