Skip to content

Instantly share code, notes, and snippets.

@immontilla
Created December 25, 2018 14:30
Show Gist options
  • Save immontilla/da0717e9a06b4b500104b53fcd1a14b9 to your computer and use it in GitHub Desktop.
Save immontilla/da0717e9a06b4b500104b53fcd1a14b9 to your computer and use it in GitHub Desktop.
MAC OS X High Sierra ISO Creation
#!/bin/bash
hdiutil info | grep /dev/disk | grep partition | cut -f 1 | xargs hdiutil detach
hdiutil attach /Applications/Install\ macOS\ High\ Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/HighSierra
hdiutil create -o /tmp/HighSierra -size 8g -layout SPUD -fs HFS+J -type SPARSE
hdiutil attach /tmp/HighSierra.sparseimage -noverify -nobrowse -mountpoint /Volumes/install_build
asr restore -source /Applications/Install\ macOS\ High\ Sierra.app/Contents/SharedSupport/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
ditto -V /Volumes/HighSierra/Packages /Volumes/OS\ X\ Base\ System/System/Installation/
ditto -V /Applications/Install\ macOS\ High\ Sierra.app/Contents/SharedSupport/BaseSystem.chunklist /Volumes/OS\ X\ Base\ System/BaseSystem.chunklist
ditto -V /Applications/Install\ macOS\ High\ Sierra.app/Contents/SharedSupport/BaseSystem.dmg /Volumes/OS\ X\ Base\ System/BaseSystem.dmg
hdiutil detach /Volumes/HighSierra
hdiutil detach /Volumes/OS\ X\ Base\ System/
hdiutil resize -size `hdiutil resize -limits /tmp/HighSierra.sparseimage | tail -n 1 | awk '{ print $1 }'`b /tmp/HighSierra.sparseimage
hdiutil convert /tmp/HighSierra.sparseimage -format UDTO -o /tmp/HighSierra
rm /tmp/HighSierra.sparseimage
hdiutil convert /tmp/HighSierra.cdr -format UDTO -o ~/Desktop/HighSierra.iso
mv ~/Desktop/HighSierra.iso.cdr ~/Desktop/HighSierra.iso
@immontilla
Copy link
Author

Link to download macOS High Sierra from the Mac App Store https://support.apple.com/macos/high-sierra

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment