Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 213973 - net-dialup/usb_modeswitch-0.9.3 ebuild
Summary: net-dialup/usb_modeswitch-0.9.3 ebuild
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Wolfram Schlich (RETIRED)
URL: http://www.draisberghof.de/usb_modesw...
Whiteboard:
Keywords: EBUILD
: 233950 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-03-20 00:23 UTC by Stefan Behte (RETIRED)
Modified: 2008-08-25 22:46 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
usb_modeswitch-0.9.3.ebuild (usb_modeswitch-0.9.3.ebuild,864 bytes, text/plain)
2008-03-20 00:24 UTC, Stefan Behte (RETIRED)
Details
usb_modeswitch-0.9.3.ebuild (usb_modeswitch-0.9.3.ebuild,937 bytes, text/plain)
2008-03-20 19:35 UTC, Stefan Behte (RETIRED)
Details
usb_modeswitch-0.9.3.ebuild (usb_modeswitch-0.9.3.ebuild,1.45 KB, text/plain)
2008-03-23 15:12 UTC, Stefan Behte (RETIRED)
Details
/usb_modeswitch-0.9.4_beta2.ebuild (usb_modeswitch-0.9.4_beta2.ebuild,1.46 KB, text/plain)
2008-04-24 23:03 UTC, Stefan Behte (RETIRED)
Details
91-usb_modeswitch.rules.udev-ge-106 (91-usb_modeswitch.rules.udev-ge-106,103 bytes, text/plain)
2008-04-24 23:03 UTC, Stefan Behte (RETIRED)
Details
91-usb_modeswitch.rules.udev-lt-106 (91-usb_modeswitch.rules.udev-lt-106,102 bytes, text/plain)
2008-04-24 23:03 UTC, Stefan Behte (RETIRED)
Details
usb_modeswitch-0.9.4.ebuild (usb_modeswitch-0.9.4.ebuild,1.46 KB, text/plain)
2008-08-23 17:50 UTC, Stefan Behte (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Behte (RETIRED) gentoo-dev Security 2008-03-20 00:23:31 UTC
usb_modeswitch is needed to get some UMTS devices to work, because they appear as mass storage devices for a "Windows-Zero-CD-Experience" and get switchted to another USB mode (modem mode instead of storage) by the windows drivers.
This switch has to be done by usb_modeswitch or else the GSM/GPRS part of the card won't work with linux, so it *is* a needed package in my opinion.

The devices are namely:

GlobeSurfer Icon (aka "Vodafone EasyBox")
GlobeSurfer Icon 7.2
GlobeSurfer Icon 7.2 with HSO driver interface
Icon 225 HSDPA (aka "T-Mobile web'n'walk Stick")
GlobeTrotter HSUPA Modem (aka "T-Mobile wnw Card Compact III")
GlobeTrotter GT MAX 3.6 (aka "T-Mobile wnw Card Compact II")
GlobeTrotter EXPRESS 7.2 (aka "T-Mobile wnw Card Express II")
Huawei E220 (aka "Vodafone EasyBox II", aka "T-Mobile wnw Box Micro")
Huawei E270
Huawei E630 (Experimental!)
ZTE MF620 (aka "Onda MH600HS")
ZTE MF622
Novatel Wireless Ovation MC950D HSUPA and XU950D
Novatel U727 USB modem

See also: http://www.draisberghof.de/usb_modeswitch/
Please ask if there are further questions/quality issues with the ebuild.
I'd would also maintain the package, if no one else is willing to do so (and if that's possible).
Comment 1 Stefan Behte (RETIRED) gentoo-dev Security 2008-03-20 00:24:10 UTC
Created attachment 146626 [details]
usb_modeswitch-0.9.3.ebuild
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2008-03-20 10:02:44 UTC
1/ Do NOT call gcc directly, it breaks crosscompile. We have tc-getCC function in toolchain-funcs eclass for this.

2/ We have dosbin for installing stuff to /usr/sbin

Comment 3 Stefan Briesenick (RETIRED) gentoo-dev 2008-03-20 11:28:06 UTC
hmmm. Question: this is for USB-Hardware?

Then I would suggest to include an udev-rule to call this tool automatically this after the device is plugged in.

There're some examples on the project-homepage...
Comment 4 Stefan Briesenick (RETIRED) gentoo-dev 2008-03-20 11:36:06 UTC
btw: gcc -l usb -o usb_modeswitch usb_modeswitch.c

should be:

$(tc-getCC) ${CFLAGS} ${LDFLAGS} -l usb -o usb_modeswitch usb_modeswitch.c
Comment 5 Stefan Behte (RETIRED) gentoo-dev Security 2008-03-20 12:41:13 UTC
As I'm not a usual ebuild writer, I did surely feel strange about calling gcc directly, but didn't know how it would be done in an appropriate way.
Thanks for the correction, jakub.

