PDA

View Full Version : [Guide] Customize RecoveryHD w/ 3rd Party Apps




mac-hacks
Jan 8, 2013, 10:12 AM
Prerequisites:
OS X Mountain Lion.app
Lion Recovery Update v1.0 (http://support.apple.com/downloads/DL1464/en_US/RecoveryHDUpdate.dmg)
LuggagePackages (https://github.com/golbiga/LuggagePackages/tree/master/Recovery%20HD)

* To Avoid Permission Issues. Create Root Account and Login as Root when your ready to start guide.
* Google it if you do not know how create root account
* Your apps need to be set with following permissions: drwxr-xr-x root admin )
* This guide will only show you how to customize BaseSystem.dmg. How you use it will be up to you.
* IMPORTANT"There only 123.5 MB available space on RecoveryHD."
* You have 2 options if want to use RecoveryHD on your disk.
A) Keep 3rd party apps under 123.5 MB. If this is path you choose, delete BaseSystem.dmg normally in /dev/disk0s3 aka "Recovery Partition" and replace it with the one from guide.
B) Know how to add space to partition, I will not show you in this guide. I may get to it at later date.


____________________________________________________________


1) Copy and Paste Utilities.plist we need to Hack to desktop.

* Commands below assume "OS X Mountain Lion.app" is in /Applications. Change path if you need to.


$ hdiutil attach /Applications/Install\ OS\ X\ Mountain\ Lion.app/Contents/SharedSupport/InstallESD.dmg
$ cp /Volumes/Mac\ OS\ X\ Base\ System/System/Installation/CDIS/OS\ X\ Utilities.app/Contents/Resources/Utilities.plist ~/Desktop


* Create Project folder and name it Recovery. Add another folder named inside of it. Name it RecoveryHD:


$ mkdir /tmp/Recovery
$ mkdir /tmp/Recovery/RecoveryHD && cd /tmp/Recovery/RecoveryHD


2) Preparation:

You will only have 100 MB by default. We add 1GB to .dmg, you can add more if you need it.

Locate Applications and paths for source files.

You will need to run mdfind for each app.

Open terminal and run:

$ mdfind "application name"
# You may need to run $ mdfind "Company-Name-for-Software"

Example:
$ mdfind Disk Warrior
# You should see lines like below with directories. You will need save output from terminal window to txt file.

/Applications/DiskWarrior.app
/Users/~/Library/Preferences/com.Alsoft.DiskWarrior.prefs

Open TextEdit.app or Notes.app and copy paths and save this text file we will need it shortly..

3) Time to Hack:

Open text editor or Xcode we need add "BundlePath", "Application.app", "Path", "TitleKey", and "name" to Utilities.plist for each Application you want to add GUI Menu/ RecoveryHD.

To find "Path" -> "String", use "control + click" -> "Show Packages" -> navigate to /Contents/MacOS/"name-of-app".

Example:
<dict>
<key>BundlePath</key>
<string>/Applications/DiskWarrior.app</string>
<key>Path</key>
<string>/Applications/DiskWarrior.app/Contents/MacOS/DiskWarrior</string>
<key>TitleKey</key>
<string>DiskWarrior</string>
</dict>

Copy and paste to bottom Utilities.plist found on ~/Desktop.

http://www.adminosx.com/wp-content/uploads/2013/01/Screen-Shot-2013-01-08-at-8.57.51-AM.jpg

*** "SignatureCheck"* add "-skipSignatureCheck 1" Argument to <key- Path -> for all apps you plan to RecoveryHD Menu.
* Very Important and do not skip this!!!

<key>Arguments</key>
<array>
<string>-skipSignatureCheck 1</string>
</array>
<key>BundlePath</key>

Example how should look like with Xcode.

http://www.adminosx.com/wp-content/uploads/2013/01/Screen-Shot-2013-01-08-at-6.01.38-PM.jpg

4) BaseSystem:

* Create tmp folder for hack BaseSystem.dmg :


