Reinstalling Snow Leopard on Some Tricky MacBook Pros
Introduction
As can often be the case, I recently faced a problem captured by an Apple Discussions post. This time it was, “How can I install snow leopard on 2010 MacBook Pro that has no os?”. I had come into a free MacBook Pro from from 2010, but had no operating system disks. This is my journey to wiping the hard drive and updating to the latest available version of Mac OS X 10.6 Snow Leopard.
The Problem
The explanation is that my particular MacBook Pro, and some others, were released around the same time as Mac OS X 10.6 Snow Leopard (which I will not refer to as Snow Leopard). Consumers could buy Snow Leopard in a box, however the MacBook Pro 7,1 would not accept this particular version of Snow Leopard. The MacBook Pro 7,1 came with a slightly newer version of OS X.
The only sanctioned, and frankly sane, way to reinstall OS X is to use the grey DVDs that came with the computer. This was not an option for me, 11 years since I sold my friend this particular MacBook Pro (and it has now come full circle).
The Solution
I take no responsibility for any problems you encounter as a result of following these instructions. Do not undertake this unless you are confident in understanding what’s happening. If in any doubt, do not proceed, and call Apple for help with your problem.
At Hand
The necessary ingredients are as follows:
- A file, quite available from the usual places, called “Mac OS X Snow Leopard 10.6.7 ISO”. A similar but different file may work — the important thing is to ensure that it is newer than 10.6.3. 10.6.3 itself will not do.
- Terminal skills/confidence.
- A USB drive or a HDD, preferably 16GB or greater.
Steps
Invisible files
The ISO file you have needs modification to run on a problematic MacBook Pro. To perform this, we first need to be able to see the files we’re modifying. Paste the following into your terminal (minus the $
s, which denotes a command in your shell):
$ defaults write com.apple.finder AppleShowAllFiles TRUE
$ killall Finder
You should now see ‘invisible’ files in the finder. Good.
To reverse this change after you’re finished, run the same two commands except with FALSE
instead of TRUE
.
Mount Your Steed
You will now need to mount the Snow Leopard ISO, but in a manner that allows you to write to this read-only file. Again in Terminal, write
$ hdiutil attach /path/to/image/OSX_10.6.7.iso -shadow
This will mount your ISO in the normal way, but with ‘custom’ permissions that allow you to play around. The changes will be kept track of in a separate file named something like /path/to/image/OSX_10.6.7.iso.shadow
.
A Detour
In the MacRumors thread, the following is recommended:
Mount the image and go into the system/Installation/CDIS/
In there right click the Mac OS X Installer.app and select show package contents. Then navigate to Contents/Resources and delete the file CheckforOSX.
I did not find this file, but am including it in case you find it relevant.
Packages: A Bundle of Fun
Head to the System/Installation/Packages
folder in the mounted disk image, and locate the file OSInstall.mpkg
. Copy this to a new folder, say ~/Desktop/install
on your local computer. Then, perform the following:
$ cd ~/Desktop/install # Go to the directory with the file
$ xar -x -f OSInstall.mpkg
There should be three files in ~/Desktop/install
: Distribution, Scripts and Resources. We are only going to change Distribution.
With a text editor of your choice, edit the text file to remove the two portions between the text XXXdeletemeXXX.
<?xml version="1.0"?>
<installer-gui-script minSpecVersion='1'>
<options
eraseOptionAvailable='true'
hostArchitectures='i386'
allow-external-scripts='yes'
/>
<title>MacOSX_Title</title>
<license file="License.rtf" sla="EA0560"/>
<welcome file='Welcome.rtfd'/>
<script>
var minRam = 1024;
function checkSupportedMachine(machineType){
// Fail on G3
if (1 != system.sysctl('hw.vectorunit') ) {
return false;
}
var badMachines = ['iMac','PowerBook1,1','PowerBook2,1', 'AAPL,Gossamer', 'AAPL,PowerMac G3', 'AAPL,PowerBook1998', 'AAPL,PowerBook1999'];
if(machineType){
var length = badMachines.length;
// Fail if any of the compatible values match the list of badMachines
for( var j = 0; j < length; j++ ){
if(machineType == badMachines[j]){
return false;
}
}
}
// require 867Mhz+
if (system.sysctl("hw.cpufrequency") < 866000000) {
return false;
}
return true;
}
function checkSupportedBootRom(machineType){
var machinesNeedingROMUpdate = new Array();
machinesNeedingROMUpdate['PowerMac2,1'] = 'f2';
machinesNeedingROMUpdate['PowerMac2,2'] = '$0003.30f3';
try{
var bootROMEntry = system.ioregistry.matchingName('boot-rom','IODeviceTree');
var bootROM;
if ( bootROMEntry.length > 0 ) {
var bootROM = bootROMEntry[0]['BootROM-version'];
} else {
return true;
}
// Fail if any of the compatible values match the machine/ROM pairs that need updating
for( k in machinesNeedingROMUpdate ){
if((machineType == k) && (bootROM == machinesNeedingROMUpdate[k])){
return false;
}
}
} catch(e) {
system.log('checkSupportedBootRom threw exception ' + e);
}
// if we can't find it, assume it's supported
return true;
}
function hasAtLeastRam(RAM) {
var requiredRAM = (RAM * 1024 * 1024);
var actualRAM = system.sysctl('hw.memsize');
return (actualRAM > (requiredRAM - 1));
}
XXXdeletemeXXX function earlyMachineCheck(machineType) {
var earlyIntelMachines = [ "iMac4,1", "iMac4,2", "iMac5,1", "iMac5,2", "iMac6,1", "iMac7,1",
"MacBook1,1", "MacBook2,1", "MacBookPro1,1", "MacBookPro1,2",
"MacBookPro2,1", "MacBookPro2,2", "MacBookPro3,1", "Macmini1,1",
"Macmini2,1", "MacPro1,1", "MacPro2,1",
];
if(machineType){
var length = earlyIntelMachines.length;
for( var j = 0; j < length; j++ ){
if(machineType == earlyIntelMachines[j]){
return true;
}
}
}
}XXXdeletemeXXX
function installCheckScript(){
try{
var machineType = system.ioregistry.fromPath('IODeviceTree:/')['compatible'];
if ( typeof(machineType) == "string") {
if(!checkSupportedMachine(machineType)){
my.result.message = system.localizedStringWithFormat('IC_Machine_message');
my.result.type = 'Fatal';
return false;
}
if(!checkSupportedBootRom(machineType)){
my.result.message = system.localizedStringWithFormat('IC_Firmware_message');
my.result.type = 'Fatal';
return false;
}
}
else {
for(var i = 0;i < machineType.length; i++){
if(!checkSupportedMachine(machineType[i])){
my.result.message = system.localizedStringWithFormat('IC_Machine_message');
my.result.type = 'Fatal';
return false;
}
if(!checkSupportedBootRom(machineType[i])){
my.result.message = system.localizedStringWithFormat('IC_Firmware_message');
my.result.type = 'Fatal';
return false;
}
}
}
if(!hasAtLeastRam(minRam)){
my.result.message = system.localizedStringWithFormat('IC_RAM_message');
my.result.type = 'Fatal';
return false;
}
XXXdeletemeXXX if (system.compareVersions(system.version.ProductVersion, '10.6') >= 0) {
if (earlyMachineCheck(machineType)) {
var checkResult = system.run('./OSCheck.pl');
if(0 != checkResult){
my.result.message = system.localizedStringWithFormat('IC_Upgrade_message', '10.5');
my.result.type = 'Fatal';
return false;
}
}
}
findBJPrinters();XXXdeletemeXXX
}catch (e){
system.log('installCheckScript threw exception ' + e);
}
return true;
}
function volCheckScript(){
var target = my.target;
var destSystemVersion = target['systemVersion'];
if(system.files.fileExistsAtPath(my.target.mountpoint + "/Backups.backupdb")) {
my.result.message = system.localizedString('VC_Backup_message');
my.result.type = 'Fatal';
return false;
}
if(destSystemVersion){
if( typeof(isFNI) == "undefined" )
{
if(destSystemVersion.isServer){
my.result.message = system.localizedString('VC_ServerVersion_message');
my.result.type = 'Fatal';
return false;
}
}
}
return true;
}
In addition, I found that I needed to add my MacBook Pro model number (MacBook Pro7,1) to the file, resulting in the following updated lines:
var hwbeSupportedMachines = [
'MacBook7,1',
'MacBookPro8,1',
'MacBookPro8,2',
'MacBookPro8,3',
];
You will want to make sure that you have the right string above — blithely pasting what I have here may not necessarily work for the MacBook7,1 detail. “System Profiler” on your Mac will let you know if you are not sure — and even a standard Retail Snow Leopard disc will allow you to launch this on your MacBook Pro.
Wrap it all up
That’s the end of the changes — all that’s left to do is consolidate and wrap up our packages.
You will need to move the OSInstall.mpkg
file out of the ~/Desktop/install/
directory, and run:
$ xar -c -f OSInstall.mpkg *
You will see OSInstall.mpkg
generated in the ~/Desktop/install/
directory. Move this file back into the ISO, at system/installation/packages/
, replacing the existing file.
We now need create a new disk image that applies the changes in our shadow file into a consolidated image. To do this, we return to the command line:
$ hdiutil convert -format UDZO -o new.dmg /path/to/image/OSX_10.6.7.iso -shadow
This creates a file new.dmg
in the current directory, mergeing ISO and the record of changes you have made.
Disk Utility
You can probably use hdiutil
for this too, but I used Disk Utility.
Open Disk Utility, and selecting your USB that you want to turn into an image of Snow Leopard, press ‘restore’. Select your new.dmg
image as the restore image, select ‘OK’, and wait for the USB to be wiped. You will then have an image that will be much more agreeable with your very particular MacBook Pro.
Resources/Background Information
I put this guide together particularly with the significant assistance of the MacRumors thread, as well as some guides on how to modify read-only ISO files.