aboutsummaryrefslogtreecommitdiff
blob: 71d9adbe046e27dc4853c855824c530144181b5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
<?xml version="1.0" encoding="UTF-8"?>

<deviceinfo version="0.2">
  <device>
    <match key="info.udi" string="/org/freedesktop/Hal/devices/computer">
      <append key="info.callouts.add" type="strlist">hal-storage-cleanup-all-mountpoints</append>
    </match>

    <!-- poll drives with removable media -->
    <match key="storage.removable" bool="true">
      <append key="info.addons" type="strlist">hald-addon-storage</append>
    </match>

    <match key="volume.is_disc" bool="true">
      <match key="volume.disc.has_audio" bool="true">
        <append key="info.interfaces" type="strlist">org.freedesktop.Hal.Device.Volume</append>
        <append key="org.freedesktop.Hal.Device.Volume.method_names" type="strlist">Eject</append>
        <append key="org.freedesktop.Hal.Device.Volume.method_signatures" type="strlist">as</append>
	<append key="org.freedesktop.Hal.Device.Volume.method_argnames" type="strlist">extra_options</append>
        <append key="org.freedesktop.Hal.Device.Volume.method_execpaths" type="strlist">hal-storage-eject</append>
      </match>
      <match key="volume.disc.is_blank" bool="true">
        <append key="info.interfaces" type="strlist">org.freedesktop.Hal.Device.Volume</append>
        <append key="org.freedesktop.Hal.Device.Volume.method_names" type="strlist">Eject</append>
        <append key="org.freedesktop.Hal.Device.Volume.method_signatures" type="strlist">as</append>
	<append key="org.freedesktop.Hal.Device.Volume.method_argnames" type="strlist">extra_options</append>
        <append key="org.freedesktop.Hal.Device.Volume.method_execpaths" type="strlist">hal-storage-eject</append>
      </match>
    </match>

    <!-- this is to be able to mount media in drives we cannot poll, e.g. IDE Zip Drives and PC style floppy drives -->
    <match key="storage.media_check_enabled" bool="false">
      <match key="storage.no_partitions_hint" bool="true">

        <append key="info.interfaces" type="strlist">org.freedesktop.Hal.Device.Volume</append>

        <append key="org.freedesktop.Hal.Device.Volume.method_names" type="strlist">Mount</append>
        <append key="org.freedesktop.Hal.Device.Volume.method_signatures" type="strlist">ssas</append>
	<append key="org.freedesktop.Hal.Device.Volume.method_argnames" type="strlist">mount_point fstype extra_options</append>
        <append key="org.freedesktop.Hal.Device.Volume.method_execpaths" type="strlist">hal-storage-mount</append>

        <append key="org.freedesktop.Hal.Device.Volume.method_names" type="strlist">Unmount</append>
        <append key="org.freedesktop.Hal.Device.Volume.method_signatures" type="strlist">as</append>
	<append key="org.freedesktop.Hal.Device.Volume.method_argnames" type="strlist">extra_options</append>
        <append key="org.freedesktop.Hal.Device.Volume.method_execpaths" type="strlist">hal-storage-unmount</append>

        <append key="org.freedesktop.Hal.Device.Volume.method_names" type="strlist">Eject</append>
        <append key="org.freedesktop.Hal.Device.Volume.method_signatures" type="strlist">as</append>
	<append key="org.freedesktop.Hal.Device.Volume.method_argnames" type="strlist">extra_options</append>
        <append key="org.freedesktop.Hal.Device.Volume.method_execpaths" type="strlist">hal-storage-eject</append>

        <!-- allow these mount options for all file systems -->
	<match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" string="Linux">
          <append key="volume.mount.valid_options" type="strlist">ro</append>
          <append key="volume.mount.valid_options" type="strlist">sync</append>
          <append key="volume.mount.valid_options" type="strlist">dirsync</append>
          <append key="volume.mount.valid_options" type="strlist">noatime</append>
          <append key="volume.mount.valid_options" type="strlist">nodiratime</append>
          <append key="volume.mount.valid_options" type="strlist">noexec</append>
          <append key="volume.mount.valid_options" type="strlist">quiet</append>
          <append key="volume.mount.valid_options" type="strlist">remount</append>
	  <append key="volume.mount.valid_options" type="strlist">exec</append>
          <!-- As this is removable media give some leeway -->
	  <append key="volume.mount.valid_options" type="strlist">utf8</append>
	  <append key="volume.mount.valid_options" type="strlist">shortname=</append>
	  <append key="volume.mount.valid_options" type="strlist">codepage=</append>
	  <append key="volume.mount.valid_options" type="strlist">iocharset=</append>
	  <append key="volume.mount.valid_options" type="strlist">umask=</append>
	  <append key="volume.mount.valid_options" type="strlist">uid=</append>
	</match>
	<match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" string="FreeBSD">
	  <append key="volume.mount.valid_options" type="strlist">ro</append>
	  <append key="volume.mount.valid_options" type="strlist">noexec</append>
	  <append key="volume.mount.valid_options" type="strlist">noatime</append>
	</match>
      </match>
    </match>


    <match key="volume.fsusage" string="filesystem">

      <!-- Here follow volumes we specifically want to ignore - it is the -->
      <!-- responsibility of software higher in the stack (e.g. gnome-vfs) -->
      <!-- amd mount programs (e.g. Mount() on HAL) to respect volume.ignore -->
      <merge key="volume.ignore" type="bool">false</merge>

      <!-- Should always ignore Apple Bootstrap partitions (it would be -->
      <!-- a security hole to mount it) - TODO: should use the bootable -->
      <!-- flag from the Mac partition table instead -->
      <match key="volume.fstype" string="hfs">
	<match key="volume.label" string="bootstrap">
          <merge key="volume.ignore" type="bool">true</merge>
	</match>
      </match>

      <!-- Lenovo and IBM ship with a various recovery partitions -->
      <match key="volume.fstype" string="vfat">
	<match key="volume.label" string="SERVICEV001">
	  <merge key="volume.ignore" type="bool">true</merge>
	</match>
	<match key="volume.label" string="IBM_SERVICE">
	  <merge key="volume.ignore" type="bool">true</merge>
	</match>
      </match>
      <match key="volume.fstype" string="ntfs">
	<match key="volume.label" string="SERVICEV002">
	  <merge key="volume.ignore" type="bool">true</merge>
	</match>
      </match>

      <!-- HP ships desktops with a recovery partition -->
      <match key="volume.fstype" string="vfat">
	<match key="volume.label" string="HP_RECOVERY">
	  <merge key="volume.ignore" type="bool">true</merge>
	</match>
      </match>

      <!-- Sony ships laptops with a recovery partition -->
      <match key="volume.fstype" string="ntfs">
	<match key="volume.label" string="Recovery Partition">
	  <merge key="volume.ignore" type="bool">true</merge>
	</match>
      </match>

      <!-- DELL ships some laptops with a visible recovery partition -->
      <match key="volume.fstype" string="vfat">
	<match key="volume.label" string="DellUtility">
	  <merge key="volume.ignore" type="bool">true</merge>
	</match>
	<match key="volume.label" string="DellRestore">
	  <merge key="volume.ignore" type="bool">true</merge>
	</match>
      </match>

      <!-- ASUS ships some desktop with a recovery partition -->
      <match key="volume.fstype" string="vfat">
	<match key="volume.label" string="RECOVERY">
	  <merge key="volume.ignore" type="bool">true</merge>
	</match>
	<match key="volume.label" string="PQSERVICE">
	  <merge key="volume.ignore" type="bool">true</merge>
	</match>
      </match>
      <match key="volume.fstype" string="ntfs">
	<match key="volume.label" string="PQSERVICE">
	  <merge key="volume.ignore" type="bool">true</merge>
	</match>
      </match>

      <!-- Hide partitions marked as Compaq Diagnostics -->
      <match key="volume.partition.type" string="0x12">
         <merge key="volume.ignore" type="bool">true</merge>
      </match>

      <!-- EFI firmware partitions -->
      <match key="volume.fstype" string="vfat">
	<match key="volume.label" string="EFI">
	  <merge key="volume.ignore" type="bool">true</merge>
	</match>
      </match>

      <append key="info.interfaces" type="strlist">org.freedesktop.Hal.Device.Volume</append>

      <append key="org.freedesktop.Hal.Device.Volume.method_names" type="strlist">Mount</append>
      <append key="org.freedesktop.Hal.Device.Volume.method_signatures" type="strlist">ssas</append>
      <append key="org.freedesktop.Hal.Device.Volume.method_argnames" type="strlist">mount_point fstype extra_options</append>
      <append key="org.freedesktop.Hal.Device.Volume.method_execpaths" type="strlist">hal-storage-mount</append>

      <append key="org.freedesktop.Hal.Device.Volume.method_names" type="strlist">Unmount</append>
      <append key="org.freedesktop.Hal.Device.Volume.method_signatures" type="strlist">as</append>
      <append key="org.freedesktop.Hal.Device.Volume.method_argnames" type="strlist">extra_options</append>
      <append key="org.freedesktop.Hal.Device.Volume.method_execpaths" type="strlist">hal-storage-unmount</append>

      <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" string="Linux">
        <match key="volume.linux.is_device_mapper" bool="false">
          <append key="org.freedesktop.Hal.Device.Volume.method_names" type="strlist">Eject</append>
          <append key="org.freedesktop.Hal.Device.Volume.method_signatures" type="strlist">as</append>
          <append key="org.freedesktop.Hal.Device.Volume.method_argnames" type="strlist">extra_options</append>
          <append key="org.freedesktop.Hal.Device.Volume.method_execpaths" type="strlist">hal-storage-eject</append>
        </match>
      </match>

      <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" string="FreeBSD">
        <append key="org.freedesktop.Hal.Device.Volume.method_names" type="strlist">Eject</append>
	<append key="org.freedesktop.Hal.Device.Volume.method_signatures" type="strlist">as</append>
	<append key="org.freedesktop.Hal.Device.Volume.method_argnames" type="strlist">extra_options</append>
	<append key="org.freedesktop.Hal.Device.Volume.method_execpaths" type="strlist">hal-storage-eject</append>
      </match>

      <!-- allow these mount options for all file systems -->
      <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" string="Linux">
        <append key="volume.mount.valid_options" type="strlist">ro</append>
        <append key="volume.mount.valid_options" type="strlist">sync</append>
        <append key="volume.mount.valid_options" type="strlist">dirsync</append>
        <append key="volume.mount.valid_options" type="strlist">noatime</append>
        <append key="volume.mount.valid_options" type="strlist">nodiratime</append>
        <append key="volume.mount.valid_options" type="strlist">noexec</append>
        <append key="volume.mount.valid_options" type="strlist">quiet</append>
        <append key="volume.mount.valid_options" type="strlist">remount</append>
        <append key="volume.mount.valid_options" type="strlist">exec</append>
      </match>
      <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" string="FreeBSD">
        <append key="volume.mount.valid_options" type="strlist">ro</append>
	<append key="volume.mount.valid_options" type="strlist">noexec</append>
	<append key="volume.mount.valid_options" type="strlist">noatime</append>
      </match>

      <!-- allow these mount options for vfat -->
      <match key="volume.fstype" string="vfat">
	<match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" string="Linux">
	  <append key="volume.mount.valid_options" type="strlist">utf8</append>
	  <append key="volume.mount.valid_options" type="strlist">shortname=</append>
	  <append key="volume.mount.valid_options" type="strlist">codepage=</append>
	  <append key="volume.mount.valid_options" type="strlist">iocharset=</append>
	  <append key="volume.mount.valid_options" type="strlist">umask=</append>
	  <append key="volume.mount.valid_options" type="strlist">dmask=</append>
	  <append key="volume.mount.valid_options" type="strlist">fmask=</append>
	  <append key="volume.mount.valid_options" type="strlist">uid=</append>
	  <append key="volume.mount.valid_options" type="strlist">flush</append>
	</match>
	<match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" string="FreeBSD">
	  <append key="volume.mount.valid_options" type="strlist">longnames</append>
	  <append key="volume.mount.valid_options" type="strlist">shortnames</append>
	  <append key="volume.mount.valid_options" type="strlist">nowin95</append>
	  <append key="volume.mount.valid_options" type="strlist">-u=</append>
	  <append key="volume.mount.valid_options" type="strlist">-g=</append>
	  <append key="volume.mount.valid_options" type="strlist">-m=</append>
	  <append key="volume.mount.valid_options" type="strlist">-M=</append>
	  <append key="volume.mount.valid_options" type="strlist">-L=</append>
	  <append key="volume.mount.valid_options" type="strlist">-D=</append>
	  <append key="volume.mount.valid_options" type="strlist">large</append>
	</match>
      </match>


      <!-- allow these mount options for hfs -->
      <match key="volume.fstype" string="hfs">
	<append key="volume.mount.valid_options" type="strlist">gid=</append>
	<append key="volume.mount.valid_options" type="strlist">uid=</append>
	<append key="volume.mount.valid_options" type="strlist">force</append>
      </match>

      <!-- allow these mount options for hfsplus -->
      <match key="volume.fstype" string="hfsplus">
	<append key="volume.mount.valid_options" type="strlist">force</append>
      </match>

      <!-- allow these mount options for ntfs -->
      <match key="volume.fstype" string="ntfs">
	<match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" string="Linux">
	  <append key="volume.mount.valid_options" type="strlist">uid=</append>
	  <append key="volume.mount.valid_options" type="strlist">gid=</append>
	  <append key="volume.mount.valid_options" type="strlist">umask=</append>
	  <append key="volume.mount.valid_options" type="strlist">locale=</append>
	  <append key="volume.mount.valid_options" type="strlist">utf8</append>
	</match>
	<match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" string="FreeBSD">
	  <append key="volume.mount.valid_options" type="strlist">-u=</append>
	  <append key="volume.mount.valid_options" type="strlist">-g=</append>
	  <append key="volume.mount.valid_options" type="strlist">-m=</append>
	  <append key="volume.mount.valid_options" type="strlist">-a</append>
	  <append key="volume.mount.valid_options" type="strlist">-i</append>
	  <append key="volume.mount.valid_options" type="strlist">-C=</append>
	  <append key="volume.mount.valid_options" type="strlist">-W=</append>
	</match>
      </match>

      <!-- allow these mount options for ext3 -->
      <match key="volume.fstype" string="ext3">
	<append key="volume.mount.valid_options" type="strlist">acl</append>
	<append key="volume.mount.valid_options" type="strlist">user_xattr</append>
	<append key="volume.mount.valid_options" type="strlist">data=</append>
      </match>

      <!-- allow these mount options for ext2 -->
      <match key="volume.fstype" string="ext2">
	<append key="volume.mount.valid_options" type="strlist">acl</append>
	<append key="volume.mount.valid_options" type="strlist">user_xattr</append>
      </match>

      <!-- allow these mount options for ufs -->
      <match key="volume.fstype" string="ufs">
	<match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" string="Linux">
	  <append key="volume.mount.valid_options" type="strlist">ufstype=</append>
	</match>
      </match>

      <!-- udf -->
      <match key="volume.fstype" string="udf">
	<match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" string="Linux">
	  <append key="volume.mount.valid_options" type="strlist">uid=</append>
	  <append key="volume.mount.valid_options" type="strlist">umask=</append>
	</match>
	<match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" string="FreeBSD">
	  <append key="volume.mount.valid_options" type="strlist">-C=</append>
	  <append key="volume.mount.valid_options" type="strlist">-v</append>
	</match>
      </match>

      <!-- iso9660 -->
      <match key="volume.fstype" string="iso9660">
	<match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" string="Linux">
	  <append key="volume.mount.valid_options" type="strlist">utf8</append>
	  <append key="volume.mount.valid_options" type="strlist">uid=</append>
	  <append key="volume.mount.valid_options" type="strlist">mode=</append>
	  <append key="volume.mount.valid_options" type="strlist">iocharset=</append>
	</match>
	<match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" string="FreeBSD">
	  <append key="volume.mount.valid_options" type="strlist">extatt</append>
	  <append key="volume.mount.valid_options" type="strlist">gens</append>
	  <append key="volume.mount.valid_options" type="strlist">nojoliet</append>
	  <append key="volume.mount.valid_options" type="strlist">norrip</append>
	  <append key="volume.mount.valid_options" type="strlist">nostrictjoliet</append>
	  <append key="volume.mount.valid_options" type="strlist">-s=</append>
	  <append key="volume.mount.valid_options" type="strlist">-C=</append>
	  <append key="volume.mount.valid_options" type="strlist">-v</append>
	</match>
      </match>

      <!-- allow these unmount options -->
      <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" string="Linux">
        <append key="volume.unmount.valid_options" type="strlist">lazy</append>
      </match>

    </match>

    <!-- make sure we export Eject on discs where we don't recognize the file system -->
    <match key="volume.is_disc" bool="true">
      <match key="volume.fsusage" string="">
        <append key="info.interfaces" type="strlist">org.freedesktop.Hal.Device.Volume</append>
        <append key="org.freedesktop.Hal.Device.Volume.method_names" type="strlist">Eject</append>
        <append key="org.freedesktop.Hal.Device.Volume.method_signatures" type="strlist">as</append>
	<append key="org.freedesktop.Hal.Device.Volume.method_argnames" type="strlist">extra_options</append>
        <append key="org.freedesktop.Hal.Device.Volume.method_execpaths" type="strlist">hal-storage-eject</append>
      </match>
    </match>

    <match key="storage.requires_eject" bool="true">
        <!-- storage Eject causes eject on each volume on this storage -->
        <append key="info.interfaces" type="strlist">org.freedesktop.Hal.Device.Storage</append>
        <append key="org.freedesktop.Hal.Device.Storage.method_names" type="strlist">Eject</append>
        <append key="org.freedesktop.Hal.Device.Storage.method_signatures" type="strlist">as</append>
	<append key="org.freedesktop.Hal.Device.Storage.method_argnames" type="strlist">extra_options</append>
        <append key="org.freedesktop.Hal.Device.Storage.method_execpaths" type="strlist">hal-storage-eject</append>

        <append key="info.interfaces" type="strlist">org.freedesktop.Hal.Device.Storage</append>
        <append key="org.freedesktop.Hal.Device.Storage.method_names" type="strlist">CloseTray</append>
        <append key="org.freedesktop.Hal.Device.Storage.method_signatures" type="strlist">as</append>
	<append key="org.freedesktop.Hal.Device.Storage.method_argnames" type="strlist">extra_options</append>
        <append key="org.freedesktop.Hal.Device.Storage.method_execpaths" type="strlist">hal-storage-closetray</append>
    </match>
  </device>
</deviceinfo>