Modifying mount points of USB Mass Storage devices

John (J5) Palmieri johnp at redhat.com
Fri Dec 9 05:27:52 PST 2005


On Fri, 2005-12-09 at 13:59 +0100, vitko wrote:
> Bill Paxton wrote:
> 
> > I hate asking these kinds of questions, I've read the archives and 
> > googled for a couple days but I can't figure it out on my own. Sorry.
> > 
> > So here we have a USB Mass Storage camera. I can tickle udev to make a 
> > snazzy device name for it, that works well but it's just cosmetic. The 
> > big deal comes from the fdi entry and the mount point. I don't care if 
> > it's /dev/sd? but I do care where it gets mounted.
> 
> ...
> 
> > And it does make those entries in the corresponding udi when you check 
> > it with lshal. But that's not where the actual mount is; it's a parent 
> > device.
> 
> Bill, I have similar problems, I'm trying to enforce custom mountpoint
> /media/apacerht203 for my Apacer flash drive. My FDI is
> 
> $ cat /usr/share/hal/fdi/50user/apacer_ht203.fdi
> <?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->
> 
> <deviceinfo version="0.2">
>    <device>

So the first match (or first few matches) needs to be a match that is
unique to the level you wish to append the property to. The you must
match on keys relative to that level using the @<udi_key>:<key> syntax
(i.e. <match key="@info.parent:usb.vendor_id" int="0x1005">).  It is
best not to use info.parent because you can't be sure the parent won't
change in future releases but if there is no other UDI key that points
to the right level then this is the way to do it.   Sorry I don't have
any USB hardware to give a better example with but it is all at the
office and the weather is keeping me from going in today.  Check out the
storage policy fdi that ships with HAL for more insight.

>      <match key="info.bus" string="usb">
>        <match key="usb.vendor_id" int="0x1005">
>          <match key="usb.product_id" int="0xb113">
>            <merge key="usb.product" type="string">FooBarJustToTestMatchWorks</merge>
>            <merge key="volume.policy.desired_mount_point" 
> type="string">/media/apacerht203</merge>
>        </match>
>      </match>
>    </device>
> </deviceinfo>
> 
> but so far I failed to set it for correct object, as I don't know how
> to propagete it to volume object.
> 
> (Anyone willing to kick me in the right direction?)
> 
> Vit
> _______________________________________________
> hal mailing list
> hal at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/hal
-- 
John (J5) Palmieri <johnp at redhat.com>



More information about the hal mailing list