-
-
Save gerrior/4647fdc2050afd30da210aef1c7a193e to your computer and use it in GitHub Desktop.
Bash script to create a Bootable ISO from macOS Sierra Install Image from Mac App Store
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 characters
#!/bin/bash | |
# | |
# Bash script to create a Bootable ISO from macOS Sierra Install Image from Mac App Store | |
# | |
# 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 | |
# | |
# Save as a text file; open terminal; enter the command line: sh sierra_bootable.sh | |
# | |
# Used on "macOS Sierra 10.12.6" build 16G29 | |
# | |
# The resulting ISO was used to create a fresh Virtual Machine in vSphere | |
# | |
hdiutil attach /Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app | |
hdiutil create -o /tmp/Sierra.cdr -size 6144m -layout SPUD -fs HFS+J | |
hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/iso | |
asr restore -source /Volumes/install_app/BaseSystem.dmg -target /Volumes/iso -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/ | |
cp -rp /Volumes/install_app/BaseSystem.dmg /Volumes/OS\ X\ Base\ System/ | |
hdiutil detach /Volumes/install_app | |
hdiutil detach /Volumes/OS\ X\ Base\ System/ | |
hdiutil convert /tmp/Sierra.cdr.dmg -format UDTO -o /tmp/macOS_Sierra_10.12.6.03.iso | |
mv /tmp/macOS_Sierra_10.12.6.03.iso.cdr ~/Desktop/macOS_Sierra_10.12.6.03.iso | |
rm /tmp/Sierra.cdr.dmg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment