Merge pull request #545 from leoneu/master

Add dkms package for wifi mt7601.
This commit is contained in:
Kevin Mihelich 2013-08-18 13:21:47 -07:00
commit ab011365fe
3 changed files with 124 additions and 0 deletions

View file

@ -0,0 +1,45 @@
pkgname=dkms-mt7601
pkgver=v3.0.0.3
pkgrel=1
pkgdesc="Driver for Ralink MT7601 chipset wireless adaptors"
arch=('arm')
url="http://www.ralinktech.com"
license=('GPL')
depends=('dkms' 'linux-headers')
conflicts=()
install=${pkgname}.install
options=(!strip)
_pkgname="mt7601"
source=("https://googledrive.com/host/0B_JlgOR4VNe0Sjg4ei0ySEY4aUE/DPA_MT7601U_LinuxSTA_3.0.0.3_20130717_LS.tar.bz2"
"dkms.conf")
md5sums=('7597450f4374ecaa5798a8f60c956911'
'230952e09ff23d9725fc329a2e9522e3')
package() {
# Change src dir name
mv ${srcdir}/DPA_MT7601U_LinuxSTA_3.0.0.3_20130717_LS ${srcdir}/$_pkgname-$pkgver
# Copy Makefile to subdir (because symbolic link is not copied for some reason)
rm ${srcdir}/$_pkgname-$pkgver/UTIL/Makefile
cp ${srcdir}/$_pkgname-$pkgver/Makefile.inc ${srcdir}/$_pkgname-$pkgver/UTIL/Makefile
installDir="$pkgdir/usr/src/$_pkgname-$pkgver"
install -dm755 "$installDir"
install -m644 "$srcdir/dkms.conf" "$installDir"
install -dm755 "$pkgdir/etc/modprobe.d"
cd "${srcdir}/${_pkgname}-${pkgver}/"
for d in `find . -type d`
do
install -dm755 "$installDir/$d"
done
for f in `find . -type f -o -type l`
do
install -m644 "${srcdir}/${_pkgname}-${pkgver}/$f" "$installDir/$f"
done
}

View file

@ -0,0 +1,60 @@
post_install (){
MODULE="mt7601"
VERSION="v3.0.0.3"
DKMS=$(which dkms)
MODPROBE=$(which modprobe)
CP=$(which cp)
MKDIR=$(which mkdir)
# TODO: replace /usr/src with a variable.
SRCDIR=/usr/src/$MODULE-$VERSION
$DKMS add -m $MODULE -v $VERSION
$DKMS build -m $MODULE -v $VERSION
$DKMS install -m $MODULE -v $VERSION
# This file is read form a hardcoded location.
# Can we put this in a standard location?
PARAMSDIR="/etc/Wireless/RT2870STA"
$MKDIR -p $PARAMSDIR
$CP $SRCDIR/RT2870STA.dat $PARAMSDIR
$MODPROBE -a mt7601Usta mtutil7601Usta mtnet7601Usta
}
pre_upgrade(){
pre_remove
}
post_upgrade(){
post_install
}
pre_remove (){
_inmemory=$(/usr/bin/lsmod | /usr/bin/grep mt7601)
if [ ! -z "$_inmemory" ]; then
/usr/bin/rmmod mt7601 &> /dev/null
fi
DKMS=$(which dkms)
_line=$($DKMS status -m mt7601)
if echo "$_line" | grep -E 'added|built|installed'; then
version=$(echo "$_line" | sed 's/mt7601,\([^,]*\)[,:].*/\1/;t;d')
$DKMS remove -m mt7601 -v $version --all
fi
RM=$(which rm)
RMDIR=$(which rmdir)
$RM -rf /etc/Wireless/RT2870STA
$RMDIR --ignore-fail-on-non-empty /etc/Wireless
}
post_remove () {
/sbin/depmod -a
}
op=$1
shift
$op $*

View file

@ -0,0 +1,19 @@
PACKAGE_NAME="mt7601"
PACKAGE_VERSION="v3.0.0.3"
AUTOINSTALL="yes"
MAKE[0]="make"
BUILT_MODULE_NAME[0]="mt7601Usta"
BUILT_MODULE_NAME[1]="mtutil7601Usta"
BUILT_MODULE_NAME[2]="mtnet7601Usta"
BUILT_MODULE_LOCATION[0]="MODULE/os/linux"
BUILT_MODULE_LOCATION[1]="UTIL/os/linux"
BUILT_MODULE_LOCATION[2]="NETIF/os/linux"
DEST_MODULE_LOCATION[0]="/kernel/drivers/net/wireless"
DEST_MODULE_LOCATION[1]="/kernel/drivers/net/wireless"
DEST_MODULE_LOCATION[2]="/kernel/drivers/net/wireless"