On 2/8/2010 5:20 PM, Alan Mackenzie wrote:

.  Am I the only person that finds this semantic gibberish?  Is there
any explanation somewhere of what a "policy" aka "device rule" is?  What
is the semantic significance of a "device rule"?  What does it mean, to
"rule a device", or what sort of restrictions are being placed on this
device?

Given that one might desire a "basic working keyboard/mouse
combination", what is the chain of reasoning that ends up selecting the
file called "10-input-policy.fdi" from all the other ones?

This file is an inpenetrable stanza of uncommented XML.  Are its verbs
documented somewhere?  What do "<match ...>" and"<append ....>" mean,
for example?

The way HAL works, in a nutshell, is to scan your system for every known piece of hardware it can find, and stores the information in a tree-like database of key/value pairs. Software can then query this database for information about whatever hardware you have. The information includes things like the bus location of the hardware, the manufacturer information, state information, and a lists of known capabilities like "keyboard", "mouse", "disk", etc.

Device Rules are simply ways for the user to change values in the database after a device has been detected. The XML files work in two steps:

1. <match> an existing node in the database,
2. <append> or <merge new values into those nodes.

For example, the hplip printer/scanner drivers include a set of HAL rules that match HP devices by their PCI device information, then append "scanner" to their list of capabilities. Other software can then scan the HAL database for "all scanners" and find them. The synaptics touchpad driver (if you build it +hal) includes a set of HAL rules that overrides the standard 'mouse' rules to make your touchpad more useful.

That bit about you having to do anything to make a "basic working" setup function, though, is wrong. On Gentoo, at least, everything you need for a working keyboard and mouse in X should be installed properly for you by default. You'd only need to mess with the rules if something didn't work. But, see below.

Can this new-style fragmented XML configuration do anything that a good
old-fashioned, human-readable and compact xorg.conf can't?  If so, what?
What am I missing here?

HAL manages a *lot* more than just your X configuration. It's intended to be a complete hardware management layer, one that was able to keep pace with new hardware more quickly than the kernel could. If you run the HAL database dump utility "lshal" you'll see more information about your hardware than you could ever possible care to know.

Please, somebody, tell me all this HAL stuff is straightforwardly
explained in an easily accessible Gentoo document, so that I can hang my
head in shame and apologise for the noise!  ;-)

Oddly enough, the most complete explanation of HAL I've ever found was on the Gentoo wiki and I think the page may be lost. It was never really documented that well, though there are a number of places you can find specific ways to do specific things (like using a touchpad) with HAL.

The key point here, though, is that HAL is going away. Not because it was hard to configure, though -- because the code is an "unmaintainable mess" and because other software, like udev, duplicated much of its purpose.

At this point, if it's not working for you out of the box, turn it back off and revert to the old style configuration file.

Reply via email to