hal: Branch 'master'
Richard Hughes
hughsient at kemper.freedesktop.org
Thu Mar 1 12:23:48 PST 2007
hald/linux/acpi.c | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
New commits:
diff-tree 61dea57bbe4c47479505e550325214013df8248b (from eb21c07c30222aa05fd006ecc4f242f2a0598303)
Author: Richard Hughes <richard at hughsie.com>
Date: Thu Mar 1 20:22:41 2007 +0000
fix acpi detection for very new kernels
Apply patch from S.ÃaÄlar Onur <caglar at pardus.org.tr> to make
HAL detect the presence of ACPI not from the info file, but
the acpi directory as the info file is not in sysfs.
Slightly tweaked by me to remove a warning.
You will need to use HAL 0.5.9 with >2.6.21 if you are not using the
configuration option CONFIG_ACPI_PROCFS.
diff --git a/hald/linux/acpi.c b/hald/linux/acpi.c
index 414165c..3111170 100644
--- a/hald/linux/acpi.c
+++ b/hald/linux/acpi.c
@@ -1055,7 +1055,7 @@ acpi_synthesize_hotplug_events (void)
HalDevice *computer;
gchar path[HAL_PATH_MAX];
- if (!g_file_test ("/proc/acpi/info", G_FILE_TEST_EXISTS))
+ if (!g_file_test ("/proc/acpi/", G_FILE_TEST_IS_DIR))
return FALSE;
if ((computer = hal_device_store_find (hald_get_gdl (), "/org/freedesktop/Hal/devices/computer")) == NULL &&
@@ -1066,8 +1066,16 @@ acpi_synthesize_hotplug_events (void)
/* Set appropriate properties on the computer object */
hal_device_property_set_string (computer, "power_management.type", "acpi");
- hal_util_set_string_elem_from_file (computer, "power_management.acpi.linux.version",
- "/proc/acpi", "info", "version", 0, FALSE);
+ if (g_file_test ("/proc/acpi/info", G_FILE_TEST_EXISTS)) {
+ hal_util_set_string_elem_from_file (computer, "power_management.acpi.linux.version",
+ "/proc/acpi", "info", "version", 0, FALSE);
+ } else {
+ gchar *firmware_path;
+ firmware_path = g_strdup_printf ("%s/firmware/acpi", get_hal_sysfs_path ());
+ hal_util_set_string_elem_from_file (computer, "power_management.acpi.linux.version",
+ firmware_path, "info", "version", 0, FALSE);
+ g_free (firmware_path);
+ }
/* collect batteries */
snprintf (path, sizeof (path), "%s/acpi/battery", get_hal_proc_path ());
More information about the hal-commit
mailing list