Hello,
I'm using usb_modeswitch (2.2.6, db 2015-11-01) on a Yocto core-image-minimal and I'm having trouble with automatic switching.
The modeswitch works if I do it manually (usb_modeswitch -v 12d1 -p 1f16 -J) but it won't work with the udev scripts.
I have tried to locate the problem but I'm stuck, and the log is empty.
I can tell for sure that udev is invoking /lib/udev/usb_modeswitch and that in turn invokes usb_modeswitch_dispatcher --switch-mode 2-1.2/2-1.2:1.0 and nothing happens afterwards.
If I run usb_modeswitch_dispatcher --switch-mode 2-1.2/2-1.2:1.0 , I get the following output:
error waiting for process to exit: child process lost (is SIGCHLD ignored or trapped?)
while executing
"exec echo "\nUSB_ModeSwitch log from [clock format [clock seconds]]" >/var/log/usb_modeswitch_$device"
invoked from within
"if [string length $loginit] {
exec echo "\nUSB_ModeSwitch log from [clock format [clock seconds]]" >/var/log/usb_modeswitch_$device
exec echo "$lo..."
invoked from within
"if $flags(logwrite) {
if [string length $loginit] {
exec echo "\nUSB_ModeSwitch log from [clock format [clock seconds]]" >/var/log/usb_modeswitch_$..."
(procedure "Log" line 7)
invoked from within
"Log "\n----------------\nUSB values from sysfs:""
invoked from within
"if $flags(logging) {
Log "\n----------------\nUSB values from sysfs:"
foreach attr {manufacturer product serial} {
Log " $attr\t$usb($attr)"
}
..."
(procedure "Main" line 133)
invoked from within
"Main $argv $argc"
(file "/usr/sbin/usb_modeswitch_dispatcher" line 1196)
If I disable logging, the stacktrace is easier to read:
usb_modeswitch_dispatcher --switch-mode 2-1.2/2-1.2:1.0
error waiting for process to exit: child process lost (is SIGCHLD ignored or trapped?)
while executing
"exec cat /proc/version"
(procedure "Main" line 157)
invoked from within
"Main $argv $argc"
(file "/usr/sbin/usb_modeswitch_dispatcher" line 1196)
Executing exec cat /proc/version works just fine with the following output:
Linux version 4.3.0-test3 (dev@development.localdomain) (gcc version 5.2.0 (GCC) ) #1 Fri Nov 13 14:09:25 EET 2015
Any ideas?
Any help is appreciated!
Best regards!
Re: dispatcher problem
Good analysis, the problem is obvious.
Can you check where the "cat" and "echo" programs are sitting in your system? A simple "which cat" should do.
I suspect they are not in a standard path.
Can you check where the "cat" and "echo" programs are sitting in your system? A simple "which cat" should do.
I suspect they are not in a standard path.
-
catalin.crenguta
- Posts: 2
- Joined: 13 Nov 2015, 15:26
Re: dispatcher problem
Hello Josh,
Unfortunately that is not the problem, they are in the right place.
I have tried poking with the tclsh and it seems that exec always fails, even with the full path of the binary, and returns the "error waiting for process to exit: child process lost (is SIGCHLD ignored or trapped?)" error.
I have no idea what is wrong with the tclsh.
Any ideas? Or replacements for that TCL script?
Best regards!
Unfortunately that is not the problem, they are in the right place.
I have tried poking with the tclsh and it seems that exec always fails, even with the full path of the binary, and returns the "error waiting for process to exit: child process lost (is SIGCHLD ignored or trapped?)" error.
I have no idea what is wrong with the tclsh.
Any ideas? Or replacements for that TCL script?
Best regards!
Re: dispatcher problem
Do you have a special tcl version installed?
In any case, you can try to link the dispatcher with an embedded tcl interpreter. I think the command was "make static" in the usb_modeswitch source folder.
In any case, you can try to link the dispatcher with an embedded tcl interpreter. I think the command was "make static" in the usb_modeswitch source folder.