Skip to content

Instantly share code, notes, and snippets.

@drupalicus
Forked from raultm/commands.sh
Created May 13, 2014 16:42
Show Gist options
  • Save drupalicus/b393926d5227145a9186 to your computer and use it in GitHub Desktop.
Save drupalicus/b393926d5227145a9186 to your computer and use it in GitHub Desktop.

Revisions

  1. @raultm raultm renamed this gist Nov 11, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. @raultm raultm created this gist Nov 11, 2013.
    35 changes: 35 additions & 0 deletions commands
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    # Source : http://thezinx.com/2013/10/29/create-bootable-dmg-iso-mavericks-app.html

    # Mount the installer image
    hdiutil attach /Applications/Install\ OS\ X\ Mavericks.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app

    # Convert the boot image to a sparse bundle
    hdiutil convert /Volumes/install_app/BaseSystem.dmg -format UDSP -o /tmp/Mavericks

    # Increase the sparse bundle capacity to accommodate the packages
    hdiutil resize -size 8g /tmp/Mavericks.sparseimage

    # Mount the sparse bundle for package addition
    hdiutil attach /tmp/Mavericks.sparseimage -noverify -nobrowse -mountpoint /Volumes/install_build

    # Remove Package link and replace with actual files
    rm /Volumes/install_build/System/Installation/Packages
    cp -rp /Volumes/install_app/Packages /Volumes/install_build/System/Installation/

    # Unmount the installer image
    hdiutil detach /Volumes/install_app

    # Unmount the sparse bundle
    hdiutil detach /Volumes/install_build

    # Resize the partition in the sparse bundle to remove any free space
    hdiutil resize -size `hdiutil resize -limits /tmp/Mavericks.sparseimage | tail -n 1 | awk '{ print $1 }'`b /tmp/Mavericks.sparseimage

    # Convert the sparse bundle to ISO/CD master
    hdiutil convert /tmp/Mavericks.sparseimage -format UDTO -o /tmp/Mavericks

    # Remove the sparse bundle
    rm /tmp/Mavericks.sparseimage

    # Rename the ISO and move it to the desktop
    mv /tmp/Mavericks.cdr ~/Desktop/Mavericks.iso