Filesystem options for USB storage devices

Carlos Rodrigues carlos.efr at mail.telepac.pt
Wed Apr 27 22:50:11 UTC 2005


Karel Zak wrote:
>>I wanted to change some options (exec, ...) for "vfat" devices but I
>>don't want to hardcode an entry into /etc/fstab.
> 
> 
> /usr/share/hal/fdi/90defaultpolicy/storage-policy.fdi
> /usr/share/hal/fdi/95userpolicy

Ok, got it. I added a file to "95userpolicy" containing:

<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->
<deviceinfo version="0.2">
   <device>
     <!-- Normal volumes; use volume label, uuid or drive_type -->
     <match key="block.is_volume" bool="true">
       <match key="volume.fsusage" string="filesystem">
         <!-- skip for drives with the no partitions hint (they are 
handled above) -->
         <match key="@block.storage_device:storage.no_partitions_hint" 
bool="false">
           <!-- Use UTF-8 charset for vfat -->
           <match key="volume.fstype" string="vfat">
             <merge key="volume.policy.mount_option.exec" 
type="bool">false</merge>
             <merge key="volume.policy.mount_option.nodev" 
type="bool">true</merge>
             <merge key="volume.policy.mount_option.noexec" 
type="bool">true</merge>
             <merge key="volume.policy.mount_option.nosuid" 
type="bool">true</merge>
             <merge key="volume.policy.mount_option.iocharset=utf8" 
type="bool">true</merge>
             <merge key="volume.policy.mount_option.shortname=winnt" 
type="bool">true</merge>
           </match>
         </match>
       </match>
     </match>
   </device>
</deviceinfo>

I don't know if it can be done with less text, but it works anyway.

But God... this makes me remember why I _hate_ XML configuration files...

-- 
Carlos Rodrigues




More information about the devel mailing list