1fdi(4) File Formats fdi(4)
2
3
4
6 fdi - HAL device information file format
7
9 /usr/share/lib/xml/dtd/fdi.dtd.1
10
11
13 The hardware abstraction layer facility, described in hal(5), uses an
14 XML-based file format to merge arbitrary properties onto device
15 objects. The way device information files works is that once all physi‐
16 cal properties are merged onto a device object, it is tried against the
17 set of installed device information files. Device information files are
18 used for both merging facts and policy settings for devices.
19
20
21 Each device information file has a number of match directives that are
22 tested against the properties of the device object. The directives have
23 the form:
24
25 <match key="property" [string|int|bool|..]="value">
26
27
28
29 If all the match directives pass, then the device information can
30 include the following property directives in the form:
31
32 <[merge|append|prepend] key="property" type="[string|int|bool|..]">
33
34
35
36 These directives are used to merge new properties or append to existing
37 properties on the device object. Any previously property stemming from
38 device detection can be overridden by a device information file.
39
40
41 The match, merge, append, and prepend directives require that the key
42 attribute be either a property name on the device object in question or
43 a path to a property on another device object. The path to a property
44 is expressed either through direct specification of the UDI, such as
45 /org/freedesktop/Hal/devices/computer:foo.bar or through indirect ref‐
46 erences such as "@info.parent:baz", meaning that the device object
47 specified by the UDI in the string property "info.parent" should be
48 used to query the property "baz". It is also possible to use multiple
49 indirections. For example, for a volume on a USB memory stick, the
50 indirection "@block.storage_device:@storage.physical_device:usb.ven‐
51 dor_id" references the "usb.vendor_id" property on the device object
52 representing the USB interface.
53
54
55 When the property to match has been determined, the following
56 attributes can be used within the "match" tag:
57
58 string Match a string property. For example, <match key=
59 "foo.bar" string="baz"> matches only if "foo.bar"
60 is a string property assuming the value "baz".
61
62
63 int Match an integer property
64
65
66 uint64 Match property with the 64-bit unsigned type
67
68
69 bool Match a boolean property
70
71
72 double Match a property of type double
73
74
75 exists Used as <match key="foo.bar" exists="true">. This
76 attribute can be used with "true" and "false",
77 respectively to match when a property exists or
78 does not exist.
79
80
81 empty This attribute can only be used on string proper‐
82 ties with "true" and "false". The semantics for
83 "true" is to match only when the string is non-
84 empty.
85
86
87 is_absolute_path Matches only when a string property represents an
88 absolute path (the path does not have to exist).
89 This attribute can be can be used with "true" or
90 "false".
91
92
93 is_ascii Matches only when a string property contains ASCII
94 characters. This attribute can be used with "true"
95 or "false".
96
97
98 compare_lt This attribute can be used with int, uint64, double
99 and string properties to compare with a constant.
100 It matches when the given property is less than the
101 given constant using the default ordering.
102
103
104 compare_le Similar to compare_lt, but matches when the given
105 property is less than or equal than the given con‐
106 stant using the default ordering.
107
108
109 compare_gt Similar to compare_lt, but matches when the given
110 property is greater than the given constant using
111 the default ordering.
112
113
114 Similar to compare_lt, but matches when the given
115 property is greater than or equal than the given
116 constant using the default ordering.
117
118
119 This attribute can only be used with string and
120 strlist (string list). For a string key, this
121 matches when the property contains the given
122 (sub)string. For a string list, this matches if the
123 given string matches a item in the list.
124
125
126 contains_ncase Similar to contains, but the property and the given
127 key are converted to lowercase before it is
128 checked.
129
130
131
132 The merge, append, and prepend directives all require the attribute
133 type which specifies what is to be merged. The following values are
134 supported:
135
136 string The value is copied to the property. For example,
137 <merge key="foo bar" type="string"> baz</merege>
138 merges the value "baz" into the property "foo.bar".
139
140
141 strlist For merge, the value is copied to the property and the
142 current property is overwritten. For append and
143 prepend, the value is appended or prepended to the
144 list as a new item.
145
146
147 bool This attribute can merge the values "true" or "false"
148
149
150 int Merges an integer
151
152
153 uint64 Merges an unsigned 64-bit integer
154
155
156 double Merges a double precision floating point number
157
158
159 copy_property Copies the value of a given property; supports paths
160 with direct and indirect UDI's. For example, <merge
161 key="foo.bar" type="copy_property">@info.par‐
162 ent:baz.bat</merge> merges the value of the property
163 "baz.bat" on the device object with the UDI from the
164 property "info.parent" into the property "foo.bar" on
165 the device object being processed.
166
167
168
169 The remove directive requires only a key and can be used with all keys.
170 For strlist, there is also a special syntax to remove a item from the
171 string list. For example, to remove item "bla" from property "foo.bar",
172 use the following syntax:
173
174 <remove key="foo.bar" type="strlist">bla</merge>
175
176
177
178 Device Information files are stored in the following standard hierachy
179 with the following default top level directories information, policy
180 and preprobe:
181
182 information Device information files to merge device information.
183
184 10freedesktop Device information files included with
185 the hal tarball.
186
187
188 20thirdparty Device information files from the
189 device manufacturer and installed from
190 media accompanying the hardware.
191
192
193 30user Device information for specific
194 devices.
195
196
197
198 policy Device information files to merge policy propertys
199
200 10osvendor Device information files included with
201 the hal tarball and supplied by the
202 operating system vendor for policy rules
203
204
205 20thirdparty Policy rules from the device manufac‐
206 turer and installed from media accompa‐
207 nying the hardware
208
209
210 30user Policy rules for specific devices.
211
212
213
214 preprobe Device information files to merge information before
215 probe devices.
216
217 10osvendor Device information files included with
218 the hal tarball and supplied by the
219 operating system vendor.
220
221
222 20thirdparty Device information files from the device
223 manufacturer and installed from media
224 accompanying the hardware.
225
226
227 30user Device information for specific devices.
228
229
230
231
232 All device information files are matched for every hal device object.
233
235 See attributes(5) for descriptions of the following attributes:
236
237
238
239
240 ┌─────────────────────────────┬─────────────────────────────┐
241 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
242 ├─────────────────────────────┼─────────────────────────────┤
243 │Availability │SUNWhalr │
244 ├─────────────────────────────┼─────────────────────────────┤
245 │Interface Stability │Volatile │
246 └─────────────────────────────┴─────────────────────────────┘
247
249 hald(1M), attributes(5), hal(5), locale(5), smf(5)
250
251
252
253SunOS 5.11 5 Sept 2006 fdi(4)