Edit the Recovery Partition without breaking it.

Discussion in 'macOS' started by Dalton63841, Jun 18, 2013.

  1. Dalton63841, Jun 18, 2013
    Last edited: Jun 30, 2013

    Dalton63841 macrumors 65816

    Dalton63841

    Joined:
    Nov 27, 2010
    Location:
    SEMO, USA
    #1
    A. Turn it into a FULL Offline Installer.
    This will build a recovery partition that will work as a full installer. This will work for clean installs or reinstalls, and will work with Lion, Mountain Lion, or Mavericks. In fact the installer on the recovery partition doesn't even have to match the installed system. In other words, "No Disks, No Flash Drives, No Internet, No Problem." Cherry on top, it stays a proper hidden partition, and lets Find My Mac and FileVault work, just like a factory recovery partition. Obviously there is one downside. It inflates your Recovery partition from 650MB to almost 6GB, but if you have the room to spare it makes life easier.

    1. Show hidden files by opening /Applications/Utilities/Terminal.app and typing the following:
    Code:
    defaults write com.apple.finder AppleShowAllFiles TRUE
    killall Finder
    2. Right click Installer.app file and click Show Package Contents, Open Contents folder, then look in SharedSupport folder. You will see InstallESD.dmg.

    3. Mount InstallESD.dmg.

    4. Copy the BaseSystem.dmg file out to somewhere convenient.

    5. Open Disk Utility and click New Image. Set the following...
    Name: OS X Base System
    Size: Custom - 6GB

    Leave the other settings alone. It should be a read/write disk image formatted Mac OS Extended (Journaled). The file should be saved as BaseSystem.dmg.

    6. Now you want to restore the BaseSystem.dmg from the Installer to the BaseSystem.dmg that you just built.

    7. When that's done, unmount the BaseSystem.dmg from the Installer. Look in /Volumes/OS X Base System/System/Installation/. In that folder you will see a white icon with an arrow called Packages. That's a broken alias. Delete it.

    8. Now go back to your InstallESD.dmg file. Inside is a folder weighing in at about 4.5GB called Packages. Copy that folder into the OS X Base System in place of where the alias was. While you are there, copy the BaseSystem.chunklist file into the same place as the BaseSystem.dmg

    9. Now go to /Volumes/OS X Base System/System/Installation/CDIS/OS X Utilities.app/Contents/Resources/. Sroll down until you find Utilities.plist. Open in in a Text Editor and delete
    Code:
    <key>Arguments</key>
    			<array>
    				<string>-RunInOSIEnv</string>
    			</array>
    10. Unmount /Volumes/OS X Base System.

    11. Download the Lion Recovery Update. Make sure it is in your downloads folder. Go ahead and drop BaseSystem.dmg(that you made) and BaseSystem.chunklist into the Downloads folder too, just for simplicities sake.

    12. Now open terminal and do the following commands.

    Code:
    hdiutil attach -nobrowse ~/Downloads/RecoveryHDUpdate.dmg
    pkgutil --expand /Volumes/Mac\ OS\ X\ Lion\ Recovery\ HD\ Update/RecoveryHDUpdate.pkg /tmp/RecoveryHDUpdate
    /tmp/RecoveryHDUpdate/RecoveryHDUpdate.pkg/Scripts/Tools/dmtest ensureRecoveryPartition / ~/Downloads/BaseSystem.dmg 0 0 ~/Downloads/BaseSystem.chunklist
    13. Let it finish. When you reboot to test, you will notice that it now boots into a normal Mac installer instead of the traditional Recovery Screen. Don't worry though. The other tools are still there in the Utilities menu at the top. Except for Safari, which is where the next part of this post comes in.

    B. Adding Applications to the Utilities menu of the Recovery Partition.

    1. You will need a read/write disk image of the BaseSystem.dmg, so follow the intstructions above. So follow the instructions above.
    Note: Steps A1-6 if you want a regular recovery partition with extra apps listed. Steps A1-9 if you want a full offline recovery partition.

    2. Now mount your new BaseSystem.dmg

    3. Choose the apps you want to have access to on the Recovery partition. I highly doubt apps with a full blown .pkg installer would work here, but simple .app applications work fine. Copy any apps you want to have access to into /Volumes/OS X Base System/Applications/.

    4. Now go to /Volumes/OS X Base System/System/Installation/CDIS/OS X Installer.app/Contents/Resources/. Find InstallerMenuAdditions.plist and open it with a text editor. I will use Safari as an example, because it is available in the normal recovery partition, but is invisible in the full offline version. You only need to add a section that looks like the following:
    Code:
    	<dict>
    		<key>Path</key>
    		<string>/Applications/Safari.app</string>
    	</dict>
    You can tell how it goes by copying what is already in the file.

    5. After you save that file, go back to the first section of this post and do steps A10-12.

    ***If there is anything that needs clarification, please ask before performing these steps. While nothing here should be detrimental to your actual running OS, this does involve screwing with the Recovery partition and making it do stuff we want it to, but wasn't inherently designed to do.***
     
  2. ssn637 macrumors 6502

    Joined:
    Feb 12, 2009
    Location:
    Switzerland
    #2
    Hi Dalton

    Thanks for the fantastic instructions!

    One question: Now that Mavericks DP2 has been released is there any way to merge the 10.9 update .dmg (I've downloaded separately) with the original DP1 installation image when making the recovery partition? Similar to merging Windows Service Pack updates with their original images? I'd love to perform a clean installation from the Recovery Partition with the most recent version of Mavericks without having to perform a separate update.
     
  3. Dalton63841, Jun 27, 2013
    Last edited: Jun 27, 2013

    Dalton63841 thread starter macrumors 65816

    Dalton63841

    Joined:
    Nov 27, 2010
    Location:
    SEMO, USA
    #3
    You know I hadn't thought about it. I will definitely look into that later. Currently I'm building an application to do all this messing around with the Recovery partition without all the manual work.

    EDIT: Just as soon as I can get a copy of an update I will see what can be done. I'm one of those dreaded "non-developers" so I can't download it from Apple's developer website.
     
  4. ssn637 macrumors 6502

    Joined:
    Feb 12, 2009
    Location:
    Switzerland
    #4
    You can download the update directly from the Apple Software update site

    (https://swscan.apple.com/content/ca...ion-snowleopard-leopard.merged-1.sucatalog.gz)

    Here's the direct link (as far as I know both packages are identical, but I used the first). Can you access this without an account?

    http://swcdn.apple.com/content/down...76nicx0mguy40d4ug43t37pet/OSXUpd10.9Patch.pkg
    http://swcdn.apple.com/content/down...cqrpc76nicx0mguy40d4ug43t37pet/OSXUpd10.9.pkg

    Perhaps System Image Utility could be of help here, but I'm not familiar with its use.
     
  5. Dalton63841, Jun 27, 2013
    Last edited: Jul 6, 2013

    Dalton63841 thread starter macrumors 65816

    Dalton63841

    Joined:
    Nov 27, 2010
    Location:
    SEMO, USA
    #5
    Downloading it now. I will check it out.

    I made this to do stuff like this a little easier:
    http://forums.macrumors.com/showthread.php?p=17540458#post17540458
     
  6. Speedracerxyz macrumors newbie

    Joined:
    Dec 9, 2010
    #6
    Dalton: are you aware if the process of modifying the InstallerMenuAdditions.plist you outline below works in 10.8/10.9 as well? Tried with latest version of Mavericks installer and no dice.

     
  7. TMRJIJ macrumors 68020

    TMRJIJ

    Joined:
    Dec 12, 2011
    Location:
    South Carolina, United States
    #7
    The Rocovery Partition works but . . .

    I reckon the recovery partition (Mavericks) was a success. I can't seem to boot to the normal OS (Mavericks) after booting up the recovery partition. Luckily I have a backup partition (Mountain Lion). Any ideas how I can get back to my normal OS X Mav Partition?
     
  8. ktappe, Jun 3, 2014
    Last edited: Jun 3, 2014

    ktappe macrumors regular

    ktappe

    Joined:
    Oct 10, 2003
    Location:
    Wilmington, DE
    #8
    Size

    A suggestion for Step 5: Make your new image 7Gb, not 6. The Mavericks "Packages" folder grew since previous versions and now won't fit on/in a 6Gb .dmg.

    Also in Step 7 you say "unmount the BaseSystem.dmg from the Installer." I think you mean "mount BaseSystem.dmg in Finder."
     

Share This Page