制作 MacOS 安装 ISO/光盘映像文件
昨天,想要在家庭服务器上黑苹果,先是破解ESXi,添加了MaxOS描述文件。
现在需要准备MacOS安装ISO,忽然发现家里的30Mb光纤下载7GB的文件还是需要很久滴。
忽然想起,上次更新 MacBook Pro 好像没有删除安装文件,那么,直接在本地转换安装文件为ISO映像吧,只要区区几分钟就搞定。
#!/bin/bash
#
# Create the Blank ISO Image of 6GB with a Single Partition - Apple Partition Map
hdiutil create -o /tmp/Mojave -size 6g -layout SPUD -fs HFS+J -type SPARSE
# Mount the Blank Sparse Image
hdiutil attach /tmp/Mojave.sparseimage -noverify -nobrowse -mountpoint /Volumes/install_build
# Create the installer image
sudo ./Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/install_build --nointeraction
# Give the installer image an icon
cp "./Install macOS Mojave.app/Contents/Resources/InstallAssistant.icns" "/Volumes/Install macOS Mojave/.VolumeIcon.icns"
SetFile -a C "/Volumes/Install macOS Mojave/"
# Unmount the Install Image
hdiutil detach /Volumes/Install\ macOS\ Mojave
# Resize the SparseImage to its minimum
#hdiutil compact /tmp/Mojave.sparseimage
#hdiutil resize -size min /tmp/Mojave.sparseimage
# Convert the Sparse Image to ISO/CD
hdiutil convert /tmp/Mojave.sparseimage -format UDTO -o /tmp/Mojave
# Rename the ISO Image and move it to the desktop
mv /tmp/Mojave.cdr ~/Desktop/Mojave.iso
rm /tmp/Mojave.sparseimage