Skip to content

Instantly share code, notes, and snippets.

@ndauten
Created October 31, 2017 02:43
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ndauten/ac142e86b070bf5b46c5a5ce320dc474 to your computer and use it in GitHub Desktop.
Save ndauten/ac142e86b070bf5b46c5a5ce320dc474 to your computer and use it in GitHub Desktop.
This gist details how to generate a bootable High Sierra installer ISO image. It solves a few differences from the Sierra install. It assumes the Install downloaded into the directory with the script.
src=./Install\ macOS\ High\ Sierra.app
hdiutil attach \
./Install\ macOS\ High\ Sierra.app/Contents/SharedSupport/InstallESD.dmg \
-noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil create -o /tmp/HighSierra.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/HighSierra.cdr.dmg -noverify -nobrowse -mountpoint \
/Volumes/install_build
# Do something and rename the install_build mount point to "OS X Base System"
asr restore --source "${src}"/Contents/SharedSupport/BaseSystem.dmg \
--target /Volumes/install_build --noprompt --noverify --erase
# High Sierra uses this link to mount the Packages dir in a ramdisk
cp -rp /Volumes/install_app/Packages /Volumes/OS\ X\ Base\ System/System/Installation/PackagesLink
cp -rp "${src}"/Contents/SharedSupport/BaseSystem.chunklist /Volumes/OS\ X\ Base\ System/BaseSystem.chunklist
cp -rp "${src}"/Contents/SharedSupport/BaseSystem.dmg /Volumes/OS\ X\ Base\ System/BaseSystem.dmg
hdiutil detach /Volumes/install_app
hdiutil detach /Volumes/OS\ X\ Base\ System/
hdiutil convert /tmp/HighSierra.cdr.dmg -format UDTO -o /tmp/HighSierra.iso
mv /tmp/HighSierra.iso.cdr ./HighSierra.iso
rm -f /tmp/HighSierra.cdr.dmg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment