experiment-x/OpenCore/create_iso_catalina.sh
Dhiru Kholia 1cc6430f96 OSX-KVM - October 2021 Batch Update
Changes:

- Add Makefile to improve usability (thiagokokada)

- Typo fix (cclauss)

- Update to OpenCore-0.7.4 (via Nick)
2021-10-25 11:40:51 +05:30

38 lines
1 KiB
Bash
Executable file

#!/usr/bin/env bash
# Create a "ISO" (DMG) image for powering offline macOS installations
# Bail at first ISO creation error
set -e
display_help() {
echo "Usage: $(basename $0) [-h] [<path/to/install_app.app> <path/to/output_iso_file.iso>]"
exit 0
}
if [ "$1" == "-h" ] ; then
display_help
fi
if [ "$#" -eq 2 ]
then
in_path=$1
dmg_path=$2
elif [ "$#" -eq 0 ]
then
in_path=/Applications/Install\ macOS\ Catalina.app
dmg_path=~/Desktop/Catalina.iso
echo "Using default paths:"
echo "Install app: $in_path"
echo "Output disk: $dmg_path"
else
display_help
fi
# Borrrowed from multiple internet sources
hdiutil create -o "$dmg_path" -size 9g -layout GPTSPUD -fs HFS+J
hdiutil attach "$dmg_path" -noverify -mountpoint /Volumes/install_build
sudo "$in_path/Contents/Resources/createinstallmedia" --volume /Volumes/install_build --nointeraction
# createinstallmedia may leave a bunch of subvolumes still mounted when it exits, so we need to use -force here.
hdiutil detach --force "/Volumes/Install macOS Catalina"