summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059>2009-09-26 16:01:28 +0800
committermarcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059>2009-09-26 16:01:28 +0800
commit00ed237c926daf750c0679520c804d018ff53f3c (patch)
treeeb3f2cdb639c9f49ef0a44b43fe4dfa37a9696de
parent6a347d629d5af4011637a9db51368e0e1b20ecc9 (diff)
downloadmarcuscom-ports-00ed237c926daf750c0679520c804d018ff53f3c.tar
marcuscom-ports-00ed237c926daf750c0679520c804d018ff53f3c.tar.gz
marcuscom-ports-00ed237c926daf750c0679520c804d018ff53f3c.tar.bz2
marcuscom-ports-00ed237c926daf750c0679520c804d018ff53f3c.tar.lz
marcuscom-ports-00ed237c926daf750c0679520c804d018ff53f3c.tar.xz
marcuscom-ports-00ed237c926daf750c0679520c804d018ff53f3c.tar.zst
marcuscom-ports-00ed237c926daf750c0679520c804d018ff53f3c.zip
Another day, another hal patch.
Attempt to workaround the GEOM lock race by sleeping half of a second when a DESTROY event is seen by the storage subsystem. Additionally, protect against kern.geom.conftxt returning NULL. When this happens, all disks would get removed, and that's bad. Fix a bug in the volume probing code which could lead to an assert crash. Fix a bug in the volume probing code when it comes to handling UFS IDs. git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@13027 df743ca5-7f9a-e211-a948-0013205c9059
-rw-r--r--sysutils/hal/Makefile4
-rw-r--r--sysutils/hal/files/patch-hald_freebsd_probing_probe-volume.c8
-rw-r--r--sysutils/hal/files/patch-hald_hf-storage.c27
3 files changed, 24 insertions, 15 deletions
diff --git a/sysutils/hal/Makefile b/sysutils/hal/Makefile
index 42d269608..c1ed98e7a 100644
--- a/sysutils/hal/Makefile
+++ b/sysutils/hal/Makefile
@@ -3,12 +3,12 @@
# Whom: Joe Marcus Clarke <marcus@FreeBSD.org>
#
# $FreeBSD$
-# $MCom: ports/sysutils/hal/Makefile,v 1.65 2009/09/19 06:09:44 marcus Exp $
+# $MCom: ports/sysutils/hal/Makefile,v 1.66 2009/09/22 05:59:43 marcus Exp $
#
PORTNAME= hal
DISTVERSION= 0.5.13
-PORTREVISION= 7
+PORTREVISION= 8
CATEGORIES= sysutils
MASTER_SITES= http://hal.freedesktop.org/releases/
diff --git a/sysutils/hal/files/patch-hald_freebsd_probing_probe-volume.c b/sysutils/hal/files/patch-hald_freebsd_probing_probe-volume.c
index e933e3344..c92b70266 100644
--- a/sysutils/hal/files/patch-hald_freebsd_probing_probe-volume.c
+++ b/sysutils/hal/files/patch-hald_freebsd_probing_probe-volume.c
@@ -1,5 +1,5 @@
--- hald/freebsd/probing/probe-volume.c.orig 2008-08-10 09:50:10.000000000 -0400
-+++ hald/freebsd/probing/probe-volume.c 2009-08-19 17:00:14.000000000 -0400
++++ hald/freebsd/probing/probe-volume.c 2009-09-26 03:54:16.000000000 -0400
@@ -36,7 +36,12 @@
#include <sys/disk.h>
#include <sys/cdio.h>
@@ -23,7 +23,7 @@
hf_probe_volume_advanced_disc_detect(fd);
}
else
-@@ -555,6 +561,46 @@ main (int argc, char **argv)
+@@ -555,6 +561,48 @@ main (int argc, char **argv)
libhal_device_set_property_bool(hfp_ctx, hfp_udi, "volume.ignore", has_children || is_swap, &hfp_error);
@@ -40,6 +40,7 @@
+
+ snprintf(ufsid, sizeof(ufsid), "%08x%08x", ufsdisk.d_fs.fs_id[0], ufsdisk.d_fs.fs_id[1]);
+ libhal_device_set_property_string(hfp_ctx, hfp_udi, "volume.freebsd.ufsid", ufsid, &hfp_error);
++ dbus_error_free(&hfp_error);
+ ufs_devs = libhal_manager_find_device_string_match(hfp_ctx,
+ "volume.freebsd.ufsid",
+ ufsid,
@@ -48,7 +49,7 @@
+ dbus_error_free(&hfp_error);
+ for (i = 0; i < num_udis; i++)
+ {
-+ if (ufs_devs[i] != NULL)
++ if (ufs_devs[i] != NULL && strcmp(ufs_devs[i], hfp_udi))
+ {
+ gboolean mounted;
+
@@ -58,6 +59,7 @@
+ {
+ libhal_device_set_property_bool(hfp_ctx, hfp_udi, "volume.ignore", TRUE, &hfp_error);
+ dbus_error_free(&hfp_error);
++ break;
+ }
+ }
+ }
diff --git a/sysutils/hal/files/patch-hald_hf-storage.c b/sysutils/hal/files/patch-hald_hf-storage.c
index 17570163d..65440e796 100644
--- a/sysutils/hal/files/patch-hald_hf-storage.c
+++ b/sysutils/hal/files/patch-hald_hf-storage.c
@@ -1,5 +1,5 @@
--- hald/freebsd/hf-storage.c.orig 2009-05-12 08:24:28.000000000 -0400
-+++ hald/freebsd/hf-storage.c 2009-09-22 01:53:29.000000000 -0400
++++ hald/freebsd/hf-storage.c 2009-09-26 03:51:08.000000000 -0400
@@ -30,6 +30,8 @@
#include <limits.h>
#include <inttypes.h>
@@ -114,7 +114,7 @@
else
geom_obj->type = atoi(fields[10]);
}
-@@ -541,15 +579,20 @@ hf_storage_device_rescan_real (HalDevice
+@@ -541,17 +579,27 @@ hf_storage_device_rescan_real (HalDevice
}
static gboolean
@@ -135,10 +135,17 @@
+ if (! data || strcmp(system, "DEVFS") || strcmp(subsystem, "CDEV") ||
+ (strcmp(type, "CREATE") && strcmp(type, "DESTROY")))
+ return FALSE;
++
++ if (! strcmp(type, "DESTROY"))
++ g_usleep(G_USEC_PER_SEC/2);
conftxt = hf_get_string_sysctl(NULL, "kern.geom.conftxt");
++ if (! conftxt)
++ return FALSE;
new_disks = hf_storage_parse_conftxt(conftxt);
-@@ -572,6 +615,7 @@ hf_storage_conftxt_timeout_cb (gpointer
+ g_free(conftxt);
+
+@@ -572,6 +620,7 @@ hf_storage_conftxt_timeout_cb (gpointer
if (! hf_storage_find_disk(disks, disk->name))
{
osspec_probe(); /* catch new disk(s) */
@@ -146,7 +153,7 @@
break;
}
}
-@@ -593,7 +637,10 @@ hf_storage_conftxt_timeout_cb (gpointer
+@@ -593,7 +642,10 @@ hf_storage_conftxt_timeout_cb (gpointer
device = hf_devtree_find_from_name(hald_get_gdl(), disk->name);
if (device && hal_device_has_capability(device, "storage") &&
! hf_storage_device_has_addon(device))
@@ -158,7 +165,7 @@
}
}
else
-@@ -601,7 +648,10 @@ hf_storage_conftxt_timeout_cb (gpointer
+@@ -601,7 +653,10 @@ hf_storage_conftxt_timeout_cb (gpointer
/* disk removed */
device = hf_devtree_find_from_name(hald_get_gdl(), disk->name);
if (device && hal_device_has_capability(device, "storage"))
@@ -170,7 +177,7 @@
}
}
}
-@@ -610,17 +660,30 @@ hf_storage_conftxt_timeout_cb (gpointer
+@@ -610,17 +665,30 @@ hf_storage_conftxt_timeout_cb (gpointer
g_slist_free(disks);
disks = new_disks;
@@ -203,7 +210,7 @@
return;
conftxt = hf_get_string_sysctl(NULL, "kern.geom.conftxt");
-@@ -636,8 +699,10 @@ hf_storage_init_geom (void)
+@@ -636,8 +704,10 @@ hf_storage_init_geom (void)
static void
hf_storage_init (void)
{
@@ -215,7 +222,7 @@
}
void
-@@ -719,8 +784,6 @@ hf_storage_device_add (HalDevice *device
+@@ -719,8 +789,6 @@ hf_storage_device_add (HalDevice *device
{
g_return_if_fail(HAL_IS_DEVICE(device));
@@ -224,7 +231,7 @@
if (hf_device_preprobe(device))
{
hf_storage_device_probe(device, FALSE);
-@@ -738,7 +801,7 @@ hf_storage_get_geoms (const char *devnam
+@@ -738,7 +806,7 @@ hf_storage_get_geoms (const char *devnam
g_return_val_if_fail(devname != NULL, NULL);
@@ -233,7 +240,7 @@
hash = g_str_hash(devname);
node = g_node_find(hf_storage_geom_tree, G_PRE_ORDER, G_TRAVERSE_ALL,
-@@ -801,3 +864,7 @@ HFHandler hf_storage_handler = {
+@@ -801,3 +869,7 @@ HFHandler hf_storage_handler = {
.probe = hf_storage_probe,
.device_rescan = hf_storage_device_rescan
};