Add common orderly_poweroff()
Various pieces of code around the kernel want to be able to trigger an orderly poweroff. This pulls them together into a single implementation. By default the poweroff command is /sbin/poweroff, but it can be set via sysctl: kernel/poweroff_cmd. This is split at whitespace, so it can include command-line arguments. This patch replaces four other instances of invoking either "poweroff" or "shutdown -h now": two sbus drivers, and acpi thermal management. sparc64 has its own "powerd"; still need to determine whether it should be replaced by orderly_poweroff(). Signed-off-by:Jeremy Fitzhardinge <jeremy@xensource.com> Acked-by:
Len Brown <lenb@kernel.org> Signed-off-by:
Chris Wright <chrisw@sous-sol.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Randy Dunlap <randy.dunlap@oracle.com> Cc: Andi Kleen <ak@suse.de> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Arnd Bergmann <arnd@arndb.de> Cc: David S. Miller <davem@davemloft.net>
Showing
- drivers/acpi/thermal.c 2 additions, 22 deletionsdrivers/acpi/thermal.c
- drivers/sbus/char/bbc_envctrl.c 2 additions, 3 deletionsdrivers/sbus/char/bbc_envctrl.c
- drivers/sbus/char/envctrl.c 2 additions, 5 deletionsdrivers/sbus/char/envctrl.c
- include/linux/reboot.h 5 additions, 0 deletionsinclude/linux/reboot.h
- kernel/sys.c 58 additions, 0 deletionskernel/sys.c
- kernel/sysctl.c 10 additions, 0 deletionskernel/sysctl.c
Loading
Please register or sign in to comment