~ubuntu-branches/ubuntu/raring/usb-modeswitch/raring

« back to all changes in this revision

Viewing changes to README

  • Committer: Package Import Robot
  • Author(s): Mathieu Trudel-Lapierre
  • Date: 2011-12-05 15:00:29 UTC
  • mfrom: (17.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20111205150029-814z3v95yed05hxe
Tags: 1.2.0+repack0-1ubuntu1
* Merge with Debian testing; remaining changes:
  - debian/control: Drop the dependency on tcl and Build-Depends on
    jimsh/libjim (another tcl implementation).
  - debian/control: add libudev-dev and libpipeline-dev to Build-Depends.
  - debian/patches/dispatcher-c-rewrite.patch: rewrite the dispatcher in C,
    to be able to drop the Tcl dependencies.
* debian/patches/dispatcher-c-rewrite.patch:
  - Adapt to follow the changes introduced in version 1.2.0.
  - Move bind_list, current_cfg and other state files to /run.
  - Fix handling parameters when the dispatcher is called manually instead
    of via udev. (LP: #829519)

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
!! You need the usb-modeswitch-data package from the same source as this !!
50
50
 
51
51
If you have an earlier version installed, de-installation is recommended ("make
52
 
uninstall"). The wrapper script location changed in 1.1.0, old ones might be
53
 
orphaned in /usr/sbin.
54
 
 
55
 
Important: you need "tcl" for the wrapper script to work; if you enter "tclsh"
56
 
and you get a "%" prompt, you are set (to exit type "exit"). The "tcl" package
57
 
is part of all distributions I know. Use version 8.4 and higher.
58
 
If you are space-restricted you can also use the "jimsh" mini Tcl interpreter. The
59
 
Tcl wrapper is compatible with the limited command set of this small shell. Since
60
 
version 1.1.7 an alternative source package containing jimsh will be provided.
61
 
The typical size of jimsh is 140 kB, or 70 kB in a compressed file system.
62
 
 
63
 
To install the tool set, unpack and in the newly created directory use this line
64
 
at the shell (as root):
65
 
 
66
 
> make install
67
 
 
68
 
This installs the small shell script, the dispatcher (wrapper) script, a global
69
 
config file, the binary and a man page. If you chose the package with jimsh, the
70
 
Tcl shell is configured, built and installed in the same step, optimized for
71
 
size.
72
 
 
73
 
Install the data package as well and you are set already; if your device is
74
 
known, you should be able to just plug it and use it. If it doesn't work -
75
 
we will find out why not.
 
52
uninstall") but not mandatory. The wrapper script location changed in 1.1.0;
 
53
old files might be orphaned but will not do any harm.
 
54
 
 
55
The main prerequisite for installing from source is package "libusb-dev" !!
 
56
 
 
57
To install the tool set, unpack and run the install command (see below) in the
 
58
newly created directory.
 
59
 
 
60
From version 1.2.0, there are three flavours of installing. The only difference
 
61
between those is the way the dispatcher is installed, but this affects the
 
62
dependencies as well:
 
63
 
 
64
1. If you have the "Tcl" scripting language available on your system (packages
 
65
   "tcl" or "jimsh"), use the light-weight installation:
 
66
 
 
67
   # make install
 
68
 
 
69
2. If you are size-constrained and have the Jimsh library on your system
 
70
   (package "libjim-dev"), you can have the Tcl interpreter embedded with the
 
71
   dispatcher, using its shared lib:
 
72
 
 
73
   # make install-shared
 
74
 
 
75
3. If you are size-constrained and definitely don't need a Tcl interpreter
 
76
   for anything else, choose the statically embedded flavour. This will have
 
77
   no further dependency as it uses the included interpreter code, which is
 
78
   configured for small size:
 
79
 
 
80
   # make install-static
 
81
 
 
82
These commands will install a small posix shell script, the dispatcher
 
83
(wrapper) as script or as binary, a global config file, the core program and
 
84
a man page.
 
85
 
 
86
Install the data package as well and you are set.
 
87
 
 
88
 
 
89
How to use
 
90
==========
 
91
 
 
92
If your device is known, you should be able to just plug it and use it. If
 
93
it doesn't work - we will find out why.
76
94
 
77
95
For manual use just run "usb_modeswitch" (as root). Work with the command
78
96
line interface or with a setup file. You can use any file and give its path
79
97
with the "-c" parameter.
80
 
The file named "device_reference.txt" that you can find in this package is
81
 
a device and configuration reference containing most known devices; you can
82
 
use it as a base to create your own configuration file.
 
98
The file named "device_reference.txt" that you can find on the home site of
 
99
this package is a device and configuration reference containing most known
 
100
devices; you can use it as a "database" to create your own configuration file.
83
101
It's heavily commented and should tell you what to do. It also contains a
84
102
thorough explanation of all the parameters.
85
103
 
86
104
Run "usb_modeswitch -h" to list the command line parameters.
87
105
See also the provided man page.
88
106
 
89
 
Note: manual use is intended for testing and analyzing !
 
107
Note: Manual use is mainly intended for testing and analyzing !
90
108
 
91
109
Once your new device is switching fine you can add a rule entry to the rules
92
110
file to let udev run usb_modeswitch as soon as the default IDs are found
95
113
The location is:
96
114
/lib/udev/rules.d/40-usb_modeswitch.rules
97
115
 
98
 
Then add your new setup file to the folder
99
 
"/usr/share/usb_modeswitch". And don't forget to report your success !!
 
116
Then add your new config file to the folder
 
117
"/etc/usb_modeswitch.d" (only for custom config files!).
 
118
And don't forget to report your success !!
100
119
 
101
 
Again, mind that the rules file and the config folder are installed by
102
 
the usb_modeswitch data package.
 
120
Again, remember that the rules file and the default device config folder
 
121
(/usr/share/usb_modeswitch) are installed by the usb_modeswitch data package.
103
122
 
104
123
 
105
124
##########
124
143
 
125
144
Note the device's vendor and product ID from /proc/bus/usb/devices (or from the
126
145
output of lsusb); the assigned driver is usually "usb-storage". Then try spying
127
 
on the USB communication to the device with the same ID inside M$ Windoze. I
 
146
on the USB communication to the device with the same ID inside MS Windoze. I
128
147
recommend this tool:
129
148
"SniffUSB" (http://benoit.papillault.free.fr/usbsnoop/index.php.en).
130
149
 
135
154
Whodunit
136
155
========
137
156
 
138
 
Copyright 2007, 2008, 2009, 2010 Josua Dietze (mail to "usb_admin"
 
157
Copyright 2007, 2008, 2009, 2010, 2011 Josua Dietze (mail to "usb_admin"
139
158
 at the domain "draisberghof.de" or write a personal message through the forum
140
 
 to "Josh"; NO SUPPORT QUESTIONS VIA E-MAIL, use the forum!)
141
 
 
142
 
Command line parsing, decent usage/config output and handling, advanced options
143
 
 and bugfixes:
144
 
 Joakim Wennergren (jokedst) (gmail.com)
 
159
 to "Josh")
 
160
 NO SUPPORT QUESTIONS VIA E-MAIL, use the forum!
 
161
 
 
162
Major contributions:
 
163
 
 
164
Command line parsing and other essential contributions:
 
165
 Joakim Wennergren
145
166
 
146
167
TargetClass parameter implementation to support new Option devices/firmware:
147
168
 Paul Hardwick (http://www.pharscape.org)
150
171
 "usbsnoop2libusb.pl" by Timo Lindfors
151
172
 (http://iki.fi/lindi/usb/usbsnoop2libusb.pl)
152
173
 
153
 
Config file parsing stuff borrowed from:
 
174
Config file parsing code borrowed from:
154
175
 Guillaume Dargaud (http://www.gdargaud.net/Hack/SourceCode.html)
155
176
 
156
177
Hexstr2bin function borrowed from:
173
194
 Nils Radtke
174
195
 Filip Aben
175
196
 Amit Mendapara
 
197
 Roman S. Samarev
 
198
 Chi-Hang Long
176
199
 
177
200
Device information contributors are named in the "device_reference.txt" file.
178
201
 
 
202
JimTcl is currently maintained by Steve Bennett; see README in subfolder
 
203
 for details. It is released under a FreeBSD-style license.
 
204
 Visit http://jim.berlios.de/
 
205
 
 
206
 
179
207
 
180
208
Legal
181
209
=====
196
224
 
197
225
 
198
226
 
199
 
Last revised: 2011-02-25, Josua Dietze
 
227
Last revised: 2011-10-23, Josua Dietze