Skip to content

Instantly share code, notes, and snippets.

@julianxhokaxhiu
Created September 24, 2016 21:46
Show Gist options
  • Save julianxhokaxhiu/6ed6853f3223d0dd5fdffc4799b3a877 to your computer and use it in GitHub Desktop.
Save julianxhokaxhiu/6ed6853f3223d0dd5fdffc4799b3a877 to your computer and use it in GitHub Desktop.
Simple bash script to create a Bootable ISO from macOS Sierra Install Image from Mac App Store
#!/bin/bash
#
# Credits to fuckbecauseican5 from https://www.reddit.com/r/hackintosh/comments/4s561a/macos_sierra_16a238m_install_success_and_guide/
# Adapted to work with the official image available into Mac App Store
#
# Enjoy!
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 /tmp/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 /tmp/Sierra.cdr.dmg -format UDTO -o /tmp/Sierra.iso
mv /tmp/Sierra.iso.cdr ~/Desktop/Sierra.iso
@rmsa5
Copy link

rmsa5 commented Jun 6, 2017

watching for correct commands for the latest high sierra beta too :)

@fieryo
Copy link

fieryo commented Jun 7, 2017

For High Sierra iso, I tried to put BaseSystem.dmg at "/System/Installation/Packages/" or at "/" as shown above, but the same error appears: OSInstall.mpkg is damaged (since it can't find BaseSystem.dmg).
screen shot 2017-06-08 at 01 12 01

Pacifist gives the following error when opening InstallESD.dmg.
screen shot 2017-06-08
Update: I managed to install High Sierra as an update to Sierra in VirtualBox. This blog helped me a lot.

I'm still curious how to create iso for High Sierra, though.

@agentsim
Copy link

agentsim commented Jun 10, 2017

Copy link

ghost commented Aug 6, 2017

It hangs at IOConsoleUsers: getIOScreenLockState

@sntulix
Copy link

sntulix commented Oct 28, 2017

Thank you.

@thirdwheel
Copy link

What's the difference between this process and running /Applications/Install macOS <Version>.app/Contents/Resources/createinstallmedia tool on an image file, then converting it to an ISO?

@HoudayerPierre
Copy link

Stop on "IOConsoleUsers: getIOScreenLockState" too.

@julianxhokaxhiu
Copy link
Author

If you're searching for a script that works with Catalina, move over to this link: https://gist.github.com/julianxhokaxhiu/d8c4a986ddb1cfc87e19a50eb238217f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment