Wednesday, January 9, 2019

Building OSX Images for fun and profit

I'm compiling all the build instruction into one repository. It's a bitch to go look for all this on the internets, so I'm just dropping it here for my own convenience.

Mojave OSX 

hdiutil create -o mojave.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach mojave.cdr.dmg -noverify -mountpoint /Volumes/install_build
sudo /Applications/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/install_build
mv mojave.cdr.dmg InstallSystem.dmg
hdiutil detach /Volumes/Install\ macOS\ Mojave/
hdiutil convert InstallSystem.dmg -format UDTO -o Mojave.iso 

High Sierra OSX 

hdiutil create -o highsierra.cdr - size 7316m -layout SPUD -fs HFS+J
hdiutil attach highsierra.cdr.dmg -noverify -mountpoint /Volumes/install_build
sudo /Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/createinstallmedia —volume /Volumes/install_build --nointeraction
mv highsierra.cdr.dmg highsierra.dmg
hdiutil detach /Volumes/Install\ macOS\ High\ Sierra/
hdiutil convert highsierra.dmg -format UDTO -o highsierra.iso 

Sierra OSX 

hdiutil attach /Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
asr restore -source /Volumes/install_app/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
rm /Volumes/OS\ X\ Base\ System/System/Installation/Packages
cp -rp /Volumes/install_app/Packages /Volumes/OS\ X\ Base\ System/System/Installation/
cp -rp /Volumes/install_app/BaseSystem.chunklist /Volumes/OS\ X\ Base\ System/BaseSystem.chunklist
cp -rp /Volumes/install_app/BaseSystem.dmg /Volumes/OS\ X\ Base\ System/BaseSystem.dmg
hdiutil detach /Volumes/install_app
hdiutil detach /Volumes/OS\ X\ Base\ System/
hdiutil convert sierra.cdr.dmg -format UDTO -o sierra.iso
mv sierra.iso.cdr sierra.iso

El Capitan OSX 

hdiutil attach "/Applications/Install OS X El Capitan.app/Contents/SharedSupport/InstallESD.dmg" -noverify -nobrowse -mountpoint /Volumes/esd
hdiutil create -o elcapitan.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach elcapitan.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/iso
asr restore -source /Volumes/esd/BaseSystem.dmg -target /Volumes/iso -noprompt -noverify -erase
rm /Volumes/OS\ X\ Base\ System/System/Installation/Packages
cp -rp /Volumes/esd/Packages /Volumes/OS\ X\ Base\ System/System/Installation
cp -rp /Volumes/esd/BaseSystem.chunklist /Volumes/OS\ X\ Base\ System/
cp -rp /Volumes/esd/BaseSystem.dmg /Volumes/OS\ X\ Base\ System/
hdiutil detach /Volumes/esd
hdiutil detach /Volumes/OS\ X\ Base\ System
hdiutil convert elcapitan.cdr.dmg -format UDTO -o elcapitan.iso
mv elcapitan.iso.cdr elcapitan.iso

Yosemite OSX 
TBC

Mavericks OSX  

TBC

No comments: