2 # http://www.insanelymac.com/forum/topic/293481-how-to-create-a-bootable-iso-from-the-mavericks-installesddmg/
8 if [ -z "$ESD" ] ||
[ -z "$TMP" ]; then
9 echo usage
: "'$0' /path/to/esd /path/to/tmpdir"
12 if ! [ -e "$ESD" ]; then
13 echo "file '$ESD' does not exist"
16 if ! [ -e "$TMP" ]; then
17 echo "dir '$TMP' does not exist"
21 MPAPP
=/Volumes
/install_app
22 MPIMG
=/Volumes
/install_img
23 IMGSPARSE
=$TMP/install.sparseimage
24 IMGDVD
=$TMP/install.cdr
27 if [ -d "$MPAPP" ]; then hdiutil detach
"$MPAPP"; fi
28 if [ -d "$MPIMG" ]; then hdiutil detach
"$MPIMG"; fi
31 echo +++ Command returned with error
, aborting ...
38 echo +++ Trying to unmount anything from previous run
41 echo +++ Mount the installer image
42 hdiutil attach
"$ESD" -noverify -nobrowse -readonly -mountpoint "$MPAPP"
44 echo +++ Convert the boot image to a sparse bundle
46 hdiutil convert
"$MPAPP"/BaseSystem.dmg
-format UDSP
-o "$IMGSPARSE"
48 echo +++ Increase the sparse bundle capacity to accommodate the packages
49 hdiutil resize
-size 9g
"$IMGSPARSE"
51 echo +++ Mount the sparse bundle
for package addition
52 hdiutil attach
"$IMGSPARSE" -noverify -nobrowse -readwrite -mountpoint "$MPIMG"
54 echo +++ Remove Package link and replace with actual files
55 rm -f "$MPIMG"/System
/Installation
/Packages
56 cp -rp "$MPAPP"/Packages
"$MPIMG"/System
/Installation
/
58 echo +++ Unmount the installer image
59 hdiutil detach
"$MPAPP"
61 echo +++ Unmount the sparse bundle
62 hdiutil detach
"$MPIMG"
64 echo +++ Resize the partition
in the sparse bundle to remove any free space
65 hdiutil resize
-sectors min
"$IMGSPARSE"
67 echo +++ Convert the sparse bundle to ISO
/CD master
69 hdiutil convert
"$IMGSPARSE" -format UDTO
-o "$IMGDVD"
71 echo +++ Remove the sparse bundle
76 echo "Find your DVD at '$IMGDVD'"