createinstallmedia for macOS Sierra is a fork bomb!

Apple have posted a set of download links for installers for older versions of macOS on their website here:

https://support.apple.com/en-us/HT201372

There’s a teeny-tiny problem with the macOS Sierra installer though: running the createinstallmedia command as suggested ends up with an infinite loop of createinstallmedia spawning new copies of itself, until the computer’s resources are exhausted (a fork bomb)!

sudo /Applications/Install\ macOS\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ macOS\ Sierra.app

# Boom! The command hangs, and if you leave it for a minute or so your computer will be crippled
# You can abort it by quickly running "sudo killall createinstallmedia" in another tab

createinstallmedia is hard-coded to install a specific version of the operating system package, which is the version it was originally bundled with. So it looks at the CFBundleShortVersionString field of the Contents/Info.plist file in the applicationpath you provided to make sure it matches the version it is expecting.

If it doesn’t match, it assumes that you’re running the wrong copy of createinstallmedia, and the createinstallmedia from the applicationpath should be run instead, so it launches that.

But since there is a version mismatch in the Sierra installer that Apple is currently offering (as of 2020-02-11, the last-modified date of the installer is 2019-10-24) the version of the bundled createinstallmedia doesn’t match the installer’s version, and this triggers an infinite loop!

You can fix this by editing the CFBundleShortVersionString field of the Install macOS Sierra/Contents/Info.plist file to match what createinstallmedia is expecting. For the version currently offered by Apple, that is:

macOS 10.12 Sierra – Version is 12.6.06 and needs to be changed to 12.6.03

Obviously there was a mistake somewhere in Apple’s build process and they forgot to rebuild createinstallmedia to match their latest update.

You can discover which version createinstallmedia requires like so:

# For macOS 10.12, look for strings including "12":

$ strings "/Applications/Install macOS Sierra.app/Contents/Resources/createinstallmedia" | grep 12

12.6.03

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.