On 27/02/2014 23:25, Robert Millan wrote:
> On 27/02/2014 18:25, Christoph Egger wrote:
>> On Sun, Feb 23, 2014 at 11:44:35AM -0300, brunomaxi...@openmailbox.org wrote:
>>> but, any input (mouse, touchpad, keyboard) doesn't work, so I can't
>>> log in.
>>> This is happening with you guys or just me? Any idea?
>>> Thanks,
>>
>> Happens for me since xserver 1.15 or something (very recent update in
>> jessie). I don't have any input working in any way (kfreebsd 9.2 or
>> 9.3) with slim. I'll try to allocate some time to fix that but can't promise
>> anything currently.
>
> Probably HAL-related. xserver 1.15 works fine with the devd patch, I tested
> that version just a few days ago.
Here's the most recent version. Also needs the Debian bits from:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=736765#47
--
Robert Millan
>From d96e2bd2a2b48ede527ad7071d3e0eeda9861b73 Mon Sep 17 00:00:00 2001
From: Robert Millan
Date: Mon, 24 Feb 2014 23:22:57 +0100
Subject: [PATCH] Add devd config backend for FreeBSD (and GNU/kFreeBSD)
Based on original code by Baptiste Daroussin, with some fixes made
by Koop Mast and myself.
Signed-off-by: Robert Millan
---
config/Makefile.am |4 +
config/config-backends.h|5 +
config/config.c |5 +
config/devd.c | 387 +++
configure.ac| 16 ++
hw/xfree86/common/xf86Config.c |7 +-
hw/xfree86/common/xf86Globals.c |3 +-
include/dix-config.h.in |3 +
8 files changed, 427 insertions(+), 3 deletions(-)
create mode 100644 config/devd.c
diff --git a/config/Makefile.am b/config/Makefile.am
index 0e20e8b..16f8aaa 100644
--- a/config/Makefile.am
+++ b/config/Makefile.am
@@ -34,6 +34,10 @@ if CONFIG_WSCONS
libconfig_la_SOURCES += wscons.c
endif # CONFIG_WSCONS
+if CONFIG_DEVD
+libconfig_la_SOURCES += devd.c
+endif
+
endif # !CONFIG_HAL
endif # !CONFIG_UDEV
diff --git a/config/config-backends.h b/config/config-backends.h
index 5f07557..889e2ad 100644
--- a/config/config-backends.h
+++ b/config/config-backends.h
@@ -44,3 +44,8 @@ void config_hal_fini(void);
int config_wscons_init(void);
void config_wscons_fini(void);
#endif
+
+#ifdef CONFIG_DEVD
+int config_devd_init(void);
+void config_devd_fini(void);
+#endif
diff --git a/config/config.c b/config/config.c
index 760cf19..cca5a31 100644
--- a/config/config.c
+++ b/config/config.c
@@ -53,6 +53,9 @@ config_init(void)
#elif defined(CONFIG_WSCONS)
if (!config_wscons_init())
ErrorF("[config] failed to initialise wscons\n");
+#elif defined(CONFIG_DEVD)
+if (!config_devd_init())
+ErrorF("[config] failed to initialise devd\n");
#endif
}
@@ -65,6 +68,8 @@ config_fini(void)
config_hal_fini();
#elif defined(CONFIG_WSCONS)
config_wscons_fini();
+#elif defined(CONFIG_DEVD)
+config_devd_fini();
#endif
}
diff --git a/config/devd.c b/config/devd.c
new file mode 100644
index 000..92a66c4
--- /dev/null
+++ b/config/devd.c
@@ -0,0 +1,387 @@
+/*
+ * Copyright © 2012 Baptiste Daroussin
+ * Copyright © 2014 Robert Millan
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Author: Baptiste Daroussin
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include
+#endif
+
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "input.h"
+#include "inputstr.h"
+#include "hotplug.h"
+#include "config-backends.h"
+#include "os.h"
+
+#define DEVD_SOCK_PATH "/var/run/devd.pipe"
+
+#define DEVD_EVENT_ADD '+'
+#define DEVD_EVENT_REMOVE '-'
+
+static int sock_devd = -1;
+
+struct hw_type {
+const char *driver;
+int flag;
+const char *xdriver;
+};
+
+static struct hw_type hw_types[] = {
+{"ukbd", ATTR_KEYBOARD, "kbd"},
+{"atkbd", ATTR_KEYBOARD, "kbd"},
+{"ums", ATTR_POINTER, "mouse"},
+{"psm", ATTR