Skip to content

Instantly share code, notes, and snippets.

@niw
Last active April 1, 2019 04:13
Show Gist options
  • Save niw/8d1cb3e4ba523949beb2 to your computer and use it in GitHub Desktop.
Save niw/8d1cb3e4ba523949beb2 to your computer and use it in GitHub Desktop.
How to create a bootable install disk image from Install OS X 10.10 Developer Preview.app
# Since Contents/Resources/createinstallmedia command doesn't work, we need to manually create an disk image.
# Mount InstallESD.dmg
hdiutil mount /Applications/Install\ OS\ X\ 10.10\ Developer\ Preview.app/Contents/SharedSupport/InstallESD.dmg
# Create a temporary writable BaseSystem image.
hdiutil convert /Volumes/OS\ X\ Install\ ESD/BaseSystem.dmg -format UDRW -o rw.dmg
# Get required sectors for packages.
# You'll get these numbers.
# min cur max
# 10215452 10215452 10215452
hdiutil resize -limits /Applications/Install\ OS\ X\ 10.10\ Developer\ Preview.app/Contents/SharedSupport/InstallESD.dmg
# Get current sectors.
# You'll get these numbers.
# min cur max
# 2527712 2527712 1312429208
hdiutil resize -limits rw.dmg
# Increase the install image size so that we can write all install packages.
# 10215452 + 2527712 = 12743164
hdiutil resize -sectors 12743164 rw.dmg
# Mount the install image.
hdiutil mount rw.dmg
# Enable ownership on these disks so that we can copy file ownerships.
sudo diskutil enableOwnership /Volumes/OS\ X\ Install\ ESD
sudo diskutil enableOwnership /Volumes/OS\ X\ Base\ System
# Remove an existing symbolic link pointing install packages.
sudo rm /Volumes/OS\ X\ Base\ System/System/Installation/Packages
# Copy packages into the writable install image.
sudo cp -a /Volumes/OS\ X\ Install\ ESD/BaseSystem.chunklist /Volumes/OS\ X\ Base\ System
sudo cp -a /Volumes/OS\ X\ Install\ ESD/BaseSystem.dmg /Volumes/OS\ X\ Base\ System
sudo cp -a /Volumes/OS\ X\ Install\ ESD/Packages /Volumes/OS\ X\ Base\ System/System/Installation
# Unmount images.
hdiutil eject /Volumes/OS\ X\ Install\ ESD
hdiutil eject /Volumes/OS\ X\ Base\ System
# Shrink the install image
hdiutil resize -size min rw.dmg
# Convert and compress the install image
hdiutil convert rw.dmg -format UDZO -imagekey zlib-level=9 -o OS\ X\ 10.10\ Developer\ Preview.dmg
# Remove the temporary writable install image.
rm rw.dmg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment