Mac OS X,  Mac OS X Server,  Mass Deployment

Hacking Around in Lion's Recovery Mode

Boot holding down the R key and you are placed into Lion’s Recovery Mode. From inside Recovery Mode, you can select a number of options. Many are helpful, especially for road warriors. But in a centralized environment, not everyone should be able to perform potentially dangerous operations. One way to eliminate such an option is to just wipe the Recovery Mode, but what if you actually wanted to leave Recovery Mode…

To see the Recovery Partition, check out this article. Once you are in the Recovery Partition, there are lots of nifty little toys. For example, to see the menu of options shown in Recovery Mode, run Mac OS X Utilities in the /Volumes/Mac OS X Base System/System/Installation/CDIS directory (expand the Mac OS X Base System dmg to see it in Volumes). Or to get rid of your dock, run the Lock app in the same directory (gets rid of your dock until you click an app window at least). Or to get rid of the dock and menu, use LCA (again, reappears when you click on another window). Or more to the point of what most want to do, nested within the Contents/Resources/Utilities.plist directory of the Mac OS X Utilities you can edit the items that appear in the directory. You can also add items in, provided they have no dependencies not in the recovery build of OS X (see otool to track dependencies).

Editing the graphical interface for Recovery Mode is also done here. Each of the icons and other graphical elements are exposed, for easy replacement (menu and icons). For example, the /Volumes/Mac OS X Base System/System/Installation/CDIS/Mac OS X Utilities.app/Contents/Resources/LowBatteryImage.tiff or TimeMachineIcon.png, Utilities.icns or DFA.icns in the same directory. You can even reformat the informational screens, within each language by going into each lproj.

While there are aspects of Recovery Mode that I haven’t figured out yet, overall I think it’s pretty easy to be able to customize as needed, and look forward to seeing just how far it’s taken in the next weeks to come.