CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
Attached to Project: CRUX-ARM
Opened by Ryan Mullen - 2012-08-23
Last edited by Victor Martinez - 2013-09-15

FS#38 - Xorg input devices not working with udev 167, working with udev 182

Xorg input devices would not work for me using core-arm/udev (version 167) on a cubox platform.

I upgraded to version 182 and the input devices worked fine. I had to patch udev to replace calls to accept4() with accept(). Pkgfile (based on core/udev) and patch appear below:

######## Pkgfile ############
# Description: Userspace device management daemon
# URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html # Maintainer: CRUX System Team, core-ports at crux dot nu
# Depends on: kmod

name=udev version=182
release=1
source=(ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/$name-$version.tar.x
z \

      pre-accept4-kernel.patch 81-crux.rules start_udev)

build() {

  cd udev-$version
  patch -p1 < $SRC/pre-accept4-kernel.patch
  ./configure --prefix=/usr \
              --sbindir=/sbin --bindir=/sbin \
              --sysconfdir=/etc \
              --with-rootlibdir=/lib \
              --with-rootprefix= \
              --libexecdir=/lib \
              --mandir=/usr/man \
              --disable-introspection \
              --disable-gudev \
              --disable-udev_acl \                                                                                                                                                                                                                         --disable-keymap \
              --enable-static \
              --enable-rule_generator                                                                                                                                                                                                      
  make
  make install DESTDIR=$PKG
  mkdir -p $PKG/lib/{firmware,udev/devices/{pts,shm}}
  mkdir -p $PKG/{lib,sbin,run}
  
  # Symlink to udevd
  ln -s ../lib/udev/udevd $PKG/sbin/udevd
  # Add CRUX items
  install -m 0755 $SRC/start_udev $PKG/sbin
  install -m 0644 $SRC/81-crux.rules $PKG/lib/udev/rules.d
                                                                                                                                                                                                                                               # Remove junk
  rm -r $PKG/usr/share/{gtk-,}doc

}

######### pre-accept4-kernel.patch ###########
diff -urN a/src/udev-ctrl.c b/src/udev-ctrl.c
— a/src/udev-ctrl.c 2011-10-09 17:10:32.000000000 -0600
+++ b/src/udev-ctrl.c 2011-10-25 15:11:09.000000000 -0600
@@ -15,6 +15,7 @@
#include <stddef.h>
#include <string.h>
#include <unistd.h>
+#include <fcntl.h>
#include <sys/types.h>
#include <sys/poll.h>
#include <sys/socket.h> @@ -182,6 +183,7 @@

       struct ucred ucred;
       socklen_t slen;
       const int on = 1;

+ int flgs;

       conn = calloc(1, sizeof(struct udev_ctrl_connection));
       if (conn == NULL)

@@ -189,13 +191,19 @@

       conn->refcount = 1;
       conn->uctrl = uctrl;


- conn→sock = accept4(uctrl→sock, NULL, NULL, SOCK_CLOEXEC|SOCK_NONBLOCK);
+ conn→sock = accept4(uctrl→sock, NULL, NULL, SOCK_CLOEXEC|SOCK_NONBLOCK);
+ conn→sock = accept(uctrl→sock, NULL, NULL);
if (conn→sock < 0) {
if (errno != EINTR)
err(uctrl→udev, "unable to receive ctrl connection: %m\n");
goto err;
}
+
Since we don't have accept4
+ flgs = fcntl(conn→sock, F_GETFL, NULL); + if(flgs >= 0) fcntl(conn→sock, F_SETFL, flgs | O_NONBLOCK);
+ fcntl(conn→sock, F_SETFD, FD_CLOEXEC); +

       /* check peer credential of connection */                                                                                                                                                                                                    slen = sizeof(ucred);
       if (getsockopt(conn->sock, SOL_SOCKET, SO_PEERCRED, &ucred, &slen) < 0) {
Closed by  Victor Martinez
Sunday, 15 September 2013, 11:16 GMT
Reason for closing:  Fixed
Additional comments about closing:  

This should be fixed with current cubox kernel and upstream (2.8) udev 182 version

Ryan Mullen commented on Thursday, 23 August 2012, 15:17 GMT

Sorry, I don't know how to format text in Flyspray, so here are links to the files:

pre-accept4-kernel.patch: http://sprunge.us/MKdc Pkgfile: http://sprunge.us/XDLO

Project Manager
Victor Martinez commented on Saturday, 15 September 2012, 17:05 GMT

This is interesting, as we can create an overlay for cubox and put there that udev version.
Here I tested on the rpi and I got the same problem. It cames rom there, udev's version 167 doesn't play complete right with new xorg server, as it seems to be a problem with hotplug, but evdev is working right.
Here I'm using this xorg.conf, forcing the use of evdev for kbd/mouse.

Section "InputDevice"

Identifier  "Keyboard1"
Driver      "evdev"
Option      "Device"   "/dev/input/event0"
Option      "CoreKeyboard"
Option      "XkbRules"  "xorg"
Option      "XkbModel"  "pc105"
Option      "XkbLayout" "es"
#Option      "XkbOptions"  "lv3:ralt_switch_multikey"

EndSection

Section "InputDevice"

Identifier   "Mouse1"
Driver   "evdev"
Option   "Device"   "/dev/input/event1"

EndSection

Section "ServerLayout"

Identifier  "Server Layout"
InputDevice "Mouse1"  "CorePointer"
InputDevice "Keyboard1" "CoreKeyboard"

It needs to be adapted to the right devices in other machines.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing