Modifying mount points of USB Mass Storage devices
vitko
vitk0 at seznam.cz
Tue Dec 13 02:38:08 PST 2005
> I did figure out an admittedly redundant kludge-y way after talking with John off-list (thanks John!) It's probably not the right solution; nonetheless it works.
>
> My (and yours, and probably everyones' similar) problem is that I kept trying to refer to keys from a "deeper" udi than it's parent. AFAICT this does not work or I cannot decipher the proper refer syntax. So what I did to get it to work is to just clone the relevant values "up" to a "higher" udi where they are accessable.
>
> In my case, I'm trying to match at the volume udi. But I wanted to refer to keys in storage.physical_device... two "levels below" as it were. However inside the volume's udi I could only access block.storage_device keys.(it's direct parent). To get around it I just copy the needed keys from physical. to block. and then when I match on volume level keys I can have access to these values... problem solved.
>
> As exampled below, any media mounted via USB device 0x123 from vendor 0x1234 with serial 012345 will /always/ mount to /media/permanent_mount_point regardless of it's size, label, format, uuid, etc.
Very good.
(OT: please note that very long lines of text are hard to quote, try to
break your lines after some 80 characters)
> ----
> <device>
> <match key="storage.bus" string="usb">
> <match key="@storage.physical_device:usb.vendor_id" int="0x1234">
> <match key="@storage.physical_device:usb.product_id" int="0x123">
> <match key="@storage.physical_device:usb.serial" string="012345">
> <merge key="usb.vendor_id" type="copy_property">@storage.physical_device:usb.vendor_id</merge>
> <merge key="usb.product_id" type="copy_property">@storage.physical_device:usb.product_id</merge>
> <merge key="usb.serial" type="copy_property">@storage.physical_device:usb.serial</merge>
> </match>
> </match>
> </match>
> </match>
> </device>
>
> <device>
> <match key="block.is_volume" bool="true">
> <match key="@block.storage_device:usb.vendor_id" int="0x1234">
> <match key="@block.storage_device:usb.product_id" int="0x123">
> <match key="@block.storage_device:usb.serial" string="012345">
> <merge key="volume.policy.desired_mount_point" type="string">permanent_mount_point</merge>
> </match>
> </match>
> </match>
> </match>
> </device>
> ----
Yes, your fdi really works, thanks a lot! Yet I hope this is still only a workaround and a
clean solution lives somewhere out there.
Have a nice day,
Vit
More information about the hal
mailing list