From c7088581e930a8229279e1428fc683a03ce972f5 Mon Sep 17 00:00:00 2001 From: Marco Bonetti Date: Sat, 14 Aug 2010 15:52:15 -0400 Subject: [PATCH] system/ipheth-driver: Added (iPhone USB Ethernet Driver) Signed-off-by: dsomero --- system/ipheth-driver/README | 14 ++++ system/ipheth-driver/README.SLACKWARE | 6 ++ system/ipheth-driver/doinst.sh | 16 ++++ system/ipheth-driver/ipheth-driver.SlackBuild | 81 +++++++++++++++++++ system/ipheth-driver/ipheth-driver.info | 10 +++ system/ipheth-driver/ipheth.conf.idevicepair | 8 ++ system/ipheth-driver/ipheth.conf.ipheth-pair | 7 ++ system/ipheth-driver/slack-desc | 19 +++++ 8 files changed, 161 insertions(+) create mode 100644 system/ipheth-driver/README create mode 100644 system/ipheth-driver/README.SLACKWARE create mode 100644 system/ipheth-driver/doinst.sh create mode 100644 system/ipheth-driver/ipheth-driver.SlackBuild create mode 100644 system/ipheth-driver/ipheth-driver.info create mode 100644 system/ipheth-driver/ipheth.conf.idevicepair create mode 100644 system/ipheth-driver/ipheth.conf.ipheth-pair create mode 100644 system/ipheth-driver/slack-desc diff --git a/system/ipheth-driver/README b/system/ipheth-driver/README new file mode 100644 index 0000000000..7365f2384a --- /dev/null +++ b/system/ipheth-driver/README @@ -0,0 +1,14 @@ +This is a Linux Kernel driver that adds support for iPhone tethering through +USB cables. Unlike other solutions out there, you don't need to jailbreak your +phone or install third-party proxy applications. + +Attention: The ipheth kernel module has been accepted upstream as of Apr 21 +2010 for kernel 2.6.34. + +This module is still useful if you're running the stock Slackware kernel or +the 2.6.33 tree. You still need an iPhone pairing program: this package will +configure by default a modprobe helper based on ipheth-pair, an optional +helper based on idevicepair from latest libimobiledevice releases is also +provided. + +This package requires ipheth-pair. diff --git a/system/ipheth-driver/README.SLACKWARE b/system/ipheth-driver/README.SLACKWARE new file mode 100644 index 0000000000..bac8ac0905 --- /dev/null +++ b/system/ipheth-driver/README.SLACKWARE @@ -0,0 +1,6 @@ +By default, this package will install a modprobe configuration which uses +ipheth-pair as pairing program. Latest libimobiledevice releases ship with a +copy of idevicepair. An alternate modprobe configuration file for the newer +program is shipped too in this folder. If you're going to use it, you may also +want to modify /etc/udev/rules.d/90-iphone-tether.rules and just keep in mind +that this method hasn't been fully tested so YMMV :) diff --git a/system/ipheth-driver/doinst.sh b/system/ipheth-driver/doinst.sh new file mode 100644 index 0000000000..c57f522a1a --- /dev/null +++ b/system/ipheth-driver/doinst.sh @@ -0,0 +1,16 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +config etc/modprobe.d/ipheth.conf.new + +chroot . /sbin/depmod -a @KERNEL@ diff --git a/system/ipheth-driver/ipheth-driver.SlackBuild b/system/ipheth-driver/ipheth-driver.SlackBuild new file mode 100644 index 0000000000..5f9a4a909c --- /dev/null +++ b/system/ipheth-driver/ipheth-driver.SlackBuild @@ -0,0 +1,81 @@ +#!/bin/sh + +# Slackware build script for ipheth-driver. +# +# Copyright 2010-2011 Marco Bonetti +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=ipheth-driver +VERSION=${VERSION:-1.0} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +KERNEL=${KERNEL:-$(uname -r)} +PKG_VERS=${VERSION}_$(echo $KERNEL | tr - _) + +# Automatically determine the architecture we're building on: +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=${PKG:-$TMP/package-$PRGNAM} +OUTPUT=${OUTPUT:-/tmp} + +DOCS="$CWD/README.SLACKWARE $CWD/ipheth.conf.idevicepair" + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2 +cd $PRGNAM-$VERSION +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \; + +make + +mkdir -p $PKG/lib/modules/$KERNEL/extra +install -m 0644 ipheth.ko $PKG/lib/modules/$KERNEL/extra/ +mkdir -p $PKG/etc/modprobe.d/ +install -m 0644 $CWD/ipheth.conf.ipheth-pair $PKG/etc/modprobe.d/ipheth.conf.new + +mkdir -p $PKG/usr/doc/$PRGNAM-$PKG_VERS +install -m 0644 $DOCS $PKG/usr/doc/$PRGNAM-$PKG_VERS +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$PKG_VERS/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +sed "s%@KERNEL@%$KERNEL%" $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$PKG_VERS-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/system/ipheth-driver/ipheth-driver.info b/system/ipheth-driver/ipheth-driver.info new file mode 100644 index 0000000000..c9444c673b --- /dev/null +++ b/system/ipheth-driver/ipheth-driver.info @@ -0,0 +1,10 @@ +PRGNAM="ipheth-driver" +VERSION="1.0" +HOMEPAGE="http://giagio.com/wiki/moin.cgi/iPhoneEthernetDriver" +DOWNLOAD="http://slackbuilds.org/sources/13.1/ipheth-driver-1.0.tar.bz2" +MD5SUM="cb6a3358da60aa2c94b21ba258aa03a0" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +MAINTAINER="Marco Bonetti" +EMAIL="sid77@slackware.it" +APPROVED="dsomero" diff --git a/system/ipheth-driver/ipheth.conf.idevicepair b/system/ipheth-driver/ipheth.conf.idevicepair new file mode 100644 index 0000000000..212dc8c3bd --- /dev/null +++ b/system/ipheth-driver/ipheth.conf.idevicepair @@ -0,0 +1,8 @@ +# iPhone USB Ethernet Driver +# +# This configuration forces modprobe to execute device pairing after loading +# the driver and device unpairing before removing it. + +install ipheth /sbin/modprobe --ignore-install ipheth && /usr/bin/idevicepair pair +remove ipheth /usr/bin/idevicepair unpair && /sbin/modprobe -r --ignore-remove ipheth + diff --git a/system/ipheth-driver/ipheth.conf.ipheth-pair b/system/ipheth-driver/ipheth.conf.ipheth-pair new file mode 100644 index 0000000000..13f7ffbcae --- /dev/null +++ b/system/ipheth-driver/ipheth.conf.ipheth-pair @@ -0,0 +1,7 @@ +# iPhone USB Ethernet Driver +# +# This configuration forces modprobe to execute device pairing after loading +# the driver. + +install ipheth /sbin/modprobe --ignore-install ipheth && /lib/udev/ipheth-pair + diff --git a/system/ipheth-driver/slack-desc b/system/ipheth-driver/slack-desc new file mode 100644 index 0000000000..131b43666c --- /dev/null +++ b/system/ipheth-driver/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +ipheth-driver: ipheth-driver (iPhone USB Ethernet Driver) +ipheth-driver: +ipheth-driver: This is a Linux Kernel driver that adds support for iPhone tethering +ipheth-driver: through USB cables. Unlike other solutions out there, you don't need +ipheth-driver: to jailbreak your phone or install third-party proxy applications. +ipheth-driver: +ipheth-driver: This driver has been accepted into 2.6.34+ kernels so it's only useful +ipheth-driver: if you're running on older versions. +ipheth-driver: +ipheth-driver: http://giagio.com/wiki/moin.cgi/iPhoneEthernetDriver +ipheth-driver: