OldGentooWiki:Xorg server 1.3 vers 1.5
De Gentoo-Quebec.
Index entretien et sauvegardes
Mise en contexte
La migration de xorg-server 1.3 vers xorg-server 1.5 implique beaucoup de changements techniques dans la gestion des périphériques. En effet, le fichier /etc/X11/xorg.conf est modifié radicalement. La nouvelle version de Xorg utilise maintenant hal et evdev pour détecter automatiquement tous les périphériques.
Le noyau communique avec udev qui lui appelle hal. Ce dernier communique ensuite avec l'application. hal est donc un intermédiaire entre le noyau et l'application.
Quant à evdev, il communique aussi avec hal, mais seulement pour la gestion des périphériques d'entrée, c'est à dire souris, clavier, touchpad (synaptic), etc.
Enfin, une nouveauté importante, la configuration du clavier et de la souris se fait maintenant à partir d'un fichier XML, soit :
- /etc/hal/fdi/policy/10-x11-input.fdi
Pour ce qui est des touchpads (synaptics), nous devons configurer le fichier suivant :
- /etc/hal/fdi/policy/11-x11-synaptics.fdi
La migration
La migration va se faire en plusieurs étapes. On doit en effet préparer la migration car sinon au premier redémarrage on va se retrouver avec un système Gentoo sans clavier ni souris.
Voici les étapes de la migration :
- Mise à jour du fichier /etc/make.conf
- Configuration du noyau avec support evdev
- Activation de hal
- Copie de sécurité du fichier /etc/X11/xorg.conf
- Migration du fichier /etc/X11/xorg.conf
- Configuration manuelle des fichiers XML
Mise à jour du fichier /etc/make.conf
Pour pouvoir effectuer la migration décrite dans ce tutoriel, vous devez avoir une configuration qui prend en compte evdev.
La variable INPUT_DEVICES de votre fichier /etc/make.conf doit donc être initialisée comme dans cet exemple.
INPUT_DEVICES="keyboard mouse evdev"
Après avoir apporté ce changement, vous devez recompiler tout votre système.
Configuration du noyau avec support evdev
Pour pouvoir utiliser la nouvelle manière de fonctionner de xorg-server, vous devez vous assurer d'avoir activé le support evdev dans votre noyau. Autrement dit, l'option Event interface doit être activée. Vous la trouvez dans :
Device Drivers --->
Input device support --->
<*> Event interface
Veuillez suivre les instructions du guide de mise à jour du noyau, section changement de version ou révision, pour apporter ce changement et recompiler votre noyau. Tenez-vous en aux instructions concernant make menuconfig appliquées seulement sur votre noyau courant et ensuite procédez à la compilation et la copie.
En cas de doute ou d'incertitude sur cette modification du noyau, n'hésitez pas à soumettre votre question et à demander de l'aide sur le forum.
Activation de hal
Maintenant il faut activer hal au démarrage de votre Gentoo.
Copie de sécurité du fichier /etc/X11/xorg.conf
Avant de commencer la conversion, il est três important que vous ayez une copie de votre fichier /etc/X11/xorg.conf actuel en cas d'un éventuel retour-arrière.
Migration du fichier /etc/X11/xorg.conf
Puisque evdev gère claviers, souris et touchpads, vous devez supprimer les sections correspondantes dans /etc/X11/xorg.conf.
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
EndSection
Section "Files"
EndSection
Section "Module"
Load "dbe"
Load "extmod"
Load "type1"
Load "freetype"
Load "glx"
EndSection
Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "Auto" # Auto detect
Option "Device" "/dev/input/mice"
Option "Name" "Logitech USB Gaming Mouse"
Option "ZAxisMapping" "4 5 6 7"
Option "SendCoreEvents" "true"
Option "Emulate3Buttons"
EndSection
Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
Option "AutoRepeat" "500 30"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "ca(fr)"
EndSection
Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "Unknown"
Option "DPMS"
EndSection
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Depth 24
EndSubSection
EndSection
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0"
EndSection
Section "Module"
Load "dbe"
Load "extmod"
Load "type1"
Load "freetype"
Load "glx"
EndSection
Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "Unknown"
Option "DPMS"
EndSection
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Depth 24
EndSubSection
EndSection
Comme vous pouvez le constater, les section InputDevice n'existent plus.
Configuration manuelle des fichiers XML
Il faut maintenant regarder ce que hal a généré comme fichiers XML en utilisant les informations de evdev.
La configurations du clavier et de la souris se trouvent dans le fichier /etc/hal/fdi/policy/10-x11-input.fdi.
Vous devriez avoir quelque chose du genre :
<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
<device>
<match key="info.capabilities" contains="input.keys">
<merge key="input.x11_options.XkbRules" type="string">evdev</merge>
<merge key="input.x11_options.XkbModel" type="string">evdev</merge>
<merge key="input.xkb.layout" type="string">ca</merge>
<merge key="input.xkb.variant" type="string">fr</merge>
<merge key="input.x11_options.XkbOptions" type="string">compose:menu</merge>
</match>
</device>
</deviceinfo>
Dans cet exemple, nous avons une configuration de souris standard ainsi qu'un clavier avec la disposition canadienne-française.
Modifiez la ligne <merge key="input.xkb.layout" type="string">ca</merge> en changeant le code du pays pour celui correspondant au vôtre si différent de Canada.
Enfin, si vous utilisez un portable vous devez vous assurer que votre fichier /etc/hal/fdi/policy/11-x11-synaptics.fdi soit configuré correctement.
<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
<device>
<match key="info.capabilities" contains="input.touchpad">
<match key="info.product" contains="SynPS/2 Synaptics TouchPad">
<merge key="input.x11_driver" type="string">synaptics</merge>
<merge key="input.x11_options.Emulate3Buttons" type="string">yes</merge>
<!-- Tapping -->
<merge key="input.x11_options.TapButton1" type="string">1</merge>
<merge key="input.x11_options.TapButton2" type="string">2</merge>
<merge key="input.x11_options.TapButton3" type="string">3</merge>
<merge key="input.x11_options.BMaxTapMove" type="string">2000</merge>
<merge key="input.x11_options.SHMConfig" type="string">true</merge>
<!-- 2 fingers scroll vertical and horizontal -->
<merge key="input.x11_options.VertTwoFingerScroll" type="string">true</merge>
<merge key="input.x11_options.HorizTwoFingerScroll" type="string">true</merge>
<merge key="input.x11_options.VertEdgeScroll" type="string">true</merge>
<merge key="input.x11_options.SpecialScrollAreaRight" type="string">true</merge>
</match>
</match>
</device>
</deviceinfo>
Vérification de la syntaxe du fichier .fdi
Enfin, vous redémarrez et vous priez que ça fonctionne !
Vérification du fonctionnement
Vous pouvez vérifier si ça fonctionne en lançant cette commande :
udi = '/org/freedesktop/Hal/devices/computer_logicaldev_input_3'
input.x11_options.XkbRules = 'evdev' (string)
input.x11_options.XkbModel = 'evdev' (string)
input.x11_options.xkbOptions = 'compose:menu' (string)
linux.hotplug_type = 2 (0x2) (int)
linux.subsystem = 'input' (string)
input.device = '/dev/input/event8' (string)
input.product = 'Video Bus' (string)
info.product = 'Video Bus' (string)
info.udi = '/org/freedesktop/Hal/devices/computer_logicaldev_input_3' (string)
linux.sysfs_path = '/sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:02/input/input8/event8' (string)
info.parent = '/org/freedesktop/Hal/devices/computer' (string)
input.xkb.rules = 'base' (string)
info.capabilities = { 'input', 'input.keys', 'button' } (string list)
info.category = 'input' (string)
input.xkb.model = 'evdev' (string)
info.addons.singleton = { 'hald-addon-input' } (string list)
info.subsystem = 'input' (string)
linux.device_file = '/dev/input/event8' (string)
input.xkb.layout = 'ca' (string)
input.xkb.variant = 'fr' (string)
input.x11_driver = 'evdev' (string)
udi = '/org/freedesktop/Hal/devices/computer_logicaldev_input_2'
input.xkb.model = 'evdev' (string)
input.xkb.layout = 'ca' (string)
input.xkb.variant = 'fr' (string)
input.x11_driver = 'evdev' (string)
input.xkb.rules = 'base' (string)
linux.hotplug_type = 2 (0x2) (int)
linux.subsystem = 'input' (string)
input.x11_options.XkbRules = 'evdev' (string)
input.x11_options.XkbModel = 'evdev' (string)
input.x11_options.xkbOptions = 'compose:menu' (string)
input.device = '/dev/input/event4' (string)
input.product = 'ThinkPad Extra Buttons' (string)
info.product = 'ThinkPad Extra Buttons' (string)
button.has_state = true (bool)
linux.sysfs_path = '/sys/devices/virtual/input/input4/event4' (string)
info.parent = '/org/freedesktop/Hal/devices/computer' (string)
button.state.value = false (bool)
info.capabilities = { 'input', 'input.keys', 'input.switch', 'button', 'input.keymap' } (string list)
info.category = 'input' (string)
button.type = 'radio' (string)
input.keymap.data = { '0x01:screenlock', '0x02:battery', '0x03:sleep', '0x04:wlan', '0x06:switchvideomode', '0x07:f22', '0x08:f24', '0x0b:suspend', '0x0f:brightnessup', '0x10:brightnessdown', '0x11:kbdillumtoggle', '0x13:zoom', '0x14:volumeup', '0x15:volumedown', '0x16:mute', '0x17:prog1' } (string list)
info.subsystem = 'input' (string)
linux.device_file = '/dev/input/event4' (string)
info.udi = '/org/freedesktop/Hal/devices/computer_logicaldev_input_2' (string)
info.addons.singleton = { 'hald-addon-input' } (string list)
info.callouts.add = { 'hal-setup-keymap' } (string list)
udi = '/org/freedesktop/Hal/devices/platform_i8042_i8042_KBD_port_logicaldev_input'
input.x11_options.XkbRules = 'evdev' (string)
input.x11_options.XkbModel = 'evdev' (string)
input.xkb.variant = 'fr' (string)
linux.hotplug_type = 2 (0x2) (int)
linux.subsystem = 'input' (string)
input.x11_options.xkbOptions = 'compose:menu' (string)
input.device = '/dev/input/event3' (string)
input.product = 'AT Translated Set 2 keyboard' (string)
info.product = 'AT Translated Set 2 keyboard' (string)
info.udi = '/org/freedesktop/Hal/devices/platform_i8042_i8042_KBD_port_logicaldev_input' (string)
linux.sysfs_path = '/sys/devices/platform/i8042/serio0/input/input3/event3' (string)
info.parent = '/org/freedesktop/Hal/devices/platform_i8042_i8042_KBD_port' (string)
input.xkb.rules = 'base' (string)
info.capabilities = { 'input', 'input.keyboard', 'input.keypad', 'input.keys', 'button' } (string list)
info.category = 'input' (string)
input.xkb.model = 'evdev' (string)
input.originating_device = '/org/freedesktop/Hal/devices/platform_i8042_i8042_KBD_port' (string)
info.subsystem = 'input' (string)
linux.device_file = '/dev/input/event3' (string)
input.xkb.layout = 'ca' (string)
info.addons.singleton = { 'hald-addon-input' } (string list)
input.x11_driver = 'evdev' (string)
udi = '/org/freedesktop/Hal/devices/computer_logicaldev_input_0'
input.xkb.model = 'evdev' (string)
input.x11_options.XkbModel = 'evdev' (string)
input.x11_options.xkbOptions = 'compose:menu' (string)
input.x11_driver = 'evdev' (string)
input.x11_options.XkbRules = 'evdev' (string)
linux.hotplug_type = 2 (0x2) (int)
linux.subsystem = 'input' (string)
input.device = '/dev/input/event2' (string)
input.product = 'Sleep Button' (string)
info.product = 'Sleep Button' (string)
button.has_state = false (bool)
linux.sysfs_path = '/sys/devices/LNXSYSTM:00/device:00/PNP0C0E:00/input/input2/event2' (string)
info.parent = '/org/freedesktop/Hal/devices/computer' (string)
button.type = 'sleep' (string)
info.capabilities = { 'input', 'button', 'input.keys' } (string list)
info.category = 'input' (string)
info.udi = '/org/freedesktop/Hal/devices/computer_logicaldev_input_0' (string)
info.addons.singleton = { 'hald-addon-input' } (string list)
info.subsystem = 'input' (string)
linux.device_file = '/dev/input/event2' (string)
input.xkb.layout = 'ca' (string)
input.xkb.variant = 'fr' (string)
input.xkb.rules = 'base' (string)
udi = '/org/freedesktop/Hal/devices/computer_logicaldev_input'
input.xkb.model = 'evdev' (string)
input.x11_options.XkbModel = 'evdev' (string)
input.x11_options.xkbOptions = 'compose:menu' (string)
input.x11_driver = 'evdev' (string)
input.x11_options.XkbRules = 'evdev' (string)
linux.hotplug_type = 2 (0x2) (int)
linux.subsystem = 'input' (string)
input.device = '/dev/input/event0' (string)
input.product = 'Power Button' (string)
info.product = 'Power Button' (string)
button.has_state = false (bool)
linux.sysfs_path = '/sys/devices/LNXSYSTM:00/LNXPWRBN:00/input/input0/event0' (string)
info.parent = '/org/freedesktop/Hal/devices/computer' (string)
button.type = 'power' (string)
info.capabilities = { 'input', 'button', 'input.keys' } (string list)
info.category = 'input' (string)
info.udi = '/org/freedesktop/Hal/devices/computer_logicaldev_input' (string)
info.addons.singleton = { 'hald-addon-input' } (string list)
info.subsystem = 'input' (string)
linux.device_file = '/dev/input/event0' (string)
input.xkb.layout = 'ca' (string)
input.xkb.variant = 'fr' (string)
input.xkb.rules = 'base' (string)

