Le mardi 5 mai 2009 20:12:07 Gildas Le Nadan, vous avez écrit : > Package: usb-modeswitch > Version: 0.9.7-1 > Severity: important > > Hi,
Hi Gildas,
first of all, thanks for having reported this very detailed bugreport. I very
much appreciate the time you have spent understanding my packaging stuff and
the way everything is imbricated.
> When I tried configuring my 3G ZTE/onda MF626 usb key, I had a hard time
> trying to understand why after setting the right value in
> /etc/usb_modeswitch.conf and having it work manually (using "sudo
> usb_modeswitch"), I couldn't get it to work automagically through udev.
>
> The reason was that there is 2 lines in /etc/usb_modeswitch.conf for the
> ZTE MF626 and only the second one (which is supposed to be the
> "fallback" solution) is present in the file usb_modeswitch.rules
> generated by mkrules.py.
OK. I had hard time understanding this. The thing is that usb_modeswitch.conf
contains two "MessageContent" lines for the same set of configuration values.
> ########################################################
> # ZTE MF628+ (tested version from Telia / Sweden)
> # ZTE MF626
> #
> # Contributor: Joakim Wennergren
>
> ;DefaultVendor= 0x19d2
> ;DefaultProduct= 0x2000
>
> ;TargetVendor= 0x19d2
> ;TargetProduct= 0x0031
>
> ;MessageEndpoint=0x01
> ;MessageContent="55534243123456782000000080000c85010101180101010101000000000000"
>
> # if that command doesn't work, try the other ("eject")
> ;MessageContent="5553424312345678000000000000061b000000030000000000000000000000"
This situation is not supported my mkrules.py for now. Actually, it uses the
second line.
> My first idea to correct this bug was to ask to modify mkrules.py so it
> includes the 2 lines, but I think this is probably the wrong approach.
This could be done without too much trouble. Maybe the easiest for this would
rather be to patch the configuration file to have two complete entries.
> My understanding of the rational behind mkrules.py is that is allows to
> create a udev.rules that automatically contains entries for all the
> devices in the mainstream package.
That is at least what I intended to do.
> But in the actual form, on top of the actual bug I presented above, this
> approach means you may have to modify 2 files to get your device working
> in both manual and auto mode. This could lead to further discrepancies
> in the configuration and imho is error prone.
I agree. This situation where you have to update two different files is error
prone and probably not "future prone" either.
> Also, unless I've failed to notice something, I think it is useless
> since if you don't specify parameters in the udev rule, usb_modeswitch
> will get the right values from /etc/usb_modeswitch.conf.
This will be true only if the admin configured its /etc/usb_modeswitch.conf.
> Thus, I believe that it would be more elegant to have mkrules.py
> generate a usb_modeswitch.rules file containing one line per
> DefaultVendor:DefaultProduct pair, without any parameter to the
> usb_modeswitch command.
Some facts as I understand them :
* Bad commands sent to some devices could potentially break them.
* Some DefaultVendor:DefaultProduct strings point to multiple devices with
different needs (different commands).
* Some users could have multiple dongles which different needs (different
commands).
By setting an automatic launch of usb-modeswitch without options for each and
every possible device listed by upstream as "potentially working",
usb-modeswitch will be run with the options configured by the admin for each
device, potentially breaking your havoc.
I see some ways out :
(1) Implement your solution "no specifics in /e/u/r.d/usb-modeswitch.rules"
* Needs administrator configuration
* Pros:
+ No manual edition of /e/u/r.d/usb-modeswitch.rules needed
+ Configuration is done in one place /e/usb-modeswitch.rules
* Cons:
- Works for only one device per machine
- Launches usb-modeswitch with false commands for all other devices, with
potential hardware breaking
- Works correctly for machines that only get connected to one device of
the list _ever_.
(2) Introduce a new binary "update-usb-modeswitch-rules"
This binary would create a /e/u/r.d/usb-modeswitch.rules
from /e/usb-modeswitch.conf in which the administrator could configure more
than one device.
* Pros
+ Works for multiple devices automagically (udev rule), according to admin
configuration
+ No potential hardware breaking (usb-modeswitch launched only for
configured devices)
+ No manual edition of /e/u/r.d/usb-modeswitch.rules needed
+ Configuration is done in one place /e/usb-modeswitch.rules
* Cons
- usb-modeswitch cannot be run without options if multiple devices are
defined in the .conf (but this should not be needed if
autoconfiguration
works)
- new entry in NEWS.Debian with changes /again/ on how it works
- this binary needs to be run after configuration changes
(3) Completely change the way upstream works with its configuration
I suggested a more global solution in upstream's forum there:
http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?t=142
The idea is to get rid of this database as configuration but to settle it
down somewhere under /usr/ and then have a waaay simpler configuration file
which then only has identifiers.
The /etc/usb-modeswitch.conf could be splitted
in /etc/usb-modeswitch/manual.conf for manual runs
and /etc/usb-modeswitch/udev.conf which would be sourced by the above
binary
to create a simpler /e/u/r.d/*.rules.
I haven't had any answer yet from upstream but I still think that this is
the way to go.
> Cheers,
> Gildas Le Nadan
What do _you_ think ?
Best regards,
OdyX
--
Didier Raboud, proud Debian user.
CH-1802 Corseaux
[email protected]
signature.asc
Description: This is a digitally signed message part.

