Created
October 20, 2015 07:22
-
-
Save davidandreoletti/1b9afafd322463854d37 to your computer and use it in GitHub Desktop.
Create OS X El Capitan Installer iso image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
INSTALLERIMG="/Applications/Install OS X El Capitan.app/Contents/SharedSupport/InstallESD.dmg" | |
OUTDIR="/Users/$(whoami)/Desktop" | |
FILENAME="Install OS X El Capitan" | |
TMPIMG="/tmp/ElCapitan.sparseimage" | |
SOURCEDISK="/Volumes/InstallESD" | |
TARGETDISK="/Volumes/BaseSystem" | |
set -x | |
sudo -s | |
hdiutil attach "${INSTALLERIMG}" -noverify -nobrowse -mountpoint "${SOURCEDISK}" | |
hdiutil convert "${SOURCEDISK}/BaseSystem.dmg" -format UDSP -o "${TMPIMG}" | |
hdiutil resize -size 8g "${TMPIMG}" | |
hdiutil attach "${TMPIMG}" -noverify -nobrowse -mountpoint "${TARGETDISK}" | |
rm "${TARGETDISK}/System/Installation/Packages" | |
cp -rp "${SOURCEDISK}/Packages" "${TARGETDISK}/System/Installation/" | |
cp -rp ${SOURCEDISK}/BaseSystem* "${TARGETDISK}/" | |
cp -rp /System/Library/Kernels "${TARGETDISK}/System/Library/" | |
hdiutil detach "${SOURCEDISK}" | |
hdiutil detach "${TARGETDISK}" | |
hdiutil resize -size min "${TMPIMG}" | |
hdiutil convert "${TMPIMG}" -format UDTO -o "${OUTDIR}/${FILENAME}.cdr" | |
mv "${OUTDIR}/${FILENAME}.cdr" "${OUTDIR}/${FILENAME}.iso" | |
rm "${TMPIMG}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment