Add a patch for scsi devices with no parents. This should fix the "hald won't start...
authorStephen Klimaszewski <steev@gentoo.org>
Fri, 30 Mar 2007 23:25:44 +0000 (23:25 +0000)
committerStephen Klimaszewski <steev@gentoo.org>
Fri, 30 Mar 2007 23:25:44 +0000 (23:25 +0000)
Package-Manager: portage-2.1.2.3

sys-apps/hal/ChangeLog
sys-apps/hal/Manifest
sys-apps/hal/files/fix-scsi-fake-host-event.patch [new file with mode: 0644]
sys-apps/hal/hal-0.5.9_rc2.ebuild

index c0f5e5b6cd90e1689f8b19182110d38736dab4dc..94f37c0587e9e5d5fa40c627fa738377e1d7b546 100644 (file)
@@ -1,6 +1,11 @@
 # ChangeLog for sys-apps/hal
 # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/hal/ChangeLog,v 1.136 2007/03/30 14:37:01 cardoe Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/hal/ChangeLog,v 1.137 2007/03/30 23:25:44 steev Exp $
+
+  30 Mar 2007; Steev Klimaszewski <steev@gentoo.org>
+  +files/fix-scsi-fake-host-event.patch, hal-0.5.9_rc2.ebuild:
+  Patch for scsi devices that don't have parents... this will fix the "hald
+  won't start" errors.
 
   30 Mar 2007; Doug Goldstein <cardoe@gentoo.org> metadata.xml,
   -hal-0.5.7-r3.ebuild, -hal-0.5.7.1-r4.ebuild:
index dfe36c41947e2385c0d4dd0c6c50f3b476d348d7..9a18fee92495841e271e2e414283b0e1bb85cc85 100644 (file)
@@ -1,10 +1,11 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
 AUX 0.5-hald.rc 681 RMD160 f94d4a6e4ffb3beb84eeeb8e25564fa566ecc493 SHA1 fe413a84ee58cefa923cbc922a1c961fbdb17aa6 SHA256 802f83998c50a3e030d1db2f5a8364e4bb10eebecd464683445d63cf56702161
 MD5 facf81eeca7ebddff5d030acb36de31d files/0.5-hald.rc 681
 RMD160 f94d4a6e4ffb3beb84eeeb8e25564fa566ecc493 files/0.5-hald.rc 681
 SHA256 802f83998c50a3e030d1db2f5a8364e4bb10eebecd464683445d63cf56702161 files/0.5-hald.rc 681
+AUX fix-scsi-fake-host-event.patch 3108 RMD160 2bda406fcb2dd92c348781a6c0958d40c79d78ea SHA1 af1d5c9a2cde091bd7abe04ed5e91a4bb815b675 SHA256 199749c188e5fb4858e4c1dac8800525377daf6a680dcd13e7096e71266ed05d
+MD5 3b6df9a24978d931781dc029c85288a9 files/fix-scsi-fake-host-event.patch 3108
+RMD160 2bda406fcb2dd92c348781a6c0958d40c79d78ea files/fix-scsi-fake-host-event.patch 3108
+SHA256 199749c188e5fb4858e4c1dac8800525377daf6a680dcd13e7096e71266ed05d files/fix-scsi-fake-host-event.patch 3108
 AUX hal-0.5.1-old_storage_policy.patch 856 RMD160 d73708510cbfebc897fe20070e3c6997559f8296 SHA1 9fb9facb27e381fb27c0658de3482c8aa0754c40 SHA256 6ea5cd467e1b7b34308c9ecc0eaf2442a3272b7c02ef75d7c0af16566e523cc2
 MD5 25cb64ec27a48a80126b6de5ff6c3340 files/hal-0.5.1-old_storage_policy.patch 856
 RMD160 d73708510cbfebc897fe20070e3c6997559f8296 files/hal-0.5.1-old_storage_policy.patch 856
@@ -115,14 +116,14 @@ EBUILD hal-0.5.7.1-r5.ebuild 6426 RMD160 ba28bce7126639c77de28ac2fc8d233475bb498
 MD5 709ca20b11819f2e13e381be47e19535 hal-0.5.7.1-r5.ebuild 6426
 RMD160 ba28bce7126639c77de28ac2fc8d233475bb498e hal-0.5.7.1-r5.ebuild 6426
 SHA256 6e020d3a29d82b993984f58ab8ef3659d837c11bce25f3ad25df6f4748e11207 hal-0.5.7.1-r5.ebuild 6426
