hal: Branch 'master' - 2 commits

David Zeuthen david at kemper.freedesktop.org
Sat Sep 23 16:19:23 PDT 2006


 configure.in                                   |   76 ++++++++++++++++++-------
 fdi/policy/10osvendor/10-cpufreq.fdi           |    9 ++
 fdi/policy/10osvendor/10-power-mgmt-policy.fdi |    2 
 fdi/policy/10osvendor/Makefile.am              |    4 +
 hald/debug-hald.sh                             |   10 ++-
 hald/device_info.c                             |    3 
 hald/linux/addons/Makefile.am                  |   22 +++----
 hald/run-hald.sh                               |   10 ++-
 hald/valgrind-hald.sh                          |   10 ++-
 9 files changed, 102 insertions(+), 44 deletions(-)

New commits:
diff-tree f7906c5168fa5631c26cd1ca7a44bfb702f14ac5 (from 499e981a3055ef8bf09ef7b2737721a275698d09)
Author: David Zeuthen <davidz at redhat.com>
Date:   Sat Sep 23 19:19:08 2006 -0400

    make Macbook Pro utils x86 only again
    
    I seem to have removed this by mistake.

diff --git a/configure.in b/configure.in
index fa54e62..61841f0 100644
--- a/configure.in
+++ b/configure.in
@@ -483,7 +483,13 @@ elif test "x$with_macbookpro" = "x" ; th
   if test "$HAVE_LIBPCI" != "false" ; then
     case "${HALD_BACKEND}" in
       linux)
-        BUILD_MACBOOKPRO=yes
+        case "${host}" in
+	  i[[3456]]86-*-*)
+            BUILD_MACBOOKPRO=yes
+	    ;;
+	  *)
+	    ;;
+	esac
         ;;
       *)
         ;;
@@ -594,7 +600,7 @@ echo "
         use libparted:              ${USE_PARTED}
         use PolicyKit:              ${msg_polkit}
 
-        Macbook Pro utils:          ${BUILD_MACBOOKPRO} (Linux only, requires libpci)
+        Macbook Pro utils:          ${BUILD_MACBOOKPRO} (Linux only, x86 only, requires libpci)
         CPU frequency scaling:      ${BUILD_CPUFREQ} (Linux only)
 
         Maintainer mode:            ${USE_MAINTAINER_MODE}
diff-tree 499e981a3055ef8bf09ef7b2737721a275698d09 (from aee0e0ba2e734506f5c430374e9896c025b7a655)
Author: David Zeuthen <davidz at redhat.com>
Date:   Sat Sep 23 19:15:30 2006 -0400

    make cpufreq support optional
    
    This is part of a larger effort to make HAL better support embedded systems.

diff --git a/configure.in b/configure.in
index ddb6f24..fa54e62 100644
--- a/configure.in
+++ b/configure.in
@@ -247,24 +247,6 @@ AC_CHECK_HEADERS(pci/pci.h, [
 		USE_LIBPCI=no AM_CONDITIONAL(HAVE_LIBPCI,false)])], [
 	USE_LIBPCI=no AM_CONDITIONAL(HAVE_LIBPCI,false)])
 
