#!/bin/sh # ############################################################################# # # # Copyright (c) 2008 Daniel Moerner # # # # Permission is hereby granted, free of charge, to any person # # obtaining a copy of this software and associated documentation # # files (the "Software"), to deal in the Software without # # restriction, including without limitation the rights to use, # # copy, modify, merge, publish, distribute, sublicense, and/or sell # # copies of the Software, and to permit persons to whom the # # Software is furnished to do so, subject to the following # # conditions: # # # # The above copyright notice and this permission notice shall be # # included in all copies or substantial portions of the Software. # # # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES # # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT # # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # # OTHER DEALINGS IN THE SOFTWARE. # # # ############################################################################# # # This script was created to create a local binary of the rt2860sta module. # Since the module is linked against proprietary firmware, this avoids # binary redistribution. # # This script requires linux-headers-2.6.26 and compiletc # # VERSION: 0.1 (12/04/2008) # set -e PACKAGE="rt2860sta-source" UPSTREAM="http://www.ralinktech.com.tw/data/drivers" SOURCE="2008_0918_RT2860_Linux_STA_v1.8.0.0.tar.bz2" SOURCEDIR="2008_0918_RT2860_Linux_STA_v1.8.0.0" MD5SUM="cc6167b73fd26cd6ffbbf41444ec5bdc" SHARE="/usr/local/share/"$PACKAGE"" PATCH="rt2860sta-config-fixes.patch" MODULEDIR="/lib/modules/2.6.26-tinycore/drivers/net/wireless" MODULE="rt2860sta.ko" SCRIPTVERSION="0.1" clean() { rm -rf /tmp/$SOURCE /tmp/$SOURCE.md5sum /tmp/$SOURCEDIR } echo "Welcome to $(basename $0), version "$SCRIPTVERSION"." echo "This script will create a package with the rt2860sta module in it." echo "This package has been created without the inclusion of the RT2860STA.dat" echo "file because of its inconsistency. This means that you will most likely" echo "have to use wpa-supplicant to use this wireless card, even with WEP." echo echo -n "Fetching upstream source of rt2860sta..." clean cd /tmp wget -c -q "$UPSTREAM"/"$SOURCE" echo "done" echo ""$MD5SUM" "$SOURCE"" > $SOURCE.md5sum md5sum -c $SOURCE.md5sum echo -n "Untarring upstream source..." tar -jxf "$SOURCE" echo "done" echo cd "$SOURCEDIR" # Apply the patch to the source which enables wpa_supplicant support and # doesn't install pointless /tftpboot. echo "Patching source..." patch -p1 -i "$SHARE"/"$PATCH" echo make echo echo -n "Gzip'ing and installing module in preparation for package creation..." gzip -c9 os/linux/"$MODULE" > os/linux/"$MODULE".gz sudo mkdir -p "$MODULEDIR" sudo cp os/linux/"$MODULE".gz "$MODULEDIR"/"$MODULE".gz echo "done" echo echo "Creating package..." tar -czvf /tmp/rt2860sta.tcem "$MODULEDIR"/"$MODULE".gz md5sum /tmp/rt2860sta.tcem > /tmp/rt2860sta.tcem.md5.txt sudo rm -f "$MODULEDIR"/"$MODULE".gz clean echo echo "Script complete. The extension and md5sums are in /tmp/rt2860sta.tcem." exit 0