Le mercredi 21 avril 2010 14:29:28 Julien Danjou, vous avez écrit :
> "Didier 'OdyX' Raboud" <did...@raboud.com> writes:
> >   * /e/usb_modeswitch.setup is a "one-file" version of what
> >   usb-modeswitch-data provides in /etc/usb_modeswitch.d/
> >   
> >   * It's existence is mainly historical, back in the days when
> >   usb-modeswitch was shipped with the switching commands.
> 
> Ok, I'm new so I did not know that. However, usb_modeswitch binary seems
> to look for it, that seems wrong, isn't it?

Hmm… That's true. It is a fallback on case no configuration is pushed to it by 
the udev scripts (see below).

> >   * the usb-modeswitch + usb-modeswitch-data combination is supposedly
> >   working "out-of-the-box", thanks to udev rules and wrappers.
> 
> That's not my case currently, even if my device USB id are included in
> the files provided by -data.
> 
> This is why I tried to investigate a little but and discovered that
> calling usb_modeswitch fails because of that missing file.
> 
> And when I read:
> ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="2000", RUN+="usb_modeswitch
> '%b/%k'" (my device)
> 
> I was wondering if it really runs "usb_modeswitch something/something",
> because I'm not sure it'd works.

You are right that it wouldn't work; but there is a slight subtility in this 
udev rules file: the "usb_modeswitch" called from the udev rules file is the 
/lib/udev/usb_modeswitch [provided by usb-modeswitch]. This one is a wrapper 
around /usr/sbin/usb_modeswtich that finds and reads the correct configuration 
file.

So if you want to investigate your device, you should either build yourself a 
small /etc/usb_modeswitch.d/19d2:2000 -like and run /usr/sbin/usb_modeswitch -c 
~/yourfile for testing purposes. Then you could try to put it with a sensible 
name under /etc/usb_modeswitch.d/.

Is it clearer now ? 

Cheers, 

OdyX

-- 
Didier Raboud, proud Debian Maintainer (DM).
CH-1020 Renens
did...@raboud.com

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to