Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=ffbdceed8a41a06b762a6121e91fbd859a8240c1

commit ffbdceed8a41a06b762a6121e91fbd859a8240c1
Author: Miklos Vajna <vmik...@frugalware.org>
Date:   Mon May 18 00:03:39 2009 +0200

hal-0.5.11-6-i686

- backport move-from-libvolume_id-to-libblkid.patch from git

diff --git a/source/apps/hal/FrugalBuild b/source/apps/hal/FrugalBuild
index d811e5e..d737537 100644
--- a/source/apps/hal/FrugalBuild
+++ b/source/apps/hal/FrugalBuild
@@ -4,10 +4,10 @@

pkgname=hal
pkgver=0.5.11
-pkgrel=5
+pkgrel=6
pkgdesc="Hardware Abstraction Layer"
url="http://www.freedesktop.org/wiki/Software/hal";
-depends=('dbus-glib>=0.74' 'udev>=132' 'glib2' 'libcap' 'dbus>=1.2.12-4' \
+depends=('dbus-glib>=0.74' 'udev>=132' 'util-linux-ng>=2.15' 'glib2' 'libcap' 
'dbus>=1.2.12-4' \
'libusb' 'popt' 'pciutils' 'parted>=1.8.8' 'shadow>=4.0.18.1-2' \
'dmidecode' 'usbutils' 'zlib')
makedepends=('pkgconfig' 'perl-xml-parser' 'intltool' 'gperf')
@@ -22,21 +22,26 @@ 
source=(http://hal.freedesktop.org/releases/$pkgname-$pkgver.tar.gz \
ntfs-3g.patch \
suspend_hibernate.patch \
hal-performance_pci.ids_v5.diff \
-       hal.conf.patch newer-udev.patch)
+       hal.conf.patch newer-udev.patch \
+       move-from-libvolume_id-to-libblkid.patch)
sha1sums=('f51366229e5dd6d5d72d60114fdef76bf5feba26' \
'bd113f345e7b2671764c8dfb2ed41301fcf42e41' \
'2273e77c0c3c52aca31294b2b1a829937d0a3c18' \
'2fab4fd75f1359b0838748dfae4d749eb26b64b9' \
'654235977c83f76433f9737f37b8a18f04136b35' \
'9d7ea8f348b2de6aa1bf42cf0cb7ab2b19a03bd2' \
-          'f99e64227cf66f2eee6ed852542db7b5cb038299')
+          'f99e64227cf66f2eee6ed852542db7b5cb038299' \
+          '8c40f44c189b36cecc5fce79e4f47d4d0eaf8ccd')

