forked from wulf7/libudev-devd
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
215 lines (162 loc) · 5.29 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
libudev-compatible interface for devd
=====================================
Intended to work with xorg-server and libinput
Installation:
1. Install multimedia/v4l_compat port. In case of evdev-enabled kernels it
can be patched to use system evdev headers instead of webcamd-supplied
2. Build and install libudev-devd
export CFLAGS=-I/usr/local/include
export CPPFLAGS=-I/usr/local/include
cd libudev-devd
./autogen.sh
./configure
make && sudo make install
3. recompile x11-servers/xorg-server with DEVD port option disabled and
following configure args added: --enable-config-udev=yes \
--disable-config-udev-kms --disable-systemd-logind
If you are going to use /dev/kbdmux0 as keyboard input device patch[1] should
be applied to config/udev.c file in xorg distribution
4. Apply changes to xorg.conf
Remove all InputDevice from "ServerLayout" section of xorg.conf
For gsoc2014 evdev-enabled kernels add following lines to xorg.conf
<<< CUT
# Use the libinput driver for all event devices
Section "InputClass"
Identifier "evdev"
Driver "libinput"
# Driver "evdev"
MatchDevicePath "/dev/input/event*"
EndSection
# Explicitly set xkb_rules to evdev for keyboards
Section "InputClass"
Identifier "evdev keyboard"
MatchIsKeyboard "on"
MatchDevicePath "/dev/input/event*"
Option "XkbRules" "evdev"
EndSection
# Disable kbdmux to not receive keyboard events twice
Section "InputClass"
Identifier "evdev disable kbdmux"
MatchIsKeyboard "on"
MatchProduct "System keyboard multiplexer"
MatchDevicePath "/dev/input/event*"
Option "Ignore" "true"
EndSection
<<<CUT
For stock kernels add following lines to xorg.conf
<<<CUT
# Use the libinput driver for all event devices
Section "InputClass"
Identifier "evdev"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
EndSection
Section "InputClass"
Identifier "kbdmux"
MatchDevicePath "/dev/kbdmux*"
Driver "kbd"
EndSection
Section "InputClass"
Identifier "System mouse"
MatchDevicePath "/dev/sysmouse"
Driver "mouse"
EndSection
Section "InputClass"
Identifier "PS/2 mouse"
MatchDevicePath "/dev/psm*"
Driver "mouse"
EndSection
Section "InputClass"
Identifier "USB mouses"
MatchDevicePath "/dev/ums*"
Driver "mouse"
EndSection
Section "InputClass"
Identifier "Joystick"
MatchDevicePath "/dev/joy*"
Driver "mouse"
EndSection
Section "InputClass"
Identifier "Apple touchpad"
MatchDevicePath "/dev/atp*"
Driver "mouse"
EndSection
Section "InputClass"
Identifier "Wellspring touchpad"
MatchDevicePath "/dev/wsp*"
Driver "mouse"
EndSection
Section "InputClass"
Identifier "eGalax touchscreen"
MatchDevicePath "/dev/uep*"
Driver "egalax"
EndSection
<<<CUT
5. Fetch and install libinput port by Jan Kokemuller???
For gsoc2014 evdev-enabled kernels only:
fetch https://github.com/wulf7/libinput/archive/master.tar.gz
tar zxvf master.tar.gz
cd libinput-master
./autogen.sh
make && sudo make install
6. Fetch and install xf86-input-libinput
For gsoc2014 evdev-enabled kernels only:
fetch http://xorg.freedesktop.org/releases/individual/driver/xf86-input-libinput-0.14.0.tar.bz2
..
..
..
7. Build and install libudev-devd for Linuxolator
install devel/linux-c7-devtools, devel/autoconf and devel/automake
than compile libudev.so library and install it somewhere under /compat/linux.
To build and install 64-bit library:
cd libudev-devd
./autogen.sh
env CC="/compat/linux/bin/gcc" CFLAGS="--sysroot /compat/linux" ./configure --libdir=/usr/lib64/shims
make
sudo make install-exec DESTDIR=/compat/linux
To build and install 32-bit library:
cd libudev-devd
./autogen.sh
env CC="/compat/linux/bin/gcc" CFLAGS="--sysroot /compat/linux -m32" ./configure --libdir=/usr/lib/shims
make
sudo make install-exec DESTDIR=/compat/linux
To run my_64bit_app or my_32bit_app with libudev overloaded with libudev-devd use
LD_PRELOAD=/usr/lib64/shims/libudev.so my_64bit_app
or
LD_PRELOAD=/usr/lib/shims/libudev.so my_32bit_app
8. Appendix
[1] config/udev.c patch. Just place content between two <<<CUTs as
/usr/ports/x11-servers/xorg-server/files/patch-config_udev.c file
<<<CUT
+--- config/udev.c.orig 2015-05-21 17:23:54.000000000 +0300
++++ config/udev.c 2015-10-13 17:37:05.063290000 +0300
+@@ -29,6 +29,7 @@
+
+ #include <libudev.h>
+ #include <ctype.h>
++#include <fcntl.h>
+ #include <unistd.h>
+
+ #include "input.h"
+@@ -188,6 +189,20 @@ device_added(struct udev_device *udev_de
+ attrs.product = strdup(name);
+ input_options = input_option_new(input_options, "name", name);
+ input_options = input_option_new(input_options, "path", path);
++ if(strstr(path, "kbdmux") != NULL) {
++ /*
++ * Don't pass "device" option if the keyboard is already attached
++ * to the console (ie. open() fails). This would activate a special
++ * logic in xf86-input-keyboard. Prevent any other attached to console
++ * keyboards being processed. There can be only one such device.
++ */
++ int fd = open(path, O_RDONLY);
++ if (fd > -1) {
++ close(fd);
++ input_options = input_option_new(input_options, "device", path);
++ }
++ }
++ else
+ input_options = input_option_new(input_options, "device", path);
+ input_options = input_option_new(input_options, "major", itoa(major(devnum)));
+ input_options = input_option_new(input_options, "minor", itoa(minor(devnum)));
<<<CUT