$ mkdir /tmp/Recovery
$ mkdir /tmp/Recovery/RecoveryHD
$ hdiutil attach /Applications/Install\ OS\ X\ Mountain\ Lion.app/Contents/SharedSupport/InstallESD.dmg
$ hdiutil convert /Volumes/Mac\ OS\ X\ Install\ ESD/BaseSystem.dmg -format UDRW -o /tmp/Recovery/BaseSystem.dmg
# Skip next line if you plan to re-size RecoveryHD or use dmtest to repackage ReccoveryUpdate.
$ cp -r /Volumes/Mac\ OS\ X\ Install\ ESD/mach_kernel /Volumes/Mac\ OS\ X\ Base\ System\
$ hdiutil eject /Volumes/Mac OS X Install ESD
$ hdiutil resize -size 2g /private/tmp/Recovery/BaseSystem.dmg
$ hdiutil attach /private/tmp/Recovery/BaseSystem.dm
* Add Utility Software and Source files to BaseSystem.dmg:



$ cp ~/Desktop/Utilities.plist /Volumes/Mac\ OS\ X\ Base\ System/System/Installation/CDIS/OS\ X\ Utilities.app/Contents/Resources/Utilities.plist


Add Applications and Source Files:

* Replace Utilities.plist with Hack Version:

* Copy source directories paths to match same paths on Mac OS X Base System.
* Use Paths from mdfind data we copied to .txt file.

$ cp -r /Applications/"Name-Of-Software"app /Volumes/Mac\ OS\ X\ Base\ System/Applications
$ cp -r /Library/Application\ Support/"Name-Of-Software" /Volumes/Mac\ OS\ X\ Base\ System/Library/Application\ Support
Example:
http://www.adminosx.com/wp-content/uploads/2013/01/Screen-Shot-2013-01-08-at-6.35.49-AM.jpg
$ cp -r /Applications/SpeedTools\ Utilities\ Pro.app /Volumes/Mac\ OS\ X\ Base\ System/Applications
$ cp /Library/Application\ Support/SpeedTools\ Utilities\ Support /Volumes/Mac\ OS\ X\ Base\ System/Library/Application\
Support

5) Final Steps:

Eject, Convert, Rename and move BaseSystem.dmg

$ hdiutil eject /Volumes/Mac\ OS\ X\ Base\ System
$ hdiutil convert /private/tmp/Recovery/BaseSystem.dmg -format UDRO -o /private/tmp/Recovery/RecoveryHD/BaseSystem.dmg
$ sudo rm -rf /private/tmp/Recovery/BaseSystem.dmg
Then Save RecoveryHD.dmg to your backup folder.

You can stop here and make bootable USB or Netboot image from BaseSystem.dmg.

6) You can try either of these script1 (https://github.com/justindelliott/PartitionAndRestoreLionRecoveryHD) and script 2 (https://github.com/grahamgilbert/Make-Recovery-HD)for restoring RecoveryHD to Disk. Both have instructions on how process works.

[I] I tested baseSystem.dmg with FLASH Drive. I've never used dmtest so Im not sure what it will do. I figure 10.8.3 will be release in near future so Im going to wait. I need to do clean OS restore on my testing rig and If lose OS it want be big deal. I limited on time to do 2 restores if some thing goes wrong. My clone is corrupt.

Tip:
* You can delete "alias" /Volumes/Mac OS X Base System/System/Installation/Packages
and replace it with /Volumes/Mac OS X Install ESD/Packages from installESD.dmg.

* This will allow you to install OS X over existing OS with out deleting your files.

* It does not create RecoveryHD!!!

http://www.adminosx.com/wp-content/uploads/2013/01/Screen-Shot-2013-01-08-at-1.30.04-PM.jpg



Marx55
Jan 13, 2013, 04:09 PM
AWESOME!!! Thanks! Now, Apple should allow to install third-parties on the Recover partition. At least DiskWarrior.

mac-hacks
Jan 20, 2013, 08:44 AM
AWESOME!!! Thanks! Now, Apple should allow to install third-parties on the Recover partition. At least DiskWarrior.

It still needs some work to make it easier to add apps to recoveryHD. I was hoping developer who knows more about packaging scripts & imaging with asr would pick up where I left off. I was trying to write bash script to do work. "ASR" man page is limited on details for making asr.dmg. Other Tricky part of script will be to copy 3rd party app manifest to Utility.plist. Probably best approach would be to take the top Utility apps and either make gui or have folder with manifest that the script scans and uses any manifest in that folder. My 1st few attempts writing script failed. Im limited on time and waiting on 10.8.3 to be released before I spend anymore time on it.

I think if some one has time. To write script to make shadow sparseimage of basesystem.dmg to copy over hack Utility.plist & .app to /Applications/Utilities/ with there support files and sets right permissions. Use the guide on github, creating RecvoveryHD with luggage & dmtest. I think will work. I don't have time to spend on it at moment.

jroskos
Jul 17, 2013, 02:39 PM
We're having a heck of a time with this..not sure if something has changed or we are doing it wrong, but we've added the application and necessary plist file, but the app doesn't seem to launch. We can see it in the menu, but it doesn't launch. We tried two different apps with out any luck. Am wondering if it is is something to do with the "-skipSignatureCheck 1" argument? Below is one example of what we are using...is it correct?


<dict>
<key>Arguments</key>
<array>
<string>-skipSignatureCheck 1</string>
</array>
<key>BundlePath</key>
<string>/Applications/Disk Inventory X.app</string>
<key>Path</key>
<string>/Applications/Disk Inventory X.app/Contents/MacOS/Disk Inventory X</string>
<key>TitleKey</key>
<string>Disk Inventory X</string>
</dict>


Thank you for any help on this.

ClassicII
Jul 25, 2013, 12:36 PM
We're having a heck of a time with this..not sure if something has changed or we are doing it wrong, but we've added the application and necessary plist file, but the app doesn't seem to launch. We can see it in the menu, but it doesn't launch. We tried two different apps with out any luck. Am wondering if it is is something to do with the "-skipSignatureCheck 1" argument? Below is one example of what we are using...is it correct?


<dict>
<key>Arguments</key>
<array>
<string>-skipSignatureCheck 1</string>
</array>
<key>BundlePath</key>
<string>/Applications/Disk Inventory X.app</string>
<key>Path</key>
<string>/Applications/Disk Inventory X.app/Contents/MacOS/Disk Inventory X</string>
<key>TitleKey</key>
<string>Disk Inventory X</string>
</dict>


Thank you for any help on this.


Same thing happend to me any ideas

Dalton63841
Jul 25, 2013, 12:44 PM
What is the purpose of LuggagePackages in this? Here is a tutorial I did a while back to turn the Recovery partition into a completely offline installer(much quicker restores), AND/OR adding applications to the Recovery partition. It isn't limited by the amount of partition space, because when the new files are written by dmtest it will adjust the size to fit automatically. The only necessary files are the dmtest executable and a BaseSystem.dmg and BaseSystem.chunklist either from an installer or from the Lion Recovery Update package.

http://forums.macrumors.com/showthread.php?t=1598564

jroskos
Aug 6, 2013, 03:26 PM
Thanks Dalton, but I am looking to do this on a flash drive versus the local Recovery HD. I did try your process and just copy the BaseSystem.dmg over to a OS X Recovery Drive, but the issue appears to be permissions I think. For whatever reason, I can set the correct permissions on the [application].app correctly, but when I copy or move it to the dmg, it goes to admin:staff? If I try to chown it within the dmg it doesn't give me an error, but still retains the admin:staff ownership?

Any ideas how to "force" it? I've su'd it and tried logged in as root with no luck?

NoSloppy
Jan 9, 2014, 10:18 PM
Don't leave me hangin?!