Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # This script auto-builds a macintosh recovery partition installer based on
- # Greg Neagle's http://managingosx.wordpress.com/2012/08/15/creating-recovery-partitions/
- #----------------------------------------------------------
- # Variables
- #----------------------------------------------------------
- #-----Assignments
- SCRIPTNAME=$0
- #-----Logging
- exec >> "/Library/Logs/Getty Installations.log" 2>&1 ## must be run as admin or root for exec to work
- #-----Folders & Files (use your own locations, of course)
- RecUpd="/CreateRecoveryPartition/RecoveryHDUpdate.pkg"
- CreatePart="/CreateRecoveryPartition/CreateRecoveryPartition.pkg"
- InstallESD="/Applications/Install OS X Mountain Lion.app/Contents/SharedSupport/InstallESD.dmg"
- #----------------------------------------------------------
- # Timestamp
- #----------------------------------------------------------
- echo " "
- echo "###################################"
- echo "##### $SCRIPTNAME"
- echo "##### `date "+%A %m/%d/%Y %H:%M"`"
- echo "###################################"
- echo " "
- pkgutil --expand $RecUpd ./RecoveryUpdate
- cd ./RecoveryUpdate/RecoveryHDUpdate.pkg/Scripts/Tools/
- cp dmtest $CreatePart/Contents/Resources/
- hdiutil attach "$InstallESD" -noverify
- cp /Volumes/Mac\ OS\ X\ Install\ ESD/BaseSystem.* $CreatePart/Contents/Resources/
- hdiutil eject /Volumes/Mac\ OS\ X\ Install\ ESD/
- echo " "
- echo "Recovery Partition Installer has been created and is now available at:"
- echo "$CreatePart"
- echo " "
- #----------------------------------------------------------
- # Timestamp
- #----------------------------------------------------------
- echo " "
- echo "###################################"
- echo "##### End Log"
- echo "##### `date "+%A %m/%d/%Y %H:%M"`"
- echo "###################################"
- echo " "
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement