Applied barry-unbind-storage.sh script from Niels de Vos.
commit301e6f875e245f2153da0490780ea7d298b209ad
authorNiels de Vos <nixpanic@users.sourceforge.net>
Fri, 25 Jul 2008 04:17:55 +0000 (25 00:17 -0400)
committerChris Frey <cdfrey@foursquare.net>
Fri, 25 Jul 2008 04:17:55 +0000 (25 00:17 -0400)
treec3c375ced3bab9100fb186a0e2ec001ed5643dc9
parent4847b97dd5f9fd335f381e5d18c096b57d1b2564
Applied barry-unbind-storage.sh script from Niels de Vos.

Added to contrib for now, in the interests of getting
version 0.13 released soon... we can work on integrating
this better in 0.14, which hopefully won't take so long :-)

From Niels' email:

Hello,

just hacked a little script together which uses the sysfs-structure
for finding any BlackBerries (well, at least my BB8100). After some
small sanity checks the script disconnects the BlackBerry from
usb-storage using the 'unbind' file.

Instead of a script, it would of course also be possible to add a
C/C++-function to libbarry. The logic is pretty straight forward,
however writing it in C/C++ would require quite some more lines ;) For
the adventurous wanting to write this code, please see these notes
about _not_ using libsysfs:
<http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/filesystems/sysfs.txt>.

I hope this script helps somebody and explains a bit more how
usb-storage can be kept loaded while using barry. I provide this
script for inclusion in barry as utility, testcase and/or
documentation. Have fun wit it!

Cheers,
Niels

Parts of the followup email:

> Thanks Niels!
>
> This is an improvement over dropping usb_storage in the module blacklist.

That's the point. Still only roughly tested though. Someone already
mentioned it some months ago in this thread, I just kept on thinking
about it :)
...searching archive... It was Martin Owens:
<http://sourceforge.net/mailarchive/message.php?msg_id=69ff73b20710091437r1335496am691a4ea2054eb754%40mail.gmail.com>

> > <http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/filesystems/sysfs.txt>.
>
> Is this the document you meant to link to?  I didn't see any mention
> of libsysfs.

You're right, it should be
<http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/sysfs-rules.txt>.
ChangeLog
contrib/barry-unbind-storage.sh [new file with mode: 0755]