From c98a0312352118b9943aa01589f4e1eda723767c Mon Sep 17 00:00:00 2001 From: Alin Năstac Date: Sat, 18 Mar 2006 20:10:52 +0000 Subject: Initial import from bug #110665. (Portage version: 2.0.54) --- net-dialup/speedtouch-usb/ChangeLog | 11 + net-dialup/speedtouch-usb/Manifest | 4 + net-dialup/speedtouch-usb/files/README | 251 +++++++++++++++++++++ .../files/digest-speedtouch-usb-3.0.1.2 | 1 + net-dialup/speedtouch-usb/files/speedtch.usermap | 2 + net-dialup/speedtouch-usb/metadata.xml | 6 + .../speedtouch-usb/speedtouch-usb-3.0.1.2.ebuild | 124 ++++++++++ 7 files changed, 399 insertions(+) create mode 100644 net-dialup/speedtouch-usb/ChangeLog create mode 100644 net-dialup/speedtouch-usb/Manifest create mode 100644 net-dialup/speedtouch-usb/files/README create mode 100644 net-dialup/speedtouch-usb/files/digest-speedtouch-usb-3.0.1.2 create mode 100644 net-dialup/speedtouch-usb/files/speedtch.usermap create mode 100644 net-dialup/speedtouch-usb/metadata.xml create mode 100644 net-dialup/speedtouch-usb/speedtouch-usb-3.0.1.2.ebuild (limited to 'net-dialup/speedtouch-usb') diff --git a/net-dialup/speedtouch-usb/ChangeLog b/net-dialup/speedtouch-usb/ChangeLog new file mode 100644 index 000000000000..937cf50c2292 --- /dev/null +++ b/net-dialup/speedtouch-usb/ChangeLog @@ -0,0 +1,11 @@ +# ChangeLog for net-dialup/speedtouch-usb +# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/net-dialup/speedtouch-usb/ChangeLog,v 1.1 2006/03/18 20:10:52 mrness Exp $ + +*speedtouch-usb-3.0.1.2 (18 Mar 2006) + + 18 Mar 2006; Alin Nastac +files/README, + +files/speedtch.usermap, +metadata.xml, +speedtouch-usb-3.0.1.2.ebuild: + Initial import from bug #110665. Credits goes to Paul Bredbury + . + diff --git a/net-dialup/speedtouch-usb/Manifest b/net-dialup/speedtouch-usb/Manifest new file mode 100644 index 000000000000..84584cd42297 --- /dev/null +++ b/net-dialup/speedtouch-usb/Manifest @@ -0,0 +1,4 @@ +MD5 9ee871b46e9d9efa35efb70866f84ddf files/README 9905 +MD5 455d21a7ea0d002dcd3cb16b8ac4c16d files/digest-speedtouch-usb-3.0.1.2 76 +MD5 a20d50e68b46e8c5893c2a38606f3e11 files/speedtch.usermap 389 +MD5 856b84cc2d9dd85a607e15e3a8eb201a speedtouch-usb-3.0.1.2.ebuild 4287 diff --git a/net-dialup/speedtouch-usb/files/README b/net-dialup/speedtouch-usb/files/README new file mode 100644 index 000000000000..1e3a9b20c5eb --- /dev/null +++ b/net-dialup/speedtouch-usb/files/README @@ -0,0 +1,251 @@ +Introduction +============ + +This ebuild enables kernel-space support for Alcatel/Thomson SpeedTouch +USB modems, which first appeared in kernel 2.6.10 as a replacement for +the user-space driver. For earlier kernels, the "speedtouch" ebuild +must be emerged instead. + + +Configuration +============= + +It is necessary to choose an interface number for the connection. This +is arbitrary - the only requirement is that the connection number is +not already in use. The first available number is 0, and it is usual to +choose the lowest unused number. For the purposes of this document, 0 +will be chosen. + +Add the following lines to /etc/conf.d/net, then customize them as per +the inline comments. + +a) /etc/conf.d/net for PPPoA links: + config_ppp0=( 'ppp' ) # Runs /lib/rcscripts/net.modules.d/pppd + link_ppp0='/dev/null' # Not required by PPPoA links, but must be specified + # The 2 numbers represents the VPI&VCI of your ISP and they are separated + #by a dot. Choose here, or ask your ISP: + # http://www.linux-usb.org/SpeedTouch/faq/index.html#q12 + plugins_ppp0=( 'pppoa 0.38' ) + # 'man pppd' shows other options. Compression is disabled because it is + # rarely taken advantage of, and may interfere with the connection. + # Add option 'usepeerdns' to populate /etc/ppp/resolv.conf + pppd_ppp0=( updetach debug defaultroute noaccomp nobsdcomp noccp + nodeflate nopcomp novj novjccomp ) + username_ppp0='username@isp.com' # E.g. 'fredbloggs@hg5.btclick.com' + password_ppp0='password' # ADSL password, assigned by your ISP + + # If the kernel modules are not built-in, then you also need to load + # them before starting the PPP daemon: + function preup() { + if [[ "$1" = "ppp0" ]] ; then + modprobe -q pppoatm + modprobe -q speedtch + fi + } + +b) /etc/conf.d/net for PPPoE links: + config_ppp0=( 'ppp' ) # Runs /lib/rcscripts/net.modules.d/pppd + # The name of the Ethernet interface over which PPPoE link + link_ppp0='nas0' #must correspond to the -c option of the br2684ctl utility + plugins_ppp0=( pppoe ) + # 'man pppd' shows other options. Compression is disabled because it is + # rarely taken advantage of, and may interfere with the connection. + # Add option 'usepeerdns' to populate /etc/ppp/resolv.conf + pppd_ppp0=( updetach debug defaultroute noaccomp nobsdcomp noccp + nodeflate nopcomp novj novjccomp ) + username_ppp0='username@isp.com' # E.g. 'fredbloggs@hg5.btclick.com' + password_ppp0='password' # ADSL password, assigned by your ISP + + # If the kernel modules are not built-in, then you also need to load + # them before starting the PPP daemon: + function preup() { + if [[ "$1" = "ppp0" ]] ; then + modprobe -q speedtch + # The number after -c correspond with the name of the Ethernet + # interface (e.g. 0 for nas0, ...) + # Use -e 0 for LLC mux or -e 1 for VC mux + # The 2 numbers after -a represents the VPI&VCI of your ISP and + # they are separated by a dot. Choose here, or ask your ISP: + # http://www.linux-usb.org/SpeedTouch/faq/index.html#q12 + eval local nasifname=\$\{link_$1\} + start-stop-daemon --start --pidfile /var/run/${nasifname}.pid --makepid -- \ + br2684ctl -c ${nasifname#nas} -e 0 -a 0.38 + fi + } + function postdown() { + if [[ "$1" = "ppp0" ]] ; then + eval local nasifname=\$\{link_$1\} + start-stop-daemon --stop --pidfile /var/run/${nasifname}.pid + fi + } + +Create a symlink for the new network interface, for it to be enabled by +baselayout: + cd /etc/init.d && ln -sfn net.lo net.ppp0 + +The "debug" option adds some extra commentary from pppd regarding the +connection to /var/log/messages, e.g.: +"sent [LCP ConfReq id=0x1 ]". It is wise to keep the +option on permanently, due to its usefulness when debugging. + +Alternatively, if you choosed to compile speedtouch driver as a +kernel module, you could load it through /etc/modules.autoload.d/kernel-2.6 +instead of loading it in preup function. +This allows the kernel to load the firmware during bootup, before the +network is configured, thus saving a couple of seconds from the startup +time. + +Set RC_NET_STRICT_CHECKING="yes" in /etc/conf.d/rc, to prevent Internet +services in /etc/init.d/ from starting before the Internet connection +is established. Other options are to start/stop programs in +/etc/ppp/ip-{up,down}.local, and to customize initscript dependencies +as described in: + http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=4 + + +Starting the Connection +======================= + +To start manually, with the modem connected: + /etc/init.d/net.ppp0 start + +To start automatically when the PC boots: + rc-update add net.ppp0 default + + +Kernel Configuration +==================== + +The ebuild, during an emerge, checks that the required kernel modules +are present. + +Note that in the list below, "[*]" means that the option is compiled +into the kernel, whereas "[M]" means that the option can either be +compiled into the kernel, or as a module. Compiling them into the +kernel is preferable, to guarantee that the modules are already loaded +when they are needed. + +In "make menuconfig", you can press "/" and search on e.g. "speedtouch" +to see exactly where an option is - the location of an option and its +dependencies can change between kernel versions. + +Check that the following kernel options are configured as shown (this +list includes the prerequisites, e.g. USB_SPEEDTOUCH depends on USB): + + Code maturity level options ---> + [*] Prompt for development and/or incomplete code/drivers + - CONFIG_EXPERIMENTAL + + General setup ---> + [*] Kernel Userspace Events - CONFIG_KOBJECT_UEVENT + (for kernels < 2.6.16 *ONLY*) + + Device Drivers ---> + Generic Driver Options ---> + [ ] Select only drivers that don't need compile-time external + firmware (*unselected*) - CONFIG_STANDALONE + [*] Hotplug firmware loading support - CONFIG_FW_LOADER + + Networking ---> + [*] Networking support - CONFIG_NET + Networking options ---> + [*] Packet socket - CONFIG_PACKET + [M] Asynchronous Transfer Mode (ATM) - CONFIG_ATM + + Device Drivers ---> + Network device support ---> + [*] Network device support - CONFIG_NETDEVICES + [M] PPP (point-to-point protocol) support - CONFIG_PPP + [M] PPP Deflate compression - CONFIG_PPP_DEFLATE (only useful if + compression is supported - rare) + [M] PPP BSD-Compress compression - CONFIG_PPP_BSDCOMP (only useful + if compression is supported - rare) + [M] PPP over ATM - CONFIG_PPPOATM + USB support ---> + [*] Support for Host-side USB - CONFIG_USB + [*] USB device filesystem - CONFIG_USB_DEVICEFS + [M] (O or U)HCI HCD support + USB DSL modem support ---> + [M] USB DSL modem support - CONFIG_USB_ATM + [M] Speedtouch USB support - CONFIG_USB_SPEEDTOUCH + + + +Troubleshooting +=============== + +Try "emerge speedtouch-usb" again, because the ebuild checks that the +required kernel modules are present (showing a warning message if +appropriate), and creates the firmware files and symlinks in +/lib/firmware/ + +If the modem is unresponsive, then run "/etc/init.d/net.ppp0 stop" and +unplug the modem for 30 seconds, to drain its memory. Then reconnect +the modem to the PC and run "/etc/init.d/net.ppp0 start" + +To check the modem's connection progress, run: + tail -f /var/log/messages +/var/log/messages should show e.g.: + +usb n-n: new full speed USB device using xxxx_hcd and address n +usb n-n: found stage 1 firmware speedtch-1.bin +usb n-n: found stage 2 firmware speedtch-2.bin +pppd[nnn]: Plugin pppoatm.so loaded. +pppd[nnn]: pppd n.n.n started by root, uid 0 +pppd[nnn]: Using interface ppp0 +pppd[nnn]: Connect: ppp0 <--> n.nn +ADSL line is synchronising +DSL line goes up +ADSL line is up (nnn Kib/s down | nnn Kib/s up) +pppd[nnn]: CHAP authentication succeeded +pppd[nnn]: local IP address nnn.nnn.nnn.nnn +pppd[nnn]: remote IP address nnn.nnn.nnn.nnn + + +If the authentification fails, then check username_ppp0 and +password_ppp0. + +If the ADSL connection is not established, then check the options in +pppd_ppp0. "man pppd" explains all the options in that file. + +If the ADSL connection seems to have worked, but no websites can be +contacted, then check that /etc/resolv.conf is populated, and possibly +add the "usepeerdns" option to pppd_ppp0, along with running: + ln -s /etc/resolv.conf /etc/ppp/resolv.conf + +If the problem is still not resolved, then describe the problem in the +"discussion and bugs" tab at: + http://gentoo-wiki.com/HOWTO_Speedtouch_modem +Or post to the Gentoo Forums at http://forums.gentoo.org/ - ultimately, +if there is no answer, then file a bug at http://bugs.gentoo.org/ + + +Compression +=========== + +Some ISPs require compression to be disabled in order for the +connection to work, so the default configuration described above +disables compression. Few ISPs support ADSL compression anyway. If you +are lucky enough to have an ISP which *does* support compression +(Google is your best friend for determining this), then compression can +be enabled by following these steps: + +* Compile the kernel modules CONFIG_PPP_DEFLATE and CONFIG_PPP_BSDCOMP +(only one is strictly necessary - pppd prefers "deflate" compression). +Add them to /etc/modules.autoload.d/kernel-2.6 or /etc/conf.d/net above +the "pppoatm" line, if they are not built-in. +* Remove the following options in pppd_ppp0: + noaccomp nobsdcomp noccp nodeflate nopcomp novj novjccomp +* Ensure that "debug" is in the pppd_ppp0 options, to check that +compression is being utilized. Note that "module registered" in +/var/log/messages only confirms that the kernel module is loaded - +it does not indicate that the connection is compressed. + + +Links +===== + +Gentoo wiki: http://gentoo-wiki.com/HOWTO_Speedtouch_modem +SpeedTouch ebuilds: http://packages.gentoo.org/search/?sstring=speedtouch +SpeedTouch hardware: http://www.speedtouch.com/support.htm +SpeedTouch firmware: http://www.speedtouch.com/driver_upgrade_lx_3.0.1.2.htm diff --git a/net-dialup/speedtouch-usb/files/digest-speedtouch-usb-3.0.1.2 b/net-dialup/speedtouch-usb/files/digest-speedtouch-usb-3.0.1.2 new file mode 100644 index 000000000000..d51893105db5 --- /dev/null +++ b/net-dialup/speedtouch-usb/files/digest-speedtouch-usb-3.0.1.2 @@ -0,0 +1 @@ +MD5 2551ce46ef785642f2c6768511f70ff3 SpeedTouch330_firmware_3012.zip 769125 diff --git a/net-dialup/speedtouch-usb/files/speedtch.usermap b/net-dialup/speedtouch-usb/files/speedtch.usermap new file mode 100644 index 000000000000..c9079e764232 --- /dev/null +++ b/net-dialup/speedtouch-usb/files/speedtch.usermap @@ -0,0 +1,2 @@ +# usb module match_flags idVendor idProduct bcdDevice_lo bcdDevice_hi bDeviceClass bDeviceSubClass bDeviceProtocol bInterfaceClass bInterfaceSubClass bInterfaceProtocol driver_info +speedtch 0x0003 0x06b9 0x4061 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 "Alcatel SpeedTouch USB" diff --git a/net-dialup/speedtouch-usb/metadata.xml b/net-dialup/speedtouch-usb/metadata.xml new file mode 100644 index 000000000000..ad9105084891 --- /dev/null +++ b/net-dialup/speedtouch-usb/metadata.xml @@ -0,0 +1,6 @@ + + + +net-dialup +Firmware and configuration instructions for the kernel-space driver for Alcatel SpeedTouch USB modems. + diff --git a/net-dialup/speedtouch-usb/speedtouch-usb-3.0.1.2.ebuild b/net-dialup/speedtouch-usb/speedtouch-usb-3.0.1.2.ebuild new file mode 100644 index 000000000000..15a1145484be --- /dev/null +++ b/net-dialup/speedtouch-usb/speedtouch-usb-3.0.1.2.ebuild @@ -0,0 +1,124 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-dialup/speedtouch-usb/speedtouch-usb-3.0.1.2.ebuild,v 1.1 2006/03/18 20:10:52 mrness Exp $ + +inherit eutils linux-info + +DESCRIPTION="Firmware and configuration instructions for the kernel-space driver for Alcatel SpeedTouch USB modems" +HOMEPAGE="http://www.speedtouch.com/" +SRC_URI="http://www.speedtouch.com/download/drivers/USB/SpeedTouch330_firmware_${PV//./}.zip" + +# Taken from http://www.speedtouch.com/driver_upgrade_lx_3.0.1.2.htm +LICENSE="SpeedTouch-USB-Firmware" +SLOT="0" +KEYWORDS="~x86" +IUSE="" + +# udev replaces hotplug, as mentioned at +# http://www.linux-usb.org/SpeedTouch/firmware/firmware.html +# hotplug only needs to be *installed*, to create /etc/hotplug/usb/ - it does +# not need to be running. + +RDEPEND=">=net-dialup/ppp-2.4.3-r11 + >=sys-apps/hotplug-20040923-r1 + >=sys-fs/udev-079-r1 + !net-dialup/speedtouch" +DEPEND="${RDEPEND} + app-arch/unzip" + +S="${WORKDIR}" + +pkg_setup() { + linux-info_pkg_setup + + if kernel_is lt 2 6 10 ; then + eerror "The kernel-space driver exists only in kernels >= 2.6.10." + eerror "Please emerge net-dialup/speedtouch instead or upgrade the kernel." + die "Unsupported kernel version" + fi + + if ! has_version '>=sys-apps/baselayout-1.12.0_pre16' ; then + ewarn "The best way of using speedtouch driver is through pppd net module of the" + ewarn ">=sys-apps/baselayout-1.12.0_pre16 package, which is also the only" + ewarn "documented mode of using ${CATEGORY}/${PN}." + ewarn "Please install baselayout-1.12.0_pre16 or else you will be on your own!" + ebeep + fi +} + +src_install() { + local FILE_VER="${PV#*.}" + FILE_VER="${PV%%.*}.${FILE_VER//./}" # {major_ver}.{minor_digits} + + # Extract the "stage 1" portion of the firmware + dd if=KQD6_${FILE_VER} of=speedtch-1.bin.2 \ + ibs=1 obs=991 count=991 skip=36 &> /dev/null \ + || die "Extraction of stage 1 firmware (step 1) failed" + + dd if=ZZZL_${FILE_VER} of=speedtch-1.bin.4 \ + ibs=1 obs=935 count=935 skip=32 &> /dev/null \ + || die "Extraction of stage 1 firmware (step 2) failed" + + # Extract the "stage 2" portion of the firmware + dd if=KQD6_${FILE_VER} of=speedtch-2.bin.2 \ + ibs=1 obs=762650 count=762650 skip=1027 &> /dev/null \ + || die "Extraction of stage 2 firmware (step 1) failed" + + dd if=ZZZL_${FILE_VER} of=speedtch-2.bin.4 \ + ibs=1 obs=775545 count=775545 skip=967 &> /dev/null \ + || die "Extraction of stage 2 firmware (step 2) failed" + + # Copy to the firmware directory + insinto /lib/firmware + insopts -m 600 + doins speedtch-{1,2}.bin.{2,4} || die "doins firmware failed" + + # Symlinks for other revisions of the modem + cd "${D}/lib/firmware" + for n in 1 2 ; do + for rev in 0 1 ; do + ln -sfn speedtch-${n}.bin.2 speedtch-${n}.bin.${rev} + done + # Seems like a reasonable guess, for revision 3 + ln -sfn speedtch-${stub}${n}.bin.4 speedtch-${n}.bin.3 + done + + insinto /etc/hotplug/usb + insopts -m 644 + doins "${FILESDIR}/speedtch.usermap" || die "doins usermap failed" + + # The documentation necessary to complete the setup + dodoc "${FILESDIR}/README" || die "dodoc failed" +} + +pkg_postinst() { + [[ -e /etc/hotplug/usb.usermap ]] && egrep -q " 0x06[bB]9 +0x4061 " /etc/hotplug/usb.usermap && \ + ewarn "Please remove the SpeedTouch line from /etc/hotplug/usb.usermap" + + #Check kernel configuration + CONFIG_CHECK="~FW_LOADER ~NET ~PACKET ~ATM ~NETDEVICES \ + ~PPP ~PPPOATM ~ATM_BR2684 ~USB_DEVICEFS ~USB_ATM ~USB_SPEEDTOUCH" + check_extra_config + einfo "Note: All the above kernel configurations are required except the following:" + einfo " - CONFIG_ATM_BR2684 is needed only for PPPoE links, while" + einfo " - CONFIG_PPPOATM is needed only for PPPoA links." + echo + + # Check user space for PPPoA support + if ! built_with_use net-dialup/ppp atm ; then + eerror "PPPoA support: net-dialup/ppp should be built with 'atm' USE flag enabled!" + ewarn "Run the following command if you need PPPoA support:" + einfo " euse -E atm && emerge net-dialup/ppp" + echo + fi + # Check user space PPPoE support + if ! has_version net-misc/br2684ctl ; then + eerror "PPPoE support: net-misc/br2684ctl is not installed!" + ewarn "Run the following command if you need PPPoE support:" + einfo " emerge net-misc/br2684ctl" + echo + fi + + ewarn "To complete the installation, you must read the documentation available in" + ewarn " ${ROOT}usr/share/doc/${PF}" +} -- cgit v1.2.3-65-gdbad