[Pkg-utopia-commits] r3200 - in /packages/unstable/hal/debian: control patches/50_kfreebsd.patch

biebl at users.alioth.debian.org biebl at users.alioth.debian.org
Fri Aug 7 14:33:17 UTC 2009


Author: biebl
Date: Fri Aug  7 14:33:16 2009
New Revision: 3200

URL: http://svn.debian.org/wsvn/pkg-utopia/?sc=1&rev=3200
Log:
More kFreeBSD fixes

- Updated patch 50_kfreebsd.patch by aurel32 so it actually compiles on kFreeBSD
- Add Build-Depends on libusbhid-dev on kFreeBSD

Modified:
    packages/unstable/hal/debian/control
    packages/unstable/hal/debian/patches/50_kfreebsd.patch

Modified: packages/unstable/hal/debian/control
URL: http://svn.debian.org/wsvn/pkg-utopia/packages/unstable/hal/debian/control?rev=3200&op=diff
==============================================================================
--- packages/unstable/hal/debian/control (original)
+++ packages/unstable/hal/debian/control Fri Aug  7 14:33:16 2009
@@ -16,6 +16,7 @@
  doxygen,
  intltool (>= 0.22),
  libusb-dev [!hurd-i386],
+ libusbhid-dev [kfreebsd-amd64 kfreebsd-i386],
  libblkid-dev (>= 2.15),
  xmlto,
  libxml2-utils,

Modified: packages/unstable/hal/debian/patches/50_kfreebsd.patch
URL: http://svn.debian.org/wsvn/pkg-utopia/packages/unstable/hal/debian/patches/50_kfreebsd.patch?rev=3200&op=diff
==============================================================================
--- packages/unstable/hal/debian/patches/50_kfreebsd.patch (original)
+++ packages/unstable/hal/debian/patches/50_kfreebsd.patch Fri Aug  7 14:33:16 2009
@@ -1,5 +1,3 @@
-diff --git a/hald/freebsd/libprobe/Makefile.am b/hald/freebsd/libprobe/Makefile.am
-index 20f8788..f0a8211 100644
 --- a/hald/freebsd/libprobe/Makefile.am
 +++ b/hald/freebsd/libprobe/Makefile.am
 @@ -8,7 +8,7 @@ AM_CPPFLAGS = \
@@ -11,8 +9,6 @@
  endif
  
  libhald_freebsd_probe_la_SOURCES = \
-diff --git a/hald/freebsd/libprobe/Makefile.in b/hald/freebsd/libprobe/Makefile.in
-index 1e04a3c..04b0a83 100644
 --- a/hald/freebsd/libprobe/Makefile.in
 +++ b/hald/freebsd/libprobe/Makefile.in
 @@ -42,15 +42,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -143,3 +139,354 @@
  
  # Tell versions [3.59,3.63) of GNU make to not export all variables.
  # Otherwise a system limit (for SysV at least) may be exceeded.
