Skip to content

Instantly share code, notes, and snippets.

@dwolke
Created June 10, 2019 09:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dwolke/00d374691db0ed8fa6d73205f83454f4 to your computer and use it in GitHub Desktop.
Save dwolke/00d374691db0ed8fa6d73205f83454f4 to your computer and use it in GitHub Desktop.
Create a bootable ISO for macOS Mojave
#!/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/macOS\ Base\ System/System/Installation/Packages
mkdir -p /Volumes/macOS\ Base\ System/System/Installation/Packages
cp -R /Volumes/mojave/Packages/* /Volumes/macOS\ Base\ System/System/Installation/Packages/
hdiutil detach /Volumes/macOS\ Base\ System/
hdiutil detach /Volumes/mojave/
mv ./MojaveBase.cdr.dmg ./BaseSystem.dmg
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/macOS\ Base\ System
hdiutil detach /Volumes/macOS\ Base\ System/
hdiutil convert ./Mojave.cdr.dmg -format UDTO -o ./Mojave.iso
mv ./Mojave.iso.cdr ~/Downloads/Mojave.iso
rm ./Mojave.cdr.dmg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment