mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 13:33:09 +07:00
Write ACPI sleep state to /sys/power/state instead of /proc/acpi/sleep
From http://acpi.sourceforge.net/documentation/sleep.html: /proc/acpi is being replaced by interfaces in /sys and new software should not look in /proc. Users of 2.6 are advised to use the new file in sysfs: /sys/power/state. Metalshark says: February 15th, 2008 at 6:15 am In shutdown you use “/proc/acpi/sleep”, would it be advisable to use the new sysfs method and use that if available and if not use proc (at runtime) with compile time options to disable proc/sysfs methods? Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
- replace system("touch") with touch() in finit-mod (Metalshark)
|
||||
- disable NO_HCTOSYS by default to match stock Eeepc kernel
|
||||
- drop system("rm -f") to clean /tmp, its a fresh mounted tmpfs
|
||||
- write ACPI sleep state to /sys/power/state instead of
|
||||
/proc/acpi/sleep (Metalshark)
|
||||
|
||||
0.1 (20081214)
|
||||
- initial release
|
||||
|
||||
+1
-1
@@ -373,7 +373,7 @@ void shutdown(int sig)
|
||||
if (sig == SIGINT || sig == SIGUSR1)
|
||||
reboot(RB_AUTOBOOT);
|
||||
|
||||
if ((fd = open("/proc/acpi/sleep", O_WRONLY)) >= 0) {
|
||||
if ((fd = open("/sys/power/state", O_WRONLY)) >= 0) {
|
||||
write(fd, "5", 1);
|
||||
close(fd);
|
||||
}
|
||||
|
||||
+2
-1
@@ -34,6 +34,7 @@ Changelog from the original Eeepc fastinit:
|
||||
- Add –directisa to hwclock if user has disabled CONFIG_GENRTC and enabled
|
||||
CONFIG_RTC but not CONFIG_HPET_TIMER and CONFIG_HPET_RTC_IRQ (by Metalshark)
|
||||
- Drop system() call to clean /tmp, it's a fresh mounted tmpfs
|
||||
- Change /proc/acpi/sleep to /sys/power/state (by Metalshark)
|
||||
|
||||
*/
|
||||
|
||||
@@ -311,7 +312,7 @@ void shutdown(int sig)
|
||||
if (sig == SIGINT || sig == SIGUSR1)
|
||||
reboot(RB_AUTOBOOT);
|
||||
|
||||
if ((fd = open("/proc/acpi/sleep", O_WRONLY)) >= 0) {
|
||||
if ((fd = open("/sys/power/state", O_WRONLY)) >= 0) {
|
||||
write(fd, "5", 1);
|
||||
close(fd);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user