If you have a laptop, you probably have a TouchPad which is driven by the “synaptics” driver. To configure your TouchPad, you probably always used the GSynaptics utility, right? This utility required to modify your xorg.conf, but we don’t have this file in Fedora 10 anymore…so what now?
If you simply launch a “yum install gsynaptics” and try to launch it, you get an error message:
GSynaptics couldn’t initialize.
You have to set ‘SHMConfig’ ‘true’ in xorg.conf or XF86Config to use GSynaptics
As I previously told you, since Fedora 10 the xorg.conf doesn’t exist anymore. The whole peripheral detection and configuration is now done by HAL (Hardware Abstraction Layer). A good article explaining HAL can be found in Red Hat Magazine #3.
The most important thing you learn from there is that the devices are configured trough several different information sources, one of them being “Device Information Files” located in /usr/share/hal/fdi/. These files are standard XML files approximately matching the sections we had in the xorg.conf file (for what’s concerning us).
I started poking around the Internet to know how to add this SHMConfig option to HAL and quickly came across Pingou’s post. It’s a quick little howto but it doesn’t tell me how things work behind the scenes, and I like to know such things
Let’s get started in our configuration…
Step 1: what do you see, HAL?
First of all, we need to know what HAL is seeing. For that, we have the handy “lshal” command, which behaves like lspci or lsusb. A quick search in the results shows us our TouchPad:
udi = ‘/org/freedesktop/Hal/devices/platform_i8042_i8042_AUX_port_logicaldev_input_0′
access_control.file = ‘/dev/input/event7′ (string)
access_control.type = ‘mouse’ (string)
info.callouts.add = {‘hal-acl-tool –add-device’, ‘hal-probe-vmmouse’} (string list)
info.callouts.remove = {‘hal-acl-tool –remove-device’} (string list)
info.capabilities = {‘input’, ‘input.mouse’, ‘input.touchpad’, ‘access_control’} (string list)
info.category = ‘input’ (string)
info.parent = ‘/org/freedesktop/Hal/devices/platform_i8042_i8042_AUX_port’ (string)
info.product = ‘AlpsPS/2 ALPS DualPoint TouchPad’ (string)
info.subsystem = ‘input’ (string)
info.udi = ‘/org/freedesktop/Hal/devices/platform_i8042_i8042_AUX_port_logicaldev_input_0′ (string)
input.device = ‘/dev/input/event7′ (string)
input.originating_device = ‘/org/freedesktop/Hal/devices/platform_i8042_i8042_AUX_port’ (string)
input.product = ‘AlpsPS/2 ALPS DualPoint TouchPad’ (string)
input.x11_driver = ’synaptics’ (string)
linux.device_file = ‘/dev/input/event7′ (string)
linux.hotplug_type = 2 (0×2) (int)
linux.subsystem = ‘input’ (string)
linux.sysfs_path = ‘/sys/devices/platform/i8042/serio1/input/input7/event7′ (string)
We can clearly see that the used driver is synaptics and the precise hardware is an ALPS TouchPad.
Step 2: configuring the synaptics driver
Now that we are sure the synaptics driver is used, we have to look in /usr/share/hal/fdi/ if there is a corresponding “Device Information File”.
A “find” later, we can see /usr/share/hal/fdi/policy/20thirdparty/10-synaptics.fdi which sounds like a good start. This file contains a section which perfectly matches the “lshal” output for my TouchPad:
<match key=”info.product” contains=”AlpsPS/2 ALPS”>
<merge key=”input.x11_driver” type=”string”>synaptics</merge>
</match>
In theory, we could add our configuration right here by replacing the previous lines with:
<match key=”info.product” contains=”AlpsPS/2 ALPS”>
<merge key=”input.x11_driver” type=”string”>synaptics</merge>
<merge key=”input.x11_options.SHMConfig” type=”string”>On</merge>
</match>
This works perfectly if you reboot your system, but it’s a bit ugly to edit these files directly. There is a much more elegant solution: add the configuration change to a file in the /etc/hal/fdi/policy/ directory. The files in this directory are automatically read each time you restart HAL.
So, I created a file called “touchpad.fdi” in this directory with the desired modifications:
<match key=”info.product” contains=”AlpsPS/2 ALPS”>
<merge key=”input.x11_options.SHMConfig” type=”string”>On</merge>
</match>
At the next reboot, HAL will read this file + the file in /usr/share/hal/fdi/policy and merge te contents of the AlpsPS/2 ALPS tags.
Done, GSynaptics starts and we begin to understand how HAL works
. If we look at the “lashal” output again, we can see that the modification is effective:
udi = ‘/org/freedesktop/Hal/devices/platform_i8042_i8042_AUX_port_logicaldev_input_0′
access_control.file = ‘/dev/input/event7′ (string)
access_control.type = ‘mouse’ (string)
info.callouts.add = {‘hal-acl-tool –add-device’, ‘hal-probe-vmmouse’} (string list)
info.callouts.remove = {‘hal-acl-tool –remove-device’} (string list)
info.capabilities = {‘input’, ‘input.mouse’, ‘input.touchpad’, ‘access_control’} (string list)
info.category = ‘input’ (string)
info.parent = ‘/org/freedesktop/Hal/devices/platform_i8042_i8042_AUX_port’ (string)
info.product = ‘AlpsPS/2 ALPS DualPoint TouchPad’ (string)
info.subsystem = ‘input’ (string)
info.udi = ‘/org/freedesktop/Hal/devices/platform_i8042_i8042_AUX_port_logicaldev_input_0′ (string)
input.device = ‘/dev/input/event7′ (string)
input.originating_device = ‘/org/freedesktop/Hal/devices/platform_i8042_i8042_AUX_port’ (string)
input.product = ‘AlpsPS/2 ALPS DualPoint TouchPad’ (string)
input.x11_driver = ’synaptics’ (string)
input.x11_options.SHMConfig = ‘On’ (string)
linux.device_file = ‘/dev/input/event7′ (string)
linux.hotplug_type = 2 (0×2) (int)
linux.subsystem = ‘input’ (string)
linux.sysfs_path = ‘/sys/devices/platform/i8042/serio1/input/input7/event7′ (string)
I’m not a HAL expert at all, this is my first look at it, so let me know if I said something stupid.
been there, seen that
had to do the same for touchpad, trackpoint, wacom bamboo tablet (btw. wacom driver uses 3-4 entries in xorg.conf, each having different type set, but fscking HAL does not allow you to add same device multiple times but with different option)
oh well just another craptastic ‘enhancement’ which was supposed to alleviate the problems with input devices, but actually it turned out to be just opposite
Two comments… Not all Synaptics touchpads are supported (see https://bugzilla.redhat.com/show_bug.cgi?id=189676), and it’s silly to expect end-users to edit HAL fdi files. Since everyone with a working Synaptics touchpad ends up doing this eventually, should the configuration be the default?
I Steven, thanks for the post.
I actually think the comments here made a point that ptit seb made on my blog also, the hal file should be added to the gsynaptics package to avoid people to edit the file themselve.
I should find to time to open a bug in this way
For one I don’t understand how to set Virtual screen size (so that when I attach a bigger monitor to my laptop I don’t need to restart the X server just to enforce it to recalculate the maximum resolution).
I think this removing of the xorg file was a stupid move.
Anyone knowing how to set the virtual screen size via HAL?
Hey, this worked perfect for me. Thanks for the tip!
Mike
As the new maintainer of gsynaptics I’m rather happy to see a suggestion here how to handle the xorg.conf-less times.
Did you plan on pushing this hal change into hal upstream? Or would you rather like to see it in the gsynaptics package?
regards,
andreas
Honestly, I don’t know who should handle this, but very probably GSynaptics. What the “man synaptics” says about SHMConfig is pretty clear:
Option “SHMConfig” “boolean”
Switch on/off shared memory for configuration. This enables the
driver to be configured at runtime. Note that this is considered
a security risk since any user can access the configuration.
I can’t see a “security risk” being pushed into HAL for everyone.Now, there are numerous ways of applying this setting to the synaptics driver. In my case, I’m applying the setting to one specific hardware component, but if you look at Pingou’s blog, he seems to apply it to the global synaptics driver.
This sounds to me like an interesting discussion to bring to the -devel mailing list
Andreas would you like to bring it there ?
I’m co-maintaining gsynaptics together with Andreas and IMO this fix shouldn’t go into gsynaptics but into xorg-x11-drv-synaptics.
Yep, it would be nice if you could bring that up on fedora-devel…
Interesting that you’d like to see the change go into gsynaptics.
I’d have suggested HAL upstream as it’s IMHO the right place.
The shared memory segment however is something to consider.
fedora-devel might be the right place….
Even if this option should not be enabled by default,
adding the fdi fragment to hal with a default setting
of ‘false’ would help.
This way, it is “secure by default” but make it easy
for interested people to override.
Maybe also add a comment in the fdi file about
the security implications which point to the man
page for further details.
With the annoucement of 1.0.0 of the synaptics driver it looks like it doesn’t actually need the SHM anymore anyway
http://lists.freedesktop.org/archives/xorg/2009-February/043170.html
So, how does one turn off the G** D*** touchpad entirely? I hate it and want it dead, but HAL’s getting in my way…
Simply in the BIOS
It would indeed be simple if you could turn it off in the BIOS.
Unfortunately that didn’t occur to Dell.
In the spew from lshal, there’s a line that says “info.product = ‘ AlpsPS/2 ALPS GlidePoint’ (string)”. I assume that means the thing is an Alps. The x11 driver appears to be ‘evdev’. Guess I’ll go ask about it on the Fedora forum…
HAL’s features like great, but it’s configuration makes me pine for the simplicity of Selinux.
This does not work at all. BSD needs a little time so Ihave to waste my time with this Shuttleworth Bill Gates destroying Linux. I hate HTML. It is the most stupid thing ever created. You write and write and have 2 words on the screen.
SuSE 11.1 still has xorg.conf and there is no problem and no editing of files in subsubsubsubsubsubsubsubsubsubsubsudireccstories. I still cannot start GSynaptics. This written above is s…. . It causes an error of bad style in prgramming. Both of the methods.
Goodbye Linux.
It looks like later versions of gsynaptics no longer require the SHM settings in X.
Not for me. The latest upgrade for F10 caused my SHMconfig entry in HAL to suddenly stop working. I am hoping that the above will fix the problem.
I tried this creating a new file via Pingou’s post. I have no xorg.conf in my system, Fedora 11 ppc on an iBook G4. I still get the message from gsynaptics to set shmconfig to “yes”. I also tried lashal and my touchpad was not listed. A very long list and very cumbersome compared to the old method.
Thanks for your thourghness . I only wish it would work. Typing is almost impossible with the over-itchy touchpad on the mac.
Stan
thanks for trick it works smoothly, finally i know how to set my presario touchpad & 2 finger tap
fahrul