-dnl see if we should build macbookpro utils
-AC_ARG_WITH(macbookpro,     [  --with-macbookpro       Whether to build Macbook Pro utils (auto)])
-BUILD_MACBOOKPRO=no
-if test "x$use_macbookpro" = "xyes" ; then
-   BUILD_MACBOOKPRO=yes
-elif test "x$use_macbookpro" = "x" ; then
-  if test "$HAVE_LIBPCI" != "false" ; then
-    case "${host}" in
-      i[[3456]]86-*-linux*)
-        BUILD_MACBOOKPRO=yes
-        ;;
-      *)
-        ;;
-      esac
-   fi
-fi
-AM_CONDITIONAL(BUILD_MACBOOKPRO, test x$BUILD_MACBOOKPRO = xyes)
-
 AC_ARG_WITH(backend, [  --with-backend=<name>   backend to use (linux/solaris/dummy)],
                       [
                       backend=$withval
@@ -488,6 +470,50 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GE
 AC_PROG_INTLTOOL([0.22])
 AM_GLIB_GNU_GETTEXT
 
+dnl
+dnl SUBSETTING START
+dnl
+
+dnl macbookpro utils
+AC_ARG_WITH(macbookpro,     [  --with-macbookpro       Whether to build Macbook Pro utils (auto)])
+BUILD_MACBOOKPRO=no
+if test "x$with_macbookpro" = "xyes" ; then
+   BUILD_MACBOOKPRO=yes
+elif test "x$with_macbookpro" = "x" ; then
+  if test "$HAVE_LIBPCI" != "false" ; then
+    case "${HALD_BACKEND}" in
+      linux)
+        BUILD_MACBOOKPRO=yes
+        ;;
+      *)
+        ;;
+    esac
+   fi
+fi
+AM_CONDITIONAL(BUILD_MACBOOKPRO, test x$BUILD_MACBOOKPRO = xyes)
+
+dnl cpufreq
+AC_ARG_WITH(cpufreq,        [  --with-cpufreq          Whether to build cpufreq utils (auto)])
+BUILD_CPUFREQ=no
+if test "x$with_cpufreq" = "xyes" ; then
+   BUILD_CPUFREQ=yes
+elif test "x$with_cpufreq" = "x" ; then
+  case "${HALD_BACKEND}" in
+    linux)
+      BUILD_CPUFREQ=yes
+      ;;
+    *)
+      ;;
+  esac
+fi
+AM_CONDITIONAL(BUILD_CPUFREQ, test x$BUILD_CPUFREQ = xyes)
+
+
+dnl
+dnl SUBSETTING END
+dnl
+
+
 AC_OUTPUT([
 hal.pc
 hal-storage.pc
@@ -558,16 +584,18 @@ echo "
         Group for HAL:              ${HAL_GROUP}
         hald pidfile:               ${HALD_PID_FILE}
         hald socket dir:            ${HALD_SOCKET_DIR}
-        hald backend:               ${HALD_BACKEND}
+
+        OS backend:                 ${HALD_BACKEND}
+
         use acpi kernel interface:  ${acpi_proc}
         use acpid interface:        ${acpi_acpid}
         use libusb:                 ${USE_LIBUSB}
         use libpci:                 ${USE_LIBPCI}
         use libparted:              ${USE_PARTED}
-
         use PolicyKit:              ${msg_polkit}
 
-        build Macbook Pro utils:    ${BUILD_MACBOOKPRO}
+        Macbook Pro utils:          ${BUILD_MACBOOKPRO} (Linux only, requires libpci)
+        CPU frequency scaling:      ${BUILD_CPUFREQ} (Linux only)
 
         Maintainer mode:            ${USE_MAINTAINER_MODE}
         Building verbose mode:      ${enable_verbose_mode}
diff --git a/fdi/policy/10osvendor/10-cpufreq.fdi b/fdi/policy/10osvendor/10-cpufreq.fdi
new file mode 100644
index 0000000..31c8cc0
--- /dev/null
+++ b/fdi/policy/10osvendor/10-cpufreq.fdi
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deviceinfo version="0.2">
+  <device>
+    <match key="info.udi" string="/org/freedesktop/Hal/devices/computer">
+      <append key="info.addons" type="strlist">hald-addon-cpufreq</append>
+    </match>
+  </device>
+</device>
diff --git a/fdi/policy/10osvendor/10-power-mgmt-policy.fdi b/fdi/policy/10osvendor/10-power-mgmt-policy.fdi
index c0b4845..2c2705a 100644
--- a/fdi/policy/10osvendor/10-power-mgmt-policy.fdi
+++ b/fdi/policy/10osvendor/10-power-mgmt-policy.fdi
@@ -26,8 +26,6 @@
     <match key="info.udi" string="/org/freedesktop/Hal/devices/computer">
       <append key="info.interfaces" type="strlist">org.freedesktop.Hal.Device.SystemPowerManagement</append>
 
-      <append key="info.addons" type="strlist">hald-addon-cpufreq</append>
-
       <append key="org.freedesktop.Hal.Device.SystemPowerManagement.method_names" type="strlist">Suspend</append>
       <append key="org.freedesktop.Hal.Device.SystemPowerManagement.method_signatures" type="strlist">i</append>
       <append key="org.freedesktop.Hal.Device.SystemPowerManagement.method_argnames" type="strlist">num_seconds_to_sleep</append>
diff --git a/fdi/policy/10osvendor/Makefile.am b/fdi/policy/10osvendor/Makefile.am
index 827d995..5cb1894 100644
--- a/fdi/policy/10osvendor/Makefile.am
+++ b/fdi/policy/10osvendor/Makefile.am
@@ -9,6 +9,10 @@ dist_fdi_DATA = 			\
 	15-storage-luks.fdi		\
 	20-storage-methods.fdi
 
+if BUILD_CPUFREQ
+dist_fdi_DATA += 10-cpufreq.fdi
+endif
+
 check:
 	for f in $(dist_fdi_DATA); do \
             echo -n "Validate XML in $$f : "; \
diff --git a/hald/debug-hald.sh b/hald/debug-hald.sh
index 49f460b..c2aab4b 100755
--- a/hald/debug-hald.sh
+++ b/hald/debug-hald.sh
@@ -2,9 +2,13 @@
 
 export HALD_RUNNER_PATH=`pwd`/linux:`pwd`/linux/probing:`pwd`/linux/addons:`pwd`/.:`pwd`/../tools:`pwd`/../tools/linux
 export PATH=`pwd`/../hald-runner:$PATH
-export HAL_FDI_SOURCE_PREPROBE=../fdi/preprobe
-export HAL_FDI_SOURCE_INFORMATION=../fdi/information
-export HAL_FDI_SOURCE_POLICY=../fdi/policy
+
+rm -rf .local-fdi
+make -C ../fdi install DESTDIR=`pwd`/.local-fdi prefix=/
+export HAL_FDI_SOURCE_PREPROBE=.local-fdi/share/hal/fdi/preprobe
+export HAL_FDI_SOURCE_INFORMATION=.local-fdi/share/hal/fdi/information
+export HAL_FDI_SOURCE_POLICY=.local-fdi/share/hal/fdi/policy
+
 echo ========================================
 echo Just type \'run\' to start debugging hald
 echo ========================================
diff --git a/hald/device_info.c b/hald/device_info.c
index b181321..cf42935 100644
--- a/hald/device_info.c
+++ b/hald/device_info.c
@@ -36,6 +36,7 @@
 #include <dbus/dbus.h>
 #include <dbus/dbus-glib.h>
 #include <math.h>
+#include <errno.h>
 
 #include "hald.h"
 #include "logger.h"
@@ -1498,7 +1499,7 @@ scan_fdi_files (const char *dir, HalDevi
 
 	num_entries = scandir (dir, &name_list, 0, my_alphasort);
 	if (num_entries == -1) {
-		perror ("scandir");
+		HAL_ERROR (("scandir failed for '%s' (errno=%d '%s')", dir, errno, strerror (errno)));
 		return FALSE;
 	}
 
diff --git a/hald/linux/addons/Makefile.am b/hald/linux/addons/Makefile.am
index 9765121..90fef2f 100644
--- a/hald/linux/addons/Makefile.am
+++ b/hald/linux/addons/Makefile.am
@@ -15,20 +15,25 @@ libexec_PROGRAMS  = 			\
 	hald-addon-hid-ups 		\
 	hald-addon-keyboard 		\
 	hald-addon-pmu			\
-	hald-addon-storage		\
-	hald-addon-cpufreq
+	hald-addon-storage
 
 if BUILD_MACBOOKPRO
 libexec_PROGRAMS += hald-addon-macbookpro-backlight
-endif
-if HAVE_LIBUSB
-libexec_PROGRAMS += hald-addon-usb-csr
-endif
+hald_addon_macbookpro_backlight_SOURCES = addon-macbookpro-backlight.c ../../logger.c
+hald_addon_macbookpro_backlight_LDADD = $(top_builddir)/libhal/libhal.la -lpci @GLIB_LIBS@
 endif
 
+if BUILD_CPUFREQ
+libexec_PROGRAMS += hald-addon-cpufreq
 hald_addon_cpufreq_SOURCES = addon-cpufreq.c addon-cpufreq.h addon-cpufreq-userspace.h \
 	                     addon-cpufreq-userspace.c ../../logger.c
 hald_addon_cpufreq_LDADD = $(top_builddir)/libhal/libhal.la @GLIB_LIBS@ @POLKIT_LIBS@
+endif
+
+if HAVE_LIBUSB
+libexec_PROGRAMS += hald-addon-usb-csr
+endif
+endif
 
 hald_addon_acpi_SOURCES = addon-acpi.c ../../logger.c ../../util_helper.c
 hald_addon_acpi_LDADD = $(top_builddir)/libhal/libhal.la
@@ -42,11 +47,6 @@ hald_addon_hid_ups_LDADD = $(top_builddi
 hald_addon_keyboard_SOURCES = addon-keyboard.c ../../logger.c ../../util_helper.c
 hald_addon_keyboard_LDADD = $(top_builddir)/libhal/libhal.la 
 
-if BUILD_MACBOOKPRO
-hald_addon_macbookpro_backlight_SOURCES = addon-macbookpro-backlight.c ../../logger.c
-hald_addon_macbookpro_backlight_LDADD = $(top_builddir)/libhal/libhal.la -lpci @GLIB_LIBS@
-endif
-
 hald_addon_pmu_SOURCES = addon-pmu.c ../../logger.c ../../util_helper.c
 hald_addon_pmu_LDADD = $(top_builddir)/libhal/libhal.la
 
diff --git a/hald/run-hald.sh b/hald/run-hald.sh
index 69dd17e..d8e6cb3 100755
--- a/hald/run-hald.sh
+++ b/hald/run-hald.sh
@@ -2,9 +2,13 @@
 
 export HALD_RUNNER_PATH=`pwd`/linux:`pwd`/linux/probing:`pwd`/linux/addons:`pwd`/.:`pwd`/../tools:`pwd`/../tools/linux
 export PATH=`pwd`/../hald-runner:$PATH
-export HAL_FDI_SOURCE_PREPROBE=../fdi/preprobe
-export HAL_FDI_SOURCE_INFORMATION=../fdi/information
-export HAL_FDI_SOURCE_POLICY=../fdi/policy
+
+rm -rf .local-fdi
+make -C ../fdi install DESTDIR=`pwd`/.local-fdi prefix=/
+export HAL_FDI_SOURCE_PREPROBE=.local-fdi/share/hal/fdi/preprobe
+export HAL_FDI_SOURCE_INFORMATION=.local-fdi/share/hal/fdi/information
+export HAL_FDI_SOURCE_POLICY=.local-fdi/share/hal/fdi/policy
+
 ./hald --daemon=no --verbose=yes
 #./hald --daemon=no
 
diff --git a/hald/valgrind-hald.sh b/hald/valgrind-hald.sh
index 8f47d20..11f95c3 100755
--- a/hald/valgrind-hald.sh
+++ b/hald/valgrind-hald.sh
@@ -2,7 +2,11 @@
 
 export HALD_RUNNER_PATH=`pwd`/linux:`pwd`/linux/probing:`pwd`/linux/addons:`pwd`/.:`pwd`/../tools:`pwd`/../tools/linux
 export PATH=`pwd`/../hald-runner:$PATH
-export HAL_FDI_SOURCE_PREPROBE=../fdi/preprobe
-export HAL_FDI_SOURCE_INFORMATION=../fdi/information
-export HAL_FDI_SOURCE_POLICY=../fdi/policy
+
+rm -rf .local-fdi
+make -C ../fdi install DESTDIR=`pwd`/.local-fdi prefix=/
+export HAL_FDI_SOURCE_PREPROBE=.local-fdi/share/hal/fdi/preprobe
+export HAL_FDI_SOURCE_INFORMATION=.local-fdi/share/hal/fdi/information
+export HAL_FDI_SOURCE_POLICY=.local-fdi/share/hal/fdi/policy
+
 valgrind --num-callers=20 --show-reachable=yes --leak-check=yes --tool=memcheck ./hald --daemon=no --verbose=yes


More information about the hal-commit mailing list