Skip to content

Instantly share code, notes, and snippets.

@stnvh
Created October 23, 2014 10:41
Show Gist options
  • Save stnvh/4125d38f20a64da3c702 to your computer and use it in GitHub Desktop.
Save stnvh/4125d38f20a64da3c702 to your computer and use it in GitHub Desktop.
Downloads the latest Intel HD Graphics driver from OSX combo update
#!/bin/bash
URL="http://support.apple.com/downloads/DL1760/en_US/OSXUpdCombo10.9.5.dmg"
if [[ ! -f /tmp/OSXUpdCombo10.9.5.dmg ]]; then
echo 'Downloading 10.9.5 Combo...'
curl -Lo /tmp/OSXUpdCombo10.9.5.dmg $URL
fi
if [[ ! -d /tmp/ComboMount ]]; then
mkdir /tmp/ComboMount
fi
echo 'Mounting combo image...'
hdiutil attach -nobrowse -noverify -mountpoint /tmp/ComboMount /tmp/OSXUpdCombo10.9.5.dmg
echo 'Expanding install package...'
pkgutil --expand /tmp/ComboMount/OSXUpdCombo10.9.5.pkg /tmp/ComboExpanded
echo 'Expanding payload...'
KEXTDIR="System/Library/Extensions"
KEXT="$KEXTDIR/AppleIntelFramebufferCapri.kext"
cd /tmp/ComboExpanded/OSXUpdCombo10.9.5.pkg/
bunzip2 Payload
cpio -ivd $KEXT < Payload.out
if [[ "$1" == "-c" ]]; then
echo 'Copying kext [sudo required] ...'
sudo nvram boot-args=kext-dev-mode=1
sudo mv /$KEXT /$KEXT.old
sudo cp -Rp $KEXT /$KEXT
sudo chmod -R 755 /$KEXT
sudo chown -R root:wheel /$KEXT
sudo touch /$KEXTDIR
echo 'Clear kernelcache...'
sudo rm /System/Library/Caches/com.apple.kext.caches/Startup/kernelcache
else
echo 'Copying to desktop...'
cp -Rp $KEXT "$HOME/Desktop/AppleIntelFramebufferCapri.kext"
fi
echo 'Cleanup...'
rm -R /tmp/ComboExpanded
hdiutil detach /tmp/ComboMount
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment