Sonntag, 7. Juni 2015

Mac OS X 10.10 (Yosemite) - Mac Pro 1.1 - Repair recovery partition automatized

Heyyo Dudes,
i automized a script to repair the recovery partition
- done it several times on a mac pro 1,1
- so i had no lust to do it over and over again after every update per hand.
can someone try the script out to confirm that it works well?
the only thing what made me concerns are the permissions.
maybe somone can proof them before and after execution.

Warning:
Please proof with 'diskutil list' if the script is executed on the right partition.

#!/bin/bash
sudo su
diskutil mount /dev/disk0s3
cd /Volumes/Recovery\ HD/com.apple.recovery.boot/
/usr/libexec/PlistBuddy -c "Add :SupportedBoardIds: string 'Mac-F4208DC8'" PlatformSupport.plist
/usr/libexec/PlistBuddy -c "Add :SupportedBoardIds: string 'Mac-F4208DA9'" PlatformSupport.plist
/usr/libexec/PlistBuddy -c "Add :SupportedModelProperties: string 'MacPro1,1'" PlatformSupport.plist
/usr/libexec/PlistBuddy -c "Add :SupportedModelProperties: string 'MacPro2,1'" PlatformSupport.plist
hdiutil convert BaseSystem.dmg -format UDRW -o ~/Downloads/BaseSystemUDRW.dmg
cd ~/Downloads
chmod 777 BaseSystemUDRW.dmg
hdiutil attach -readwrite BaseSystemUDRW.dmg
# Piker-Alpha_bootloader_-_black_-_build_3b402a9
curl -o piker.zip 'http://forums.macrumors.com/attachments/boot-black-zip.511172/'
unzip piker.zip
chmod 644 boot.efi
cd /Volumes/OS\ X\ Base\ System/
rm -rf /System/Library/CoreServices/boot.efi
rm -rf /usr/standalone/i386/boot.efi
cp ~/Downloads/boot.efi /System/Library/CoreServices/
cp ~/Downloads/boot.efi /usr/standalone/i386/
cd /Volumes/OS\ X\ Base\ System/System/Library/CoreServices/
/usr/libexec/PlistBuddy -c "Add :SupportedBoardIds: string 'Mac-F4208DC8'" PlatformSupport.plist
/usr/libexec/PlistBuddy -c "Add :SupportedBoardIds: string 'Mac-F4208DA9'" PlatformSupport.plist
/usr/libexec/PlistBuddy -c "Add :SupportedModelProperties: string 'MacPro1,1'" PlatformSupport.plist
/usr/libexec/PlistBuddy -c "Add :SupportedModelProperties: string 'MacPro2,1'" PlatformSupport.plist
cd /Volumes/OS\ X\ Base\ System/System/Library/CoreServices/com.apple.recovery.boot/
/usr/libexec/PlistBuddy -c "Add :SupportedBoardIds: string 'Mac-F4208DC8'" PlatformSupport.plist
/usr/libexec/PlistBuddy -c "Add :SupportedBoardIds: string 'Mac-F4208DA9'" PlatformSupport.plist
/usr/libexec/PlistBuddy -c "Add :SupportedModelProperties: string 'MacPro1,1'" PlatformSupport.plist
/usr/libexec/PlistBuddy -c "Add :SupportedModelProperties: string 'MacPro2,1'" PlatformSupport.plist
hdiutil convert ~/Downloads/BaseSystemUDZW.dmg -format UDZO -imagekey zlib-level=9 -o BaseSystem.dmg
cd /Volumes/Recovery\ HD/com.apple.recovery.boot/
rm -rf boot.efi
rm -rf BaseSystem.dmg
cp ~/Downloads/boot.efi /
cp ~/Downloads/BaseSystem.dmg /
chflags uchg boot.efi

add execution permission in terminal to the script:
chmod +x repairrecovery.command
Execute it with doubleclick.

macrumors.com