Analysis of the OS X Mountain Lion pre-install checks

There are a number of checks that are run by “Install OS X Mountain Lion.app” before it allows the installation to begin. This post is about those checks and how we (as sysadmins) can make sure that a client machine is compatible with Mountain Lion before trying to install it. These pre-install checks can be found in the distribution file of the OSInstall.mpkg file. Usually this is located in /Applications/Install OS X Mountain Lion.app/Contents/SharedSupport/OSInstall.mpkg. It’s a flat package so it needs to be expanded with pkgutil or Flat Package Editor.app before we can see the contents.

installCheckScript

The first thing to check is whether the current CPU is 64 bit capable. The machine might be running i386 kernel when the install process is started but Mountain Lion runs a 64 bit kernel. The 64 bit capability is determined by looking at the hw.cpu64bit_capable kernel parameter. This information can be looked up with sysctl command:

sysctl -n hw.cpu64bit_capable

The next check is to compare the motherboard id of the current system to a list of Apple approved id’s. The full list of compatible board id’s is stored in platformSupportValues array. The motherboard id of the current system can be found in I/O Kit registry. A command line tool ioreg provides access to these values:

ioreg -p IODeviceTree -r -n / -d 1

The above command gives a lot of other information too but we’re only interested about the “board-id” value. So grep and sed to the rescue:

ioreg -p IODeviceTree -r -n / -d 1 | grep board-id | sed 's/.*<\"\(.*\)\">/\1/'

The final important check is to make sure the machine has enough RAM. Mountain Lion requires at least 2GB of it. The installCheckScript uses hw.memsize kernel parameter to determine the amount of installed memory and compares it to 2048 * 1024 * 1024 (which is of course 2GB converted to bytes). To get the amount of installed memory from command line:

sysctl -n hw.memsize

volCheckScript

This script runs a few simpler checks and the most important ones are:

  1. Whether a Backups.backupdb directory exists on the root of a volume. This of course means that installing on top of your Time Machine backup disk is not allowed.
  2. Machine should not be running something newer than 10.8
  3. Machine should be running at least Mac OS X 10.6.6

Automated way

I’ve compiled the checks described here to a python script which looks at the machine it runs on and provides details about Mountain Lion compatibility. The script reports compatibility with exit codes (0 for supported, 1 for not supported) and prints something like this for the administrator:

./check-mountainlion-compatibility.py
Board ID: Mac-F2238BAE                    [OK]
Memory: 16 GB physical memory installed   [OK]
CPU: 64 bit capable                       [OK]
System: Mac OS X 10.8.2                   [Failed]

As usual, I’ve posted the script on GitHub:  https://github.com/hjuutilainen/adminscripts/blob/master/check-mountainlion-compatibility.py

Enjoy!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s