Skip to content

Instantly share code, notes, and snippets.

@FREEWING-JP
Forked from jimklo/README.md
Created January 19, 2017 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FREEWING-JP/7be82b853fa5a7ed90ec159b3c4660bd to your computer and use it in GitHub Desktop.
Save FREEWING-JP/7be82b853fa5a7ed90ec159b3c4660bd to your computer and use it in GitHub Desktop.
Fix for installing MediaTek USB(RT2870/RT2770/RT3X7X/RT537X) driver in OS X Mavericks

Fix for installing MediaTek USB(RT2870/RT2770/RT3X7X/RT537X) driver in OS X Mavericks

Absolutely no warranties! Proceed at your own risk!

Download driver from here: http://www.mediatek.com/_en/07_downloads/01_windows.php?sn=502

You will need Pacifist: http://www.charlessoft.com

  1. Ensure your USB Wireless adapter is disconnected and reboot.
  2. Mount RTUSB D2870-4.2.6.0 UI-4.0.8.0_2012_09_28-2.dmg
  3. Run the USBWireless-Uninstall.pkg and reboot.
  4. Open USBWireless-Install.pkg
  5. Click "Package Contents" then select "Contents of rt2870resources.pkg".
  6. Click Extract To.. and select your hard disk (which correlates to / ) and click "Choose".
  7. Check "Use Administrator Privileges" and then click "Extract", entering your administrator password when prompted.
  8. Open Terminal.app and type: cd /; sudo mv /USBWireless-Install\ Folder /RT2870Resources
  9. Download the file below, "postinstall", to /RT2870Resources
  10. In Terminal.app type: chmod a+x /RT2870Resources/postinstall sudo /RT2870Resources/postinstall
  11. It will take a few minutes for the script to finish running.
  12. When done shutdown, plug in your USB Wireless adapter, and start back up.
  13. Your adapter should be active and the Ralink menu should now be in the tool bar and selection "Open Wireless Utility" should now work.
  14. Configure and done.

Note: I have noticed that in Mavericks the Mountain Lion driver is a bit touchy. You should shutdown your computer before disconnecting from USB, otherwise a sudden kernel panic could follow.

#!/bin/sh
#. /etc/rc.common
folder="Ralink Wireless Utility"
utility="WirelessUtility"
LeopardMajorVersion="9."
SnowLeopardMajorVersion="10"
LionMajorVersion="11"
MountainLionMajorVersion="12"
MavericksMajorVersion="13" ## Adding version for Mavericks
ThisVersion=`uname -r`
echo ThisVersion=$ThisVersion
ThisMajorVersion=${ThisVersion:0:2}
echo ThisMajorVersion=$ThisMajorVersion
case $ThisMajorVersion in
$LeopardMajorVersion) OsName="Leopard";;
$SnowLeopardMajorVersion) OsName="SnowLeopard";;
$LionMajorVersion) OsName="Lion";;
$MountainLionMajorVersion) OsName="MountainLion";;
$MavericksMajorVersion) OsName="MountainLion";; ## Adding case for Mavericks to use MountainLion
esac
###### Install Driver ######
sudo cp -R /RT2870Resources/Driver/$OsName/RT2870USBWirelessDriver.kext /System/Library/Extensions/RT2870USBWirelessDriver.kext
sudo chown -R root:wheel /System/Library/Extensions/RT2870USBWirelessDriver.kext
sudo chmod -R 755 /System/Library/Extensions/RT2870USBWirelessDriver.kext
#sudo kextload -v /System/Library/Extensions/RT2870USBWirelessDriver.kext
#sudo touch /System/Library/Extensions
if [ $ThisMajorVersion != $LeopardMajorVersion ]
then
sudo kextcache -system-prelinked-kernel
sudo kextcache -system-caches
#sudo kextcache -v -1 -t -m /System/Library/Caches/com.apple.kext.caches/Startup/Extensions.mkext /System/Library/Extensions
#else
#sudo touch /System/Library/Extensions
fi
###### Install API ######
sudo cp -R /RT2870Resources/API/RaWLAPI.framework /Library/Frameworks/RaWLAPI.framework
sudo chown -R root:wheel /Library/Frameworks/RaWLAPI.framework
sudo chmod -R 755 /Library/Frameworks/RaWLAPI.framework
###### Install UI ######
sudo cp -R /RT2870Resources/UI/"$folder" /Applications/"$folder"
sudo chmod -R 777 /RT2870Resources/UI/"$folder" /Applications/"$folder"
###### Install CommandServer ######
sudo cp -R /RT2870Resources/Other/WiFiUtilityStartUp /System/Library/StartupItems/WiFiUtilityStartUp
sudo chown -R root:wheel /System/Library/StartupItems/WiFiUtilityStartUp
sudo chmod -R 755 /System/Library/StartupItems/WiFiUtilityStartUp
###### Modify LoginItem ######
/Applications/"$folder"/LoginItem -stringArg /Applications/"$folder"/$utility.app -boolArg YES
###### Remove install temp files ######
sudo rm -R /RT2870Resources
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment