Skip Navigation Links | |
Exit Print View | |
man pages section 4: File Formats Oracle Solaris 11.1 Information Library |
- HAL device information file format
/usr/share/lib/xml/dtd/fdi.dtd.1
The hardware abstraction layer facility, described in hal(5), uses an XML-based file format to merge arbitrary properties onto device objects. The way device information files works is that once all physical properties are merged onto a device object, it is tried against the set of installed device information files. Device information files are used for both merging facts and policy settings for devices.
Each device information file has a number of match directives that are tested against the properties of the device object. The directives have the form:
<match key="property" [string|int|bool|..]="value">
If all the match directives pass, then the device information can include the following property directives in the form:
<[merge|append|prepend] key="property" type="[string|int|bool|..]">
These directives are used to merge new properties or append to existing properties on the device object. Any previously property stemming from device detection can be overridden by a device information file.
The match, merge, append, and prepend directives require that the key attribute be either a property name on the device object in question or a path to a property on another device object. The path to a property is expressed either through direct specification of the UDI, such as /org/freedesktop/Hal/devices/computer:foo.bar or through indirect references such as “@info.parent:baz”, meaning that the device object specified by the UDI in the string property “info.parent” should be used to query the property “baz”. It is also possible to use multiple indirections. For example, for a volume on a USB memory stick, the indirection “@block.storage_device:@storage.physical_device:usb.vendor_id” references the “usb.vendor_id” property on the device object representing the USB interface.
When the property to match has been determined, the following attributes can be used within the “match” tag:
Match a string property. For example, <match key= “foo.bar” string=”baz”> matches only if “foo.bar” is a string property assuming the value “baz”.
Match an integer property
Match property with the 64-bit unsigned type
Match a boolean property
Match a property of type double
Used as <match key=“foo.bar” exists=“true”>. This attribute can be used with “true” and “false”, respectively to match when a property exists or does not exist.
This attribute can only be used on string properties with “true” and “false”. The semantics for “true” is to match only when the string is non-empty.
Matches only when a string property represents an absolute path (the path does not have to exist). This attribute can be can be used with “true” or “false”.
Matches only when a string property contains ASCII characters. This attribute can be used with “true” or “false”.
This attribute can be used with int, uint64, double and string properties to compare with a constant. It matches when the given property is less than the given constant using the default ordering.
Similar to compare_lt, but matches when the given property is less than or equal than the given constant using the default ordering.
Similar to compare_lt, but matches when the given property is greater than the given constant using the default ordering.
Similar to compare_lt, but matches when the given property is greater than or equal than the given constant using the default ordering.
This attribute can only be used with string and strlist (string list). For a string key, this matches when the property contains the given (sub)string. For a string list, this matches if the given string matches a item in the list.
Similar to contains, but the property and the given key are converted to lowercase before it is checked.
The merge, append, and prepend directives all require the attribute type which specifies what is to be merged. The following values are supported:
The value is copied to the property. For example, <merge key=”foo bar” type=”string”> baz</merege> merges the value “baz” into the property “foo.bar”.
For merge, the value is copied to the property and the current property is overwritten. For append and prepend, the value is appended or prepended to the list as a new item.
This attribute can merge the values “true” or “false”
Merges an integer
Merges an unsigned 64-bit integer
Merges a double precision floating point number
Copies the value of a given property; supports paths with direct and indirect UDI's. For example, <merge key=”foo.bar” type=”copy_property”>@info.parent:baz.bat</merge> merges the value of the property “baz.bat” on the device object with the UDI from the property “info.parent” into the property “foo.bar” on the device object being processed.
The remove directive requires only a key and can be used with all keys. For strlist, there is also a special syntax to remove a item from the string list. For example, to remove item “bla” from property “foo.bar”, use the following syntax:
<remove key=”foo.bar” type=”strlist”>bla</merge>
Device Information files are stored in the following standard hierachy with the following default top level directories information, policy and preprobe:
Device information files to merge device information.
Device information files included with the hal tarball.
Device information files from the device manufacturer and installed from media accompanying the hardware.
Device information for specific devices.
Device information files to merge policy propertys
Device information files included with the hal tarball and supplied by the operating system vendor for policy rules
Policy rules from the device manufacturer and installed from media accompanying the hardware
Policy rules for specific devices.
Device information files to merge information before probe devices.
Device information files included with the hal tarball and supplied by the operating system vendor.
Device information files from the device manufacturer and installed from media accompanying the hardware.
Device information for specific devices.
All device information files are matched for every hal device object.
See attributes(5) for descriptions of the following attributes:
|