That was a bit hasty. I'd got the usb_modeswitch_dispatcher to work
without realising that systemd was escaping the sysfs paths.

This patch might be more thorough:

--- usb-modeswitch-2.2.1+repack0.orig/usb_modeswitch.tcl
+++ usb-modeswitch-2.2.1+repack0/usb_modeswitch.tcl
@@ -54,8 +54,12 @@ if {[lindex $argv 0] == "--symlink-name"
 }
 
 if {[lindex $argv 0] == "--switch-systemd"} {
+       # Format of $argv1 should be %b/%k eg. 1-1.2/1-1.2:1.0
+       # For some reason '/' and '-' are indistinguishable after systemd (v215)
+       # escaping so expect either: (%I causes '-' to become '/', %i the 
reverse).
        set device [string trim [lindex $argv 1] "/-"]
-       set device [regsub {/} $device "-"]
+       set device [regsub -all {/} $device "-"]
+       regexp {^[0-9]+-[0-9.]+-([0-9]+-[0-9.]+:[0-9.]+)$} $device d device
        set argList [list "" $device]
        Log "\nStarted via systemd"
 } else {


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to