-EBUILD hal-0.5.9_rc2.ebuild 5195 RMD160 e0e1e1cd12c64102e528f390c291530e6280131d SHA1 8a9e79596769821b5ab6238b2b8d3abc6b245d6b SHA256 a8d52c6d4e07b162655490369d25f5fa2dc2d6403a03a612bbed4a61602b5e9a
-MD5 4ed743184af0b3303b3cd6c8987f483a hal-0.5.9_rc2.ebuild 5195
-RMD160 e0e1e1cd12c64102e528f390c291530e6280131d hal-0.5.9_rc2.ebuild 5195
-SHA256 a8d52c6d4e07b162655490369d25f5fa2dc2d6403a03a612bbed4a61602b5e9a hal-0.5.9_rc2.ebuild 5195
-MISC ChangeLog 20777 RMD160 d35166a50e4cff52afcbd621d2a6928f9796df65 SHA1 59e98b0de2615686f627cf994c2b509b5d8d8f52 SHA256 f8fb48aeec7b7d87dac80a87bca172f9969b15a77b9e546e758a7bad7ca65b41
-MD5 2bd40b7a88cec6afaf108e6d973e6280 ChangeLog 20777
-RMD160 d35166a50e4cff52afcbd621d2a6928f9796df65 ChangeLog 20777
-SHA256 f8fb48aeec7b7d87dac80a87bca172f9969b15a77b9e546e758a7bad7ca65b41 ChangeLog 20777
+EBUILD hal-0.5.9_rc2.ebuild 5246 RMD160 0e9aa04e4894e452d002cec7532fda31d024085e SHA1 b1375f9d93f2585b7986d0de7c7ffe1d53716a02 SHA256 453768e5bcb268b3913850dc4901795d78358c7d986bedd17f331da5b1ae15da
+MD5 9fcd878332741eccc43d7595e91f6923 hal-0.5.9_rc2.ebuild 5246
+RMD160 0e9aa04e4894e452d002cec7532fda31d024085e hal-0.5.9_rc2.ebuild 5246
+SHA256 453768e5bcb268b3913850dc4901795d78358c7d986bedd17f331da5b1ae15da hal-0.5.9_rc2.ebuild 5246
+MISC ChangeLog 20992 RMD160 c7680675e8881033eb9614d8fc7d6a482f5ababe SHA1 b72bbfc7b4fc5acbe78eafb14a5517f64bf84998 SHA256 14d9b0f746853d9666dffec1bfe2e3f0bf978992e9e8cd3e441e2becb9a73b4d
+MD5 3059c5ab7e07a333a04dc077d5a4c0a9 ChangeLog 20992
+RMD160 c7680675e8881033eb9614d8fc7d6a482f5ababe ChangeLog 20992
+SHA256 14d9b0f746853d9666dffec1bfe2e3f0bf978992e9e8cd3e441e2becb9a73b4d ChangeLog 20992
 MISC metadata.xml 345 RMD160 aa6e810e9546542453ebe5d6ca46804e99f447f2 SHA1 fef829210e8555807f9b69ba5afedffb8af8d02c SHA256 0c9aeabf473a6836c25a5db2ca86b880dec1efa9e52310725e08d1e0df93447d
 MD5 3317c4000387b670183d305ef9937b75 metadata.xml 345
 RMD160 aa6e810e9546542453ebe5d6ca46804e99f447f2 metadata.xml 345
