Gentoo Logo

Xorg-server 1.8 Upgrade Guide

Content:

1.  Features changes

  • Xorg can detect input devices using udev, deprecating its HAL support. Users are strongly encouraged to migrate to udev.
  • Xorg's configuration is now much more flexible thanks to generic match options and multiple-file merging capabilities.

2.  Migrating to udev hotplugging

Enabling udev support

Enabling udev just requires building xorg-server with USE="udev".

Match rules usage

Now that Xorg is able to get a list of available input devices using udev instead of HAL, Xorg's configuration system was changed to make things easier for users and distribution maintainers alike. With HAL hot-plugging, device configuration had to be specified using HAL's XML configuration system (the infamous .fdi files) for Xorg to pick up user preferences such as the keyboard map or the mouse pointer acceleration.

Since moving those options from HAL to udev seemed like an even worse idea, it was decided to move them back to Xorg, and make Xorg's configuration much more flexible.

Warning: Config is stored in xorg.conf or xorg.conf.d files but the detection is done by udev. So make sure you turn that useflag on.

A new configuration section called InputClass is introduced. It is very similar to the InputDevice section but can match (and therfore configure) multiple devices.

The InputClass works by matching one or more properties from the devices retrieved with udev, using the following match rules:

  • MatchProduct
  • MatchVendor
  • MatchDevicePath
  • MatchIsKeyboard
  • MatchIsPointer
  • MatchIsJoystick
  • MatchIsTablet
  • MatchIsTouchpad
  • MatchIsTouchscreen

Note: MatchDevicePath uses fnmatch(3) when available, so you can use wildcard patterns (eg, Option "MatchDevicePath" "/dev/input/event*").

Examples

Code Listing 2.1: Configuring all touchpads to use synaptics driver

Section "InputClass"
	Identifier "synaptics-all"
	Driver "synaptics"
	Option "RTCornerButton" "2"
	Option "HorizEdgeScroll" "true"

	MatchIsTouchpad "on"
EndSection

Code Listing 2.2: Configuring all keyboards to use specified config

Section "InputClass"
	Identifier "keyboard-all"
	Driver "evdev"
	Option "XkbLayout" "us,cz"
	Option "XkbVariant" ",qwerty"
	Option "XkbOptions" "grp:alt_shift_toggle,grp:switch,compose:rwin,terminate:ctrl_alt_bksp"

	MatchIsKeyboard "on"
EndSection

Note: XkbOptions shown in the example file are not to be copied directly to your configs. One of really suprising results for you will be non-working AltGr if you do so.

Code Listing 2.3: Configuring all mice to use specified config

Section "InputClass"
	Identifier "mouse-all"
	Driver "evdev"

	MatchIsPointer "on"
EndSection

Disabling hotplugging

If you do not want to use udev nor HAL, you can either build xorg-server with USE="-udev -hal" or you can turn the AutoAddDevices option off in the ServerFlags section of your xorg.conf (or in some file stored in /etc/X11/xorg.conf.d/).

Code Listing 2.4: Turning AutoAddDevices off

Section "ServerFlags"
    Option "AutoAddDevices" "false"
EndSection

Both options will allow the X server to use the legacy mouse and kbd drivers.

3.  Usage of xorg.conf.d

Splitting xorg.conf

The xorg.conf.d is an additional folder where users can store adjustments to Xorg's configuraion without touching the main xorg.conf itself.

The order of inheritance is quite simple. If present, xorg.conf be loaded, then the xorg.conf.d/**.conf files will be parsed next, in ASCII alphabetical order (so numbers will be first).

Code Listing 3.1: example folder listing for xorg.conf.d

/etc/X11/xorg.conf.d $ ls
50-ati.conf  96-synaptics.conf  97-evdev.conf

Code Listing 3.2: example content of 96-synaptics.conf

Section "InputDevice"
	Identifier "touchpad"
	Driver "synaptics"
	Option "AutoServerLayout" "on"
EndSection

As you can see the code is same as for xorg.conf itself. Only one addition is the "AutoServerLayout" option. With this option enabled the device does not need to be referenced in ServerLayout section.

Note: The InputClass section automatically enables the AutoServerLayout option, you do not need to specify it.

4.  Known Quirks

Lenovo HDAPS sensor

For more info see upstream bug.

Code Listing 4.1: Disabling HDAPS accelerometer driver

Section "InputClass"
	Identifier "ThinkPad HDAPS blacklist"
	MatchProduct "ThinkPad HDAPS accelerometer data"
	Option "Ignore" "on"
EndSection


Print

Page updated April 9, 2010

Summary: This guide shows you how to upgrade X.org server to version 1.8.

Tomas Chvatal
Author

Remi Cardona
Editor

Donate to support our development efforts.

Copyright 2001-2014 Gentoo Foundation, Inc. Questions, Comments? Contact us.