diff options
author | jmcneill <jmcneill@pkgsrc.org> | 2018-05-19 13:25:36 +0000 |
---|---|---|
committer | jmcneill <jmcneill@pkgsrc.org> | 2018-05-19 13:25:36 +0000 |
commit | a5f77dad8c5e785ae5e6e34adeb17843c50f4b69 (patch) | |
tree | 14eb56f706913360eca7d4c97ea6786b348b44c8 /sysutils/hal | |
parent | d2cdf78ba8a53a57f20a4dbd1b1f30e7faec991f (diff) | |
download | pkgsrc-a5f77dad8c5e785ae5e6e34adeb17843c50f4b69.tar.gz |
On NetBSD/arm with FDT, the root device is "armfdt0" instead of "mainbus0".
Bump pkg revision.
Diffstat (limited to 'sysutils/hal')
-rw-r--r-- | sysutils/hal/Makefile | 4 | ||||
-rw-r--r-- | sysutils/hal/files/hald-netbsd/devinfo.c | 19 | ||||
-rw-r--r-- | sysutils/hal/files/hald-netbsd/devinfo.h | 1 | ||||
-rw-r--r-- | sysutils/hal/files/hald-netbsd/devinfo_misc.c | 2 | ||||
-rw-r--r-- | sysutils/hal/files/hald-netbsd/drvctl.c | 10 | ||||
-rw-r--r-- | sysutils/hal/files/hald-netbsd/hotplug.c | 2 | ||||
-rw-r--r-- | sysutils/hal/files/hald-netbsd/osspec.c | 7 |
7 files changed, 37 insertions, 8 deletions
diff --git a/sysutils/hal/Makefile b/sysutils/hal/Makefile index 7ed2558664b..ad4160730a3 100644 --- a/sysutils/hal/Makefile +++ b/sysutils/hal/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.79 2017/10/10 13:51:21 jperkin Exp $ +# $NetBSD: Makefile,v 1.80 2018/05/19 13:25:36 jmcneill Exp $ DISTNAME= hal-0.5.14 -PKGREVISION= 18 +PKGREVISION= 19 CATEGORIES= sysutils MASTER_SITES= http://hal.freedesktop.org/releases/ EXTRACT_SUFX= .tar.bz2 diff --git a/sysutils/hal/files/hald-netbsd/devinfo.c b/sysutils/hal/files/hald-netbsd/devinfo.c index 7e473836756..45066ff3a0d 100644 --- a/sysutils/hal/files/hald-netbsd/devinfo.c +++ b/sysutils/hal/files/hald-netbsd/devinfo.c @@ -48,6 +48,21 @@ devinfo_add(HalDevice *parent, gchar *name) devinfo_add_subtree (parent, name, TRUE); } +gboolean +devinfo_probe(HalDevice *parent, gchar *name) +{ + struct devlistargs laa; + + if (drvctl_list (name, &laa) == -1) { + HAL_INFO (("devinfo_probe: no %s device found", name)); + return FALSE; + } + + free (laa.l_childname); + + return TRUE; +} + void devinfo_add_subtree(HalDevice *parent, const char *devnode, gboolean is_root) { @@ -87,7 +102,7 @@ devinfo_set_default_properties (HalDevice *d, HalDevice *parent, const char *dev char *pdevice = hal_device_property_get_string (parent, "netbsd.device"); if (pdevice) { gchar *path; - if (strcmp (pdevice, "mainbus0") == 0) + if (strcmp (pdevice, "mainbus0") == 0 || strcmp (pdevice, "armfdt0") == 0) pdevice = "computer"; path = g_strdup_printf ("/org/freedesktop/Hal/devices/%s", pdevice); hal_device_property_set_string (d, "info.parent", path); @@ -98,7 +113,7 @@ devinfo_set_default_properties (HalDevice *d, HalDevice *parent, const char *dev char *pdevice = pdevnode; if (drvctl_find_parent (devnode, pdevnode) == TRUE) { gchar *path; - if (strcmp (pdevnode, "mainbus0") == 0) + if (strcmp (pdevnode, "mainbus0") == 0 || strcmp (pdevnode, "armfdt0") == 0) pdevice = "computer"; path = g_strdup_printf ("/org/freedesktop/Hal/devices/%s", pdevice); hal_device_property_set_string (d, "info.parent", path); diff --git a/sysutils/hal/files/hald-netbsd/devinfo.h b/sysutils/hal/files/hald-netbsd/devinfo.h index 6ed0dd0f5ef..79f7fb21760 100644 --- a/sysutils/hal/files/hald-netbsd/devinfo.h +++ b/sysutils/hal/files/hald-netbsd/devinfo.h @@ -52,6 +52,7 @@ typedef struct DevinfoDevHandler_s #define NELEM(a) (sizeof (a) / sizeof (*(a))) void devinfo_add (HalDevice *parent, gchar *path); +gboolean devinfo_probe (HalDevice *parent, gchar *path); HalDevice *devinfo_add_node(HalDevice *parent, const char *devnode); void devinfo_set_default_properties (HalDevice *d, HalDevice *parent, const char *devnode, char *devfs_path); void devinfo_callouts_preprobing_done (HalDevice *d, gpointer userdata1, gpointer userdata2); diff --git a/sysutils/hal/files/hald-netbsd/devinfo_misc.c b/sysutils/hal/files/hald-netbsd/devinfo_misc.c index ffb8d2a0791..a3008a741a5 100644 --- a/sysutils/hal/files/hald-netbsd/devinfo_misc.c +++ b/sysutils/hal/files/hald-netbsd/devinfo_misc.c @@ -66,7 +66,7 @@ devinfo_computer_add(HalDevice *parent, const char *devnode, char *devfs_path, c char acpi_supported_states[20]; size_t len = sizeof(acpi_supported_states); - if (strcmp (devnode, "mainbus0") != 0) { + if (strcmp (devnode, "mainbus0") != 0 && strcmp (devnode, "armfdt0") != 0) { return (NULL); } diff --git a/sysutils/hal/files/hald-netbsd/drvctl.c b/sysutils/hal/files/hald-netbsd/drvctl.c index 5384a1f7928..dbdd2add654 100644 --- a/sysutils/hal/files/hald-netbsd/drvctl.c +++ b/sysutils/hal/files/hald-netbsd/drvctl.c @@ -179,6 +179,7 @@ drvctl_list(const gchar *name, struct devlistargs *laa) } if (children != laa->l_children) HAL_WARNING (("DRVLISTDEV/3 expected %d children, got %d", children, laa->l_childname)); + return 0; } gboolean @@ -252,7 +253,14 @@ drvctl_find_device_with_child(const gchar *curnode, const gchar *devnode, gboolean drvctl_find_parent(const gchar *devnode, char *parent) { - return drvctl_find_device_with_child("mainbus0", devnode, parent); + gboolean ret; + + ret = drvctl_find_device_with_child("mainbus0", devnode, parent); + if (ret == FALSE) { + ret = drvctl_find_device_with_child("armfdt0", devnode, parent); + } + + return ret; } #if 0 diff --git a/sysutils/hal/files/hald-netbsd/hotplug.c b/sysutils/hal/files/hald-netbsd/hotplug.c index ce96f84f5e7..4a09ea543f2 100644 --- a/sysutils/hal/files/hald-netbsd/hotplug.c +++ b/sysutils/hal/files/hald-netbsd/hotplug.c @@ -89,7 +89,7 @@ hotplug_event_begin_devfs_add (HotplugEvent *hotplug_event, HalDevice *d) /* only root node is allowed to be orphan */ if (parent == NULL) { - if (strcmp(hotplug_event->un.devfs.devfs_path, "mainbus0") != 0) { + if (strcmp(hotplug_event->un.devfs.devfs_path, "mainbus0") != 0 && strcmp(hotplug_event->un.devfs.devfs_path, "armfdt0") != 0) { HAL_ERROR (("Parent is NULL devfs_path=%s parent_udi=%s", hotplug_event->un.devfs.devfs_path, parent_udi ? parent_udi : "<null>")); hotplug_event_end ((void *) hotplug_event); return; diff --git a/sysutils/hal/files/hald-netbsd/osspec.c b/sysutils/hal/files/hald-netbsd/osspec.c index 44a035dd81a..48df29d5fe2 100644 --- a/sysutils/hal/files/hald-netbsd/osspec.c +++ b/sysutils/hal/files/hald-netbsd/osspec.c @@ -72,7 +72,12 @@ void osspec_probe (void) { /* add entire device tree */ - devinfo_add (NULL, "mainbus0"); + if (devinfo_probe (NULL, "mainbus0") == TRUE) { + devinfo_add (NULL, "mainbus0"); + } + if (devinfo_probe (NULL, "armfdt0") == TRUE) { + devinfo_add (NULL, "armfdt0"); + } /* start processing events */ hotplug_event_process_queue (); |