pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils/hal On NetBSD/arm with FDT, the root device i...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c0ad370e3a69
branches:  trunk
changeset: 380683:c0ad370e3a69
user:      jmcneill <jmcneill%pkgsrc.org@localhost>
date:      Sat May 19 13:25:36 2018 +0000

description:
On NetBSD/arm with FDT, the root device is "armfdt0" instead of "mainbus0".
Bump pkg revision.

diffstat:

 sysutils/hal/Makefile                         |   4 ++--
 sysutils/hal/files/hald-netbsd/devinfo.c      |  19 +++++++++++++++++--
 sysutils/hal/files/hald-netbsd/devinfo.h      |   1 +
 sysutils/hal/files/hald-netbsd/devinfo_misc.c |   2 +-
 sysutils/hal/files/hald-netbsd/drvctl.c       |  10 +++++++++-
 sysutils/hal/files/hald-netbsd/hotplug.c      |   2 +-
 sysutils/hal/files/hald-netbsd/osspec.c       |   7 ++++++-
 7 files changed, 37 insertions(+), 8 deletions(-)

diffs (135 lines):

diff -r aadced55481d -r c0ad370e3a69 sysutils/hal/Makefile
--- a/sysutils/hal/Makefile     Sat May 19 13:00:56 2018 +0000
+++ b/sysutils/hal/Makefile     Sat May 19 13:25:36 2018 +0000
@@ -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 -r aadced55481d -r c0ad370e3a69 sysutils/hal/files/hald-netbsd/devinfo.c
--- a/sysutils/hal/files/hald-netbsd/devinfo.c  Sat May 19 13:00:56 2018 +0000
+++ b/sysutils/hal/files/hald-netbsd/devinfo.c  Sat May 19 13:25:36 2018 +0000
@@ -48,6 +48,21 @@
        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 @@
                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 @@
                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 -r aadced55481d -r c0ad370e3a69 sysutils/hal/files/hald-netbsd/devinfo.h
--- a/sysutils/hal/files/hald-netbsd/devinfo.h  Sat May 19 13:00:56 2018 +0000
+++ b/sysutils/hal/files/hald-netbsd/devinfo.h  Sat May 19 13:25:36 2018 +0000
@@ -52,6 +52,7 @@
 #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 -r aadced55481d -r c0ad370e3a69 sysutils/hal/files/hald-netbsd/devinfo_misc.c
--- a/sysutils/hal/files/hald-netbsd/devinfo_misc.c     Sat May 19 13:00:56 2018 +0000
+++ b/sysutils/hal/files/hald-netbsd/devinfo_misc.c     Sat May 19 13:25:36 2018 +0000
@@ -66,7 +66,7 @@
        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 -r aadced55481d -r c0ad370e3a69 sysutils/hal/files/hald-netbsd/drvctl.c
--- a/sysutils/hal/files/hald-netbsd/drvctl.c   Sat May 19 13:00:56 2018 +0000
+++ b/sysutils/hal/files/hald-netbsd/drvctl.c   Sat May 19 13:25:36 2018 +0000
@@ -179,6 +179,7 @@
        }
        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 @@
 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 -r aadced55481d -r c0ad370e3a69 sysutils/hal/files/hald-netbsd/hotplug.c
--- a/sysutils/hal/files/hald-netbsd/hotplug.c  Sat May 19 13:00:56 2018 +0000
+++ b/sysutils/hal/files/hald-netbsd/hotplug.c  Sat May 19 13:25:36 2018 +0000
@@ -89,7 +89,7 @@
 
        /* 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 -r aadced55481d -r c0ad370e3a69 sysutils/hal/files/hald-netbsd/osspec.c
--- a/sysutils/hal/files/hald-netbsd/osspec.c   Sat May 19 13:00:56 2018 +0000
+++ b/sysutils/hal/files/hald-netbsd/osspec.c   Sat May 19 13:25:36 2018 +0000
@@ -72,7 +72,12 @@
 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 ();



Home | Main Index | Thread Index | Old Index