build()
{
Fcd
Fpatchall
rm hal.conf || Fdie
-       autoconf || Fdie
+       autoconf || return 1
+       # hack to avoid automake
+       Fsed '@VOLUME_ID_CFLAGS@' '@BLKID_CFLAGS@' 
hald/linux/probing/Makefile.in
+       Fsed '@VOLUME_ID_LIBS@' '@BLKID_LIBS@' hald/linux/probing/Makefile.in
Fconf \
--with-pid-file=/var/run/hald.pid \
--with-hal-user=hald \
diff --git a/source/apps/hal/move-from-libvolume_id-to-libblkid.patch 
b/source/apps/hal/move-from-libvolume_id-to-libblkid.patch
new file mode 100644
index 0000000..d7797ab
--- /dev/null
+++ b/source/apps/hal/move-from-libvolume_id-to-libblkid.patch
@@ -0,0 +1,356 @@
+From 1444b321105c0fd3f870076c5cdad2ba67fdb7f0 Mon Sep 17 00:00:00 2001
+From: Kay Sievers <kay.siev...@vrfy.org>
+Date: Sun, 10 May 2009 21:11:57 +0200
+Subject: [PATCH] move from libvolume_id to libblkid
+
+Current udev does not build libvolume_id any more. udev's volume_id and old
+e2fsprog's libblkid were merged into current util-linux' libblkid. All
+applications are now expected to use that one.
+---
+ configure.in                       |   10 ++--
+ hald/linux/probing/Makefile.am     |    2 +-
+ hald/linux/probing/probe-storage.c |   44 +++++++------------
+ hald/linux/probing/probe-volume.c  |   81 +++++++++++++++++-------------------
+ hald/logger.c                      |    2 +-
+ tools/hal-storage-mount.c          |    2 +-
+ 6 files changed, 62 insertions(+), 79 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index e76ff51..5b223cd 100644
+--- a/configure.in
++++ b/configure.in
+@@ -13,7 +13,7 @@ AM_MAINTAINER_MODE
+
+ glib_module="glib-2.0 >= 2.10.0 gobject-2.0 > 2.10.0 dbus-glib-1 >= 0.61"
+ dbus_module="dbus-1 >= 0.61"
+-volume_id_module="libvolume_id >= 0.77"
++blkid_module="blkid >= 1.43"
+ polkit_module="polkit >= 0.5"
+
+ # libtool versioning - this applies to libhal and libhal-storage
+@@ -640,14 +640,14 @@ else
+ fi
+ AC_MSG_RESULT($have_glib_2_14)
+
+-# volume_id
++# blkid
+ case "$host" in
+ *-*-solaris*)
+       ;;
+ *)
+-      PKG_CHECK_MODULES(VOLUME_ID, [$volume_id_module])
+-      AC_SUBST(VOLUME_ID_CFLAGS)
+-      AC_SUBST(VOLUME_ID_LIBS)
++      PKG_CHECK_MODULES(BLKID, [$blkid_module])
++      AC_SUBST(BLKID_CFLAGS)
++      AC_SUBST(BLKID_LIBS)
+ esac
+
+ # OS specific libs
+diff --git a/hald/linux/probing/Makefile.am b/hald/linux/probing/Makefile.am
+index 274b870..57c1f0b 100644
+--- a/hald/linux/probing/Makefile.am
++++ b/hald/linux/probing/Makefile.am
+@@ -6,7 +6,7 @@ AM_CPPFLAGS = \
+       -DPACKAGE_LOCALE_DIR=\""$(localedir)"\" \
+       -DPACKAGE_LOCALSTATEDIR=\""$(localstatedir)"\" \
+       -I$(top_srcdir) \
+-      @GLIB_CFLAGS@ @DBUS_CFLAGS@ @VOLUME_ID_CFLAGS@
++      @GLIB_CFLAGS@ @DBUS_CFLAGS@ @BLKID_CFLAGS@
+
+ if HALD_COMPILE_LINUX
+ libexec_PROGRAMS =                    \
+diff --git a/hald/linux/probing/probe-storage.c 
b/hald/linux/probing/probe-storage.c
+index f13d015..9c9684b 100644
+--- a/hald/linux/probing/probe-storage.c
++++ b/hald/linux/probing/probe-storage.c
+@@ -43,7 +43,7 @@
+ #include <unistd.h>
+
+ #include <glib.h>
+-#include <libvolume_id.h>
++#include <blkid.h>
+
+ #include "libhal/libhal.h"
+ #include "partutil/partutil.h"
+@@ -51,18 +51,6 @@
+
+ #include "../../logger.h"
+
+-static void vid_log(int priority, const char *file, int line, const char 
*format, ...)
+-{
+-      char log_str[1024];
+-      va_list args;
+-
+-      va_start(args, format);
+-      vsnprintf(log_str, sizeof(log_str), format, args);
+-      logger_forward_debug("%s:%i %s\n", file, line, log_str);
+-      va_end(args);
+-}
+-
+-
+ /** Check if a filesystem on a special device file is mounted
+  *
+  *  @param  device_file         Special device file, e.g. /dev/cdrom
+@@ -115,9 +103,6 @@ main (int argc, char *argv[])
+
+       fd = -1;
+
+-      /* hook in our debug into libvolume_id */
+-      volume_id_log_fn = vid_log;
+-
+         fprintf (stderr, "woohoo\n");
+
+       /* assume failure */
+@@ -397,7 +382,7 @@ main (int argc, char *argv[])
+               close (fd);
+         HAL_DEBUG (("PROBE CLOSED LOCK ON CDROM"));
+       } else {
+-              struct volume_id *vid;
++              blkid_probe pr;
+               GDir *dir;
+               const gchar *partition;
+               const gchar *main_device;
+@@ -467,25 +452,28 @@ main (int argc, char *argv[])
+               libhal_changeset_set_property_string (cs, 
"storage.partitioning_scheme", "none");
+
+               /* probe for file system */
+-              vid = volume_id_open_fd (fd);
+-              if (vid != NULL) {
+-                      if (volume_id_probe_all (vid, 0, size) == 0) {
++              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, size) == 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 (volume_id_get_usage(vid, &usage) &&
+-                                  ( strcmp(usage, "filesystem") == 0 ||
+-                                    strcmp(usage, "raid") == 0 ||
+-                                    strcmp(usage, "other") == 0 ||
+-                                    strcmp(usage, "crypto") == 0))
++                              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;
+-                      } else {
+-                              ;
+                       }
+-                      volume_id_close(vid);
++                      blkid_free_probe (pr);
+               }
+               close (fd);
+       }
+diff --git a/hald/linux/probing/probe-volume.c 
b/hald/linux/probing/probe-volume.c
+index 4293e90..f28d709 100644
+--- a/hald/linux/probing/probe-volume.c
++++ b/hald/linux/probing/probe-volume.c
+@@ -42,24 +42,13 @@
+ #include <signal.h>
+
+ #include <glib.h>
+-#include <libvolume_id.h>
++#include <blkid.h>
+
+ #include "libhal/libhal.h"
+ #include "partutil/partutil.h"
+ #include "linux_dvd_rw_utils.h"
+ #include "../../logger.h"
+
+-static void vid_log(int priority, const char *file, int line, const char 
*format, ...)
+-{
+-      char log_str[1024];
+-      va_list args;
+-
+-      va_start(args, format);
+-      vsnprintf(log_str, sizeof(log_str), format, args);
+-      logger_forward_debug("%s:%i %s\n", file, line, log_str);
+-      va_end(args);
+-}
+-
+ static gchar *
+ strdup_valid_utf8 (const char *str)
+ {
+@@ -89,7 +78,7 @@ strdup_valid_utf8 (const char *str)
+
+
+ static void
+-set_volume_id_values (LibHalChangeSet *cs, struct volume_id *vid)
++set_blkid_values (LibHalChangeSet *cs, blkid_probe pr)
+ {
+       char buf[256];
+       const char *usage;
+@@ -101,28 +90,28 @@ set_volume_id_values (LibHalChangeSet *cs, struct 
volume_id *vid)
+
+       dbus_error_init (&error);
+
+-      if (!volume_id_get_usage(vid, &usage))
++      if (blkid_probe_lookup_value(pr, "USAGE", &usage, NULL))
+               usage = "";
+       libhal_changeset_set_property_string (cs, "volume.fsusage", usage);
+       HAL_DEBUG (("volume.fsusage = '%s'", usage));
+
+-      if (!volume_id_get_type(vid, &type))
++      if (blkid_probe_lookup_value(pr, "TYPE", &type, NULL))
+               type = "";
+-      if (!libhal_changeset_set_property_string (cs, "volume.fstype", type))
++      if (libhal_changeset_set_property_string (cs, "volume.fstype", type))
+               libhal_changeset_set_property_string (cs, "volume.fstype", "");
+       HAL_DEBUG(("volume.fstype = '%s'", type));
+
+-      if (!volume_id_get_type_version(vid, &type_version))
++      if (blkid_probe_lookup_value(pr, "VERSION", &type_version, NULL))
+               type_version = "";
+       libhal_changeset_set_property_string (cs, "volume.fsversion", 
type_version);
+       HAL_DEBUG(("volume.fsversion = '%s'", type_version));
+
+-      if (!volume_id_get_uuid(vid, &uuid))
++      if (blkid_probe_lookup_value(pr, "UUID", &uuid, NULL))
+               uuid = "";
+       libhal_changeset_set_property_string (cs, "volume.uuid", uuid);
+       HAL_DEBUG(("volume.uuid = '%s'", uuid));
+
+-      if (!volume_id_get_label(vid, &label))
++      if (blkid_probe_lookup_value(pr, "LABEL", &label, NULL))
+               label = "";
+
+       if (label[0] != '\0') {
+@@ -311,7 +300,7 @@ main (int argc, char *argv[])
+       LibHalContext *ctx = NULL;
+       DBusError error;
+       char *parent_udi;
+-      struct volume_id *vid;
++      blkid_probe pr;
+       char *stordev_dev_file;
+       char *partition_number_str;
+       char *partition_start_str;
+@@ -330,9 +319,6 @@ main (int argc, char *argv[])
+       cs = NULL;
+       disc_may_have_data = FALSE;
+
+-      /* hook in our debug into libvolume_id */
+-      volume_id_log_fn = vid_log;
+-
+       setup_logger ();
+
+       /* assume failure */
+@@ -615,23 +601,33 @@ main (int argc, char *argv[])
+               }
+
+               /* probe for file system */
+-              vid = volume_id_open_fd (fd);
+-              if (vid != NULL) {
+-                      int vid_ret;
+-                      HAL_INFO (("invoking volume_id_probe_all, offset=%d, 
size=%d", vol_probe_offset, vol_size));
+-                      vid_ret = volume_id_probe_all (vid, vol_probe_offset, 
vol_size);
+-                      HAL_INFO (("volume_id_probe_all returned %d", vid_ret));
+-
+-                      if (vid_ret != 0 && is_disc && vol_probe_offset != 0) {
++              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);
++
++                      HAL_INFO (("invoking blkid_do_safeprobe, offset=%d, 
size=%d", vol_probe_offset, vol_size));
++                      bid_ret = blkid_probe_set_device (pr, fd, 
vol_probe_offset, vol_size);
++                      if (bid_ret == 0) {
++                              bid_ret = blkid_do_safeprobe (pr);
++                              HAL_INFO (("blkid_do_safeprobe returned %d", 
bid_ret));
++                      }
++
++                      if (bid_ret != 0 && is_disc && vol_probe_offset != 0) {
+                               /* Some cd-rom drives report the offset of the 
session in the cd's TOC
+                                * wrong.  Fallback to probing at offset 0, 
just to be sure */
+-                              HAL_INFO (("invoking volume_id_probe_all, 
offset=0, size=%d", vol_size));
+-                              vid_ret = volume_id_probe_all (vid, 0 , 
vol_size);
+-                              HAL_INFO (("volume_id_probe_all returned %d", 
vid_ret));
++                              HAL_INFO (("invoking blkid_do_safeprobe, 
offset=0, size=%d", vol_size));
++                              bid_ret = blkid_probe_set_device (pr, fd, 0, 
vol_size);
++                              if (bid_ret == 0)
++                                      bid_ret = blkid_do_safeprobe (pr);
++                              HAL_INFO (("blkid_do_safeprobe returned %d", 
bid_ret));
+                       }
+
+-                      if (vid_ret == 0) {
+-                              set_volume_id_values(cs, vid);
++                      if (bid_ret == 0) {
++                              set_blkid_values(cs, pr);
+                               if (disc_may_have_data) {
+                                       libhal_changeset_set_property_bool (cs, 
"volume.disc.is_blank", FALSE);
+                                       libhal_changeset_set_property_bool (cs, 
"volume.disc.has_data", TRUE);
+@@ -647,7 +643,7 @@ main (int argc, char *argv[])
+                        *  this is good enough for now... the only discs I 
know of that does this
+                        *  is in fact Apple's install disc.)
+                        */
+-                      if (vid_ret != 0 && is_disc) {
++                      if (bid_ret != 0 && is_disc) {
+                               PartitionTable *p;
+                               p = part_table_load_from_disk 
(stordev_dev_file);
+                               if (p != NULL) {
+@@ -665,11 +661,10 @@ main (int argc, char *argv[])
+                                                       guint64 part_offset;
+
+                                                       part_offset = 
part_table_entry_get_offset (p, i);
+-                                                      if (volume_id_probe_all 
(
+-                                                                  vid, 
vol_probe_offset + part_offset, 0) == 0) {
+-
+-                                                              
set_volume_id_values(cs, vid);
+-                                                      }
++                                                      if 
(blkid_probe_set_device (pr, fd,
++                                                                              
vol_probe_offset + part_offset, 0) == 0 &&
++                                                                      
blkid_do_safeprobe (pr) == 0)
++                                                              
set_blkid_values(cs, pr);
+
+                                                       /* and we're done */
+                                                       break;
+@@ -683,7 +678,7 @@ main (int argc, char *argv[])
+                               }
+                       }
+
+-                      volume_id_close(vid);
++                      blkid_free_probe (pr);
+               }
+
+               /* get partition type number, if we find a msdos partition 
table */
+diff --git a/hald/logger.c b/hald/logger.c
+index a2d04b5..6ee1757 100644
+--- a/hald/logger.c
++++ b/hald/logger.c
+@@ -222,7 +222,7 @@ logger_emit (const char *format, ...)
+  *  @format:             Message format string, printf style
+  *  @...:                Parameters for message, printf style
+  *
+- * Forward debug messages as e.g. from udev/libvolume_id.
++ * Forward debug messages
+  */
+ void
+ logger_forward_debug (const char *format, ...)
+diff --git a/tools/hal-storage-mount.c b/tools/hal-storage-mount.c
+index 3fa59f6..3003dff 100644
+--- a/tools/hal-storage-mount.c
++++ b/tools/hal-storage-mount.c
+@@ -417,7 +417,7 @@ device_is_mounted (const char *device, char **mount_point)
+       return ret;
+ }
+
+-/* maps volume_id fs types to the appropriate -t mount option */
++/* maps blkid fs types to the appropriate -t mount option */
+ static const char *
+ map_fstype (const char *fstype)
+ {
+--
+1.6.2
+
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to