[PATCH] sysutils/hal

Jung-uk Kim jkim at FreeBSD.org
Mon Feb 2 10:34:51 PST 2009


Please review the attached patch:

- Do not search for Linux-specific hald-addon-acpi module.
- Remove unnecessary ioctl calls for battery on non-laptops.
- Do not use model-specific sysctl if it is not available.
- Always provide frequencies of BSP as we do not export APs' yet.

Thanks,

Jung-uk Kim
-------------- next part --------------
Index: sysutils/hal/Makefile
===================================================================
RCS file: /home/pcvs/ports/sysutils/hal/Makefile,v
retrieving revision 1.46
diff -u -r1.46 Makefile
--- sysutils/hal/Makefile	31 Jan 2009 21:49:13 -0000	1.46
+++ sysutils/hal/Makefile	2 Feb 2009 18:00:37 -0000
@@ -8,7 +8,7 @@
 
 PORTNAME=	hal
 DISTVERSION=	0.5.11
-PORTREVISION=	15
+PORTREVISION=	16
 CATEGORIES=	sysutils
 MASTER_SITES=	http://hal.freedesktop.org/releases/
 
Index: sysutils/hal/files/patch-fdi_policy_10osvendor_10-power-mgmt-policy.fdi
===================================================================
RCS file: sysutils/hal/files/patch-fdi_policy_10osvendor_10-power-mgmt-policy.fdi
diff -N sysutils/hal/files/patch-fdi_policy_10osvendor_10-power-mgmt-policy.fdi
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ sysutils/hal/files/patch-fdi_policy_10osvendor_10-power-mgmt-policy.fdi	2 Feb 2009 18:00:37 -0000
@@ -0,0 +1,13 @@
+--- fdi/policy/10osvendor/10-power-mgmt-policy.fdi.orig	2008-05-07 19:21:15.000000000 -0400
++++ fdi/policy/10osvendor/10-power-mgmt-policy.fdi	2009-01-30 17:41:05.000000000 -0500
+@@ -10,7 +10,9 @@
+ 
+   <device>
+     <match key="power_management.type" string="acpi">
+-      <append key="info.addons" type="strlist">hald-addon-acpi</append>
++      <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" string="Linux">
++        <append key="info.addons" type="strlist">hald-addon-acpi</append>
++      </match>
+     </match>
+   </device>
+ 
Index: sysutils/hal/files/patch-hald_freebsd_hf-acpi.c
===================================================================
RCS file: sysutils/hal/files/patch-hald_freebsd_hf-acpi.c
diff -N sysutils/hal/files/patch-hald_freebsd_hf-acpi.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ sysutils/hal/files/patch-hald_freebsd_hf-acpi.c	2 Feb 2009 18:00:37 -0000
@@ -0,0 +1,31 @@
+--- hald/freebsd/hf-acpi.c.orig	2008-05-07 19:23:59.000000000 -0400
++++ hald/freebsd/hf-acpi.c	2009-01-30 15:53:14.000000000 -0500
+@@ -105,6 +105,9 @@ hf_acpi_poll_batt (HalDevice *device)
+   gboolean ispresent;
+   union acpi_battery_ioctl_arg battif, battst, battinfo;
+ 
++  if (! hf_has_sysctl("hw.acpi.battery"))
++    return;
++
+   battif.unit = battst.unit = battinfo.unit =
+     hal_device_property_get_int(device, "freebsd.unit");
+ 
+@@ -504,6 +507,8 @@ hf_acpi_laptop_panel_new (HalDevice *par
+ 
+   g_return_val_if_fail(HAL_IS_DEVICE(parent), NULL);
+ 
++  if (! hf_has_sysctl("hw.acpi.%s", access))
++    return NULL;
+   device = hf_device_new(parent);
+ 
+   hf_device_property_set_string_printf(device, "info.product", "Laptop Panel (%s)", name);
+@@ -597,7 +602,8 @@ hf_acpi_probe (void)
+ 						      laptop_panel_types[i].max_sysctl,
+ 						      laptop_panel_types[i].access,
+ 						      laptop_panel_types[i].name);
+-	      hf_device_preprobe_and_add(panel_device);
++	      if (panel_device)
++		hf_device_preprobe_and_add(panel_device);
+ 	    }
+ 	}
+     }
Index: sysutils/hal/files/patch-hald_freebsd_hf-devtree.c
===================================================================
RCS file: /home/pcvs/ports/sysutils/hal/files/patch-hald_freebsd_hf-devtree.c,v
retrieving revision 1.1
diff -u -r1.1 patch-hald_freebsd_hf-devtree.c
--- sysutils/hal/files/patch-hald_freebsd_hf-devtree.c	26 Jan 2009 17:55:44 -0000	1.1
+++ sysutils/hal/files/patch-hald_freebsd_hf-devtree.c	2 Feb 2009 18:00:37 -0000
@@ -1,6 +1,30 @@
 --- hald/freebsd/hf-devtree.c.orig	2008-05-07 19:24:03.000000000 -0400
-+++ hald/freebsd/hf-devtree.c	2009-01-25 17:17:02.000000000 -0500
-@@ -426,7 +426,13 @@ hf_devtree_probe (void)
++++ hald/freebsd/hf-devtree.c	2009-01-30 14:30:57.000000000 -0500
+@@ -86,7 +86,11 @@ hf_devtree_cpu_can_throttle (int cpu)
+   gboolean can = FALSE;
+   char *levels;
+ 
++#ifdef notyet
+   levels = hf_get_string_sysctl(NULL, "dev.cpu.%i.freq_levels", cpu);
++#else
++  levels = hf_get_string_sysctl(NULL, "dev.cpu.0.freq_levels");
++#endif
+   if (levels)
+     {
+       char **toks;
+@@ -109,7 +113,11 @@ hf_devtree_cpu_get_maxfreq (int cpu)
+   char *levels;
+   int freq = -1;
+ 
++#ifdef notyet
+   levels = hf_get_string_sysctl(NULL, "dev.cpu.%i.freq_levels", cpu);
++#else
++  levels = hf_get_string_sysctl(NULL, "dev.cpu.0.freq_levels");
++#endif
+   if (levels)
+     {
+       sscanf(levels, "%i/", &freq);
+@@ -426,7 +434,13 @@ hf_devtree_probe (void)
  	  HalDevice *device;
  
  	  device = hf_devtree_device_new(parent, info->handler, info->unit);
@@ -15,7 +39,7 @@
  	}
  
        devices = g_slist_delete_link(devices, root);
-@@ -434,6 +440,17 @@ hf_devtree_probe (void)
+@@ -434,6 +448,17 @@ hf_devtree_probe (void)
      }
  }
  
@@ -33,7 +57,7 @@
  HalDevice *
  hf_devtree_find_from_name (HalDeviceStore *store, const char *name)
  {
-@@ -597,5 +614,6 @@ hf_devtree_is_driver (const char *name, 
+@@ -597,5 +622,6 @@ hf_devtree_is_driver (const char *name, 
  }
  
  HFHandler hf_devtree_handler = {


More information about the freebsd-gnome mailing list