Creating a macOS 10.14 Mojave installation ISO

By | September 28, 2018

I previously wrote up my version of creating a macOS High Sierra ISO HERE.

For Mojave there’s a fix that needed to be applied (delete a bad hard link on the image, replace with a directory) but otherwise it works. I also changed it to use your CURRENT DIRECTORY as the working directory. So do this on your fastest disk (SSD hopefully).

First, download Mojave from the App Store and then cancel the installation after it starts (Command-Q). This will leave the “Install macOS Mojave” installer in your /Applications folder.

Then copy this code and save it as a shell script named “mk-mojave-iso.sh”

#!/usr/bin/env bash
hdiutil attach /Applications/Install\ macOS\ Mojave\.app/Contents/SharedSupport/InstallESD.dmg -noverify -mountpoint /Volumes/mojave
hdiutil create -o ./MojaveBase.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach ./MojaveBase.cdr.dmg -noverify -mountpoint /Volumes/install_build
asr restore -source /Applications/Install\ macOS\ Mojave\.app/Contents/SharedSupport/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
rm -rf /Volumes/OS\ X\ Base\ System/System/Installation/Packages
mkdir -p /Volumes/OS\ X\ Base\ System/System/Installation/Packages
cp -R /Volumes/mojave/Packages/* /Volumes/OS\ X\ Base\ System/System/Installation/Packages/
hdiutil detach /Volumes/OS\ X\ Base\ System/
hdiutil detach /Volumes/mojave/
mv ./MojaveBase.cdr.dmg ./BaseSystem.dmg
# Restore the 10.13 Installer's BaseSystem.dmg into file system and place custom BaseSystem.dmg into the root
hdiutil create -o ./Mojave.cdr -size 8965m -layout SPUD -fs HFS+J
hdiutil attach ./Mojave.cdr.dmg -noverify -mountpoint /Volumes/install_build
asr restore -source /Applications/Install\ macOS\ Mojave\.app/Contents/SharedSupport/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
cp ./BaseSystem.dmg /Volumes/OS\ X\ Base\ System
hdiutil detach /Volumes/OS\ X\ Base\ System/
hdiutil convert ./Mojave.cdr.dmg -format UDTO -o ./Mojave.iso
mv ./Mojave.iso.cdr ~/Desktop/Mojave.iso
rm ./Mojave.cdr.dmg

Run the code from a clean working directory on a fast SSD. The output will contain a few errors highlighted below but you can ignore them:

➜ mojave ./mk-mojave-iso.sh
/dev/disk5 GUID_partition_scheme
/dev/disk5s1 EFI
/dev/disk5s2 Apple_HFS /Volumes/mojave
created: /Volumes/Data/mojave/MojaveBase.cdr.dmg
/dev/disk6 Apple_partition_scheme
/dev/disk6s1 Apple_partition_map
/dev/disk6s2 Apple_HFS /Volumes/install_build
Validating target...done
Validating source...done
Retrieving scan information...done
Validating sizes...done
Restoring ....10....20....30....40....50....60....70....80....90....100
Restored target device is /dev/disk6s2.
Remounting target volume...done
Personalization succeeded
asr: Couldn't personalize volume /Volumes/OS X Base System
"disk6" ejected.
"disk5" ejected.
created: /Volumes/Data/mojave/Mojave.cdr.dmg
/dev/disk5 Apple_partition_scheme
/dev/disk5s1 Apple_partition_map
/dev/disk5s2 Apple_HFS /Volumes/install_build
Validating target...done
Validating source...done
Retrieving scan information...done
Validating sizes...done
Restoring ....10....20....30....40....50....60....70....80....90....100
Restored target device is /dev/disk5s2.
Remounting target volume...done
Personalization succeeded
asr: Couldn't personalize volume /Volumes/OS X Base System
"disk5" ejected.
Reading Driver Descriptor Map (DDM : 0)…
Reading Apple (Apple_partition_map : 1)…
Reading disk image (Apple_HFS : 2)…
......................................................................................................................................................................
Elapsed Time: 1m 6.068s
Speed: 135.7Mbytes/sec
Savings: 0.0%
created: /Volumes/Data/mojave/Mojave.iso.cdr

The ISO will be in your working directory.

Best not to do this on your Desktop or Documents folder if you use iCloud Drive, as it will try to move several GB up to iCloud as soon as you are done.

Category: How-To Tags:

About Bill Plein

I've been in the data storage industry since the 1990's, most recently with 3PAR, Fusion-io, and Pure Storage. I'm now with Diamanti, where we make Kubernetes easy and fast. I'm attracted to bright, shiny new objects.

Leave a Reply

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