Skip to content

Instantly share code, notes, and snippets.

@alexitosrv
Forked from julianxhokaxhiu/create-iso.sh
Created December 10, 2017 23:19

Revisions

  1. @julianxhokaxhiu julianxhokaxhiu created this gist Sep 24, 2016.
    19 changes: 19 additions & 0 deletions create-iso.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    #!/bin/bash
    #
    # Credits to fuckbecauseican5 from https://www.reddit.com/r/hackintosh/comments/4s561a/macos_sierra_16a238m_install_success_and_guide/
    # Adapted to work with the official image available into Mac App Store
    #
    # Enjoy!

    hdiutil attach /Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
    hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J
    hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
    asr restore -source /Volumes/install_app/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
    rm /Volumes/OS\ X\ Base\ System/System/Installation/Packages
    cp -rp /Volumes/install_app/Packages /Volumes/OS\ X\ Base\ System/System/Installation/
    cp -rp /Volumes/install_app/BaseSystem.chunklist /Volumes/OS\ X\ Base\ System/BaseSystem.chunklist
    cp -rp /Volumes/install_app/BaseSystem.dmg /Volumes/OS\ X\ Base\ System/BaseSystem.dmg
    hdiutil detach /Volumes/install_app
    hdiutil detach /Volumes/OS\ X\ Base\ System/
    hdiutil convert /tmp/Sierra.cdr.dmg -format UDTO -o /tmp/Sierra.iso
    mv /tmp/Sierra.iso.cdr ~/Desktop/Sierra.iso