Contents of /trunk/hal/storage-policy.fdi
Parent Directory | Revision Log
Revision 23 -
(show annotations)
(download)
Wed May 4 19:46:06 2005 UTC (19 years, 4 months ago) by niro
File size: 10424 byte(s)
Wed May 4 19:46:06 2005 UTC (19 years, 4 months ago) by niro
File size: 10424 byte(s)
initial release; but really needed ?
1 | <?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- --> |
2 | |
3 | <deviceinfo version="0.2"> |
4 | |
5 | <!-- Default policies merged onto computer root object --> |
6 | <device> |
7 | <match key="info.udi" string="/org/freedesktop/Hal/devices/computer"> |
8 | <merge key="storage.policy.default.mount_root" type="string">/media</merge> |
9 | <merge key="storage.policy.default.use_managed_keyword" type="bool">true</merge> |
10 | <merge key="storage.policy.default.managed_keyword.primary" type="string">managed</merge> |
11 | <merge key="storage.policy.default.managed_keyword.secondary" type="string">kudzu</merge> |
12 | <merge key="storage.policy.default.mount_option.noauto" type="bool">true</merge> |
13 | <merge key="storage.policy.default.mount_option.pamconsole" type="bool">false</merge> |
14 | <merge key="storage.policy.default.mount_option.exec" type="bool">true</merge> |
15 | <merge key="storage.policy.default.mount_option.users" type="bool">true</merge> |
16 | </match> |
17 | </device> |
18 | |
19 | <device> |
20 | <!-- Whitelist bus types of storage devices we care about --> |
21 | <match key="info.category" string="storage"> |
22 | <match key="storage.bus" string="usb"> |
23 | <merge key="storage.policy.should_mount" type="bool">true</merge> |
24 | </match> |
25 | <match key="storage.bus" string="ide"> |
26 | <merge key="storage.policy.should_mount" type="bool">true</merge> |
27 | </match> |
28 | <match key="storage.bus" string="ieee1394"> |
29 | <merge key="storage.policy.should_mount" type="bool">true</merge> |
30 | </match> |
31 | <match key="storage.bus" string="sata"> |
32 | <merge key="storage.policy.should_mount" type="bool">true</merge> |
33 | </match> |
34 | <match key="storage.bus" string="platform"> |
35 | <merge key="storage.policy.should_mount" type="bool">true</merge> |
36 | </match> |
37 | </match> |
38 | <!-- Also add SCSI optical drives --> |
39 | <match key="storage.bus" string="scsi"> |
40 | <match key="storage.drive_type" string="cdrom"> |
41 | <merge key="storage.policy.should_mount" type="bool">true</merge> |
42 | </match> |
43 | </match> |
44 | |
45 | <!-- Handle drives with non-partitioned media --> |
46 | <match key="storage.no_partitions_hint" bool="true"> |
47 | <!-- optical drives --> |
48 | <match key="storage.drive_type" string="cdrom"> |
49 | <merge key="storage.policy.mount_filesystem" type="string">auto</merge> |
50 | <merge key="storage.policy.desired_mount_point" type="string">cdrom</merge> |
51 | <match key="storage.cdrom.cdr" bool="true"> |
52 | <merge key="storage.policy.desired_mount_point" type="string">cdrecorder</merge> |
53 | </match> |
54 | <match key="storage.cdrom.cdrw" bool="true"> |
55 | <merge key="storage.policy.desired_mount_point" type="string">cdrecorder</merge> |
56 | </match> |
57 | <match key="storage.cdrom.dvdplusr" bool="true"> |
58 | <merge key="storage.policy.desired_mount_point" type="string">cdrecorder</merge> |
59 | </match> |
60 | <match key="storage.cdrom.dvdplusrw" bool="true"> |
61 | <merge key="storage.policy.desired_mount_point" type="string">cdrecorder</merge> |
62 | </match> |
63 | <match key="storage.cdrom.dvdram" bool="true"> |
64 | <merge key="storage.policy.desired_mount_point" type="string">cdrecorder</merge> |
65 | </match> |
66 | <match key="storage.cdrom.dvdr" bool="true"> |
67 | <merge key="storage.policy.desired_mount_point" type="string">cdrecorder</merge> |
68 | </match> |
69 | <match key="storage.cdrom.dvdrw" bool="true"> |
70 | <merge key="storage.policy.desired_mount_point" type="string">cdrecorder</merge> |
71 | </match> |
72 | <match key="/org/freedesktop/Hal/devices/computer:linux.is_selinux_enabled" bool="true"> |
73 | <merge key="storage.policy.mount_option.fscontext=system_u:object_r:removable_t" type="bool">true</merge> |
74 | </match> |
75 | </match> |
76 | |
77 | <!-- floppy drives --> |
78 | <match key="storage.drive_type" string="floppy"> |
79 | <merge key="storage.policy.mount_filesystem" type="string">auto</merge> |
80 | <merge key="storage.policy.desired_mount_point" type="string">floppy</merge> |
81 | <match key="/org/freedesktop/Hal/devices/computer:linux.is_selinux_enabled" bool="true"> |
82 | <merge key="storage.policy.mount_option.fscontext=system_u:object_r:removable_t" type="bool">true</merge> |
83 | </match> |
84 | </match> |
85 | |
86 | <!-- zip drives --> |
87 | <match key="storage.drive_type" string="zip"> |
88 | <merge key="storage.policy.mount_filesystem" type="string">auto</merge> |
89 | <merge key="storage.policy.desired_mount_point" type="string">zip</merge> |
90 | <match key="/org/freedesktop/Hal/devices/computer:linux.is_selinux_enabled" bool="true"> |
91 | <merge key="storage.policy.mount_option.fscontext=system_u:object_r:removable_t" type="bool">true</merge> |
92 | </match> |
93 | </match> |
94 | |
95 | <!-- jaz drives --> |
96 | <match key="storage.drive_type" string="jaz"> |
97 | <merge key="storage.policy.mount_filesystem" type="string">auto</merge> |
98 | <merge key="storage.policy.desired_mount_point" type="string">jaz</merge> |
99 | <match key="/org/freedesktop/Hal/devices/computer:linux.is_selinux_enabled" bool="true"> |
100 | <merge key="storage.policy.mount_option.fscontext=system_u:object_r:removable_t" type="bool">true</merge> |
101 | </match> |
102 | </match> |
103 | </match> |
104 | |
105 | <!-- Normal volumes; use volume label, uuid or drive_type --> |
106 | <match key="block.is_volume" bool="true"> |
107 | <match key="volume.fsusage" string="filesystem"> |
108 | <!-- skip for drives with the no partitions hint (they are handled above) --> |
109 | <match key="@block.storage_device:storage.no_partitions_hint" bool="false"> |
110 | |
111 | <merge key="volume.policy.should_mount" type="bool">true</merge> |
112 | <merge key="volume.policy.mount_filesystem" type="copy_property">volume.fstype</merge> |
113 | |
114 | <!-- Fallback is '<storage.bus>', appended with 'disk', e.g. usbdisk, |
115 | idedisk, scsidisk etc. --> |
116 | <merge key="volume.policy.desired_mount_point" type="copy_property">@block.storage_device:storage.bus</merge> |
117 | <append key="volume.policy.desired_mount_point" type="string">disk</append> |
118 | |
119 | <!-- zip drives --> |
120 | <match key="storage.drive_type" string="zip"> |
121 | <merge key="storage.policy.desired_mount_point" type="string">zip</merge> |
122 | </match> |
123 | |
124 | <!-- Best: If available use filesystem label --> |
125 | <match key="volume.label" empty="false"> |
126 | <!-- unless it's a path (e.g. /boot, /, /home etc) --> |
127 | <match key="volume.label" is_absolute_path="false"> |
128 | <!-- and only if the label is ascii --> |
129 | <match key="volume.label" is_ascii="true"> |
130 | <merge key="volume.policy.desired_mount_point" type="copy_property">volume.label</merge> |
131 | </match> |
132 | </match> |
133 | </match> |
134 | |
135 | <!-- Should never mount Apple Bootstrap partitions (it would be |
136 | a security hole) - should use the bootable flag from the |
137 | Mac partition table instead --> |
138 | <match key="volume.fstype" string="hfs"> |
139 | <match key="volume.label" string="bootstrap"> |
140 | <merge key="volume.policy.should_mount" type="bool">false</merge> |
141 | </match> |
142 | </match> |
143 | |
144 | <!-- Use selinux mount options for hotpluggable and removable |
145 | volumes --> |
146 | <match key="/org/freedesktop/Hal/devices/computer:linux.is_selinux_enabled" bool="true"> |
147 | <match key="@block.storage_device:storage.hotpluggable" bool="true"> |
148 | <merge key="volume.policy.mount_option.fscontext=system_u:object_r:removable_t" type="bool">true</merge> |
149 | </match> |
150 | <match key="@block.storage_device:storage.removable" bool="true"> |
151 | <merge key="volume.policy.mount_option.fscontext=system_u:object_r:removable_t" type="bool">true</merge> |
152 | </match> |
153 | </match> |
154 | |
155 | <!-- Use noatime and sync options for all hotpluggable or removable |
156 | volumes smaller than 2GB --> |
157 | <match key="volume.size" compare_lt="2147483648"> |
158 | <match key="@block.storage_device:storage.hotpluggable" bool="true"> |
159 | <merge key="volume.policy.mount_option.sync" type="bool">true</merge> |
160 | <merge key="volume.policy.mount_option.noatime" type="bool">true</merge> |
161 | </match> |
162 | <match key="@block.storage_device:storage.removable" bool="true"> |
163 | <merge key="volume.policy.mount_option.sync" type="bool">true</merge> |
164 | <merge key="volume.policy.mount_option.noatime" type="bool">true</merge> |
165 | </match> |
166 | </match> |
167 | |
168 | <!-- Use UTF-8 charset for vfat --> |
169 | <match key="volume.fstype" string="vfat"> |
170 | <merge key="volume.policy.mount_option.iocharset=utf8" type="bool">false</merge> |
171 | </match> |
172 | |
173 | <!-- whitelist of partition table id's, if from a msdos partition table --> |
174 | <match key="volume.partition.msdos_part_table_type" exists="true"> |
175 | <!-- Default to no mount and punch holes --> |
176 | <merge key="volume.policy.should_mount" type="bool">false</merge> |
177 | <!-- Linux --> |
178 | <match key="volume.partition.msdos_part_table_type" int="0x83"> |
179 | <merge key="volume.policy.should_mount" type="bool">true</merge> |
180 | </match> |
181 | <!-- FAT12 --> |
182 | <match key="volume.partition.msdos_part_table_type" int="0x01"> |
183 | <merge key="volume.policy.should_mount" type="bool">true</merge> |
184 | </match> |
185 | <!-- FAT16 <32M --> |
186 | <match key="volume.partition.msdos_part_table_type" int="0x04"> |
187 | <merge key="volume.policy.should_mount" type="bool">true</merge> |
188 | </match> |
189 | <!-- FAT16 --> |
190 | <match key="volume.partition.msdos_part_table_type" int="0x06"> |
191 | <merge key="volume.policy.should_mount" type="bool">true</merge> |
192 | </match> |
193 | <!-- HPFS/NTFS --> |
194 | <match key="volume.partition.msdos_part_table_type" int="0x07"> |
195 | <merge key="volume.policy.should_mount" type="bool">true</merge> |
196 | </match> |
197 | <!-- W95 FAT32 --> |
198 | <match key="volume.partition.msdos_part_table_type" int="0x0b"> |
199 | <merge key="volume.policy.should_mount" type="bool">true</merge> |
200 | </match> |
201 | <!-- W95 FAT32 (LBA) --> |
202 | <match key="volume.partition.msdos_part_table_type" int="0x0c"> |
203 | <merge key="volume.policy.should_mount" type="bool">true</merge> |
204 | </match> |
205 | <!-- W95 FAT16 (LBA) --> |
206 | <match key="volume.partition.msdos_part_table_type" int="0x0e"> |
207 | <merge key="volume.policy.should_mount" type="bool">true</merge> |
208 | </match> |
209 | </match> |
210 | </match> |
211 | </match> |
212 | </match> |
213 | |
214 | </device> |
215 | |
216 | <!-- Dont want to mount non-hotpluggable fixed disks since ideraid |
217 | detection isnt complete as hald wrongly detects e.g. partitions |
218 | from some IDE RAID controllers --> |
219 | <device> |
220 | <match key="storage.hotpluggable" bool="false"> |
221 | <match key="storage.removable" bool="false"> |
222 | <merge key="storage.policy.should_mount" type="bool">false</merge> |
223 | </match> |
224 | </match> |
225 | </device> |
226 | |
227 | </deviceinfo> |