Weird bugs processing fdi files
David Zeuthen
david at fubar.dk
Wed May 2 19:16:58 PDT 2007
Hi,
Looks like I dropped the Cc to the hal list in my last reply, sorry,
readding it.
On Wed, 2007-05-02 at 00:49 -0400, Jeff Mitchell wrote:
> David Zeuthen wrote:
> >> <match key="info.bus" string="usb">
> >> <match key="usb.vendor_id" int="0x05ac">
> >> <match key="usb.product_id" int="0x1301">
> >> <merge key="portable_audio_player.access_method"
> >> type="string">libgpod</merge>
> >> <append key="libgpod.name" type="string">iPod Shuffle
> >> (2G)</append>
> >> </match>
> >> </match>
> >> </match>
> >>
> >> This method does produce a match, and the keys do get merged in.
> >> However, (using the names from the hal-device-manager GUI) the iPod has
> >> the following structure:
> >> iPod
> >> ->USB Mass Storage Interface
> >> -->SCSI Host Adapter
> >> --->SCSI Device
> >> ---->iPod
> >> ----->ORANGE
> >>
> >> From 10-usb-music-players.fdi, the various portable_audio_player.xyz
> >> keys are located under the second iPod entry (child of SCSI Device).
> >> However, the two keys that are added by my fdi rule instead get placed
> >> under USB Mass Storage Interface, instead of being placed with the others.
> >>
> >
> > Yeah, that's quite expected since you indeed match on the USB Mass
> > Storage interface.
> >
> Hmm. So it does a kind of greedy match, and matched on the USB Mass
> Storage Interface instead of drilling down? How would I be able to
> rewrite something like that making sure to match on the iPod instead of
> the USB Mass Storage Interface, so that the keys will get inserted at
> the right location?
Just like your first example but only matching on info.capabilities
instead of info.category, e.g.
<match key="info.capabilities" contains="storage">
<match key="storage.vendor" contains="Apple">
<match key="storage.model" contains="iPod">
<match key="@storage.physical_device:usb.vendor_id" int="0x05ac">
<match key="@storage.physical_device:usb.product_id" int="0x1301">
<merge key="portable_audio_player.access_method" type="string">libgpod</merge>
<append key="libgpod.name" type="string">iPod Shuffle (2G)</append>
</match>
</match>
</match>
</match>
</match>
Won't that work? Or am I misunderstanding something?
David
More information about the hal
mailing list