卖萌的弱渣

I am stupid, I am hungry.

Make OSX Installer (Iso) by Using Install App

  • so let’s start with that:
1
sudo -s
  • Mount the installer image:
1
hdiutil attach /Applications/Install\ OS\ X\ Yosemite.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
  • Convert the boot image to a sparse bundle:
1
hdiutil convert /Volumes/install_app/BaseSystem.dmg -format UDSP -o /tmp/Yosemite
  • Increase the sparse bundle capacity for packages, kernel, etc.:
1
hdiutil resize -size 8g /tmp/Yosemite.sparseimage
  • Mount the sparse bundle target for further processing:
1
hdiutil attach /tmp/Yosemite.sparseimage -noverify -nobrowse -mountpoint /Volumes/install_build
  • Remove Package link and replace with actual files:
1
2
rm /Volumes/install_build/System/Installation/Packages
cp -rp /Volumes/install_app/Packages /Volumes/install_build/System/Installation/
  • Only Yosemite, there are additional installer dependencies:
1
cp -rp /Volumes/install_app/BaseSystem* /Volumes/install_build/
  • Only Yosemite Assuming we’re executing these steps on a Yosemite machine:
1
cp -rp /System/Library/Kernels /Volumes/install_build/System/Library/
  • Unmount both the installer image and the target sparse bundle:
1
2
hdiutil detach /Volumes/install_app
hdiutil detach /Volumes/install_build
  • Resize the partition in the sparse bundle to remove any free space:
1
hdiutil resize -size $(hdiutil resize -limits /tmp/Yosemite.sparseimage | tail -n 1 | awk '{ print $1 }')b /tmp/Yosemite.sparseimage
  • Convert the sparse bundle to ISO/CD master:
1
hdiutil convert /tmp/Yosemite.sparseimage -format UDTO -o /tmp/Yosemite
  • Remove the sparse bundle:
1
rm /tmp/Yosemite.sparseimage
  • Rename the ISO and move it to the desktop:
1
mv /tmp/Yosemite.cdr ~/Desktop/Yosemite.iso