+--- a/hald/freebsd/probing/Makefile.am
++++ b/hald/freebsd/probing/Makefile.am
+@@ -30,15 +30,15 @@ hald_probe_scsi_LDADD = \
+ 	$(top_builddir)/hald/freebsd/libprobe/libhald_freebsd_probe.la
+ 
+ hald_probe_storage_SOURCES = freebsd_dvd_rw_utils.c freebsd_dvd_rw_utils.h probe-storage.c
+-hald_probe_storage_CPPFLAGS = $(AM_CPPFLAGS) @GLIB_CFLAGS@ @VOLUME_ID_CFLAGS@
++hald_probe_storage_CPPFLAGS = $(AM_CPPFLAGS) @GLIB_CFLAGS@ @BLKID_CFLAGS@
+ hald_probe_storage_LDADD = \
+ 	@GLIB_LIBS@							\
+-	@VOLUME_ID_LIBS@						\
++	@BLKID_LIBS@						\
+ 	$(top_builddir)/hald/freebsd/libprobe/libhald_freebsd_probe.la
+ 
+ hald_probe_volume_SOURCES = freebsd_dvd_rw_utils.c freebsd_dvd_rw_utils.h probe-volume.c
+-hald_probe_volume_CPPFLAGS = $(AM_CPPFLAGS) @GLIB_CFLAGS@ @VOLUME_ID_CFLAGS@
++hald_probe_volume_CPPFLAGS = $(AM_CPPFLAGS) @GLIB_CFLAGS@ @BLKID_CFLAGS@
+ hald_probe_volume_LDADD = \
+ 	@GLIB_LIBS@							\
+-	@VOLUME_ID_LIBS@						\
++	@BLKID_LIBS@						\
+ 	$(top_builddir)/hald/freebsd/libprobe/libhald_freebsd_probe.la
+--- a/hald/freebsd/probing/Makefile.in
++++ b/hald/freebsd/probing/Makefile.in
+@@ -272,17 +272,17 @@
+ 	$(top_builddir)/hald/freebsd/libprobe/libhald_freebsd_probe.la
+ 
+ hald_probe_storage_SOURCES = freebsd_dvd_rw_utils.c freebsd_dvd_rw_utils.h probe-storage.c
+-hald_probe_storage_CPPFLAGS = $(AM_CPPFLAGS) @GLIB_CFLAGS@ @VOLUME_ID_CFLAGS@
++hald_probe_storage_CPPFLAGS = $(AM_CPPFLAGS) @GLIB_CFLAGS@ @BLKID_CFLAGS@
+ hald_probe_storage_LDADD = \
+ 	@GLIB_LIBS@							\
+-	@VOLUME_ID_LIBS@						\
++	@BLKID_LIBS@						\
+ 	$(top_builddir)/hald/freebsd/libprobe/libhald_freebsd_probe.la
+ 
+ hald_probe_volume_SOURCES = freebsd_dvd_rw_utils.c freebsd_dvd_rw_utils.h probe-volume.c
+-hald_probe_volume_CPPFLAGS = $(AM_CPPFLAGS) @GLIB_CFLAGS@ @VOLUME_ID_CFLAGS@
++hald_probe_volume_CPPFLAGS = $(AM_CPPFLAGS) @GLIB_CFLAGS@ @BLKID_CFLAGS@
+ hald_probe_volume_LDADD = \
+ 	@GLIB_LIBS@							\
+-	@VOLUME_ID_LIBS@						\
++	@BLKID_LIBS@						\
+ 	$(top_builddir)/hald/freebsd/libprobe/libhald_freebsd_probe.la
+ 
+ all: all-am
+
+--- hal-0.5.13.orig/hald/freebsd/addons/addon-storage.c
++++ hal-0.5.13/hald/freebsd/addons/addon-storage.c
+@@ -181,10 +181,12 @@
+ static void
+ update_proc_title (const char *device, boolean polling_enabled)
+ {
++#ifndef __GLIBC__
+   if (polling_enabled)
+     setproctitle("%s", device);
+   else
+     setproctitle("no polling on %s because it is explicitly disabled", device);
++#endif
+ }
+ 
+ static DBusHandlerResult
+only in patch2:
+unchanged:
+--- hal-0.5.13.orig/hald/freebsd/probing/probe-storage.c
++++ hal-0.5.13/hald/freebsd/probing/probe-storage.c
+@@ -33,7 +33,7 @@
+ #include <sys/types.h>
+ #include <netinet/in.h>
+ #include <glib.h>
+-#include <libvolume_id.h>
++#include <blkid.h>
+ 
+ #include "libhal/libhal.h"
+ 
+@@ -191,8 +191,10 @@
+   if (! parent)
+     goto end;
+ 
++#ifndef __GLIBC__
+   /* give a meaningful process title for ps(1) */
+   setproctitle("%s", device_file);
++#endif
+ 
+   has_children = hfp_getenv_bool("HF_HAS_CHILDREN");
+   only_check_for_media = hfp_getenv_bool("HF_ONLY_CHECK_FOR_MEDIA");
+@@ -217,16 +219,38 @@
+     }
+   else if (! has_children) /* by definition, if it has children it has no fs */
+     {
+-      struct volume_id *vid;
++      blkid_probe pr;
++      int fd;
+ 
+-      vid = volume_id_open_node(device_file);
+-      if (! vid)
++      fd = open(device_file, O_RDONLY);
++      if (fd < 0)
+ 	goto end;
+ 
+-      if (volume_id_probe_all(vid, 0, 0) == 0 && vid->usage_id == VOLUME_ID_FILESYSTEM)
+-	ret = 2;		/* has a filesystem */
+-
+-      volume_id_close(vid);
++      pr = blkid_new_probe ();
++      if (pr != NULL) 
++        {
++          blkid_probe_set_request (pr, BLKID_PROBREQ_LABEL | BLKID_PROBREQ_UUID |
++                                       BLKID_PROBREQ_TYPE | BLKID_PROBREQ_SECTYPE |
++                                       BLKID_PROBREQ_USAGE | BLKID_PROBREQ_VERSION);
++          if (blkid_probe_set_device (pr, fd, 0, 0) == 0 &&
++              blkid_do_safeprobe (pr) == 0)
++            {
++              const char *usage;
++
++              /* signal to hald that we've found something and a fakevolume
++               * should be added - see hald/linux/blockdev.c:add_blockdev_probing_helper_done()
++               * and hald/linux/blockdev.c:block_rescan_storage_done().
++               */
++              if (blkid_probe_lookup_value (pr, "USAGE", &usage, NULL) == 0 &&
++                  (strcmp (usage, "filesystem") == 0 ||
++                   strcmp (usage, "raid") == 0 ||
++                   strcmp (usage, "other") == 0 ||
++                   strcmp (usage, "crypto") == 0))
++                ret = 2;
++            }
++          blkid_free_probe (pr);
++        }
++      close (fd);
+     }
+ 
+  end:
+--- hal-0.5.13.orig/hald/freebsd/probing/probe-hiddev.c
++++ hal-0.5.13/hald/freebsd/probing/probe-hiddev.c
+@@ -62,8 +62,10 @@
+   if (fd < 0)
+     goto end;
+ 
++#ifndef __GLIBC__
+   /* give a meaningful process title for ps(1) */
+   setproctitle("%s", device_file);
++#endif
+ 
+   if (ioctl(fd, USB_GET_REPORT_ID, &report_id) < 0)
+     goto end;
+only in patch2:
+unchanged:
+--- hal-0.5.13.orig/hald/freebsd/probing/probe-scsi.c
++++ hal-0.5.13/hald/freebsd/probing/probe-scsi.c
+@@ -47,8 +47,10 @@
+   if (! device_file)
+     goto end;
+ 
++#ifndef __GLIBC__
+   /* give a meaningful process title for ps(1) */
+   setproctitle("%s", device_file);
++#endif
+ 
+   /* cam_open_device() fails unless we use O_RDWR */
+   cam = cam_open_device(device_file, O_RDWR);
+--- a/hald/freebsd/probing/probe-volume.c
++++ b/hald/freebsd/probing/probe-volume.c
+@@ -39,7 +39,7 @@
+ #include <sys/types.h>
+ #include <isofs/cd9660/iso.h>
+ #include <glib.h>
+-#include <libvolume_id.h>
++#include <blkid.h>
+ 
+ #include "libhal/libhal.h"
+ 
+@@ -59,7 +59,7 @@
+ };
+ #define ISO_PATH_TABLE_ENTRY_SIZE         8
+ 
+-#if __FreeBSD_version < 600101
++#if (__FreeBSD_version < 600101) && (__FreeBSD_kernel_version < 600101)
+ static uint32_t
+ isonum_731(unsigned char *p)
+ {
+@@ -98,19 +98,20 @@
+ }
+ 
+ static char *
+-hf_probe_volume_get_label (const struct volume_id *vid)
++hf_probe_volume_get_label (const blkid_probe pr)
+ {
+-  char *label = NULL;
++  const char *label;
++  char *volume_label = NULL;
+ 
+-  if (vid && *vid->label)
++  if (blkid_probe_lookup_value(pr, "LABEL", &label, NULL) == 0)
+     {
+-      if (g_utf8_validate(vid->label, -1, NULL))
+-	label = g_strdup(vid->label);
++      if (g_utf8_validate(label, -1, NULL))
++        volume_label = g_strdup(label);
+       else				/* assume ISO8859-1 */
+-	label = g_convert(vid->label, -1, "UTF-8", "ISO8859-1", NULL, NULL, NULL);
++        volume_label = g_convert(label, -1, "UTF-8", "ISO8859-1", NULL, NULL, NULL);
+     }
+ 
+-  return label;
++  return volume_label;
+ }
+ 
+ static void
+@@ -316,7 +317,7 @@
+   char *grandparent_udi;
+   char *parent_drive_type;
+   int fd = -1;
+-  struct volume_id *vid = NULL;
++  blkid_probe pr;
+   int ret = 1;
+   gboolean has_children;
+   gboolean is_swap;
+@@ -326,7 +327,10 @@
+   gboolean has_data = FALSE;
+   gboolean is_blank = FALSE;
+   const char *usage;
+-  char *label;
++  const char *type;
++  const char *type_version;
++  const char *label;
++  const char *uuid;
+   unsigned int sector_size = 0;
+   off_t media_size = 0;
+ 
+@@ -342,7 +346,9 @@
+     goto end;
+ 
+   /* give a meaningful process title for ps(1) */
++#ifndef __GLIBC__
+   setproctitle("%s", device_file);
++#endif
+ 
+   has_children = hfp_getenv_bool("HF_HAS_CHILDREN");
+   is_swap = hfp_getenv_bool("HF_IS_SWAP");
+@@ -379,21 +385,28 @@
+    */
+   if (! has_children && ! (is_cdrom && ! has_data))
+     {
+-      vid = volume_id_open_fd(fd);
+-      if (vid)
+-	{
+-	  if (volume_id_probe_all(vid, 0, media_size) == 0)
+-	    has_data = TRUE;
+-	  else
+-	    {
+-	      volume_id_close(vid);
+-	      vid = NULL;
+-	    }
+-	}
++      pr = blkid_new_probe ();
++      if (pr != NULL) 
++        {
++          int bid_ret;
++
++          blkid_probe_set_request (pr, BLKID_PROBREQ_LABEL | BLKID_PROBREQ_UUID |
++                                       BLKID_PROBREQ_TYPE | BLKID_PROBREQ_SECTYPE |
++                                       BLKID_PROBREQ_USAGE | BLKID_PROBREQ_VERSION);
++
++          bid_ret = blkid_probe_set_device (pr, fd, 0, media_size);
++          if (bid_ret == 0)
++            {
++              bid_ret = blkid_do_safeprobe (pr);
++              hfp_warning ("blkid_do_safeprobe returned an error");
++            }
++          if (bid_ret == 0)
++            has_data = TRUE;
++        }
+     }
+ 
+   if (! has_children && ! is_swap && ! has_audio && ! has_data && ! is_blank)
+-    goto end;
++    goto end_free;
+ 
+   libhal_device_add_capability(hfp_ctx, hfp_udi, "volume", &hfp_error);
+   if (is_cdrom)
+@@ -559,28 +572,24 @@
+     usage = "partitiontable";
+   else if (is_swap)
+     usage = "other";
+-  else
+-    switch (vid ? vid->usage_id : (enum volume_id_usage) -1)
+-      {
+-      case VOLUME_ID_FILESYSTEM:	usage = "filesystem"; break;
+-      case VOLUME_ID_DISKLABEL:		usage = "disklabel"; break;
+-      case VOLUME_ID_OTHER:		usage = "other"; break;
+-      case VOLUME_ID_RAID:		usage = "raid"; break;
+-      case VOLUME_ID_CRYPTO:		usage = "crypto"; break;
+-      case VOLUME_ID_UNUSED:		usage = "unused"; break;
+-      default:				usage = "unknown"; break;
+-      }
+-
++  else if (blkid_probe_lookup_value(pr, "USAGE", &usage, NULL))
++    usage = "";
+   libhal_device_set_property_string(hfp_ctx, hfp_udi, "volume.fsusage", usage, &hfp_error);
+-  libhal_device_set_property_string(hfp_ctx, hfp_udi, "volume.fstype", vid ? vid->type: "", &hfp_error);
+-  if (vid && *vid->type_version)
+-    libhal_device_set_property_string(hfp_ctx, hfp_udi, "volume.fsversion", vid->type_version, &hfp_error);
+ 
+-  label = hf_probe_volume_get_label(vid);
++  if (blkid_probe_lookup_value(pr, "TYPE", &type, NULL))
++    type = "";
++  libhal_device_set_property_string(hfp_ctx, hfp_udi, "volume.fstype", type, &hfp_error);
++  if (blkid_probe_lookup_value(pr, "VERSION", &type, NULL))
++    type_version = "";
++  libhal_device_set_property_string(hfp_ctx, hfp_udi, "volume.fsversion", type_version, &hfp_error);
++
++  label = hf_probe_volume_get_label(pr);
+   libhal_device_set_property_string(hfp_ctx, hfp_udi, "volume.label", label ? label : "", &hfp_error);
+   g_free(label);
+ 
+-  libhal_device_set_property_string(hfp_ctx, hfp_udi, "volume.uuid", vid ? vid->uuid : "", &hfp_error);
++  if (blkid_probe_lookup_value(pr, "UUID", &uuid, NULL))
++    uuid = "";
++  libhal_device_set_property_string(hfp_ctx, hfp_udi, "volume.uuid", uuid, &hfp_error);
+ 
+   ioctl(fd, DIOCGSECTORSIZE, &sector_size);
+ 
+@@ -593,6 +602,9 @@
+ 
+   ret = 0;			/* is a volume */
+ 
++ end_free:
++  blkid_free_probe (pr);
++
+  end:
+   return ret;
+ }
+
+--- a/hald/freebsd/hf-computer.c
++++ b/hald/freebsd/hf-computer.c
+@@ -133,11 +133,11 @@
+   if (PACKAGE_VERSION) {
+       int major, minor, micro;
+ 
+-      hal_device_property_set_string (root, "org.freedesktop.Hal.version", PACKAGE_VERSION);
++      hal_device_property_set_string (device, "org.freedesktop.Hal.version", PACKAGE_VERSION);
+       if ( sscanf( PACKAGE_VERSION, "%d.%d.%d", &major, &minor, &micro ) == 3 ) {
+-	hal_device_property_set_int (root, "org.freedesktop.Hal.version.major", major);
+-        hal_device_property_set_int (root, "org.freedesktop.Hal.version.minor", minor);
+-        hal_device_property_set_int (root, "org.freedesktop.Hal.version.micro", micro);
++        hal_device_property_set_int (device, "org.freedesktop.Hal.version.major", major);
++        hal_device_property_set_int (device, "org.freedesktop.Hal.version.minor", minor);
++        hal_device_property_set_int (device, "org.freedesktop.Hal.version.micro", micro);
+       }
+   }
+ 




More information about the Pkg-utopia-commits mailing list