Description of problem: The usb_modeswitch udev helper at /lib/udev/usb_modeswitch doesn't seem to parse the arguments from udev properly, or the expected arguments have changed in 1.2.1. The 1.2.0 package works correctly. This means the udev helper doesn't know anything about the device plugged in and so immediately exits without performing the mode switch on the device. The device then doesn't show up in NetworkManager if it relies on usb_modeswitch to be loaded properly. Version-Release number of selected component (if applicable): usb_modeswitch-1.2.1-1.fc16 How reproducible: Always. Steps to Reproduce: 1. Set EnableLogging=1 in /etc/usb_modeswitch.conf 2. Plug in a modem (an Option icon 411 here) 3. Check for new /var/log/usb_modeswitch_* log files Actual results: /var/log/usb_modeswitch_noname is created with the following (note no args from udev are detected): Raw args from udev: Using global config file: /etc/usb_modeswitch.conf No data from udev. Exiting Expected results: /var/log/usb_modeswitch_1-1.1:1.0 (or similar) is created with huge amounts of logging, e.g... Raw args from udev: /1-1.1:1.0 Using global config file: /etc/usb_modeswitch.conf Bus ID for device not given by udev. Trying to determine it from kernel name (1-1.1:1.0) ... ---------------- USB values from sysfs: manufacturer Option N.V. product Globetrotter HSUPA Modem serial Serial Number ---------------- Additional info: The udev helper script seems to have changed how it parses arguments, but I can't understand much tcl to be able to work out how or why. Unable to find an upstream SCM to find an explanation either. Line 55 in the script from 1.2.1 contains this: set argList [split [lindex $argv 1] /] while in 1.2.0 it contains this: set argList [split [lindex $argv 0] /] Changing this back to 0 causes it to hit the --switch-mode conditional further down and it now exits with "No command given". I can't work out if the arguments to the script are supposed to be different in 1.2.1, but if so I'd have expected a new upstream release of usb_modeswitch_data with a new udev rules file.
Reported in the upstream bug forum: http://web52.017.netroom.de/draisberghof_de/usb_modeswitch/bb/viewtopic.php?p=5621
If you try with the upstream source package, probably after a forced uninstall of the Fedora package, does that fail as well?
Thanks for the tip, looking at the upstream source and installation partly explains the problem, which I think may be the packaging. In the Fedora package, /lib/udev/usb_modeswitch is the Tcl script shipped as usb_modeswitch.tcl. Compared to the upstream Makefile, it's actually the shell script "usb_modeswitch.sh" that should be installed at /lib/udev/usb_modeswitch and the Tcl script is installed to /usr/sbin/usb_modeswitch_dispatcher. udev then calls the shell script, which calls the Tcl script, which then calls usb_modeswitch itself. Does that description sound correct Josua? I've also looked at the Debian package of 1.2.1 and it has the above layout, with the shell script in /lib/udev and the Tcl script compiled with jim at /usr/sbin/usb_modeswitch_dispatcher. The Ubuntu package is different again, as they've rewritten the dispatcher in C! Having moved files around for the above layout, I'm able to get further with the dispatcher log file now correctly showing arguments (which are set by the shell script). I've now hit the issue where usb_modeswitch can't find the device: Looking for default devices ... bus/device number matched searching devices, found USB ID 0af0:7501 found matching vendor ID found matching product ID target class ff not matching No devices in default mode found. Nothing to do. Bye. This reported in Debian with a patch: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=656248 Now having compiled upstream sources with the patch the usb_modeswitch log file shows it's made the change, the dispatcher confirms it and my modem now shows up in NetworkManager! I'll create a patch to the spec tomorrow.
Yes, the shell script is needed to keep the udev thread from blocking further processing while the mode switch is done - it can take up to 20 seconds. I don't know if there is a good reason to skip it ... The bug in 1.2.1 will be fixed immediately, I'll release upstream 1.2.2 later today.
Created attachment 556130 [details] Proposed fix, adds usb_modeswitch.sh udev helper and Debian patch
(In reply to comment #4) > Yes, the shell script is needed to keep the udev thread from blocking further > processing while the mode switch is done - it can take up to 20 seconds. I > don't know if there is a good reason to skip it ... Ah okay. It looks like between 1.2.0 and 1.2.1 the arguments into the Tcl script from the shell script changed, so the absence of the shell script probably wouldn't have been noticed before. > The bug in 1.2.1 will be fixed immediately, I'll release upstream 1.2.2 later > today. Great, in which case the maintainer can leave off the extra patch I added in my attachment for 1.2.1.
Version 1.2.2 is available upstream. It fixes the bug reported at Debian (which would have affected all other distributions as well). http://draisberghof.de/usb_modeswitch/usb-modeswitch-1.2.2.tar.bz2
Version 1.2.2 is packaged for Fedora - but without the patch to "usb_modeswitch.spec" attached here. It will always fail if that is not fixed.
(In reply to comment #8) > Version 1.2.2 is packaged for Fedora - but without the patch to > "usb_modeswitch.spec" attached here. It will always fail if that is not fixed. Right, i will respin the rpm to fix the issue
usb_modeswitch-1.2.2-2.fc16 has been submitted as an update for Fedora 16. https://admin.fedoraproject.org/updates/usb_modeswitch-1.2.2-2.fc16
usb_modeswitch-1.2.2-2.fc15 has been submitted as an update for Fedora 15. https://admin.fedoraproject.org/updates/usb_modeswitch-1.2.2-2.fc15
Package usb_modeswitch-1.2.2-2.fc15: * should fix your issue, * was pushed to the Fedora 15 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing usb_modeswitch-1.2.2-2.fc15' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2012-0904/usb_modeswitch-1.2.2-2.fc15 then log in and leave karma (feedback).
Thanks, 1.2.2-2.fc16 seems to work perfectly (karma given).
usb_modeswitch-1.2.2-2.fc16 has been pushed to the Fedora 16 stable repository. If problems still persist, please make note of it in this bug report.
usb_modeswitch-1.2.2-2.fc15 has been pushed to the Fedora 15 stable repository. If problems still persist, please make note of it in this bug report.