APM power off fails

fritz.crusius (h0444vlt@rz.hu-berlin.de)
Tue, 27 May 1997 00:08:51 +0200 (CEST)


Hello Linus,

In 2.1.40, the APM power down on system halt does not work as one would
expect, it has to be done manually. With both CONFIG_APM and
CONFIG_APM_POWER_OFF enabled, 2.0.30 switches power off on system halt
automatically.
Whats the philosophy behind making a difference between
LINUX_REBOOT_CMD_POWER_OFF and LINUX_REBOOT_CMD_HALT with APM ?

I tried the following patch:

diff -urN linux-2.1.40.orig/kernel/sys.c
linux-2.1.40/kernel/sys.c
--- linux-2.1.40.orig/kernel/sys.c Mon May 26 22:35:39 1997
+++ linux-2.1.40/kernel/sys.c Mon May 26 22:36:38 1997
@@ -240,7 +240,11 @@
case LINUX_REBOOT_CMD_HALT:
notifier_call_chain(&reboot_notifier_list, SYS_HALT, NULL);
printk(KERN_EMERG "System halted.\n");
+#if defined(CONFIG_APM) && defined(CONFIG_APM_POWER_OFF)
+ machine_power_off();
+#else
machine_halt();
+#endif
do_exit(0);
break;

---------------------->
/ / /| / / / \ /
/ / / | / / / X
/__ / / |/ /__/ / \
<----------------------
Fritz Crusius, h0444vlt@rz.hu-berlin.de