@@ -136,10 +137,3 @@ SHA256 6fede189bf70fa0a1009bcefea0a23a8941a051256e7fafc16793324db3c61c0 files/di
 MD5 39710d0d56c5beb18d67b2845c19cc0a files/digest-hal-0.5.9_rc2 244
 RMD160 f540b0fa0b03dcb17a1cf39caa83e3d67c1fabf1 files/digest-hal-0.5.9_rc2 244
 SHA256 15c93494f0692b662024325758c82c96451ab4255eaa77ae67b5417457effda3 files/digest-hal-0.5.9_rc2 244
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.3 (GNU/Linux)
-
-iD8DBQFGDSBcoeSe8B0zEfwRAkxnAJ0RpviIga2LcOGadTxDg5+nsB+NPgCfSLzU
-863cgoTQsSmhYKWkdDfF1Y0=
-=XdPp
------END PGP SIGNATURE-----
diff --git a/sys-apps/hal/files/fix-scsi-fake-host-event.patch b/sys-apps/hal/files/fix-scsi-fake-host-event.patch
new file mode 100644 (file)
index 0000000..8101a78
--- /dev/null
@@ -0,0 +1,107 @@
+diff --git a/hald/linux/device.c b/hald/linux/device.c
+index d109e9b..1211535 100644
+--- a/hald/linux/device.c
++++ b/hald/linux/device.c
+@@ -533,27 +533,52 @@ missing_scsi_host (const gchar *sysfs_pa
+       gchar path[HAL_PATH_MAX];
+       HalDevice *d;
+       HotplugEvent *host_event;
++      const gchar *last_elem;
++      gint host_num, bus_num, target_num, lun_num;
++      int max;
++      gint num = -1;
+       int rc = FALSE;
+-      g_strlcpy(path, sysfs_path, sizeof(path));
+-      /* skip device */
+-      if (!hal_util_path_ascend (path))
++      /* catch only scsi-devices */
++      last_elem = hal_util_get_last_element (sysfs_path);
++      if (sscanf (last_elem, "%d:%d:%d:%d", &host_num, &bus_num, &target_num, &lun_num) != 4)
+               goto out;
+-      /* skip target */
+-      if (!hal_util_path_ascend (path))
++
++      /* avoid loops */
++      if (device_event->reposted)
+               goto out;
+-      if (strstr (path, "/host") == NULL)
++
++      /* search devpath for missing host */
++      g_strlcpy(path, sysfs_path, sizeof(path));
++      max = 100;
++      while (max--) {
++              if (!hal_util_path_ascend (path))
++                      goto out;
++
++              last_elem = hal_util_get_last_element (path);
++              if (sscanf (last_elem, "host%d", &num) == 1)
++                      break;
++      }
++
++      /* the device must belong to this host */
++      if (host_num != num)
+               goto out;
++      /* look if host is present */
+       d = hal_device_store_match_key_value_string (hald_get_gdl (),
+                                                    "linux.sysfs_path",
+                                                    path);
++
++      /* skip "add" if host is already created */
+       if (action == HOTPLUG_ACTION_ADD && d != NULL)
+               goto out;
++
++      /* skip "remove" if host does not exist */
+       if (action == HOTPLUG_ACTION_REMOVE && d == NULL)
+               goto out;
+-      rc = TRUE;
++      /* fake host event */
++      rc = TRUE;
+       host_event = g_new0 (HotplugEvent, 1);
+       host_event->action = action;
+       host_event->type = HOTPLUG_EVENT_SYSFS_DEVICE;
+@@ -561,15 +586,17 @@ missing_scsi_host (const gchar *sysfs_pa
+       g_strlcpy (host_event->sysfs.sysfs_path, path, sizeof (host_event->sysfs.sysfs_path));
+       host_event->sysfs.net_ifindex = -1;
++      /* insert host before our event, so we can see it as parent */
+       if (action == HOTPLUG_ACTION_ADD) {
+               hotplug_event_enqueue_at_front (device_event);
+               hotplug_event_enqueue_at_front (host_event);
+               hotplug_event_reposted (device_event);
+               goto out;
+       }
++
++      /* remove host */
+       if (action == HOTPLUG_ACTION_REMOVE)
+               hotplug_event_enqueue (host_event);
+-
+ out:
+       return rc;
+ }
+diff --git a/hald/linux/hotplug.c b/hald/linux/hotplug.c
+index 986b96c..96c8540 100644
+--- a/hald/linux/hotplug.c
++++ b/hald/linux/hotplug.c
+@@ -74,6 +74,7 @@ hotplug_event_reposted (void *end_token)
+ {
+       HotplugEvent *hotplug_event = (HotplugEvent *) end_token;
++      hotplug_event->reposted = TRUE;
+       hotplug_events_in_progress = g_slist_remove (hotplug_events_in_progress, hotplug_event);
+ }
+diff --git a/hald/linux/hotplug.h b/hald/linux/hotplug.h
+index 2daf982..b9c3501 100644
+--- a/hald/linux/hotplug.h
++++ b/hald/linux/hotplug.h
+@@ -54,6 +54,7 @@ typedef struct
+ {
+       HotplugActionType action;                               /* Whether the event is add or remove */
+       HotplugEventType type;                                  /* Type of event */
++      gboolean reposted;                                      /* Avoid loops */
+       void (*free_function) (gpointer data);
index eeb222595b7fc1835c843b5cb14f45cbee657953..667333fbcc829c9e7bc11592a499fbae4203dc39 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2007 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/hal/hal-0.5.9_rc2.ebuild,v 1.1 2007/03/30 05:46:53 steev Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/hal/hal-0.5.9_rc2.ebuild,v 1.2 2007/03/30 23:25:44 steev Exp $
 
 inherit eutils linux-info autotools flag-o-matic
 
@@ -89,6 +89,7 @@ src_unpack() {
        unpack ${A}
        cd ${S}
        epatch ${FILESDIR}/${PN}-0.5.7-plugdev-allow-send.patch
+       epatch ${FILESDIR}/fix-scsi-fake-host-event.patch
 }
 
 src_compile() {