Stefan, theses devices are used via ohci, yes. But, they come in several flavours, some are attached to a usb port, some are pcmcia cards.
The UDEV rules can't be created automatically I guess, because you need the "vendorid" and "productid" and you could only create a rule when the card is a) inserted b)in the "storage" modules at the time of emerging. I guess it's a better idea to create a "template" udev-rule and let the user fill in the appropriate values himself? Maybe a hint on how to get the values might be useful.
Comment 6 Stefan Behte (RETIRED) gentoo-dev Security 2008-03-20 19:35:42 UTC
Created attachment 146685 [details]
usb_modeswitch-0.9.3.ebuild
Comment 7 Stefan Behte (RETIRED) gentoo-dev Security 2008-03-20 22:35:26 UTC
I meant "b) in the "storage" mode"
Comment 8 Stefan Behte (RETIRED) gentoo-dev Security 2008-03-23 15:12:05 UTC
According to the gentoo docs, RDEPEND is needed, so I added it.
Also, a default udev config (/etc/udev/rules.d/91-usb_modeswitch.rules) is created, if udev<106 SUBSYSTEM and SYSFS are used, if udev>=106 SUBSYSTEMS and ATTRS are. The rule is commented out so that it does not interfere with an existing udev-config. I also modifed the einfo at the end. 

I just echo'ed the correct line into the udev-config file, which does not really seem to be the best solution.
Would it be better to create 2 files in usb_modeswitch/files for each condition and "doins" the correct one?!  


Comment 9 Stefan Behte (RETIRED) gentoo-dev Security 2008-03-23 15:12:42 UTC
Created attachment 147014 [details]
usb_modeswitch-0.9.3.ebuild
Comment 10 Stefan Behte (RETIRED) gentoo-dev Security 2008-04-24 23:02:30 UTC
We need http://www.draisberghof.de/usb_modeswitch/usb_modeswitch-0.9.4beta2.tar.bz2, as 0.9.3 has some issues with udev (confirmed on udev-116 with kernel 2.6.25-r1)!

Also, echo'ing udev-rules is very evil, because then we can not use normal tools like equery to query files installed by the ebuild, so I added 91-usb_modeswitch.rules.udev-ge-106 (greater or equals udev-106) and 91-usb_modeswitch.rules.udev-lt-106 (less than udev-106).
Comment 11 Stefan Behte (RETIRED) gentoo-dev Security 2008-04-24 23:03:02 UTC
Created attachment 150886 [details]
/usb_modeswitch-0.9.4_beta2.ebuild
Comment 12 Stefan Behte (RETIRED) gentoo-dev Security 2008-04-24 23:03:17 UTC
Created attachment 150887 [details]
91-usb_modeswitch.rules.udev-ge-106
Comment 13 Stefan Behte (RETIRED) gentoo-dev Security 2008-04-24 23:03:32 UTC
Created attachment 150889 [details]
91-usb_modeswitch.rules.udev-lt-106
Comment 14 Stefan Behte (RETIRED) gentoo-dev Security 2008-04-24 23:17:17 UTC
I'm not sure about the udev-rules naming, is there a guide on how to do it "The Gentoo Way" (TM)? ;)
I've searched a but, but didn't find anything and as it's already 1:16 a.m. I'm sure you'll forgive me that I don't search excessively right now.

Will net-dialup integrate this? As "mobile computing" becomes more and more usual (I always see peoples with laptops on the train), it would be very cool to have Gentoo-packages for needed userspace tools. Kernel 2.6.25 also brought some patches (e.g. for NOZOMI, Option) so the Kernel-side works quite well now.
Comment 15 Stefan Behte (RETIRED) gentoo-dev Security 2008-04-24 23:19:40 UTC
Last word for now:
Stefan, those PCMCIA cards have an *integrated* USB OHCI controller which is accessed over kind of a "PCMCIA-bridge".

I confirmed usb_modeswitch to work with this thing:
http://www.o2online.de/handys/Marken/o2/o2-Surf-Card.html
Comment 16 Wolfram Schlich (RETIRED) gentoo-dev 2008-08-23 06:30:16 UTC
*** Bug 233950 has been marked as a duplicate of this bug. ***
Comment 17 Stefan Behte (RETIRED) gentoo-dev Security 2008-08-23 17:50:18 UTC
Created attachment 163659 [details]
usb_modeswitch-0.9.4.ebuild
Comment 18 Stefan Behte (RETIRED) gentoo-dev Security 2008-08-23 17:54:14 UTC
I made very few minor changes made to the ebuild, it works for me.
Bad luck that no one wants to be maintainer. :(
As mentioned above I've got such a card and I'd be willing to be beta-tester if there are changes/new versions, also it's a very easy ebuild.
Comment 19 Wolfram Schlich (RETIRED) gentoo-dev 2008-08-25 22:46:36 UTC
In CVS (sys-apps/usb_modeswitch). Have fun :)