Created
October 20, 2015 07:22
-
-
Save davidandreoletti/1b9afafd322463854d37 to your computer and use it in GitHub Desktop.
Revisions
-
mzyy94 created this gist
Oct 1, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ #!/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}"